Shader Light Array

Hi all!

I have a strange problem with my shader code written in OGSL. I have written a “fixed function lightning” vertex shader which works with one light perfect! But if i try to access all lights via the [] operator (like gl_LightSource[i]), i have a compiler error: “array must be redeclared with a size before being indexed with a variable”. I thought the gl_LightSource global variable was defined with “uniform gl_LightSourceParameters gl_LightSource[gl_MaxLights];”, and gl_MaxLights gives the array size! What have i do wrong? I’m using a Radeaon 9800.

Greetings Mario

Did you ever get this to work. I am currently still having exactly the same problem with Radeon 9800 and Catalyst 5.11 divers

// Mike

If you are using pre-SM3.0 hardware, then you can’t use an application defined value as an index to any array (be it gl_LightSource or some other). You must give in constants.

Yes you can, but this is the same problem as mentioned here:;f=11;t=000920

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