PDA

View Full Version : Lightparameter via uniforms



dust
05-03-2005, 11:06 PM
Hi,
sometimes ago I got aware of the error with gl_LightSource array on ATI cards. Someone told me to pass the attributes as uniforms.

So, now is my question:
What is the best way to pass the attributes from the OpenGL state via Uniform to my shader?

Thanks in advance

V-man
05-04-2005, 06:41 AM
The problem with gl_LightSource on ATI was when indirect indexing was used, if I'm used the term correctly. Example, gl_LightSource[some_variable]

If you hard code it, gl_LightSource[0], it works.

Put the light properties into vec4 uniforms or build a struct with the uniforms.

dust
05-09-2005, 12:55 AM
Thanks, I didn't see what is so easy.