When I switch between two different OpenGL shaders instances do I need to re-upload the uniform variables.
For example I have a shader that have a Project and View matrix uniforms defined:
uniform mat4 view; uniform mat4 projection; My C++ program creates two "instances" of this shader each of which belongs to a different object--ignore the fact that I shouldn't do this in this example. Each instance is assigned to a different object. As each object is rendered I switch shaders using glUsProgram.
My question is: do I need to re-upload the Projection and View uniforms even though they don't change during application execution? Will each shader instance remember its uniform variables while it is switched-out?
Basically, I'm asking if any uniform variables need to be re-uploaded on every call or does the shader remember between calls and switches?