Uniform sharing, constants sharing


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.

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.

Generic states would be nice, like generic vertex attributes. I think it is a good idea for future GLSL spec revisions.

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