Develop
Develop
Select your platform

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, an augmented object, a passthrough brush, and a lighting source, all in the same scene.

Prerequisites

Before proceeding with this tutorial, complete the setup steps outlined in Passthrough Getting Started to set up your Unity development environment for Passthrough.

Step by Step

  1. Download the Starter Samples project from GitHub.
  2. If you prefer, set up the Meta Quest Developer Hub so you can control your on-headset application.
  3. In the Unity Project explorer, search for the scene named simply ‘Passthrough.’ Drag it to your Hierarchy window.
  4. Remove any other scene from the Hierarchy Window.
  5. Save your project and your scene.
  6. From the File menu, choose Build Profiles to open the Build Profiles window.
  7. Make sure your headset is listed in the Run Device dropdown.
  8. Click Open Scene List to open the Scene List window, then click Add Open Scenes to add your scene to the build. Deselect and remove any other scenes from the selection window.
  9. Click the Build and Run button to launch the program onto your headset.

Using the Sample

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
Passthrough multiple features
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.

Passthrough Brush

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.
Use the brush

Oculus Logo (Augmented Object)

Select the Oculus logo using the right controller grip trigger. Then use the thumbwheel to set the logo distance and orientation.
Select the logo

Flashlight

Select the flashlight using the right controller grip trigger. The flashlight illuminates an area of the scene as long as you hold it.
Use the flashlight

Style Control Panel

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.
Use the style control

Key Assets

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
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
Did you find this page helpful?