Shader "direction" attribute?


How can I pass a custom vertex attribute holding a direction between two points
like on this image (the goal is to draw camera oriented lines, wich is a more complex case than regular billboards or particles)


You have to edit the mesh and add a new vertex buffer to it.
The problem is that you have to use an existing buffer tyoe from the VertexBuffer.Type
So basically you’d need a Vector3f buffer type (you could use the Binormal type as it’s never used actually by the engine).

Look at this doc to know how to create a custom mesh[]=custom&s[]=mesh

thanks, would be nice if future v of jme had custom attributes like in standard opengl

Yeah, it’s on my list… but so far slightly less important than other things since it isn’t limiting you from doing anything… it’s just making things named funny in your shaders. :slight_smile: