On OpenGL ES offset the skybox slightly in front of the far plane to avoid clipping artifacts from inaccuracy. Closes #517.

This commit is contained in:
Lasse Öörni 2014-11-08 13:14:44 +02:00
parent 1edc6bfe64
commit b6e854eb27

View File

@ -10,7 +10,12 @@ void VS()
vec3 worldPos = GetWorldPos(modelMatrix);
gl_Position = GetClipPos(worldPos);
#ifndef GL_ES
gl_Position.z = gl_Position.w;
#else
// On OpenGL ES force Z slightly in front of far plane to avoid clipping artifacts due to inaccuracy
gl_Position.z = 0.999 * gl_Position.w;
#endif
vTexCoord = iPos.xyz;
}