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

Port Vital Updates Only editor setting to 4.x, and use it by default when the project is running #76734

Open
Rex-82 opened this issue May 4, 2023 · 3 comments

Comments

@Rex-82
Copy link

Rex-82 commented May 4, 2023

Godot version

4.0.2

System information

OS: Windows 10, CPU: Intel I5 4690, MB: MSI Z87-G43, GPU: Nvidia GTX 960 (driver version 531.79), RAM: 16GB DDR3

Issue description

Video 1 - My project

As seen in the video the debug window is stuttering (going from ~15% to ~80% gpu utilization) until I minimize the editor (steady at ~60%).
(looks like it tries to render the editor a bit, then the debug window a bit and so on)

This issue is only present in "Forward+" mode, empty project runs fine.

2023-05-04.10-51-39-1_Trim.mp4

The only "fix" i have found in this project was to re-import the frog model from the .blend file and disable "SDFGI", otherwise the stutter happened again.
(Before re-importing the model even removing WorldEnviroment node didn't solve the issue)

Video 2 - New project

Here i tried to create a new project, everything goes nominal until i enable "Use Occlusion" under "SDFGI". Then the stutter occurs.
In the video i try to show how as soon as i minimize the editor window the stutter stops and everything is smooth again.

2023-05-04.18-52-32-1.mp4

Attempt 3 - Demo project

I also tried with a demo project called Abandoned Ship Demo, here the only "fix" i have found was to remove everything (even the Camera node made the editor stutter).
Again, minimizing the editor made the debug run smooth with no frame drops
This project runs with SDFGI OFF at ~80fps and with SDFGI ON at ~60fps, the stutter is present in both cases and stops as soon as the editor window gets minimized (and resumes if re-opened).

Screenshots

Below are some screenshots that might be useful:

Profiler Process Time

Screenshot_822

Not every stutter gave a spike on the graph
Nominal time was 11, spikes are above 2000

Profiler Physics Frame Time

Screenshot_823

Nominal frame time was 16, dips were either 0 or NaN

Profiler Physics Time

Screenshot_824

Monitor tab

Screenshot_825

Visual Profiler

Screenshot_821

More graphs

System utilization

system

GPU utilization

gpu

Thank you for taking the time to look into this!

Steps to reproduce

Speaking in regard of the second project (attached below) this issue occures by adding the WorldEnviroment node and enabling "Use Occlusion".
The issue then is "fixed" by minimizing the editor window.

Minimal reproduction project

Bug.zip

@Calinou
Copy link
Member

Calinou commented May 4, 2023

This is expected, as the editor keeps redrawing continuously when it's visible (even if it's just doing so at 10 FPS because it's unfocused). This is enough to cause stuttering because the editor and running project are fighting for GPU resources.

What we need to do is port the Vital Updates Only option from 3.x and make it the default when the project is running from the editor. This way, the editor will stop redrawing when the project is running unless you manually interact with the editor window.

@Calinou Calinou changed the title Debug stutters unless editor window is minimized Port Vital Updates Only editor setting to 4.x, and use it by default when the project is running May 4, 2023
@Rex-82
Copy link
Author

Rex-82 commented May 4, 2023

Thank you for the fast answer, I will look forward to it being added!

Any clue why the stutter occurs even if the GPU is not utilized at 100%? (may be a dumb question)
As you can see in the "GPU utilization" graph it runs steady at 60% with the editor minimized and goes all funky from 0 to 60% when opened

@KoBeWi
Copy link
Member

KoBeWi commented May 4, 2023

This is expected, as the editor keeps redrawing continuously when it's visible (even if it's just doing so at 10 FPS because it's unfocused).

This only happens if you have something moving on a screen, like particles or animated shader (in this case it's the water). You can either switch to a static scene, move camera somewhere without anything moving or switch to script editor.

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

3 participants