smani
02-13-2011, 07:39 AM
Hello,
I was wondering which are the best practices (resulting in best performance) when using multiple shaders. The approach I would use at the moment is:
init:
- create and populate index buffer, vertex buffer, normal buffer, ...
- compile and link glsl program
draw:
- use the glsl program
- query attribute locations for vertex, normal, ...
- bind buffers, set and enable the attributes
- query all uniform locations and set corresponding data
- glDrawElements
Is there a better approach than re-querying all locations at each draw iteration?
Thanks!
smani
I was wondering which are the best practices (resulting in best performance) when using multiple shaders. The approach I would use at the moment is:
init:
- create and populate index buffer, vertex buffer, normal buffer, ...
- compile and link glsl program
draw:
- use the glsl program
- query attribute locations for vertex, normal, ...
- bind buffers, set and enable the attributes
- query all uniform locations and set corresponding data
- glDrawElements
Is there a better approach than re-querying all locations at each draw iteration?
Thanks!
smani