|
@@ -47,18 +47,14 @@ const UnpackDepthRGBAShader = {
|
|
|
|
|
|
|
|
#ifdef USE_REVERSEDEPTHBUF
|
|
#ifdef USE_REVERSEDEPTHBUF
|
|
|
|
|
|
|
|
- if ( depth == 1.0 ) depth = 0.0; // wrong clear value?
|
|
|
|
|
|
|
+ gl_FragColor = vec4( vec3( depth ), opacity );
|
|
|
|
|
|
|
|
- // [0, 1] -> [-1, 1]
|
|
|
|
|
- depth = depth * 2.0 - 1.0;
|
|
|
|
|
|
|
+ #else
|
|
|
|
|
|
|
|
- // Reverse to forward depth (precision is already destroyed at this point)
|
|
|
|
|
- depth = 1.0 - depth;
|
|
|
|
|
|
|
+ gl_FragColor = vec4( vec3( 1.0 - depth ), opacity );
|
|
|
|
|
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
- gl_FragColor = vec4( vec3( 1.0 - depth ), opacity );
|
|
|
|
|
-
|
|
|
|
|
}`
|
|
}`
|
|
|
|
|
|
|
|
};
|
|
};
|