Skip to content

Depth Texture Precision #699

Answered by vanruesc
KallkaGo asked this question in Q&A
Apr 5, 2025 · 2 comments · 13 replies
Discussion options

You must be logged in to vote

when I used my own depthBuffer, even if I set stencilBuffer to true, there are still bands

The stencilBuffer setting of the composer doesn't affect custom depth textures. It just switches to the sized UnsignedInt248Format for the internal depth texture which guarantees 24 bits of precision on devices that would only use 16 bits for UnsignedIntType.

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 in postprocessing is rendered by the RenderPass for free. You can also override Effect.setDepthTexture(depthTexture, depthPacking = BasicDepthPa…

Replies: 2 comments 13 replies

Comment options

You must be logged in to vote
1 reply
@KallkaGo
Comment options

Comment options

You must be logged in to vote
12 replies
@vanruesc
Comment options

@KallkaGo
Comment options

@KallkaGo
Comment options

@vanruesc
Comment options

Answer selected by KallkaGo
@KallkaGo
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants