-
-
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
FPS drops when moving mouse with high polling rate #57599
Comments
In the video there are no FPS drops happening because I move the mouse slowly. Moving it quicker then drops the FPS. But I wanted to showcase the switching of the cursor. |
Okay, I can confirm that the FPS issue disappears on Godot 3.3.4. So you can mark this issue as duplicate of #55037.
Our _Input function actually does not do anything complicated.
When debugging we also noticed that the Godot Object Counter (Debugger -> Monitors) goes up with every mouse movement. We still have the issue that the cursor flickers between the two icons that we have.
Although the crosshair is mainly displayed, as seen in the video, the pointer flickers through and the crosshair also sometimes flickers without the applied hotspot vector applied. We will create another issue for this flickering and try to attach an example project, as this issue mainly focused on the FPS issue. |
InputEvents in C# should be |
It shouldn't leak memory, they are garbage collected. It just doesn't kick in early enough to match user expectations of an event's lifecycle. |
I just noticed this in Godot 4.0.3 rc1 . Empty 2D scene just with a label showing the FPS and it is running at fullscreen, My mouse polling rate(or report rate) is 1000 reports per seconds. The performance drops, from 5800fps(not moving the mouse) to around 4400fps(when moving the mouse erratically). Should I make a new bug report ? |
Dropping from 5800 FPS to 4400 FPS is a 0.05 mspf frametime difference, which is insignificant. I think this is within expectations. The reduction you're seeing here is likely due to the OS having to update the mouse cursor position more often, not the engine. |
Godot version
3.4.2.stable.mono
System information
Windows 11, GLES3, NVIDIA GeForce GTX 1080 (511.65)
Issue description
Using mice with high polling rates creates massive FPS drops while moving the mouse.
The mouse used for testing has a polling rate of 1000 Hz. Moving the mouse drops the FPS from 120 down, even when nothing else is happening.
The faster the movements the harder the drop. For me it dropped from 165 FPS sometimes down to 50 FPS.
On another PC with a different mouse it dropped from 60 FPS down to 5 FPS during normal game-play.
When I change the polling rate of the mouse to 125 Hz the effect is still present, but way less noticeable.
Here are two graphs from the Godot profiler. The drops during mouse movement are clearly visible in both cases.
125 Hz mouse movement:
1000 Hz mouse movement:
The cursor also switches between our default cursor for the UI and the in-game cursor used to aim. This is somewhat visible in the attached video, although it is more noticeable in person.
2022-02-03.18-30-36.mp4
Steps to reproduce
Moving the mouse cursor with custom image around in a rapid way.
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: