From 2da256063f736028a9c95476226296dc339ea203 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 13 May 2009 21:28:12 -0500 Subject: [PATCH] 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 --- extra/terrain/shaders/shaders.factor | 1 + 1 file changed, 1 insertion(+) diff --git a/extra/terrain/shaders/shaders.factor b/extra/terrain/shaders/shaders.factor index 630163c724..9233ab3f36 100644 --- a/extra/terrain/shaders/shaders.factor +++ b/extra/terrain/shaders/shaders.factor @@ -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)