1
0
Fork 0

Fix bug#123: 3d cloud flicker on Mac

This commit is contained in:
Torsten Dreyer 2011-06-08 17:08:33 +02:00
parent 92b3358f83
commit cc37e63561

View file

@ -36,8 +36,12 @@ void main(void)
// Determine a lighting normal based on the vertex position from the
// center of the cloud, so that sprite on the opposite side of the cloud to the sun are darker.
float n = dot(normalize(-gl_LightSource[0].position.xyz),
normalize(mat3x3(gl_ModelViewMatrix) * (- gl_Position.xyz)));;
// fix flickering of 3d clouds on some macs
// http://code.google.com/p/flightgear-bugs/issues/detail?id=123
// float n = dot(normalize(-gl_LightSource[0].position.xyz),
// normalize(mat3x3(gl_ModelViewMatrix) * (- gl_Position.xyz)));;
float n = dot(normalize(-gl_LightSource[0].position.xyz), vec3(0.0,0.0,-1.0));
// Determine the position - used for fog and shading calculations
vec3 ecPosition = vec3(gl_ModelViewMatrix * gl_Position);