-
-
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
Forward Plus Renderer causes frameskips/jitter/judder/stutter, GPU frames aren't sorted correctly on Windows #84137
Comments
Would it be possible for you to use your phone filming your monitors to record all those various tests and post the videos here under each setting description? We all have different hardware and it is close to impossible to fully replicate your result, or be able to tell if we have replicated the same result without seeing yours. If you record your monitors with your phone we would have the best chance to see what you are seeing as screen recording software would likely alter the result as well. |
Initial Tests (Outdated, lower in the thread are actual videos, much better than anything written here-Forward Plus renderer was used Test 2.1: Basic window size, physics loop, 100%, v-sync on-Display -> Window -> Size: Viewport Width: 640 Here the character displays the jitter Test 2.2: Basic window size, process loop, 100%, v-sync on-Display -> Window -> Size: Viewport Width: 640 Here the character displays the jitter Test 2.3: zoomed window size, process loop, 300%, v-sync on-Display -> Window -> Size: Viewport Width: 1920 Here the character displays the jitter, very clearly Test 2.4: zoomed window size, physics process loop, 300%, v-sync on-Display -> Window -> Size: Viewport Width: 1920 Here the character displays the jitter, very clearly Test 2.5: Basic window size, physics loop, 100%, v-sync off-Display -> Window -> Size: Viewport Width: 640 Here the character displays no jitter Test 2.2: Basic window size, process loop, 100%, v-sync off-Display -> Window -> Size: Viewport Width: 640 Here the character displays no jitter Test 2.3: zoomed window size, process loop, 300%, v-sync off-Display -> Window -> Size: Viewport Width: 1920 Here the character displays no jitter Test 2.4: zoomed window size, physics process loop, 300%, v-sync off-Display -> Window -> Size: Viewport Width: 1920 Here the character displays no jitter The whole issue also comes up in a ton of other issue reports with physics, sprite 2d and whatever. It#s not only me experiencing those issues, I also have it on my laptop and found a bunch of similar bug reports, but I found out that it's the renderer If I use the compatibility renderer all is smooth So by sheer logic that's where the issue must lie. |
I am not familiar with the code, but I hypothesize that the swapchain is using the wrong monitor hz for the window. |
Also because it came up: changing the project settings to fullscreen also produces the jitter, having fullscreen without forward plus v-sync runs smooth again. |
I got another very interesting observation: So it also could be that the V-Sync is fine, but just something with the initial initialization of the windowed mode Hz might be wrong. I quickly created another new project and the issue again applies My main system monitor is the 100Hz monitor, my secondar ymonitor is the 60Hz monitor. Exact steps which accidentally seem to solve this issue: |
Hi @Cyangmou , I have just run the demo and got jittered whenever stretch mode set to Btw, I'm using I'm kinda concerning about the multiple monitors issue but I could not verify it because I don't have the setup to test myself so your result on this would be much appreciated! |
I just ran that linked demo how it came out of the box. I performed all tests on my 100Hz 2560x1440 monitor Test 1: out of the box what is different here: Test 1: disabling V-Sync Test 2: v sync enabled, but using process instead of physics process Test 3: v sync diabled, physics-process So with this viewport override it seems to make a difference if you use a physics process or no physics process Also I additionally tried then to set the stretch mode to viewport and to canvas items |
@Cyangmou Thanks so much! So with |
The point is that not using the physics process further in dev could drag down the game, as running physics operations in frames is costly. I would not call it a solution, rather something which unexpectedly worked. The important parts would be the physics ticks. |
@Cyangmou I don't know how costly physics operations is but the way Godot handle pixel perfect is very similar to GameMaker to me. There is no |
You can of course do it. It's just neither professional nor smart to do it. |
Oh @Cyangmou wait... In my demo I forgot to change player to |
I am also experiencing this issue and did some testing and may have found a hint to the issue. It appears that when changing the Max FPS setting to be 60 to bump up against VSync's max stepping, the issue seems to disappear. I'm not 100% sure if it actually disappears after looking at it for so long, but, the jitter is 99% reduced in conjunction with the Physics Jitter Fix setting at 0.5 (default). Monitor 1: 2560x1440p @ 60hz Settings changed: When VSync is enabled and Max FPS is set to 0, the jitter is there. When VSync is disabled and Max FPS is set to 0 (goes to around 3k+), the jitter disappears |
Yep, if you lock a 60Hz game on a 60Hz screen and your hardware can blow the specs, for sure it's running smooth. I mean that's within the expectation. |
Ok, I decided to run other tests with setups with 4 different (close to) 60HZ screens On Windows you can check in the Advanced display settings the exact Hz the screen runs. Adding those 2 lines of code in godot should give us a good idea about the return
Setup 1:screen1: 1920x1080, on Windows 11: 59,95Hz results in: Setup 2:59,97 Hz screen results in a value godot returns of 60 Conclusion:Jitter could be experienced on all screens Something is really really off here |
Here is a lossless recording with camera smoothing switched off 60hz screen |
Edited the name that the description of the issue is in line with all known test results. |
Regarding the issue of refresh rate appearing incorrectly, it looks like that Godot uses DEVMODEW here and this structure seems to used a DWORD for the storage of the refresh rate, which means that it can't deal with fractional refresh rates. Instead, the structure DWM_TIMING_INFO seems to provide "UNSIGNED_RATIO rateRefresh;" which supports fractional refresh rates, so this looks like it should be used instead |
I watched the footage very carefully... had to do it a couple of times to spot it. |
Oh hey, I was wondering where that recording went. Yes I'm also forward+ vulkan on a 5700 XT with VSync enabled. |
Sorry 5700XT, and yeah I was following up on this bug and I figured we'd
want it tagged.
…On Thu, Dec 21, 2023, 6:31 PM TestSubject06 ***@***.***> wrote:
2 different users having this issue w/ VSYNC enabled and both of us use
5600XT graphics cards, forward+, vulkan (on mine, not sure on theirs)
https://www.youtube.com/watch?v=06wlTIDRx3U&t=4s
Oh hey, I was wondering where that recording went. Yes I'm also forward+
vulkan on a 5700 XT with VSync enabled.
—
Reply to this email directly, view it on GitHub
<#84137 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKYWUIVYY3EMT6III2XYAM3YKTBEJAVCNFSM6AAAAAA6UYGWNKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRXGA2TAMJRG4>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
My Vulkan vsync stutters seem similarly fixed by the above, although it's worth noting I had to go into my NVidia control panel and set "Vulkan/OpenGL present method" to "Prefer layered on DXGI Swapchain", which probably makes sense to somebody smarter than me. |
This is not that odd of a fix, I've been considering that we could get much more consistent behavior if we used a DXGI swap chain instead even when using Vulkan. It'd get lower latency and a more consistent presentation. That control panel option does essentially do that for you at the low level AFAIK. |
See godotengine/godot-proposals#5692 where I originally proposed this. It would also allow for HDR output to be implemented in Vulkan-based rendering methods, as DXGI is the only way to achieve HDR output on Windows. Using DXGI directly also allows NvTrueHDR to work on Vulkan apps without requiring changes in the NVIDIA Control Panel to force layered DXGI presentation. |
Screenbits.2024-03-09_153433.mp4Hey, I've encountered this issue as well within Godot v4.2.1.stable.official [b09f793] where toggling VSYNC on and off leads to noticeable changes in tween behavior attached to nodes like Sprites. This seems to extend beyond the previously discussed impacts on character controllers and cameras, affecting animations and movements across the board. Steps to Reproduce
To provide a clearer picture, I’ve included a video demonstrating these steps and the observed effects. Expected vs. Observed BehaviorIdeally, tween operations should remain stable and consistent irrespective of VSYNC status, ensuring animations are smooth. However, toggling VSYNC alters the tween behavior, compromising animation smoothness and predictability. Technical Environment
Please let me know if further information is required or how I can help contribute to resolving this. |
@jbikeler This may be fixed in 4.3, there was some work done on the renderer, can you reproduce it on the latest dev release? |
Yes, using 4.3 Dev 4 I still get the same result. I did see earlier in this forum that it could be a swap chain issue and I saw that there are new settings related to VSYNC and swap chain but I haven't done any testing with them in 4.3. Purely through enabling and disabling VSYNC I still get the same results. Screenbits.2024-03-09_183857.mp4 |
The recording I just posted was a duplicated project from 4.2.1 opened in 4.3.dev4, but just to make sure I also completely rebuilt the project for the tween test in 4.3.dev4 from scratch and I still got the same results. |
Do you encounter such issues with the directx renderer, or only vulkan? I had similar jittering but managed to fix it by modifying the uhhh swapchain setting in my nvidia control panel after the render fixes were merged |
Can you try a newer NVIDIA driver? There's a chance they fixed it on their end. |
After updating my 3060 ti driver to 551.76, Godot 4.3.dev4 fixes most of the jitter issues even with Vulkan. Godot 4.2.1 still has a bit of jitter after updating, but it actually improved a bit with the update. I'll continue to test, but it seems 4.3 will fix the issue. |
The TL;DR so far from my understanding is that:
I'd not be surprised if this issue is consistent even on other Vulkan applications on NVIDIA/Windows, but I don't have enough evidence to support that yet. It's possible the issue has gone unnoticed because games are far more likely to use D3D on Windows than Vulkan, while on Godot it's the default option since it's the open standard. EDIT: It seems your latest comment would also support the theory that these are indeed two separate bugs with a similar result. |
The option appears in the Godot 4.3.dev build. I don't have it for 4.2.1 either. |
One thing to ask, is GPU hardware scheduling enabled, and or windowed optimizations in windows? |
I can't reconstruct this on Windows at all, however, I am getting something that looks just like this on Ubuntu (x11). here's a curious test: for some reason, this result in buttery smooth scrolling for me with Forward+ |
Godot version
4.1.3
System information
Windows 11, NVIDIA GeForce GTX 1070, i7-7700K CPU 4.20GHz, 1920x1080 60Hz IPS monitor & a 2560x1440 adaptive 100Hz monitor
Issue description
The forward plus renderer, causes jitters in movement. It's especially visible when V-Sync is switched on.
This happens in 2D and 3D
Those jitters are more or less pronounced, depending on which screen you use, they might not be very visible on a 60HZ screen but are still there.
Resolve_27I0HkMqLD.mp4
when i talk about "jitter" i am talking about this effect happening in the video above or clearly observable in this older video here at 5, 8, 11 and 13 seconds:
Video
The problem seems to be tha tthe renderer has a cache of 4 GPU frames and that the sorting of those frames is jumbled up.
So basically by design we seem to have an reoccuring order of 0, 1, 3, 2, 3, ... 4, 5, 8, 7, 8...
This means some frames don't get shown, others get shown twice and the judder is caused by a step back
Currently it's not clear if it's a problem with the way how the frames are put together, or if it's a driver related issue related to memory. It could be 2 bugs, as comment sin the thread show other bugs play into this
Steps to reproduce
Can this be circumvented?
No. It's a very critical and very deep sitting bug.
With the forward plus renderer there is no way to circumvent this and it will happen on any hardware. THe higher the resolution, the less obvious the bug is, however it's always there. The forward plus renderer is simply broken and can't be used in the current state.
You could Use the gl_compatibility renderer, which doesn't have this problem, but this is not a good solution either.
Minimal reproduction project:
I made a simple project in which the character can only run left and right per key input. That's literally all the code we need to test the issue properly, the setup described above is key for making it visible.
Conclusion
Hypothesis
I think the core of the problem lies with the forward plus renderer (There however might be additional problems with V_Sync, Camera or Physics)
Minimal reproduction project
Project Download
This includes a small platformer project. Project settings need to be adjusted according to my tests to reproduce the issues.
The text was updated successfully, but these errors were encountered: