You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Linux Mint's Mate panel application "CPU Frequency Scaling Monitor" applet.
337
+
338
+
339
+
Linux: xfce
340
+
~~~~~~~~~~~
341
+
342
+
xfce's compositor is not good for low latency games and can cause jitter. Disable it.
343
+
344
+
Open the **Start menu > Window Manager Tweaks > Compositor** and uncheck **Enable display compositing**.
345
+
346
+
.. image:: img/xfce-disable-compositor.webp
347
+
348
+
If you still want to use a Compositor on xfce, prefer using a better one like picom:
349
+
350
+
.. code:: sh
351
+
352
+
sudo apt install picom
353
+
354
+
You can configure picom at ``~/.config/picom/picom.conf``:
355
+
356
+
.. code:: text
357
+
358
+
# menu = { shadow = false; };
359
+
dropdown_menu = { shadow = false; };
360
+
popup_menu = { shadow = false; };
361
+
utility = { shadow = false; };
362
+
unredir-if-possible = true;
363
+
364
+
The important one is **unredir-if-possible** which allows Godot to draw directly to screen in
365
+
fullscreen mode, which minimizes latency.
366
+
367
+
150
368
Input lag
151
369
---------
152
370
@@ -241,6 +459,124 @@ If your mouse offers multiple :abbr:`DPI (Dots Per Inch)` settings, consider als
241
459
On Linux, disabling compositing in window managers that allow it (such as KWin
242
460
or Xfwm) can reduce input lag significantly.
243
461
462
+
Latency Reduction
463
+
~~~~~~~~~~~~~~~~~
464
+
465
+
Starting with Godot 4.5, new pacing methods were introduced to reduce latency (and alleviate Jitter):
466
+
467
+
1. ``rendering/rendering_device/vsync/latency_mode``. It supports 4 options:
468
+
* ``low_extreme`` (only available through the GDScript API and command line interface. Cannot be set by default).
469
+
* ``low`` (default).
470
+
* ``medium``.
471
+
* ``high_throughput``.
472
+
2. ``PacingMethod``, a fallback solution when Waitable Swapchains is not available:
473
+
* ``SEQUENTIAL``: The CPU always stalls for the GPU to minimize latency. **This can heavily penalize framerate and does not always result in lower latency**. This method can only reduce latency if the system was already fast enough to hit V-Sync's framerate.
474
+
* ``PARALLEL``: The CPU and GPU try to run in parallel. This is the usual method of 2D and 3D rendering.
475
+
* ``AUTO`` automatically selects between SEQUENTIAL or PARALLEL based on current CPU and GPU performance. AUTO will only select SEQUENTIAL if the system is fast enough.
476
+
477
+
Waitable Swapchains are by far the superior method, but if that's not available AUTO/SEQUENTIAL will be used instead.
478
+
479
+
.. warning::
480
+
481
+
In all cases (*including* Waitable Swapchain method), **lowering latency implies sacrificing framerate**.
482
+
The question is, how much FPS (frames per second) are you willing to sacrifice for latency. The relationship is not linear,
483
+
which means the lower the latency you want to achieve the greater the FPS sacrifice, which can get ridiculously high.
484
+
This is not a bug, it is just the nature of how it works.
485
+
486
+
.. warning::
487
+
488
+
Lowering latency makes Godot more susceptible to **microstutter**.
489
+
Thus if you're experiencing microstutter, use these options to *increase* latency instead.
490
+
491
+
.. warning::
492
+
``low_extreme`` might get you better latency (or even be a placebo) but always at a very large FPS cost.
493
+
Furthermore it may reintroduce microstutter. Caution is advised when seeking to lower latency too much.
494
+
495
+
.. warning::
496
+
Just because ``low_extreme`` works great in your machine doesn't mean it will work fine
497
+
in other machines. Don't deploy to end users with this setting as a default.
498
+
499
+
The following table summarizes what Godot does based on each setting and available feature:
- If Waitable Swapchains are available, at "low" Godot will target 1 frame of latency. Otherwise, at "low" it will use AUTO as fallback.
519
+
- If Waitable Swapchains are available, at "low" Godot will use the value in frame_queue_size as target for frames of latency. Otherwise it uses PARALLEL mode (which is the same as having no pacing method).
520
+
521
+
522
+
.. tip::
523
+
524
+
Godot's behavior on version 4.4 and earlier corresponds to ``high_throughput``.
525
+
526
+
**Troubleshooting:**
527
+
528
+
If you suspect Godot's pacing methods are malfunctioning, there are several steps you can take.
529
+
530
+
The first thing we need to do is to run with ``--verbose`` to know which pacing methods are available.
531
+
You should see something like this:
532
+
533
+
.. code:: text
534
+
535
+
Supported Pacing Methods (mask 03):
536
+
SEQUENTIAL_SYNC
537
+
WAITABLE_SWAPCHAIN
538
+
Current Pacing Method (may change later): WAITABLE_SWAPCHAIN
539
+
540
+
In this case, Waitable Swapchain is being used. This is great! The second thing we should try is running with a different latency mode:
541
+
Let's say: ``--latency-mode medium``. There's 4 options to try (note: ``high_throughput`` just disables any pacing method).
542
+
If the problem is gone, then we're done.
543
+
544
+
But let's say we want to try another method. For some reason, we suspect waitable swapchains are malfunctioning.
545
+
We can try masking this feature out:
546
+
547
+
- ``--pacing-mode-mask 0x01`` will force to only use SEQUENTIAL_SYNC (if available).
548
+
- ``--pacing-mode-mask 0x02`` will force to only use WAITABLE_SWAPCHAIN (if available).
549
+
550
+
The following table shows the masks for each settings (these masks can be OR'ed together):
551
+
552
+
.. table::
553
+
:widths: auto
554
+
555
+
+--------------------+------+
556
+
| Setting | Mask |
557
+
+====================+======+
558
+
| SEQUENTIAL_SYNC | 0x01 |
559
+
+--------------------+------+
560
+
| WAITABLE_SWAPCHAIN | 0x02 |
561
+
+--------------------+------+
562
+
| ANDROID_SWAPPY | 0x04 |
563
+
+--------------------+------+
564
+
565
+
Thus by launching with ``--pacing-mode-mask 0x01`` we can experience how it runs by using ``SEQUENTIAL_SYNC``.
566
+
Now that we are in sequential sync pacing mode; again we can try ``--latency-mode`` makes any difference.
567
+
You can try ``low_extreme`` (SEQUENTIAL), ``low`` (AUTO) and ``medium`` (PARALLEL) to see if they make a difference.
568
+
569
+
**When to report issues:**
570
+
571
+
- If WAITABLE_SWAPCHAIN at ``low`` or ``medium`` settings are causing problems. This could indicate an issue with the rendering API, the OS, or HW.
572
+
- If SEQUENTIAL_SYNC at ``low`` is causing problems but works fine at ``low_extreme`` or ``medium``. This would indicate a problem in Godot's AUTO algorithm.
0 commit comments