Passthrough Multiple-Feature Sample
You can use multiple Passthrough features in a single scene. In this sample, we show how to use a color style controller, a passthrough overlay, an augmented object, a passthrough brush, and a lighting source, all in the same scene.
Before you can build the Passthrough with multiple features sample, you must first complete the
Passthrough Getting Started tasks. This includes the steps in the Prequisites and Configuring a Unity Project sections. You should also complete the basic
Passthrough Tutorial to make sure you can work with Passthrough in Unity.
- Download the Starter Samples project from GitHub.
- If you prefer, set up the Meta Quest Developer Hub so you can control your on-headset application.
- In the Unity Project explorer, search for the scene named simply ‘Passthrough.’ Drag it to your Hierarchy window.
- Remove any other scene from the Hierarchy Window.
- Save your project and your scene.
- From the File menu, choose Build Settings.. to open the Build Settings window.
- Make sure your headset is listed in the Run Device dropdown.
- Click Add Open Scenes to add your scene to the build. Deselect and remove any other scenes from the selection window.
- Click the Build and Run button to launch the program onto your headset.
When you first enter the scene, you see five objects:
- a 3D Oculus logo (an augmented object)
- a Flashlight
- a Passthrough brush
- a Color style selector
- a Passthrough overlay window
Each of these are separate passthrough-enabled objects. Point at any object using the right controller, and select the object using the grip trigger. To reset the positions of the game objects, press the left controller Menu button.
Select the passthrough brush using the right controller grip trigger. Use the thumbwheel to set the passthrough brush distance. Then press the right controller finger trigger to reveal a portion of the cloaked passthrough scene.
Oculus Logo (Augmented Object) Select the Oculus logo using the right controller grip trigger. Then use the thumbwheel to set the logo distance aand orientation.
Select the flashlight using the right controller grip trigger. The flashlight illuminates are area of the scene as long as you hold it.
Select the style control panel using the right controller grip trigger. While continuing to hold the grip trigger, use the finger trigger to select and adjust any one of the controls on the style panel.
Surface Projected Passthrough Quad Select the flashlight using the right controller grip trigger. While continuing to hold the grip trigger, use the right controller thumbwheel to adjust the quad distance.
The assets used in this scene are:
Flashlight Prefab
Model for scene flashlight
Location .\Assets\StarterSamples\Usage\Passthrough\Prefabs\Flashlight.prefab
Flashlight Script
Script that sets the basic parameters of the Flashlight.
Location .\Assets\StarterSamples\Usage\Passthrough\Scripts\Flashlight.cs
Flashlight Controller Script
Script that defines the flashlight behavior in the scene.
Location .\Assets\StarterSamples\Usage\Passthrough\Scripts\FlashlightController.cs
PassthroughBrush Script
Script which controls the passthrough brush features.
Location .\Assets\StarterSamples\Usage\Passthrough\Scripts\PassthroughBrush.cs
PassthroughBrushStroke Material
Material used for cloaking the passthrough scene.
Location .\Assets\StarterSamples\Usage\Passthrough\Materials\PassthroughBrushStroke.cs
Passthrough Styler Prefab
Model for Styler Control. The Menu/Panel/Panel_Options section contains the configurable controls.
Location .\Assets\StarterSamples\Usage\Passthrough\Prefabs\PassthroughStyler.prefab
Passthrough Styler Script
Script that defines the styler control behavior.
Location .\Assets\StarterSamples\Usage\Passthrough\Scripts\PassthroughStyler.cs
Surface Projected Passthrough Script
Controls the behavior of the surface projected passthrough layer.
Location .\Assets\StarterSamples\Usage\Passthrough\Scripts\SPPquad.cs
Oculus Logo Prefab
The augmented object example in the scene.
Location .\Assets\StarterSamples\Usage\Passthrough\Prefabs\OculusLogo.fbx
Augmented Object Script
Controls the behavior of the Oculus Logo.
Location .\Assets\StarterSamples\Usage\Passthrough\Scripts\AugmentedObject.cs
Object Manipulator Script
Script which governs how you interact with the scene objects.
Location .\Assets\StarterSamples\Usage\Passthrough\Scripts\ObjectManipulator.cs