Hello.
I am learning GLSL shaders and i wrote very simply light system.
When I want add all lights by using variable like this:
int var = 10;
gl_FragColor = light[0];
for(int i = 1; i<var; i++)
gl_FragColor *= light[i]
I see graphics artifacts:
But when I write indexes manually (i use vars because i want add lights in loop, not manually) like this:
gl_FragColor = light[0] * light[1];
Everything works fine:
Why I have artifacts?