Develop

Passthrough Samples

Updated: Apr 15, 2026
Deprecated: The UOculusXRPassthroughLayerComponent is deprecated as of v74 (UE 5.6). This sample uses the legacy component-based approach. For new projects, use Persistent Passthrough instead.
Passthrough sample is available on GitHub, and its use is explained in detail below. In addition, the following projects provide examples of passthrough used with other APIs:
  • CoLocationHS: Shows how to implement colocation, where multiple users in the same room use passthrough.
  • Occlusion Sample: Illustrates using the Depth API’s different options for integrating visual occlusion with passthrough.
  • Scene Sample: Shows how to use the Scene API to interact with objects in the passthrough environment.
  • Shared Scene Sample: Illustrates using shared anchors to share scene details with other users.
  • Phanto: Shows how to use passthrough to create an entire mixed reality game.
Open the Navigation Menu by pressing the Menu button on your left controller. Once in the Navigation Menu, you can see if your device supports passthrough, the name and description of your current level, and a list of levels you can travel to. Aim your right-hand controller at the desired level and press the right trigger to travel to it. Scroll through the list with the right thumbstick.
Navigation menu

Passthrough background with augmented objects

A common use of passthrough is as a background, where you can place virtual objects (Passthrough AR). You can do this easily, starting from the PTBackground scene:
  1. Import your FBX or 3D object into your project. To do this, open the Content Drawer in the bottom left corner, click Add (the green plus icon), select Import to /Game/ (or your desired location), and choose your FBX or 3D object file.
  2. Place your object in the scene.
  3. Give your object a grab component and set its collision preset to PhysicsActor so it can be grabbed and moved around your room.
  4. Build and deploy.
Here are relevant assets in this scene that you can use and modify to fit your needs:
  • Level Blueprint: Creates and adds a passthrough layer to the player pawn.
  • BP_OculusLogo.uasset: A standard actor with the default material.
  • BP_Grafitti.uasset: This is the same as BP_OculusLogo.uasset but with a custom material.

Using passthrough styles for colorful effects

The PTStyles level demonstrates some of the styling options available on passthrough layers. You can control the styling using the widget in the level:
Styler widget
  • Color map Curve: Colorize passthrough using a predefined curve. The curves are defined in the Content/Passthrough/Data/ folder and can be customized to achieve different colorizations.
  • Color map Controls: Use the Contrast/Brightness/Posterize sliders to apply image processing effects implemented using a color map of type “Grayscale To Color.”
  • Edge Color: Use the Red/Green/Blue/Alpha sliders to adjust the color of salient edges in the image (extracted using a Sobel filter).
Here are the relevant assets in this scene that you can use and modify to fit your needs:
  • Level Blueprint: Creates and adds a passthrough layer to the player pawn and sends the layer to the widget.
  • BP_Menu.uasset: The menu actor with the menu widget.
  • W_PTStyler.uasset: The widget directly modifying the style of the passthrough.

Color maps

Instead of specifying color effects via parameters (as demonstrated in the PTStyles level), you can define them as an array of 256 values that map each (grayscale) input value to a new color. The PTColorMap level provides an example of setting colors this way. With the in-game widget, you can modify the 256 color values and see the impact on the styling.
Color map widget
Here are the relevant assets in this scene that you can use and modify to fit your needs:
  • Level Blueprint: Creates and adds a passthrough layer to the player pawn and sends the layer to the widget.
  • W_PTColorMap.uasset: The widget for viewing the color map array and editing each of its 256 values.

Color look-up tables (LUTs)

You can colorize passthrough using color LUTs. As demonstrated in the PTColorLut level, you can use two LUT types: Color LUT and Interpolated Color LUT. The second one will blend two LUTs (source and target) using the LUTWeight value.
Color LUT widget
Here are the relevant assets in this scene that you can use and modify to fit your needs:
  • Level Blueprint: Creates and adds a passthrough layer to the player pawn and sends the layer to the widget.
  • W_PTColorLUT.uasset: The widget for viewing and editing LUTs.

Color and scale offset

Another way to colorize passthrough layers is to use color scale and offset. The PTColorScaleAndOffset level demonstrates this method and animates both of those settings. You can use the in-game widget to stop and edit the color scale and offset.
Color scale and offset widget
Here are the relevant assets in this scene that you can use and modify to fit your needs:
  • Level Blueprint: Creates and adds a passthrough layer to the player pawn, sends the layer to the widget, and animates the color scale and offset.
  • W_PTColorScaleAndOffset.uasset: The widget for viewing and editing the color scale and offset.
Note: The lighting and color in this sample may cause seizures in people with epilepsy or sensitivity to light and color.

Passthrough masking

The PTMaskedBrush and PTMasked levels demonstrate experiences where a passthrough layer is masked and only visible in certain screen areas. In the PTMaskedBrush sample, the controller can be used as a brush to draw a projected passthrough stroke by pressing the left and right triggers. PTMasked showcases a circle mesh with masked projected passthrough (using the mPokeAHoleMask material) that is attached to the controller, which allows you to see your hands (you can change the attached controller with the left/right trigger).
You can re-use and modify the mPokeAHoleMask.uasset material to mask areas in your scene.
Here are the relevant assets in this scene that you can use and modify to fit your needs:
  • Level Blueprint: Creates and adds a passthrough layer to the player pawn, binds inputs, and projects the passthrough to the circle.
  • MaskedCircle: Actor on which you project the passthrough, using the mPokeAHoleMask material to smooth its border.