AR Video Passthrough with Unity
In this tutorial, you will learn how to turn the scene you built in the Build your First AR/MR App tutorial into a stereo pass-through AR experience.
Requirements #
ZED Mini
Supported VR headset:
- Oculus Rift
- HTC Vive
- HTC Vive Pro*
- Windows Mixed Reality headset* (via SteamVR only)
VR-ready PC (GTX 1070 GPU or greater recommended)
*Stereolabs’ ZED Mini mounting bracket was designed for the Oculus Rift and original HTC Vive. It can fit on some WMR headsets like the Samsung Odyssey, but you will need to create a custom attachment for the Vive Pro or other WMR headsets.
Set Up your ZED Mini #
To set up the ZED Mini on your headset, follow our guides for Oculus Rift and HTC Vive. Use the provided straps to attach the cable to the headset, and make sure to plug the USB Type-C cable into your ZED Mini with the arrows facing forward.
Enable Virtual Reality #
- Go to Edit -> Project Settings -> XR Plug-In Manager -> Click on Intall XR Plugin Management.
- Now you need to choose which Provider to use. The ZED Unity Plugin is compatible with OpenVR, Oculus and OpenXR.
Add the Stereo Rig #
Follow the steps described in the Build Your First AR/MR App tutorial.
In your Hierarchy, delete the ZED_Rig_Mono prefab you added in the last tutorial.
In the Project window, go to the ZED -> Prefabs folder. Click and drag the ZED_Rig_Stereo prefab into the Hierarchy window.
Run the Scene #
Run the scene and put on your headset. Take a look at the sphere and the shadow beneath it. Walk around it, put your hand over and under it. You can also move the sphere in the Scene window and watch it fly across your room. You’ve built your first ZED Mini AR app!
Tips #
- To see a similar scene already put together, check out the Planetarium example scene in ZED -> Examples -> Planetarium -> Scene.
- If you want to disable inside-out positional tracking to use Oculus or Vive external tracking systems, go to ZED Manager and uncheck Enable Positional Tracking. This will disable our Video Async Timewarp effect for latency compensation but can improve tracking accuracy in some situations.