Hi,
I have a query regarding a uniform variables used in a shader which is bound to multiple program objects.
If I have a shaders named as: sh1.vert, sh1.frag and sh2.frag and they are combined to create a program object as:
prog1(sh1.vert, sh1.frag)
and prog2(sh1.vert, sh2.frag).
Now in normal rendering is something like this.
prog1->enable();
render();
… something else
prog2->enable();
render();
… repeat.
In above scenario if I have declared a uniform in sh1.vert as " uniform vec4 pos; ".
Then do I need to reset the uniform again if I switch the program objects?
In gDebugger it shows that second program object has values initialized to zero rather than having same values as set previously. Memory location is still the same when queried for active uniforms in both cases.
Any suggestions?