Assets/StarterSamples/Usage/Passthrough/Scenes/. Load either EnableDisablePassthrough.unity for interactive feature demos or PassthroughAtStartup.unity for contextual launch testing. Build and deploy to your Meta Quest device. For complete build instructions and project settings, see the sample README.| Scene | What it demonstrates | Key concepts |
|---|---|---|
EnableDisablePassthrough.unity | Interactive demos of passthrough features including runtime MR/VR toggling, hand-tracked flashlight, 3D drawing brush, selective surface projection, and style controls. Combines multiple passthrough techniques in a single experience. | Runtime passthrough toggling, selective passthrough, device capability queries, hand tracking |
PassthroughAtStartup.unity | Contextual passthrough at app launch with a splash screen overlay and runtime info panel. Shows how to adapt launch behavior based on the user’s environment. | Contextual passthrough detection, splash screen configuration, project settings |
| Script | What it demonstrates | Key concepts |
|---|---|---|
EnableDisablePassthroughController.cs | Runtime MR/VR toggle with fade transitions using OVRManager.instance.isInsightPassthroughEnabled and OVRPassthroughLayer | Passthrough subsystem control, layer visibility, event-driven UI updates |
PassthroughAtStartupController.cs | Contextual passthrough detection via OVRManager.IsPassthroughRecommended() and conditional splash screen | Launch context detection, async scene loading |
PassthroughStyler.cs | Style control UI: brightness/contrast/saturation via SetBrightnessContrastSaturation(), color LUTs via SetColorLut(), edge rendering | Passthrough appearance customization, device capability adaptation |
SPPquad.cs | Selective passthrough projection onto mesh surfaces using AddSurfaceGeometry(GameObject, bool) and RemoveSurfaceGeometry(GameObject) | Surface-based passthrough windows, geometry registration |
FlashlightController.cs | Dual-input flashlight: controller mode (A button toggle) and hand tracking mode (pinch gesture) using OVRSkeleton and OVRHand | Hand tracking integration, multi-input support |
PassthroughBrush.cs | 3D drawing tool creating passthrough strokes in space using LineRenderer | Real-time passthrough geometry creation |
EnableUnpremultipliedAlpha.cs | Disables premultiplied alpha compositing via OVRManager.eyeFovPremultipliedAlphaModeEnabled = false | Correct alpha blending for selective passthrough |
OVRManager.IsPassthroughRecommended(). If passthrough is recommended (launched from MR Home), a splash screen overlay appears on the real world with a smooth fade-in. If not recommended (launched from VR Home), the scene fades in from black instead. An info panel displays the runtime status of contextual passthrough, system splash screen, and Unity splash screen settings.OVRManager.instance.isInsightPassthroughEnabled with OVRPassthroughLayer.enabled. The EnableDisablePassthroughController script subscribes to OVRPassthroughLayer.passthroughLayerResumed to synchronize UI updates with passthrough readiness. A custom shader (PassthroughFader) provides smooth visual transitions between modes. For related API details, see the OVRPassthroughLayer reference.OVRManager.IsPassthroughRecommended() to detect whether the user launched the app from a passthrough context like MR Home. When true, PassthroughAtStartupController enables passthrough and shows a splash screen overlay. When false, the app fades in from black instead. For project configuration requirements, see the contextual passthrough documentation.OVRPassthroughLayer.ColorMapEditorType. In ColorAdjustment mode, it adjusts brightness, contrast, and saturation via SetBrightnessContrastSaturation(). In ColorLut mode, it applies color look-up tables via SetColorLut() with OVRPassthroughColorLut instances. The script queries OVRManager.GetPassthroughCapabilities().SupportsColorPassthrough to adapt the UI for monochrome devices. For supported style parameters, see the passthrough styling reference.OVRPassthroughLayer.AddSurfaceGeometry(gameObject, false) on start and RemoveSurfaceGeometry(gameObject) when grabbed. This creates a “window” into the real world on a virtual surface — useful for portals, virtual window frames, or spotlight effects. The flashlight uses the same technique to create a cone of passthrough visibility.OVRManager.eyeFovPremultipliedAlphaModeEnabled = false to disable premultiplied alpha in framebuffers. This is required for correct blending when using non-binary alpha values in selective passthrough. Without this setting, the compositor assumes premultiplied alpha and produces incorrect transparency effects.OVRPassthroughLayer API reference