From 9a647a893c468539bf086e3609bfc7026cea6451 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Tue, 17 Sep 2013 19:42:46 +0200 Subject: [PATCH] Specular shader should compile even when there's no fog added. --HG-- branch : gsoc2013-dfighter --- .../src/3d/driver/OpenGL3/driver_glsl_shader_generator.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/nel/src/3d/driver/OpenGL3/driver_glsl_shader_generator.cpp b/code/nel/src/3d/driver/OpenGL3/driver_glsl_shader_generator.cpp index 2d81b087b..a006d64bf 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_glsl_shader_generator.cpp +++ b/code/nel/src/3d/driver/OpenGL3/driver_glsl_shader_generator.cpp @@ -574,7 +574,10 @@ namespace NL3D ss << "void main( void )" << std::endl; ss << "{" << std::endl; ss << "vec4 eyePosition = mvMatrix * v" << attribNames[ 0 ] << ";" << std::endl; - ss << "ecPos = eyePosition;" << std::endl; + + if( desc->fogEnabled() ) + ss << "ecPos = eyePosition;" << std::endl; + ss << "vec3 ep = eyePosition.xyz / eyePosition.w;" << std::endl; ss << "vec3 n = vnormal.xyz;" << std::endl; ss << "cubeTexCoords = ReflectionMap( ep, n );" << std::endl;