Hello.
I'm writing a rendering routine, where uniform variables are frequently updated.
My code is something like this :
glUseProgram(id) ; // start shader
for(...)
{
//Update uniforms
glUniform...
glUniform...
...
// Render a scene
renderScene() ;
glUseProgram(0) ; // end shader
[/CODE]
My questions are :
- Does this freqnent update of uniforms slow my rendering routine ?
- What is the cost of updating a uniform ?
Thanks in advance.
</div><div>glUseProgram(id) ; // start shader </div><div><br></div><div>for(...) </div><div>{</div><div> //Update uniforms</div><div> glUniform... </div><div> glUniform...</div><div> ...</div><div><br></div><div> // Render a scene </div><div> renderScene() ; </div><div><br></div><div> glUseProgram(0) ; // end shader </div><div>
My questions are :
- Does this freqnent update of uniforms slow my rendering routine ?
- What is the cost of updating a uniform ?
Thanks in advance.