Skip to content

Commit 16c34b2

Browse files
committed
Mention buffer size and Windows 11 mouse polling in Fixing jitter, stutter and input lag
This also documents command line arguments that may be of interest when running Godot projects.
1 parent 2f1c8a7 commit 16c34b2

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

tutorials/rendering/jitter_stutter.rst

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ Finally, a game exhibiting *stutter* will appear smooth, but appear to *stop* or
3434

3535
.. image:: img/motion_stutter.gif
3636

37-
3837
Jitter
3938
------
4039

@@ -98,6 +97,11 @@ games, will usually not exhibit this problem anyway).
9897
For fullscreen, Windows gives special priority to the game so stutter is no
9998
longer visible and very rare. This is how most games are played.
10099

100+
When using a mouse with a polling rate of 1,000 Hz or more, consider using a
101+
fully up-to-date Windows 11 installation which comes with fixes related to high
102+
CPU utilization with high polling rate mice. These fixes are not available in
103+
Windows 10 and older versions.
104+
101105
.. tip::
102106

103107
Games should use the **Exclusive Fullscreen** window mode, as opposed to
@@ -157,7 +161,20 @@ Project configuration
157161

158162
On platforms that support disabling V-Sync, input lag can be made less
159163
noticeable by disabling V-Sync in the project settings. This will however cause
160-
tearing to appear, especially on monitors with low refresh rates.
164+
tearing to appear, especially on monitors with low refresh rates. It's suggested
165+
to make V-Sync available as an option for players to toggle.
166+
167+
When using the Forward+ or Mobile rendering methods, another way to reduce
168+
visual latency when V-Sync is enabled is to use double-buffered V-Sync instead
169+
of the default triple-buffered V-Sync. Since Godot 4.3, this can be achieved by
170+
reducing the **Display > Window > V-Sync > Swapchain Image Count** project
171+
setting to ``2``. The downside of using double buffering is that framerate will
172+
be less stable if the display refresh rate can't be reached due to a CPU or GPU
173+
bottleneck. For instance, on a 60 Hz display, if the framerate would normally
174+
drop to 55 FPS during gameplay with triple buffering, it will have to drop down
175+
to 30 FPS momentarily with double buffering (and then go back to 60 FPS when
176+
possible). As a result, double-buffered V-Sync is only recommended if you can
177+
*consistently* reach the display refresh rate on the target hardware.
161178

162179
Increasing the number of physics iterations per second can also reduce
163180
physics-induced input latency. This is especially noticeable when using physics
@@ -187,6 +204,13 @@ every input, rather than accumulating inputs and waiting for a frame to be
187204
rendered. Disabling input accumulation will increase CPU usage, so it should be
188205
done with caution.
189206

207+
.. tip::
208+
209+
On any Godot project, you can use the ``--disable-vsync``
210+
:ref:`command line argument <doc_command_line_tutorial>` to forcibly disable V-Sync.
211+
Since Godot 4.2, ``--max-fps <fps>`` can also be used to set a FPS limit
212+
(``0`` is unlimited). These arguments can be used at the same time.
213+
190214
Hardware/OS-specific
191215
^^^^^^^^^^^^^^^^^^^^
192216

0 commit comments

Comments
 (0)