Scene Perception
What will you learn?
You will learn how to add Scene Perception functionality to your project.
Note: In this tutorial we will use Unity 2021.3.9f1 and VIVE Devices.
What is Scene Perception?
In this session, let's learn how to use Scene Perception, which is a feature that facilitates the development of Mixed Reality applications by bringing in spatial information from the users’ surroundings into the virtual environment. For more information on Scene Perception, you can check the Wave SDK documentation here.
Setup Project
Download the Vive Wave XR Plugin here. Please import the 'XR' and 'PureUnity' samples from the VIVE Wave XR Plugin if the compilation error occurs when executing Secene Perception demo script.
Setup Scene Perception using helper classes
-
To setup walls, ceiling and floor in mixed reality, on the headset, go to Settings > Boundary > Mixed Reality > Set up. Select Reset walls and draw walls in your environment.
-
In Build Settings, switch platform to Android.
-
Click Accept All at the WaveXRPlayerSettingsConfigDialog.
-
In Project Settings > XR Plug-in Management, place a checkmark for WaveXR.
-
In Projects Settings > Wave XR > Essence, click Import Feature – Scene Perception.
-
In Project Settings select XR Plug-in Management > WaveXRSettings. Under Scene Perception, place a checkmark by Enable Scene Perception and Enable Scene Mesh.
-
You can use any XR Rig that you prefer. In this tutorial, we are going to use the Wave Rig included in the Wave SDK. Add the Wave Rig to the Hierarchy.
-
Download the Scene Perception helper classes from here. Import the ScenePerceptionToolkit unity package by going to Assets > Import Package > Custom Package.
-
In the Hierarchy, create a new empty gameobject and name it ScenePerceptionToolkitDemo. Add the ScenePerceptionToolkitDemo script to the gameobject. Also add the ScenePerceptionManager script to the gameobject.
-
On the ScenePerceptionToolkitDemo script, update the references for Anchor Display Prefab, Generated Mesh Material Translucent and Generated Mesh Material Wireframe. Update the Scene Perception Manager reference. On the ScenePerceptionManager script, update the Tracking Origin reference to your XR Rig.
-
Build and deploy the apk. The walls setup in the mixed reality boundary settings should be visible.