Commit a2073670 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum

[FIX #75] - v_normal was not written if lighting was disabled but used in...

[FIX #75] - v_normal was not written if lighting was disabled but used in fragment shader. Fixed now.
parent 3944094a
......@@ -72,9 +72,9 @@ void main()
#endif // CLIPPLANE_ENABLED
// The same accounds for the vertex. Transfer it to world-space.
v_vertex = gl_ModelViewMatrix * gl_Vertex;
v_vertex = gl_ModelViewMatrix * gl_Vertex;
v_normal
#if ( defined ILLUMINATION_ENABLED || defined TUBE_ENABLED )
// Grab the tangent. We have uploaded it normalized in gl_Normal per vertex
// We need to transfer it to the world-space ass all further operations are done there.
vec3 tangent = normalize( ( gl_ModelViewMatrix * vec4( gl_Normal, 0.0 ) ).xyz );
......@@ -118,7 +118,6 @@ void main()
// with the tangent and the view vector we got the offset vector. We can noch get the normal using the tangent and the offset.
v_normal = cross( offset, tangent );
v_normal *= sign( dot( v_normal, vec3( 0.0, 0.0, 1.0 ) ) );
#endif // ( defined ILLUMINATION_ENABLED || defined TUBE_ENABLED )
#ifdef COLORMAPPING_ENABLED
// Allow the colormapper to do some precalculations with the real vertex coordinate in ow-scene-space
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment