This is probably not THREE related.
I have the following code that produces a compile error undeclared identifier 'angle_pnt_light’:
struct pointLight {
sampler2D shad_tex;
};
uniform pointLight[2] pnt_light;
uniform vec3 color;
void main() {
vec3 light = vec3(0.5);
for(int i = 0; i < 2; i++) {
vec4 pov_id = texture2D(pnt_light[i].shad_tex, vec2(0.0)); // <--- ERROR
}
gl_FragColor = vec4(light * color, 1.0);
}
If I change pnt_light[i]
to pnt_light[0]
it works.
Could somebody explain to me what goes wrong here and how to fix it?