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

Vulkan: Flashing Lights through Fog while Alt+Tabbed #61222

Open
Tracked by #69579
cnjeffer opened this issue May 20, 2022 · 4 comments
Open
Tracked by #69579

Vulkan: Flashing Lights through Fog while Alt+Tabbed #61222

cnjeffer opened this issue May 20, 2022 · 4 comments

Comments

@cnjeffer
Copy link

cnjeffer commented May 20, 2022

Godot version

Godot_v3.4.4-stable_win64

System information

Windows 10, Intel Core i9-9900k, Nvidia RTX 2070 Super

Issue description

Fast flashing light occurs when I alt-tab from my Godot project, only happens in certain areas.

2022-05-20 22_31_05-Window
2022-05-20 22_31_29-Window

Steps to reproduce

!!! WARNING FLASHING LIGHTS !!!

Godot.Bug.mp4

Minimal reproduction project

couldn't upload zip, maybe 30mbs is too much?
here's a GDrive link
https://drive.google.com/file/d/1dzYtAY3YB0DYOTQvvImt5EmC49KyXj06/view?usp=sharing

@Calinou
Copy link
Member

Calinou commented May 20, 2022

  • Can you reproduce this after disabling Volumetric Fog > Temporal Reprojection in the Environment properties?
  • Can you reproduce this after enabling Interface > Editor > Update Continuously in the Editor Settings?

couldn't upload zip, maybe 30mbs is too much?

Indeed, GitHub attachments are limited to 10 MB.

@Calinou Calinou added this to the 4.0 milestone May 20, 2022
@Calinou Calinou changed the title Flashing Lights through Fog while Alt+Tabbed Vulkan: Flashing Lights through Fog while Alt+Tabbed May 20, 2022
@sDeemm
Copy link

sDeemm commented May 31, 2022

I tested it in master since I have a similar system and the issue is reproducible.

The feature that causes trouble is the Auto Exposure. The MRP uses the following parameters

image

Note that, the scale is at the minimum while the speed is at its maximum.

While Alt+Tabbed godot runs at 100ms.

Given

double step = env->auto_exp_speed * time_step;

Used in shader (params.exposure_adjust):

avg = clamp(prev_lum + (avg - prev_lum) * params.exposure_adjust, params.min_luminance, params.max_luminance);

Considering that exposure_adjust is 64 * 100ms = 6.4 and the scene's avg luminance is near the minimum. The avg result flickers between the min_luminance and the average luminence value.

Can you reproduce this after enabling Interface > Editor > Update Continuously in the Editor Settings?

It does fixes the problem since the frame rate of godot will not "drop" when alt+tabbed.

I'm wondering what would be the next step for this issue...

@clayjohn
Copy link
Member

clayjohn commented Aug 2, 2022

I tested it in master since I have a similar system and the issue is reproducible.

The feature that causes trouble is the Auto Exposure. The MRP uses the following parameters

image

Note that, the scale is at the minimum while the speed is at its maximum.

While Alt+Tabbed godot runs at 100ms.

Given

double step = env->auto_exp_speed * time_step;

Used in shader (params.exposure_adjust):

avg = clamp(prev_lum + (avg - prev_lum) * params.exposure_adjust, params.min_luminance, params.max_luminance);

Considering that exposure_adjust is 64 * 100ms = 6.4 and the scene's avg luminance is near the minimum. The avg result flickers between the min_luminance and the average luminence value.

Can you reproduce this after enabling Interface > Editor > Update Continuously in the Editor Settings?

It does fixes the problem since the frame rate of godot will not "drop" when alt+tabbed.

I'm wondering what would be the next step for this issue...

Great work! The next step is to research how other auto exposure implementations work and determine if this line of code needs to change or another line of code. IMO auto exposure should be robust enough that it can handle variable frame rates. At the same time, perhaps the chosen speed is way outside a reasonable range, so perhaps its the range exposed in the editor that needs to change. Either way, a little bit of research is needed to form a good opinion on what to do next

@Calinou
Copy link
Member

Calinou commented Sep 26, 2023

I wonder if #82222 can help with this.

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

4 participants