Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OVRManager.IsPassthroughRecommended() always returns false when using OpenXR Plugin #14

Closed
WikkidEdd opened this issue Apr 16, 2024 · 3 comments

Comments

@WikkidEdd
Copy link

WikkidEdd commented Apr 16, 2024

Description

When switching to the OpenXR Plugin OVRManager.IsPassthroughRecommended() always returns false.

Using the Oculus XR Plugin the OVRManager.IsPassthroughRecommended() returns true or false depending on whether passthrough is enabled in the home screen

Setup

Unity: 2021.3.36f1
Packages: Meta XR Core SDK v 62.0.0; OpenXR Plugin 1.10.0; XR Plugin Management 4.4.0
Device: Quest 3, OS version 63.0.0.399.366

Repro

Add the following script to the sample project

using TMPro;
using UnityEngine;

public class IsPassthroughPreferred : MonoBehaviour
{

    TextMeshPro _text;

    // Start is called before the first frame update
    void Start()
    {
        var go = new GameObject("Debug Text");

        _text = go.AddComponent<TextMeshPro>();
        var rectTransform = go.GetComponent<RectTransform>();
        rectTransform.position = new Vector3(0, 0.8f, 1);
        rectTransform.localScale = new Vector3(0.02f, 0.02f, 0.02f);
        rectTransform.sizeDelta = new Vector2(50, 5);
        OVRManager.instance.isInsightPassthroughEnabled = true;
    }

    // Update is called once per frame
    void Update()
    {
        _text.text = $"Passthrough Preferred {OVRManager.IsPassthroughRecommended()}";
    }
}
  • Add the script to any game object in the StartScene.unity
  • Save the scene
  • Build using Oculus > Samples > Build Starter Scene and deploy to device
  • Ensure that the device has passthrough on in the OS
  • Run the app and observe the text field saying "Passthrough Preferred True"
  • Back in Unity, install the OpenXR Plugin package
  • Under Project Settings > XR Plug-in Management switch Plug-in Provider to OpenXR
  • Build using Oculus > Samples > Build Starter Scene and deploy to device
  • Run the app and observe the text field saying "Passthrough Preferred False"

Expected Results

OVRManager.IsPassthroughRecommended() returns a value that reflects the passthrough setting in the OS, as it does with the Oculus XR plugin.

Actual Results

OVRManager.IsPassthroughRecommended() always returns false

Workarounds

The cause of this bug seems to be due to the missing OpenXR extension XR_META_passthrough_preferences. You can create a custom OpenXR feature (as mentioned in this issue #12) which includes that extension and the call to OVRManager.IsPassthroughRecommended() now works

@WikkidEdd
Copy link
Author

@AlexThiv great to see the fix for #15 make it into v66. Any update on when this one will be fixed? It's a similar fix of just adding an extra string to the OpenXrExtensionList.

@AlexThiv
Copy link
Contributor

AlexThiv commented Jul 3, 2024

This is on track for v68.

@AlexThiv
Copy link
Contributor

v68 is now released with the update to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants