MacOS X glFrustum generates -0.0 in W column of projection matrix; Windows glFrustum generates 0.0. This causes sign differences in the gl_ProjectionMatrixInverse between platforms. manually force the z coordinate sign in terrain sky projection to be negative like it ought to be

db4
Joe Groff 2009-05-13 21:28:12 -05:00
parent 0378c612c6
commit 2da256063f
1 changed files with 1 additions and 0 deletions

View File

@ -12,6 +12,7 @@ void main()
gl_Position = v;
vec4 p = gl_ProjectionMatrixInverse * v;
p.z = -abs(p.z);
float s = sin(sky_theta), c = cos(sky_theta);
direction = mat3(1, 0, 0, 0, c, s, 0, -s, c)