90hz for Quest 2

Hi. I just got the Oculus v23 update which should allow 90hz. Could someone explain what I need to do to upgrade my Unity project to use 90hz? I found this guide but I’m confused on how to implement this - https://developer.oculus.com/blog/-oculus-quest-v23-how-to-update-your-app-for-90hz/?locale=en_US

You can just do this.

OVRManager.display.displayFrequency = 90f;

And if you want to check the availability of 90Hz:

using System.Linq;
...
if (OVRManager.display.displayFrequenciesAvailable.Contains(90f))
{
    OVRManager.display.displayFrequency = 90f;
}

You can watch the current refresh rate using Android Logcat or OVR Metrics Tool.

4 Likes

Oh wow so much easier, thanks!

Is there a different way I would need to do this if I’m using the XR Interaction Toolkit? I’m trying to make a script that references the OVRManager but I don’t have access to it. Do I need to install the Oculus Integration Plugin, or can I set the frame rate using just the Oculus XR plugin that comes with the XR Interaction toolkit?

If I do OVRPlugin.GetAppFramerate(); and it returns 90 does that mean the frame rate is hitting 90 without making any changes? I’m not adjusting the framerate at all but it returns 90 if I have 90hz set in the device settings Oculus app, does this mean I don’t need to adjust anything in my project to get it running at 90hz?

I’m also interested in how you target 90hz when you are using the XR Interaction Toolkit rather than Oculus Integration Plugin. Is that even possible right now?

1 Like

I am also using the XR toolkit. Is there a workaround to enable 90hz?

1 Like

You can get this support by using the latest version of the Oculus integration asset from the store. We also will have support for this in the 1.7.0-preview.2 version of the Oculus XR Plugin which has no definite date, but will hopefully release soon.

Is it possible to use both frameworks simultaneously (UnityXR for my game mechanics, Oculus integration to enable 90hz)?

I am working on a project completely based on XR

Yes, that is a pretty typical configuration.

Any news ? It’s heavy to have the complete integration package to be able to call one line of code :frowning:
Thanks!

1 Like

[quote=“jj-unity, post:8, topic: 817094, username:jj-unity”]**
You can get this support by using the latest version of the Oculus integration asset from the store. We also will have support for this in the 1.7.0-preview.2 version of the Oculus XR Plugin which has no definite date, but will hopefully release soon.
**[/quote]

jj-unity Im using the latest 1.7.0 stable release of the Oculus XR package and have no idea how to call TrySetRefreshRate, does not seem to be exposed. Any advice?

Hey hey! Wanted to pass along that Oculus XR Plugin 1.7.0-preview.2 is available now.

@Treyrannosaurus-Rex @jj-unity 1.7.0 is already out of preview however there is no documentation on how to set the display refresh rate, no settings, no example code, nothing, could you please provide some context on how to Changelog | Oculus XR Plugin | 1.7.0

Those Unity guys don’t seem able to answer the simplest of questions as well as fix the errors in the changelog.

The relevant refresh rate methods are in the Unity.XR.Oculus.Performance static class.

Hey all,

So as of 1.7.0 we expose 3 methods for dealing with refresh rate. Keep in mind that for 90hz to work you need to make sure Quest 2 is checked under the Target Devices heading in the Oculus Settings under XR Management.

Also should you try and set the refresh rate this tells the oculus system your intent but its up to it to actually change the refresh rate. This could mean you will have to wait a few frames before the frame rate will actually change and is reflected if you call TryGetDisplayRefreshRate,

float[ ] rates;
Unity.XR.Oculus.Performance.TryGetAvailableDisplayRefreshRates(out rates);

Unity.XR.Oculus.Performance.TrySetDisplayRefreshRate(90);

float rate;
Unity.XR.Oculus.Performance.TryGetDisplayRefreshRate(out rate);

Ill get the feedback back to the team as to expanding docs and examples.

6 Likes

OH MY GOSH. THANK YOU SO MUCH!!
(I’m typing in caps, because I’m shouting.)

Here’s some code I threw together to set 90hz (I tested on the Quest 1 and 2 with 1.7.0 installed and both headsets checked in the settings – obviously the Quest 1 can’t be set to 90hz, but it isn’t causing any problems either).

if (Unity.XR.Oculus.Performance.TryGetDisplayRefreshRate(out var rate))
{
    float newRate = 90f; // fallback to this value if the query fails.
    if (Unity.XR.Oculus.Performance.TryGetAvailableDisplayRefreshRates(out var rates))
    {
        newRate = rates.Max();
    }
    if (rate < newRate)
    {
        if (Unity.XR.Oculus.Performance.TrySetDisplayRefreshRate(newRate))
        {
            Time.fixedDeltaTime = 1f / newRate;
            Time.maximumDeltaTime = 1f / newRate;
        }
    }
}

I’m running the above check about once a second in a co-routine – because with android sometimes apps can lose focus (i.e. if the user steps out of them for some reason), and who knows what the state of things will be when the user gets back into the app.

9 Likes

noob question here. what’s that Max() doing?

Returns the maximum value in sequnce of nullable Single values. To remove the error, you just need to include the library:
System.Linq;