I am a bit confused about what I need to move a basic square. Should I use a translation matrix or just change the object vertices? Which one is better?
I use a simple vertex shader, gl_Position = myPMVMatrix * a_vertex, along with a VBO.
|
I am a bit confused about what I need to move a basic square. Should I use a translation matrix or just change the object vertices? Which one is better? I use a simple vertex shader, |
||||
|
|
|
The best approach is to change the value of your matrix. It is a parameter that is sent to the shader once per object and costs very little to update; changing all your vertices would mean updating the VBO with a very high bandwith cost. |
|||||||||||||
|