Open Calinou opened 1 year ago
We're only sleeping with ms resolution (very coarse): https://github.com/minetest/minetest/blob/9d736e8b8baeeacad9cfa94edd18adfcaf000029/src/client/game.cpp#L4252
That is a leftover from when the entire code operated with ms, feel free to test with higher accuracy.
(EDIT: See below for testing with larger FPS limit)
Is this issue Linux-specific? I can not reproduce it on mine (Windows 10/10.0.19045, AMD Ryzen 5 4500U with Radeon Graphics). The FPS never goes above the limit.
(setting fps_max = 30
and using Xbox Game Bar on Windows, Win+G)
fps_max = 30
, Pop!_OS. Is this wrong? Also, why FPS on MT always says 29?
https://github.com/minetest/minetest/assets/63455151/016a9bb4-e7d1-4315-a0b3-1379aaac71ab
Might be solved on Linux due to #13445
Also, why FPS on MT always says 29?
It's likely a rounding error (perhaps it's floored in one way or another instead of using round()
).
PS: While we're at it, we could make drawtime
display one or two decimals, similar to RTT
.
So, to be clear, this is fixed? I didn't get it, sorry
Seems to work great as of a98200bb4:
Thanks!
The issue still seems to be reproducible on Windows 11 with 5.8.0 on the same hardware:
Here, I use fps_max = 114
but I actually reach 120 FPS.
Should I open a new issue or reopen this one?
PS: The overlay in the corners is from Special K.
It's fundamentally the same issue, just a different platform.
After further testing, it does seem like the FPS limiter is still broken on Windows (Windows 10/10.0.19045, AMD Ryzen 5 4500U with Radeon Graphics).
I tested it with fps_max = 114
using Xbox Game Bar on Windows (Win+G).
5.0.1 |
5.7.0 |
5.8.0 |
---|---|---|
50 FPS | 118 FPS | 116 FPS |
I found another issue with FPS limiter. When I run Minetest by compiling at 5.8.0
tag using MSVC (Release configuration), my FPS is capped at around 35 FPS. This does not happen when I run Minetest from the official 5.8.0
release for Windows (compiled with MinGW, I assume): I can get much higher FPS using that. Is there any difference in calculating FPS limit between compilers?
I found another issue with FPS limiter. When I run Minetest by compiling at
5.8.0
tag using MSVC (Release configuration), my FPS is capped at around 35 FPS. This does not happen when I run Minetest from the official5.8.0
release for Windows (compiled with MinGW, I assume): I can get much higher FPS using that. Is there any difference in calculating FPS limit between compilers?
I have the same problem. I usually get 25 FPS with MSVC ("Release" configuration) builds and 55-60 FPS with official Windows builds. All settings are set to their default values. Setting a high fps_max
value doesn't make any difference for me, so I'm not sure if this problem is related to the FPS limiter.
Please test my PR. It might just happen to get fix that too.
Please test my PR. It might just happen to get fix that too.
The PR does not fix my issue.
After further checking, I found that the FPS is limited to around 35 FPS when the debug info is shown (F5). Again, this only happens in MSVC, not in MinGW.
Without debug info | With debug info |
---|---|
Sounds like some weird (msvc-specific) inefficiency with text rendering. What happens if you put lots of text in chat?
It has a lower FPS with lots of text in chat.
Opening the chat console window lowers the FPS significantly.
Minetest version
OS / Hardware
Operating system: Linux CPU: Intel Core i9-13900K
GPU model: GeForce RTX 4090 (NVIDIA 530.41.03) OpenGL version: OpenGL 4.6
Summary
Minetest's FPS limiter renders more frames than requested. This is a problem when attempting to reach a stable framerate below the V-Sync threshold for low input lag with V-Sync enabled when using a variable refresh rate monitor.
I've had decent success using
fps_max = 110
to target 117 FPS on a 120 Hz display, but even then, it will occasionally go above 117 FPS (which causes temporarily increased input lag).The screenshots below show both Minetest's own FPS counter and a MangoHUD overlay to prove that Minetest's FPS counter isn't the issue:
fps_max = 100
Expected time between frames: 10.0 ms
fps_max = 150
Expected time between frames: ~6.7 ms
fps_max = 30
Expected time between frames: ~33.3 ms
Steps to reproduce
Set
fps_max
to any value and notice how the FPS cap is exceeded by the game. This can be verified both using Minetest's own FPS counter, but also external tools such as RTSS and MangoHUD.