-
-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect use of depth texture attachments #225
Comments
Added a temporary fix in |
I'm having this issue with 6.19.3. I'm not sure if it's something I'm doing something wrong on my end but seeing this ticket it seems to confirm my suspicion of missing depth information, even though the needsDepthTexture and the following logic execute correctly. My example follows closely to yours, RenderPass with clearPass enabled -> EffectPass with DepthEffect. Also important to note that I'm able to use DoF and SMAA, both of which use depth, without issue. Edit: Never mind this. It's just that my camera is really far away. I had assumed the depth information would be relative. Cheers. |
* Copy depth texture to intermediate buffer to prevent binding depth texture to both input and output buffers in compositor shader * See pmndrs/postprocessing#225, pmndrs/postprocessing#416 for additional context
Depth texture management is fixed in the postprocessing v7 alpha which will eventually replace v6. I'm keeping this ticket open until v7 lands in case someone stumbles over this bug. |
Description of the bug
The current depth texture system assumes that a depth texture can be assigned to a render target at any time. This assumption is incorrect as render targets are initialized once when they are used. Certain pass chains will cause the internal frame buffer to be initialized with a basic depth buffer attachment and the subsequent assignment of a depth texture won't have any effect. As a result, the depth texture won't contain the depth information of the rendered scene.
To Reproduce
ClearPass
to the composer.RenderPass
to the composer.EffectPass
containing a depth-based effect such asSSAOEffect
to the composer.Expected behavior
Depth-based effects shouldn't fail with certain pass chains. One potential solution would be to assign the depth texture to a dedicated render target for geometry passes. Going one step further, a more complex render target management system could be implemented to allow passes to explicitly define input and output buffers.
Library versions used
The text was updated successfully, but these errors were encountered: