PDA

View Full Version : two general glsl questions



Vexator
08-13-2006, 04:25 AM
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 :)

k_szczech
08-13-2006, 05:09 AM
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.

Vexator
08-13-2006, 05:52 AM
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 :)

thank you!

k_szczech
08-13-2006, 08:03 AM
when you want to change a uniform, then you have to specify the shader's handleNot really:

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

Vexator
08-13-2006, 08:37 AM
d'oh you're right. i'm always using those two functions together, so i confused it.