godotengine / godotengine/godot
Noticable mouse jitter, but only when mouse mode is `Input.MOUSE_MODE_CAPTURED`
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
- Reproducible in: v4.4.dev2.mono.official.97ef3c837, v4.4.dev.custom_build.97ef3c837, v4.3.stable.arch_linux, v4.0.stable.official [92bee43ad], v3.6.stable.official [de2f0f147], v.3.3.stable.official, v.3.2.3.stable.official, v.3.2.2.stable.official
- Not reproducible in: v.3.0.stable.official, v.3.1.stable.official, v.3.2.stable.official, v.3.2.1.stable.official
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
1. Set mouse mode to `Input.MOUSE_MODE_CAPTURED`.
2. Rotate camera with normal speed. Not that high when you see nothing and not that low when everything is almost static.
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 holding `Shift`):
[bugjitter3d.zip](https://github.com/user-attachments/files/17085520/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 to `relative` in GDScript code.
For Godot 3, just create CSGBox3D or simply rotate camera even without it (this bug still should be seen).
Contributor guide
Research direction
Start by running the attached bugjitter3d.zip project and reproducing the camera movement with Input.MOUSE_MODE_CAPTURED. Compare captured and visible mouse modes, and inspect the Godot editor's 3D camera behavior across the listed versions, including the references to #54818 and #45592. Done means the captured-mode camera no longer exhibits the reported jitter during movement.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100