My (fragment) shader has a uniform array containing 12 structs:
struct LightSource
{
vec3 position;
vec4 color;
float dist;
};
uniform LightSource lightSources[12];
In my program I have 12 buffer objects that each contain the data for one light source. (They need to be seperate buffers.)
How can I bind these buffers to their respective position inside the shader?
I'm not even sure how to retrieve the location of the array.
glGetUniformLocation(program,"lightSources");
glGetUniformLocation(program,"lightSources[0]");
These run without invoking an error, but the location is definitely wrong(4294967295). (The array is being used inside the shader, so I don't think it's being optimized out)