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:
parent
1edc6bfe64
commit
b6e854eb27
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user