I recently discovered a strange error with my fragment shader:
#version 330 core
in vec4 v_color;
in vec2 v_texCoords[10];
out vec4 frag_color;
uniform int actual_textures;
uniform sampler2D u_texture[10];
void main() {
vec4 final_color = texture2D(u_texture[0], v_texCoords[0]);
for(int i = 1; i < actual_textures; i++){
vec4 tex = texture2D(u_texture[i], v_texCoords[i]);
final_color = tex * tex.a + final_color * (1 - tex.a);
}
frag_color = v_color * final_color;
}
On my PC with a GTX 960 and OpenGL 4.5.1 there is no error at all. But on my laptop with an Intel HD 3000 and OpenGL 3.3, I get a compile error that the texture2D function is deprecated and that the sampler2D array size is too big because I only pass 3 textures at the moment and I want the array to be able to handle up to 10 textures. On any other computer I testedm the error didn't occur, but they all had nvidia or amd gpus. Why do I keep getting this error on my laptop?
texture2Ddeprecation is a error, not a warning? I was using it for ages and users didn't complain. \$\endgroup\$