I have an OpenGL project and am currently working on the lighting system.
I am trying to add support for multiple lights by supporting passing an of array of light parameters to my shader.
However, when passing any array, my shader seems to get messed up and everything renders as red. It doesn't matter which attribute I try setting as an array (light color, light position etc). The end result is always a red scene.
Here's an example of how I am declaring the array in the shader:
And this is how I am setting it in my c# code:
float LightRange = new float;
LightRange = 50.0f;
Referencing the indexed value in the shader is pretty standard:
x = LightRange[index] * y;
Any ideas as to what the issue might be?
FYI, I am using build 126.96.36.1991.