@luma.gl/effects
Version:
Rendering and post-processing effects library for luma.gl
77 lines (40 loc) • 1.31 kB
Markdown
Helps working with depth buffer values.
* `DEPTH_PACKING` == 3200
* `USE_LOGDEPTHBUF`
uniform bool depth_uEnabled;
uniform float opacity;
uniform float logDepthBufFC; (`USE_LOGDEPTHBUF`)
Samples depth buffer and convert to float
Handles logarithmic depth buffers (`USE_LOGDEPTHBUF`).
### vec4 depth_getColor()
Returns the depth value of the current fragment
#if DEPTH_PACKING == 3200
return vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );
return pack_FloatToRGBA( gl_FragCoord.z );
}
* float invClipZ
* float near
* float far
NOTE: viewZ/eyeZ is < 0 when in front of the camera per OpenGL conventions
* float linearClipZ
* float near
* float far
* float viewZ
* float near
* float far
* float invClipZ
* float near
* float far