Randy Frank Posted May 21, 2016 Share Posted May 21, 2016 Hello, Is it possible to create a LinesMesh object with per-vertex coloring? It did not look like LinesMesh.color took a per-vertex color array and I tried assigning uvs coordinates with a material that specified a diffuseTexture or an emissiveTexture with no luck. I'm rendering particle traces as lines and I need to be able to change the color at each vertex along the trace. TIA. Quote Link to comment Share on other sites More sharing options...
dbawel Posted May 23, 2016 Share Posted May 23, 2016 @Randy Frank - Can you post a Playground scene with what you already attempted which did not provide your expected result? DB Quote Link to comment Share on other sites More sharing options...
Randy Frank Posted May 24, 2016 Author Share Posted May 24, 2016 Sure, here is a simple example: http://www.babylonjs-playground.com/#1WKJMI#1 I have an embedded png texture (256x2) that is just an hsv color ramp. I would like the lines to be colored using the texture. I also tried vertex coloring. Obviously I'm missing something here. Any help would be greatly appreciated. Thx. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted May 24, 2016 Share Posted May 24, 2016 LineMesh only support static color. But you can still rely on wireframe rendering: http://www.babylonjs-playground.com/#1WKJMI#2 Quote Link to comment Share on other sites More sharing options...
Randy Frank Posted May 24, 2016 Author Share Posted May 24, 2016 Thanks! My use case is for independent lines (particle traces, not related to any polygons), changing it to using degenerate triangles in wireframe mode seems to work: http://www.babylonjs-playground.com/#1WKJMI#4 Any potential issues with using triangles like this (e.g. picking, etc)? I do like the ability to light the lines this way... Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted May 24, 2016 Share Posted May 24, 2016 nope this is perfectly legit Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.