-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Noticable mouse jitter, but only when mouse mode is Input.MOUSE_MODE_CAPTURED
#97294
Comments
I have no idea why, this commit looks unrelated. I checked previous commit and it works just fine. Then from previous commit I changed
If i define |
With file:
Without file:
After that, comment out / uncomment |
https://github.com/godotengine/godot/blob/master/core/os/os.cpp#L582 |
Replacing void OS::add_frame_delay(bool p_can_draw) {
if (is_in_low_processor_usage_mode() || !p_can_draw) {
delay_usec(get_low_processor_usage_mode_sleep_usec()); //apply some delay to force idle time
} else {
uint32_t frame_delay = Engine::get_singleton()->get_frame_delay();
if (frame_delay)
delay_usec(Engine::get_singleton()->get_frame_delay() * 1000);
}
} fixed issue only in the editor itself. Enabling I added following code in double refresh_rate = DisplayServer::get_singleton()->screen_get_refresh_rate();
if (refresh_rate < 0.0) refresh_rate = 60.0;
// 900_000 is 1_000_000 * 0.9, where 0.9 is some random coefficient that makes it work
OS::get_singleton()->set_low_processor_usage_mode_sleep_usec(static_cast<int32_t>(900000.0 / refresh_rate)); Now it's close to 144 FPS (140-141 FPS), but also without this bug. I know there is a way to make it work without |
Of course, |
Tested versions
As for me, this bug in 3.3.stable.official is noticeable more than in 3.2.3.stable.official.
Also I can say nothing about 3.2.2.rc1. It feels between 3.2.1 when there is definitely no such a bug, and from 3.2.3+ where it can be clearly seen.
System information
Godot v4.4.dev2.mono - Arch Linux #1 SMP PREEMPT_DYNAMIC Thu, 12 Sep 2024 17:21:02 +0000 - Wayland - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4060 Laptop GPU - AMD Ryzen 7 7735HS with Radeon Graphics (16 Threads). 144Hz monitor
Issue description
It's pretty difficult to explain what's wrong, but it looks like something is wrong. Camera movements are too sharp. For example when you move mouse by 1px, camera immediately changes its rotation by larger amount. It's really noticeable and looks very ugly. As for me it's even better to play my own game when mouse is visible (it's FPS) than with this bug. I'm not really sure, but that may be visible only on high refresh rate screens (like 144hz that I have).
Looks like #54818, but sensitivity doesn't change in this case. Also may be a regression of #45592, because there something also was wrong only when mouse mode is
..._CAPTURED
.I already tried making my own camera smoothing to fix it and it smoothed camera movement, but didn't fix this issue at all. Only fix is to change mouse mode. Also, enabling physics interpolation seems to make no difference.
Steps to reproduce
Input.MOUSE_MODE_CAPTURED
.3 (optional). Set mouse mode to
Input.MOUSE_MODE_VISIBLE
to compare how much smoother that is.4 (optional). Move camera without rotating to compare how much smoother that is.
Also to see it better, try to visually lock on an object and rotate in such way, that this object will always be in center of screen and just move in circle around it.
Also more noticeable when camera is moving at relatively high speed.
Minimal reproduction project (MRP)
The smallest reproducible project when you already have Godot Engine is the editor itself. Hold right mouse button and move your mouse to rotate camera (in 3D tab) and move using one of WASD keys, also you can press
Shift
to speed up to make bug more noticeable. But in empty project it's pretty difficult to see the difference, so I made this MRP (you can actually rotate camera if you run it, move using WASD keys, and speed up while holdingShift
):bugjitter3d.zip
If you see some weird glitches, because you opened this project in earlier version of Godot (not 4.4), just run it. If you are getting errors about
screen_relative
, replace it torelative
in GDScript code.For Godot 3, just create CSGBox3D or simply rotate camera even without it (this bug still should be seen).
The text was updated successfully, but these errors were encountered: