Skip to content

Conversation

@Calinou
Copy link
Member

@Calinou Calinou commented Oct 6, 2025

  • Add search keyword to make DisplayServer.screen_get_refresh_rate() easier to find.
  • Mention formula for optimal FPS capping when VRR and V-Sync are both enabled. This is the same formula as used in Reflex.

@Calinou Calinou added this to the 4.6 milestone Oct 6, 2025
@Calinou Calinou requested a review from a team as a code owner October 6, 2025 18:39
@Calinou Calinou added enhancement documentation cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release labels Oct 6, 2025
@Calinou Calinou force-pushed the doc-displayserver-refresh-rate-vsync branch from 3100233 to 2a4e307 Compare October 7, 2025 23:24
If [member display/window/vsync/vsync_mode] is set to [code]Enabled[/code] or [code]Adaptive[/code], it takes precedence and the forced FPS number cannot exceed the monitor's refresh rate.
If [member display/window/vsync/vsync_mode] is [code]Enabled[/code], on monitors with variable refresh rate enabled (G-Sync/FreeSync), using an FPS limit a few frames lower than the monitor's refresh rate will [url=https://blurbusters.com/howto-low-lag-vsync-on/]reduce input lag while avoiding tearing[/url].
If [member display/window/vsync/vsync_mode] is set to [code]Enabled[/code] or [code]Adaptive[/code], it takes precedence and the forced FPS number cannot exceed the monitor's refresh rate. See also [method DisplayServer.screen_get_refresh_rate], which will return the maximum framerate the project can effectively reach.
If [member display/window/vsync/vsync_mode] is [code]Enabled[/code], on monitors with variable refresh rate enabled (G-Sync/FreeSync), using an FPS limit slightly lower than the monitor's refresh rate will [url=https://blurbusters.com/howto-low-lag-vsync-on/]reduce input lag while avoiding tearing[/url]. At higher refresh rates, the margin needs to be increased to account for timing inaccuracies and ensure the rendering remains within the VRR window. The optimal formula for this is [code]max_fps = r - (r * r) / 3600.0[/code] where [code]r[/code] is the monitor's refresh rate.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This mentions "a VRR window", but it isn't readily clear what that is. We know it's "Variable Refresh Rate", but the first mention is in lowercase (which is appropriate).
Nitpicky, too, but "window", especially where this setting is located, can be interpreted as the actual Window class, not a window of time.
Similar case for "the margin". What margin?

Suggested change
If [member display/window/vsync/vsync_mode] is [code]Enabled[/code], on monitors with variable refresh rate enabled (G-Sync/FreeSync), using an FPS limit slightly lower than the monitor's refresh rate will [url=https://blurbusters.com/howto-low-lag-vsync-on/]reduce input lag while avoiding tearing[/url]. At higher refresh rates, the margin needs to be increased to account for timing inaccuracies and ensure the rendering remains within the VRR window. The optimal formula for this is [code]max_fps = r - (r * r) / 3600.0[/code] where [code]r[/code] is the monitor's refresh rate.
If [member display/window/vsync/vsync_mode] is [code]Enabled[/code], on monitors with variable refresh rate enabled (G-Sync/FreeSync), using an FPS limit slightly lower than the monitor's refresh rate will [url=https://blurbusters.com/howto-low-lag-vsync-on/]reduce input lag while avoiding tearing[/url]. If the refresh rate is high, the FPS limit should be increased in order to ensure frames are rendered in time and to account for timing inaccuracies. The optimal formula for this setting is [code]r - (r * r) / 3600.0[/code], where [code]r[/code] is the monitor's refresh rate.

Or similar. I'm not sure I have the technical knowhow myself to describe it.

I'm also not sure how beneficial this information is exactly, in the project settings. It's not like users can adapt this setting at runtime to match an user's refresh rate. All of this feels more fitting to mention in Engine.max_fps, instead.

Copy link
Member Author

@Calinou Calinou Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't find a quick resource that explains what the VRR window is, other than a reply on a Reddit thread: https://www.reddit.com/r/digitalfoundry/comments/18vdgkz/vrr_window/kfq9jiw/

It's a fairly simple concept at its core (a range between two refresh rates), but there are some subtleties like low frame compensation and different displays having different minimum refresh rates. The lower bound of the VRR window is typically 48 Hz, or 24 Hz when taking LFC into account, but not always.

I guess "VRR range" is less confusing still, so I went ahead and replaced "VRR window" with it. I've also added this information to Engine.max_fps's description.

Note that ideally, the engine should have an option to do this on its own:

@Calinou Calinou force-pushed the doc-displayserver-refresh-rate-vsync branch 4 times, most recently from c1e3d65 to ab51c12 Compare October 13, 2025 18:46
- Mention formula for optimal FPS capping when VRR and V-Sync are both
  enabled. This is the same formula as used in Reflex.
@Calinou Calinou force-pushed the doc-displayserver-refresh-rate-vsync branch from ab51c12 to eab6668 Compare October 13, 2025 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release documentation enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants