-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fix reallocation of a depth render target in the SceneGrab class #5650
Fix reallocation of a depth render target in the SceneGrab class #5650
Conversation
If the render target does not have depth, we should probably just log error and early out / fail as what is the reason to execute depth grab if there is no depth buffer? |
Hm. I like your suggestion. But it just looks like there are two independent ways to grab depth buffers. "Depth grabpass" simplify usage "getLinearScreenDepth" or something like this. And a user can instantiate RenderTarget the next way:
In this case, |
Yep, that's a valid point! |
…/files#r1331422198" This reverts commit 4f42be1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy with this, thanks!
Thanks! I have met another case. A camera with posteffects + Depth grabpass + Render target
|
There's a scenario where a camera has a custom render target without a depth buffer texture, and the SceneGrab class incorrectly assumes that the grabbed depth texture has to be the size of the device. This can cause issues when the color buffer of the render target and a canvas have different sizes.
To fix this issue, I suggest that the code should check the size of the color buffer in the absence of a depth buffer, since they should have the same size. This will ensure that the reallocation of SceneGrab.depthRenderTarget works as expected.
I hope this helps! Let me know if you have any questions.
I confirm I have read the contributing guidelines and signed the Contributor License Agreement.