-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
[3.x] Prevent use of Opaque Pre-Pass's threshold on top of Alpha Scissor #45372
Conversation
Hi, sorry I missed this. I like the proposed change, it makes sense to have the alpha scissor override the depth-prepass threshold. That being said, the reason that the current behaviour hasn't changed, despite being awkward, is that small tweaks to how the depth prepass work have big impacts on performance, and visuals. It is very easy to accidentally break everyone's scenes when we introduce changes. So before a change like this is considered, we need to be absolutely sure that it is going to completely break real scenes. Further discussion here where I propose exactly the change you have made here :P |
@clayjohn I've been using this change in a custom Godot build for a few weeks now and haven't found issues as of yet, and I couldn't find any collisions with the "depth-prepass + blending" behavior, but I do understand there could be edge cases that I missed (or am completely unaware of), so I share the same worry. 😅 |
Do you mind testing the MRP in #36669 with your custom build? |
Was that issue fixed? Because 3.2.4 RC4 has that problem, but my custom build doesn't. prepass.mp4 |
71cb8d3
to
c58391c
Compare
What's the current status on this PR? Needs a rebase, and if it still works as intended it should be good to merge. |
e189913
to
1aba51b
Compare
1aba51b
to
ff55157
Compare
Thanks! |
PS: If anyone has time, please check the behavior in |
In SpatialMaterials and ShaderMaterials, both Alpha Scissor and Opaque Pre-Pass can discard fragments (== create fully-transparent pixels), but Opaque Pre-Pass has a hardcoded threshold of 0.1 that the end-developer cannot modify.
This PR makes SpatialMaterials use the alpha scissor threshold instead of Opaque Pre-Pass's own threshold whenever Alpha Scissor is in use. This prevents the strange behavior where any fragment with an ALPHA value under 0.1 would be discarded, no matter what Alpha Scissor value you set.
Using blue noise for ALPHA_SCISSOR and a radial gradient:
Scene in image: PrepassTesting.zip
Related: #45288
Do tell me if this breaks the intent of Opaque Pre-Pass.