XR Mind Mapper - project setup v2
After some experimentation with OVR, I am switching back to XRI. The lack of support for decent device emulation in the editor is a deal breaker for me. Having to test every tiny change on the headset is way too annoying once you are used to using the Device Emulator.
It turns out that is is possible to have the best of both worlds! You can combine the interaction framework of XRI with the rendering layer of OVR to build an application that support both XRI and low level Oculus features such as pass-through.
Here is an attempt to record the steps I took to set this up.
Assumptions
This post assumes the following Unity version and packages
Unity 2021.3.39f1
Oculus Integration SDK v50 (Unity Asset Store)
Create an XRI based project.
I used the Unity XR-Interaction-Toolkit Examples project here as a template.
https://github.com/Unity-Technologies/XR-Interaction-Toolkit-Examples
Note - I needed to upgrade the project to Unity 2021 and then edit Packages\manifest.json to force Unity 2021.3 to update to version 2.30 of XRI for this to work.
Add Oculus Integration support
Configure project for Android + OpenXR + URP
Add the URP render pipeline and update materials
Ensure that the project is setup for Android APK deployment
Download and import the Oculus Integration package from the Asset Store
Ensure that XR plug-in is configured for OpenXR and the Oculus Touch profile
Create a hybrid XR Rig
This is the main trick - you can modify the default XR Origin rig from XRI and replace the default main camera with a camera managed by the OVR layer. Adding a tracked pose driver component to this camera will cause it to track the HMD using the XRI toolkit.
- add the OVRCameraRig as a child of CameraOffset
- set the hierarchy up as follows (note which objects are enabled/disabled)
- Disable OVR Camera Rig and OVR Headset Emulator on the OVRCameraRig object
-Add a tracked pose driver component to the CenterEyeAnchor object
Device Simulation
With this setup, the XR Device Simulator should work out of the box. Just add the prefab to the game hiearchy and it should detect the active main camera (CenterEyeTracker(
Passthrough
With this setup, passthrough can be enabled as follows:
- Enable passthrough in the OVR Manager Quest feature Settings
-Add an OVR Passthrough Layer component to the OVRCameraRig object
Comments
Post a Comment