I’m trying to draw a lot of screen facing quads without sending each quad as a separate object.
I got as far as drawing a lot of quads in one go.
I set an instance count on a node, I supply a array of position offsets (and scale) and then use gl_InstanceID in a shader to add the offset and multiply by the scale. Easy.
But how do I make the quads face the camera?
I found some tutorials and examples on the web, but some want to use a geometry shader for the task (and I don’t) or the code for making a billboard is not what I want for example:
gl_Position = gl_ProjectionMatrix * (gl_Vertex + vec4(gl_ModelViewMatrix.xyz, 0));
This will make the quad face the camera, but it will also ‘glue’ it to the camera. What I want is to have the behavior of setBillboardPointEye()
Can someone point me in the right direction?