Please Select Your Location
Australia
Österreich
België
Canada
Canada - Français
中国
Česká republika
Denmark
Deutschland
France
HongKong
Iceland
Ireland
Italia
日本
Korea
Latvija
Lietuva
Lëtzebuerg
Malta
المملكة العربية السعودية (Arabic)
Nederland
New Zealand
Norge
Polska
Portugal
Russia
Saudi Arabia
Southeast Asia
España
Suisse
Suomi
Sverige
台灣
Ukraine
United Kingdom
United States
Please Select Your Location
België
Česká republika
Denmark
Iceland
Ireland
Italia
Latvija
Lietuva
Lëtzebuerg
Malta
Nederland
Norge
Polska
Portugal
España
Suisse
Suomi
Sverige

Using RefreshRate in Your App

On platforms which support dynamically adjusting the display refresh rate, application developers may request a specific display refresh rate in order to improve the overall user experience, examples include:

  1. A video application may choose a display refresh rate which better matches the video content playback rate in order to achieve smoother video frames.

  2. An application which can support a higher frame rate may choose to render at the higher rate to improve the overall perceptual quality, for example, lower latency and less flicker.

This extension allows:

  1. An application to identify what display refrhttps://dl.vive.com/SDK/openxr/unity/xrpluginmaesh rates the session supports and the current display refresh rate.

  2. An application to request a display refresh rate to indicate its preference to the runtime.

Step 1. Check your VIVE OpenXR Plugin version
Controller_Name2.png

In Window > Package Manager, make sure your VIVE OpenXR Plugin 2.0.0 or newer.

Step 2. Enable the RefreshRate feature

In Edit > Project Settings > XR Plug-in Management > OpenXR, enable the XR FB Display Refresh Rate feature.

Controller_Name2.png


Step 3. Create a script and attach it onto any GameObject in the scene.

In the script, first add a using namespace.

using VIVE.OpenXR;

1) To Get current Refresh Rate:

{
    float value;
    if (XR_FB_display_refresh_rate.GetDisplayRefreshRate(out value) == XrResult.XR_SUCCESS)
    {
        Debug.Log("GetDisplayRefreshRate = " + value);
    }    
}

2) To Request a specific Refresh Rate:

{
    XR_FB_display_refresh_rate.RequestDisplayRefreshRate(90.0f);
}

3) Check the capacity of the display Refresh Rates of the Device:

{
    UInt32 count;
    float[] values = new float[2];
    XrResult result = XR_FB_display_refresh_rate.EnumerateDisplayRefreshRates(displayRefreshRateCapacityInput : 0, displayRefreshRateCountOutput:out count, displayRefreshRates: out values[0]);
    if (result == XrResult.XR_SUCCESS)
    {
        Debug.Log("EnumerateDisplayRefreshRates = " + count);
        Array.Resize(ref values, (int)count);
        result = XR_FB_display_refresh_rate.EnumerateDisplayRefreshRates(displayRefreshRateCapacityInput: count, displayRefreshRateCountOutput: out count, displayRefreshRates: out values[0]);
        if (result == XrResult.XR_SUCCESS)
        {
            for (int i = 0; i < count; i++)
            {
                Debug.Log("EnumerateDisplayRefreshRates index " + i + " RefreshRates = " + values[i]);
            }
        }
    }
}