Two general glsl questions

  1. it seems that a shader has to be activated if you want to set uniforms and attributes for it - why? (ati, winxp, latest drivers)
  2. are the values of uniforms saved when the shader is deactivated and activated again? as an example, is it save to tell a shader only once that the normal map is in texture slot 1 or will i have to do it every frame?

thanks :slight_smile:

  1. Uniform and attribute locations are be different for every shader - you must select one before accessing it’s uniforms. This should change in upcoming versoins of OpenGL.

  2. Yes - uniforms do not change until you change it.

Uniform and attribute locations are be different for every shader - you must select one before accessing it’s uniforms. This should change in upcoming versoins of OpenGL.
ok but when you want to change a uniform, then you have to specify the shader’s handle - isn’t that enough information? well, let’s hope it’s changed :slight_smile:

thank you!

when you want to change a uniform, then you have to specify the shader’s handle
Not really:

let’s hope it’s changed
There is an article here about new object model:
http://www.khronos.org/developers/library/siggraph2006/OpenGL_BOF/

d’oh you’re right. i’m always using those two functions together, so i confused it.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.