Depth API Samples
Updated: Apr 14, 2026
The
Depth API enables virtual objects to be occluded by real-world surfaces, creating more believable mixed reality experiences. The following sample projects demonstrate Depth API features in Unreal Engine. These samples require a Meta Quest 3 or Meta Quest 3S with
Passthrough enabled.
This Blueprint-only project demonstrates several Depth API features:
- Hard occlusions: Real-world surfaces occlude virtual objects with sharp edges.
- Soft occlusions: Real-world surfaces occlude virtual objects with smooth gradient edges. Requires the Oculus-VR fork of Unreal Engine.
- Hands removal: Toggles hand removal so that the user’s hands are not occluded by virtual content. Activated with a pinch gesture.
- Environment Depth material graph node: Visualizes raw depth data from 0 to 3 meters using a custom material (
M_EnvironmentDepth). Requires the Oculus-VR fork of Unreal Engine.
Use the A/X buttons to cycle between occlusion modes.
Phanto is a mixed reality game that integrates Passthrough, Depth API occlusion, and Scene Mesh into gameplay. It demonstrates how depth-based occlusion and scene understanding can combine to create interactive mixed reality experiences where virtual content responds to the physical environment.
- Passthrough integration: Renders the physical environment as the backdrop for mixed reality visuals.
- Depth API occlusion: Integrates depth-based occlusion into gameplay mechanics so virtual content is hidden behind real-world surfaces.
- Scene Mesh interaction: Uses the scene mesh to enable virtual content to interact with the physical environment.