fireball/lib/renderers/shaders/ShaderChunk/logdepthbuf_vertex.glsl
2018-12-25 17:29:22 +03:30

16 lines
235 B
GLSL

#ifdef USE_LOGDEPTHBUF
#ifdef USE_LOGDEPTHBUF_EXT
vFragDepth = 1.0 + gl_Position.w;
#else
gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;
gl_Position.z *= gl_Position.w;
#endif
#endif