1
0
Fork 0

Tentative hack to avoid black triangles in urban terrain problem when urban effect is used

This commit is contained in:
Thorsten Renk 2014-11-17 10:23:14 +02:00
parent f6f433529f
commit 9855d16735

View file

@ -84,10 +84,18 @@ void main()
//rawPos = gl_Vertex.xy;
worldPos = (osg_ViewMatrixInverse *gl_ModelViewMatrix * gl_Vertex).xyz;
steepness = dot(normalize(gl_Normal), vec3 (0.0, 0.0, 1.0));
VNormal = normalize(gl_NormalMatrix * gl_Normal);
// hack: World Scenery 2.0 triangle mesh doesn't yield sensible tangents
// and normals, so we pretend that urban terrain is always close
// to flat to get rid of back triangles in urban terrain
//VNormal = normalize(gl_NormalMatrix * gl_Normal);
//VTangent = gl_NormalMatrix * tangent;
VNormal = gl_NormalMatrix * vec3 (0.0,0.0,1.0);
VTangent = gl_NormalMatrix * vec3 (0.0,-1.0,0.0);
ecPosition = gl_ModelViewMatrix * gl_Vertex;
// Normal = normalize(gl_Normal);
VTangent = gl_NormalMatrix * tangent;
// VBinormal = gl_NormalMatrix * binormal;