Skip to content
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

Glow flashes a lot on reflections with FSR 2.2 enabled. #83317

Open
viksl opened this issue Oct 14, 2023 · 4 comments
Open

Glow flashes a lot on reflections with FSR 2.2 enabled. #83317

viksl opened this issue Oct 14, 2023 · 4 comments

Comments

@viksl
Copy link
Contributor

viksl commented Oct 14, 2023

Godot version

4.2 beta 1

System information

Windows 11 - Vulkan - Nvidia RTX 4070 - intel i5 13600KF

Issue description

When FSR2.2 is enabled the glow on reflections has some extreme flashing behaviour, it's not related to just this model, you can check more in the lumberyard demo (#74965), the model in this MRP is taken directly from that demo to a separate scene to isolate it for this report.

I've also set the values to higher ones to make sure no one can miss it.
I did try teh luminance cap, unless it's at 0 (meaning the glow is disabled) it changes nothing - though increasing it increases the flashing more.

Check the video here: https://youtu.be/cPei3-hV40k

Steps to reproduce

Open the MRP, you should see a black screen with white flashes in the viewport, feel free to change the blend mode for the Glow in the world environment to see it differently, I set it up this way since it's the most obvious example.

Minimal reproduction project

GlowTest.zip

@bitsawer
Copy link
Member

bitsawer commented Oct 14, 2023

The glow got some improvements a few weeks ago, which might have also made it a bit more sensitive to flickering: #82353

This is possibly more of a Glow implementation issue rather than FSR, but ping at @DarioSamo in case he has some useful insight into this issue or possible workarounds/fixes.

Another test video from Lumberyard Bistro:

lamps.mp4

edit:

Comment from Jamsers on RocketChat about the video above:

About this: while yes, the recent PR regarding glow made this worse, the core cause of this issue is actually wrong usage of the transparent material in the glass casing of the lantern: I think it's double sided so it's catching specular from the light inside - it should be one sided so it only catches specular from the outside. I'm planning to do a meshes and materials pass on the project at some point to fix these issues

@Jamsers
Copy link

Jamsers commented Oct 17, 2023

Update on this: I've done my materials pass on Bistro-Demo-Tweaked and it turns out the materials were correct all along. I dug in further and can confirm that the core cause of the issue is FSR 2 itself. The recent glow PR exacerbates the issue, but is not the core cause. (The issue disappears completely if you turn off FSR 2 and use Godot TAA, for example)

What seems to be happening is that FSR 2 jitters and blurs transparencies but makes no attempt to actually upscale them. Here is a video showcasing that - the resolution in this video is set to 360p (1080p output). You'll notice the rest of the scene resolves to 1080p, but the transparencies (the lantern glass panel, the window panes, the "Le Petit Coin" decal) stay low res and jitter extremely.

2023-10-17.14-23-14.mp4

It's not as noticeable the closer you get to native, but is still happening in the background, which causes the glow flashing regardless of resolution.

I distinctly remember that other games which implemented FSR 2 (like Deathloop) also had this issue with transparencies... @DarioSamo do we already output to the reactive mask with the current FSR 2 implementation in Godot? Would it even help?

I feel like the glow shader itself needs to take into account FSR/TAA jitter and do some temporal something something resolve in the first place... I think that's how it's handled in Unreal, for example.

@DarioSamo
Copy link
Contributor

I distinctly remember that other games which implemented FSR 2 (like Deathloop) also had this issue with transparencies... @DarioSamo do we already output to the reactive mask with the current FSR 2 implementation in Godot? Would it even help?

We do output the reactive mask, but as indicated by performance concerns @reduz pointed out, we don't use a separate buffer for it but rather the alpha component that results from doing alpha blending. Therefore, anything alpha blended in the scene outputs the alpha value that was used for compositing as the value for the reactive mask.

Arguably this doesn't give as much control as we might need to address alpha blended objects that are mostly static, but I didn't get the greenlight on splitting the rendering to have this additional reactive mask that we could have bigger control of. It's an interesting point for sure.

@Jamsers
Copy link

Jamsers commented Oct 17, 2023

we don't use a separate buffer for it but rather the alpha component that results from doing alpha blending

Oh that's pretty much the default approach recommended by AMD anyway, so honestly I don't think more specific/user controlled reactive mask will even help much then. Hmm... this may need to be solved in the glow shader itself. 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants