Skip to content

olir/mr-openxr-unity-meta-passthrough-sample

Repository files navigation

MR Passthrough Unity Sample (Meta Quest 3)

This repository contains a sample Mixed Reality (MR) application built with Unity demonstrating passthrough, full 6DoF tracking, and controller input. The example is implemented and validated for Meta Quest 3 hardware and shows one way to integrate passthrough and XR input into a Unity scene.

Key Features

  • Passthrough integration demonstrating mixed-reality compositing
  • Full 6DoF head tracking and smooth locomotion examples
  • Controller input examples (button, thumbstick, and pose handling)
  • Example scenes and scripts showing common MR patterns
  • Targeted example implementation for Meta Quest 3

Requirements

  • Unity (project created with Unity 2021.3 LTS or later; newer versions should work but may require package updates)
  • OpenXR enabled in Project Settings
  • XR Plugin packages (OpenXR, XR Interaction Toolkit) installed via Package Manager
  • Android SDK & NDK for building to Meta Quest devices
  • A Meta Quest 3 device for running passthrough features and testing

Getting Started

  1. Clone the repository:

    git clone https://github.com/your-org/mr-openxr-unity-meta-passthrough-sample.git

  2. Open the project in Unity Hub and let package installation complete.

  3. Ensure OpenXR is selected in Project Settings → XR Plug-in Management and required features are enabled (hand tracking, controller support, passthrough/runtime features as needed).

  4. Connect your Meta Quest 3 via USB (or use wireless ADB) and ensure ADB recognizes the device.

  5. Build and deploy:

    • On Windows, use the provided build.ps1 script to build. Run it from PowerShell in the repository root.
    • Alternatively, open File → Build Settings in Unity, set Platform to Android, and build/Run to your device.

Notes:

  • The repository also contains helper scripts under Editor/ such as BuildScript.cs and AndroidManifestModifier.cs to simplify building and manifest adjustments.

Example Scenes and Scripts

  • Scenes: see the Assets/_Shared/Scenes/ folder for sample scenes demonstrating passthrough composition and controller interactions.
  • Scripts: key scripts live under Assets/_Shared/Scripts/ and Assets/Scripts/. Look for:
    • PassthroughManager — controls passthrough activation and layering
    • XRInputHandler — maps controller inputs to app actions
    • Example locomotion and interaction scripts demonstrating 6DoF movement and object manipulation

Passthrough and Safety

  • Passthrough behavior depends on the device runtime and permissions. On Meta Quest 3, passthrough APIs may require runtime consent and specific OpenXR extensions.
  • Use passthrough thoughtfully and provide clear UI affordances when mixing virtual content with the real environment.

Troubleshooting

  • If passthrough does not appear on device, verify OpenXR runtime and required extensions are enabled in Unity and on the headset.
  • Check Unity Console for missing package or manifest errors.
  • For build issues, ensure Android SDK/NDK paths are configured in Unity Preferences.

Contributing

  • This repository is a sample; feel free to open issues or submit PRs to improve documentation, add more examples, or broaden device support.

License & Credits

  • See the LICENSE file in the project root for license details.
  • Built as an example MR sample demonstrating Unity + OpenXR passthrough on Meta Quest 3. Portions of the project may include third-party components; consult their respective licenses.

If you want, I can also add a short quick-start guide for building with build.ps1 and for the main example scene — tell me which you'd prefer next.

About

A Unity-based Mixed Reality sample for Meta Quest 3 demonstrating OpenXR passthrough, 6DoF head tracking, and controller input. Includes example scenes, scripts for MR interaction patterns, and build support for Android, showing how to integrate real-world compositing with XR input in Unity.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors