docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Display Utilities

    The Meta Quest Display Utilities feature enables you to:

    1. Get the supported display refresh rates for the device.
    2. Request a selected display refresh rate.

    Enable Display Utilities

    To enable Meta Quest Display Utilities in your app:

    1. Go to Project Settings > XR Plug-in Management > OpenXR.
    2. Under OpenXR Feature Groups, select the Meta Quest feature group.
    3. If disabled, enable the Meta Quest Display Utilities OpenXR feature.

    As a standalone feature of this package, Meta Quest: Display Utilities solely depends on Meta Quest Support and does not require that you enable any other feature in the Meta Quest feature group.

    Code sample

    Once enabled, Meta Quest Display Utilities adds additional capabilities to Unity's XRDisplaySubsystem using C# extension methods: TryGetSupportedDisplayRefreshRates and TryRequestDisplayRefreshRate

    Important

    These extension methods will always return false if you did not Enable Display Utilities in XR Plug-in Management.

    The code sample below demonstrates how to use these extension methods:

    // Omitted null checks for brevity. You should check each line for null.
    var displaySubsystem = XRGeneralSettings.Instance
        .Manager
        .activeLoader
        .GetLoadedSubsystem<XRDisplaySubsystem>();
    
    // Get the supported refresh rates.
    // If you will save the refresh rate values for longer than this frame, pass
    // Allocator.Persistent and remember to Dispose the array when you are done with it.
    if (displaySubsystem.TryGetSupportedDisplayRefreshRates(
            Allocator.Temp,
            out var refreshRates))
    {
        // Request a refresh rate.
        // Returns false if you request a value that is not in the refreshRates array.
        bool success = displaySubsystem.TryRequestDisplayRefreshRate(refreshRates[0]);
    }
    
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)