diff --git a/code/nel/src/3d/driver/opengl3/driver_opengl_pixel_program.cpp b/code/nel/src/3d/driver/opengl3/driver_opengl_pixel_program.cpp index 88ef5857c..2dae29889 100644 --- a/code/nel/src/3d/driver/opengl3/driver_opengl_pixel_program.cpp +++ b/code/nel/src/3d/driver/opengl3/driver_opengl_pixel_program.cpp @@ -480,7 +480,7 @@ void ppGenerate(std::string &result, const CPPBuiltin &desc) else if (useTex(desc, stage)) { ss << "vec4 texel" << stage << " = texture(sampler" << stage << ", "; - if (desc.Shader == CMaterial::LightMap && stage != (maxTex - 1) && hasFlag(desc.VertexFormat, g_VertexFlags[TexCoord1])) + if (desc.Shader == CMaterial::LightMap && stage != (maxTex - 1) && useTex(desc, stage + 1) && hasFlag(desc.VertexFormat, g_VertexFlags[TexCoord1])) { ss << g_AttribNames[TexCoord1]; }