remove gl_DepthRange

This commit is contained in:
SamGondelman 2018-12-19 16:21:12 -08:00
parent df6fbefc31
commit bf704c2d0d
2 changed files with 2 additions and 6 deletions

View file

@ -103,9 +103,7 @@ void main(void) {
position = vec4(proceduralData.position, 1.0);
vec4 posClip = cam._projection * (cam._view * position);
float far = gl_DepthRange.far;
float near = gl_DepthRange.near;
gl_FragDepth = 0.5 * ((far - near) * posClip.z / posClip.w + near + far);
gl_FragDepth = 0.5 * (posClip.z / posClip.w + 1.0);
#endif
if (emissiveAmount > 0.0) {

View file

@ -114,9 +114,7 @@ void main(void) {
roughness = proceduralData.roughness;
vec4 posClip = cam._projection * posEye4;
float far = gl_DepthRange.far;
float near = gl_DepthRange.near;
gl_FragDepth = 0.5 * ((far - near) * posClip.z / posClip.w + near + far);
gl_FragDepth = 0.5 * (posClip.z / posClip.w + 1.0);
#endif
if (emissiveAmount > 0.0) {