-
-
Notifications
You must be signed in to change notification settings - Fork 21.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 viewport with transparent bg changed to solid black if enable fxaa or debanding. #54585
Conversation
Good catch 🙂 Does this fully address #45208, or are there still parts of the tonemapping shader that don't play well with Transparent Bg? |
Post processing is bypass if transparent is enabled in driver code, and the shader of glow / dof produce "black edge". I have changed the code and shader, should fix #45208. |
71cb8d3
to
c58391c
Compare
I tested this PR rebased against the latest BeforeAfter (with this PR)When Transparent Bg is disabled, the appearance is identical: BeforeAfter (with this PR) |
I was able to verify this with a project that was suffering from the issue in 3.4.3. Works great, no complaints. |
EDIT: The issue and the transparency not working was since my root node that hosted the viewport was 3D not 2D. So I don't think this is a real blocker. Original message below. A negative side-effect I just noticed: In transparent viewports that are setup via a ViewportTexture in a TextureRect and not ViewportController the (supposedly transparent) background looks overly bright. |
@Kinwailo Looks good to me, please squash the commits together so we can merge this. See PR workflow for instructions 🙂 |
This looks pretty good and is very promising. The only issue I noticed while testing is that FXAA doesn't weight the transparent samples by their alpha, so you end up with black edges when using FXAA. This shouldn't be too hard to fix, it may just be a matter of premultiplying the sampled colour by its transparency so that transparent pixels don't contribute their color. |
fixed fxaa with alpha. |
fixed a mistake. |
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.
Just the one change needed. Other than that, this is looking good to go!
should change the shader for gles3 too? |
Yes please |
…e tonemap shader output
changed |
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.
Looks great! Thank you!
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.
Thanks! Congratulations for your first merged pull request 🎉
If enable fxaa or debanding in viewport with transparent bg, the transparent bg will change to solid black color. It is because the shader always output alpha as 1.0.
Bugsquad edit: This closes #45208.