EffectPass.setDepthTexture from DepthSavePass #331
-
Hi postprocessing community, Im trying to reproduce the codesandbox postprocessing-god-rays but using Here is a sandbox showing where Im stuck : https://codesandbox.io/s/setdepthtexture-from-depthsavepass-39zp6?file=/src/App.js It can show/hide the saved depth texture as But
Seems to do absolutely nothing when feeded with Working until ... another pass ( Any advices are welcome. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It's possible to use the This setup unearthed a problem though. The
Setting a custom depth texture must be done after the pass was added to the composer. Otherwise the depth texture will be reset. From #330:
The |
Beta Was this translation helpful? Give feedback.
It's possible to use the
DepthSavePass
in combination with aRenderPass
to save a custom depth texture before rendering the main scene. Here's an example: https://codesandbox.io/s/postprocessing-god-rays-forked-tsq18?file=/src/App.jsThis setup unearthed a problem though. The
DepthSavePass
usesRGBADepthPacking
by default, but this produces fullywhiteblack pixels for fragments that read01 in the input depth texture. I think this might be a quirk of the RGBA packing function, but I'm not sure if and how that could be fixed. Here's a comparison of the discrepancy:BasicDepthPacking
can be used instead, but this will store depth in aFloatType
texture …