Skip to main content
Version: 0.23.2

Display Refresh Rate

Display Refresh Rate refers to the ability to dynamically adjust the rate at which the headset's screen refreshes. A higher display refresh rate increases the number of frames per second, but shortens the overall application compute time per frame. A lower display refresh rate reduces the frames per second, but allows for less performant applications to render more consistently.

NOTE

Developers should take into account the performance of their specific application and set the appropriate display refresh rate to ensure stable frame rates.

Usage

The following methods live inside the BaseRuntimeFeature.cs class. Before calling any of these methods, make sure that the BaseRuntimeFeature is valid.

var baseRuntimeFeature = OpenXRSettings.Instance.GetFeature<BaseRuntimeFeature>();
if (baseRuntimeFeature != null)
{
// Use baseRuntimeFeature
}

Get current refresh rate

if (baseRuntimeFeature.TryGetDisplayRefreshRate(out float displayRefreshRate))
{
// Use current displayRefreshRate
}

Get supported refresh rates

float[] refreshRates = baseRuntimeFeature.SupportedDisplayRefreshRates;

Set refresh rate

if (baseRuntimeFeature.TrySetDisplayRefreshRate(targetDisplayRefreshRate))
{
// Successfully set
}
else
{
// Display refresh rate is not supported
}