From 8200af4189f9d40fb0b547d0bd8e591b3178a64d Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Tue, 22 Aug 2023 00:25:13 +0200 Subject: [PATCH] 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. --- tutorials/rendering/jitter_stutter.rst | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/tutorials/rendering/jitter_stutter.rst b/tutorials/rendering/jitter_stutter.rst index fe85800e56c5..f19492599fda 100644 --- a/tutorials/rendering/jitter_stutter.rst +++ b/tutorials/rendering/jitter_stutter.rst @@ -34,7 +34,6 @@ Finally, a game exhibiting *stutter* will appear smooth, but appear to *stop* or .. image:: img/motion_stutter.gif - Jitter ------ @@ -98,6 +97,11 @@ games, will usually not exhibit this problem anyway). For fullscreen, Windows gives special priority to the game so stutter is no longer visible and very rare. This is how most games are played. +When using a mouse with a polling rate of 1,000 Hz or more, consider using a +fully up-to-date Windows 11 installation which comes with fixes related to high +CPU utilization with high polling rate mice. These fixes are not available in +Windows 10 and older versions. + Linux ^^^^^ @@ -143,7 +147,17 @@ Project configuration On platforms that support disabling V-Sync, input lag can be made less noticeable by disabling V-Sync in the project settings. This will however cause -tearing to appear, especially on monitors with low refresh rates. +tearing to appear, especially on monitors with low refresh rates. It's suggested +to make V-Sync available as an option for players to toggle. + +When using the Forward+ or Mobile rendering methods, another way to reduce +visual latency is to reduce the number of frames that can be buffered by the CPU. +Since Godot 4.2, this can be achieved by changing the +**Display > Window > Vsync > Buffer Count** project setting (it's effective regardless +of the current V-Sync mode). The downside of reducing this buffer size to ``1`` +is that the number of frames per second rendered may be decreased significantly +in some cases. The default value of ``2`` is a good balance between throughput +and latency. Increasing the number of physics iterations per second can also reduce physics-induced input latency. This is especially noticeable when using physics @@ -173,6 +187,13 @@ every input, rather than accumulating inputs and waiting for a frame to be rendered. Disabling input accumulation will increase CPU usage, so it should be done with caution. +.. tip:: + + On any Godot project, you can use the ``--disable-vsync`` + :ref:`command line argument ` to forcibly disable V-Sync. + Since Godot 4.2, ``--max-fps `` can also be used to set a FPS limit + (``0`` is unlimited). These arguments can be used at the same time. + Hardware/OS-specific ^^^^^^^^^^^^^^^^^^^^