PengPeng

07-26-2013, 03:13 PM

Hi Guys:

I'm relative new to opengl ES 2.0, and just wondering if someone can give me an answer on this.

From opengl es 2.0 specification, I've learned that for every glUseProgram call, it will clear out all uniform register ,which is an expensive operation, and in order to have the vertex shader working properly, I need to reset all view/projection matrices etc.

My question is, for a render frame, the view/projection matrix might be almost identical across all draw calls, and everytime I change the shader, it have to reset those matrices and cost CPU/GPU time. Is there a way to avoid this like using constant register in directX or uniform buffer object for opengl es 3.0 ?

Any help is really appreciated.

P

I'm relative new to opengl ES 2.0, and just wondering if someone can give me an answer on this.

From opengl es 2.0 specification, I've learned that for every glUseProgram call, it will clear out all uniform register ,which is an expensive operation, and in order to have the vertex shader working properly, I need to reset all view/projection matrices etc.

My question is, for a render frame, the view/projection matrix might be almost identical across all draw calls, and everytime I change the shader, it have to reset those matrices and cost CPU/GPU time. Is there a way to avoid this like using constant register in directX or uniform buffer object for opengl es 3.0 ?

Any help is really appreciated.

P