I am programming a shader and I am getting an array index out of bounds error. The error is at :
LightInfo lt;
IlluminationResult illumTotal;
int lighttemp = lights.Length;
for (int i = 0 ; i < lighttemp; i++) {
// Get the light informatio from i:th light
lt.P = lights[i].get_position(mtl); // error line**
lt.D = lights[i].get_direction(mtl);
....
}
I have followed the code back and I can't find an error.
↧