I wrote a simple deferred shading shader for my engine, and I send light-sources to the shader like this:
struct Light {
vec3 Position;
vec4 Color;
float Linear;
float Quadratic;
float Radius;
};
const int NR_LIGHTS = 4;
uniform Light lights[NR_LIGHTS];
well this works when I have fixed number of lights, but this wouldn't be a good idea with many light sources as we do have limits with number of uniforms and when the number of lights are dynamic.
I am using OpenGL 3.3, what is the best way of sending several light-sources to a shader.