logdepthbuf_fragment.glsl.js 278 B

123456789
  1. export default /* glsl */`
  2. #if defined( USE_LOGDEPTHBUF )
  3. // Doing a strict comparison with == 1.0 can cause noise artifacts
  4. // on some platforms. See issue #17623.
  5. gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
  6. #endif
  7. `;