View Full Version : Uniform sharing, constants sharing

11-24-2004, 07:44 AM

Let's say I have many shaders in my program, and all have the same uniforms and constants : some color value, some position value, a constant like (9.0, 50.0, 1.0, 2.0)

Instead of linking a program, then getting the uniform locations, and updating each shader, I would like to do it once for all the shaders.

Also, the uniforms may be updated every frame. I would like to do it for all the shaders in one shot.

11-24-2004, 08:11 AM
I "abuse" GL state variables (like unsed texgen-planes) for that purpose. Its a shame that GLSL doesn´t support "program environment" uniforms like ARB_fp and ARB_vp do.

11-24-2004, 10:41 AM
Generic states would be nice, like generic vertex attributes. I think it is a good idea for future GLSL spec revisions.