Set up AR Foundation for Hololight Stream for Unity
Set up AR Foundation
AR Foundation is a Unity package that "enables you to create multi-platform augmented reality (AR) apps with Unity. In an AR Foundation project, you choose which AR features to enable by adding the corresponding manager components to your scene. When you build and run your app on an AR device, AR Foundation enables these features using the platform’s native AR SDK, so you can create once and deploy to the world’s leading AR platforms."[1]
Hololight Stream doesn’t fully implement all AR Foundation features. Hololight Stream uses AR Foundation as a user-friendly way to expose data and functionality. This provides some, but not all, features in Hololight Stream.
| Feature | Apple Vision Pro | Apple iOS and iPadOS | HTC VIVE devices | Lenovo ThinkReality VRX | Magic Leap 2 | Meta Quest devices | Microsoft HoloLens 2 | Windows | Web Browser |
|---|---|---|---|---|---|---|---|---|---|
2D and 3D body tracking |
|||||||||
2D image tracking |
Yes |
||||||||
3D Object tracking |
|||||||||
Camera |
Yes |
Yes |
|||||||
Collaborative participants |
|||||||||
Device tracking |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Environment probes |
|||||||||
Face tracking |
|||||||||
Human segmentation |
|||||||||
Light estimation |
|||||||||
Meshing |
Yes |
Yes |
|||||||
Occlusion |
Yes[2] |
||||||||
Plane tracking |
Yes |
Yes |
|||||||
Point clouds |
|||||||||
QR code tracking |
Yes |
Yes |
|||||||
Raycast |
Yes |
||||||||
Session management |
|||||||||
Spatial anchors |
Yes |
Yes |
Yes |
||||||
Pass-through video |
Install AR Foundation
Unity imports AR Foundation when you add Hololight Stream to the project. You still need to configure AR foundation in order to take advantage of the available features.
-
In the Hierarchy, add an AR Session Origin object (GameObject > XR > AR Session Origin)
-
Expand the AR Session Origin object and select the AR Camera Set the AR Camera background to have alpha value of "0", within the inspector window
Example
Unity has an example project to demonstrate how AR Foundation works.
You can find the project here
| These example scenes use the legacy input system for touch input which is not currently supported. You may need to update scenes that uses touch to use the new input system. |
Limitations
-
Some AR Foundation features aren’t supported by Hololight Stream. This means not every AR Foundation example scene will work correctly. When using the example project with Hololight Stream, stick to the scenes which demonstrate the features marked as supported in the table above.
-
Hololight Stream does not support transparency. Transparent objects are displayed without transparency if they are directly overlaying the background.
-
To make the background transparent, make it black with an alpha value of 0.