-
Beta Was this translation helpful? Give feedback.
Answered by
vanruesc
Apr 6, 2025
Replies: 2 comments 13 replies
-
Judging depth precision by the visible banding on screen is not a reliable approach. Banding only occurs because you're rendering depth to an 8-bit buffer. Possible ways to improve depth precision are using reverseDepthBuffer and pushing out the |
Beta Was this translation helpful? Give feedback.
1 reply
-
Try enabling the stencil buffer to force 24bit depth: const composer = new EffectComposer(renderer, { stencilBuffer: true, ... }); |
Beta Was this translation helpful? Give feedback.
12 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
stencilBuffer
setting of the composer doesn't affect custom depth textures. It just switches to the sizedUnsignedInt248Format
for the internal depth texture which guarantees 24 bits of precision on devices that would only use 16 bits forUnsignedIntType
.If you want to render your own depth texture, you could just use
FloatType
. However, rendering the scene depth requires you to render the entire scene a second time whereas the internal depth texture inpostprocessing
is rendered by theRenderPass
for free. You can also overrideEffect.setDepthTexture(depthTexture, depthPacking = BasicDepthPa…