Skip to content

Commit

Permalink
Enable 90Hz mode for Oculus
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeage committed Apr 22, 2021
1 parent 8bf5d79 commit 91bf00d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Assets/Scripts/VrSdk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,17 @@ void Awake()
manager.useRecommendedMSAALevel = false;

SetControllerStyle(TiltBrush.ControllerStyle.OculusTouch);

// Set 90Hz if possible. To see the current framerate, look in the logs for prints like this one. The first number is the frame rate, the second is the display refresh rate
// VrApi : FPS=90/90,Prd=33ms,Tear=0,Early=0...
float[] freqs = OVRManager.display.displayFrequenciesAvailable;
Debug.Log($"Supported frequencies are: {freqs}");
if (Array.Exists(freqs, element => element == 90.0f))
{
OVRPlugin.systemDisplayFrequency = 90.0f;
}
OVRManager.DisplayRefreshRateChanged += DisplayRefreshRateChanged;

// adding components to the VR Camera needed for fading view and getting controller poses.
m_VrCamera.gameObject.AddComponent<OculusCameraFade>();
m_VrCamera.gameObject.AddComponent<OculusPreCullHook>();
Expand Down Expand Up @@ -339,6 +350,13 @@ private void OnInputFocus(params object[] args)
m_HasVrFocus = (bool)args[0];
}

#if OCULUS_SUPPORTED
private void DisplayRefreshRateChanged (float fromRefreshRate, float ToRefreshRate)
{
Debug.LogWarning(string.Format("Refresh rate changed from {0} to {1}", fromRefreshRate, ToRefreshRate));
}
#endif

private void OnNewPoses()
{
if (NewControllerPosesApplied != null)
Expand Down

0 comments on commit 91bf00d

Please sign in to comment.