-
-
Notifications
You must be signed in to change notification settings - Fork 23.6k
Document relationship between refresh rate and V-Sync in DisplayServer #111334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Document relationship between refresh rate and V-Sync in DisplayServer #111334
Conversation
3100233 to
2a4e307
Compare
doc/classes/ProjectSettings.xml
Outdated
| 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. |
There was a problem hiding this comment.
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?
| 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.
There was a problem hiding this comment.
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:
c1e3d65 to
ab51c12
Compare
- Mention formula for optimal FPS capping when VRR and V-Sync are both enabled. This is the same formula as used in Reflex.
ab51c12 to
eab6668
Compare
DisplayServer.screen_get_refresh_rate()easier to find.