Oculus Mixed Reality Passthrough Mode API Via XR integration

Hey folks,

I’ve built my game and libraries on top of XR Interaction. With the mixed reality support just exposed on Oculus 2, is there a way I can integrate the pass through features while still maintaining use of the XR Interaction infrastructure?

Is this planed to be exposed in the Unity XR API at some point? or would I need to port by work back over to the Oculus Integration framework to support mixed reality?

Thanks

You can run Oculus Integration together with XRI. You only need to add the VR Folder from the Intergration and add an OVRManager to the scene. The rest can stay the same. Cactus Cowboy Passthrough works this way.

2 Likes

@dpcactus - thanks for this info. I’ll give it a shot!

** updated ** doubling back to verify, that dropping the OVRManager and OVRPassthroughLayer into the project did the trick!

1 Like

@[slippyfrog]( https://discussions.unity.com/t/853860 members/slippyfrog.1034699/)
How did you manage that exactly?
I’ve tried adding 1) OVR Manager + 2) OVR Passthrough Layer to the scene
Beside the original XR Rig, and I had no luck
Can you please tell how did you handle it in your situation

Hi! I did the same , but no luck , please share how you did this , thanks!

I put an OVR Manager in the scene, next to the XR Rig. Then added an OVR Passthrough Layer component to the XR Rig itself. It worked for me. Hope it helps!

Also i can’t activate passthrough with xr rig

I think I found the problem, with the HDR field disabled on the referenced URP Pipeline assets, it works.

1 Like

Ok after much finagling here’s how I got it to work. Used this article as a base (great tutorial) How to build your passthrough AR app for Oculus Quest in Unity - The Ghost Howls But do not follow the advice he gives on using XR Interaction kit (I tried it, seems probably no longer valid).

Here’s what worked:

I think the key was adding the ‘XR Origin (Action based)’ to the scene AFTER adding the OVRCameraRig.
It doesn’t add a Main Camera object to the XR Origin.
Also make sure, that the CenterEyeAnchor is enabled (checkmark to the right of the blue camera icon):

@ForliReply the HDR enabled or disabled in the settings didn’t seem to make a difference, for some reason :expressionless:

Here’s the setup:


and
8601558--1154025--upload_2022-11-20_23-20-17.png

1 Like

UPDATE:

Getting XR interaction CAMERA + CONTROLLERS to work with Passthrough (using OVR camera rig)

  1. Install the XR Interaction Manager package (seems to be important to do this BEFORE adding the OVRCameraRig from the Oculus Interaction)

  2. Follow the project and scene setup as described in this excellent tutorial How to build your passthrough AR app for Oculus Quest in Unity - The Ghost Howls

  3. Place the OVRCameraRig inside the XR Origin (Action Based)

  4. Set the CenterEyeAnchor camera as Main Camera in the XR Origin (Action Based)

  5. Disabled the Main Camera in the XR Rig.

  6. Disabled the Left and Right hand anchors

  7. Make sure the interaction managers selected for your controllers and interactables is the XR Interactions Manager (and NOT the OVRCamera rig or anything to do with the Oculus Integration)

4 Likes

Hey, thank you so much!! I found this post after 7 hours of trying to set things up, it works fine on the Quest Pro.

As an addition for beginners: This video explains how to set up the XR Interaction Handcontrollers:

Cheers!

Does anybody know if it is possible to make the passthrough API work with the OpenXR plugin? It seems to work when ONLY the Oculus plugin is enabled in XR plugin management, but when either OpenXR or both is enabled, the background simply turns black.

I am trying to use the hand-tracking feature from XR Toolkit 2.3.0, which required the OpenXR plugin to be enabled, and ideally, I would combine this with the Oculus Passthrough API.

4 Likes

This thread is helping me right now: https://discussions.unity.com/t/912205

EDIT: just realized you’re the OP :roll_eyes: thank you for kicking off that additional thread and I’ll keep this here in case anyone is looking in the future too. I’m also actively investigating this. If you want to stay in touch, you can find me on Discord or GitHub at the following username: farmerinatechstack.

Thank you very much! The solution worked for me. I was looking for a solution like this for hours until I found this post. I almost gave up on OVR and tried to use just XR.

I found a solution to keep my [XR Origin] and OVRCameraRig two separate objects (not an amalgamation)

I got it working with this setup:

  • Install package by name: com.meta.xr.sdk.core
  • Install Oculus XR Plugin from the registry
  • I did most of the Player settings advised by meta
  • You can either use the OVRCameraRig prefab, or start from scratch. Empty gameobject, add components:
    • OVRCameraRig
    • OVRManager
    • OVRPassthroughLayer
  • If you decided to go for a Prefab instead, make sure to add OVRPassthroughLayer to it!
  • It does not matter where you place this gameobject in your scene.
  • On YourOVRObject > OVR Camera Rig component, set “Disable Eye Anchor Camera” to true
  • In YourOVRObject > OVR Manager component, under Quest Features > General, set Passthrough Support to “Supported”
  • In YourOVRObject > Insight Passthrough & Guardian Boundary > Enable Passthrough
  • In this OVR Passthrough Layer component set Placement to Underlay (if you want to see your VR content on top as well)
  • Disabling PostProcessing on the Main camera’s is only needed if you use URP. If you are using builtin, just make sure there is no PostProcessing component on the main camera’s
  • I also disabled the Trackingspace object below OVRCameraRig just to be sure.
  • And, the Main Camera of XR Rig still has the Main Camera Tag.

This enabled AR for me while not mixing the different origins. Hope it helps someone :slight_smile: