Given the surfaceNormal (gl_NormalMatrix * gl_Normal) and a gl_Vertex how do I rotate the gl_Vertex such that it will adjust to that normal. I want to use this for billboards and general rotation.
2 Questions:
Thanks!
In most of cases, the rotation should be done on the CPU, by the way of the model matrix (or directly world matrix).
Even if the CPU is slower than the GPU, keep in mind a vertex shader will have been executed for each vertex, whereas a model matrix linked to a mesh, so a lot of vertices, shall be calculated only once per frame if your mesh is dynamic, and only once of your entire program if your mesh won't move.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments