Develop

Shared Scene sample overview

Updated: May 11, 2026

Overview

This sample combines Shared Spatial Anchors, Scene API, and Passthrough to share room geometry between Meta Quest devices. The host captures their room layout, and clients reconstruct the geometry over the network. It uses Blueprint-first development with only one C++ utility function, LAN multiplayer with OnlineSubsystem=Null, and a composition-based pawn architecture.

What you will learn

  • Combine Shared Spatial Anchors, Scene API, and Passthrough in a single multiplayer experience
  • Capture and serialize room geometry (UUIDs, transforms, meshes, semantic labels)
  • Transfer scene data over the network using NetMulticast_LoadScene
  • Reconstruct room geometry on client devices from serialized data
  • Toggle visibility of scene elements by semantic label
  • Implement a Blueprint-first architecture with minimal C++ (GetDeviceSupportsLocalMultiplayer)

Requirements

  • Meta Quest 2, Quest 3, or Quest 3S
  • Unreal Engine 5.4 with the MetaXR plugin
  • MetaXR Platform plugin (bundled with the sample)
For build setup and configuration, see the sample README.

Get started

Clone or download the sample from the GitHub repository. Open the project in Unreal Engine 5.4 with the MetaXR plugin installed. The MetaXR Platform plugin is bundled with the sample. Build and deploy to two Meta Quest devices on the same WiFi network. The host device should have a completed Room Setup (Space Setup) for the room. Launch the app on both devices — the host captures the room and clients receive the reconstructed geometry.

Explore the sample

File / SceneWhat it demonstratesKey concepts
Main level (map)
Host-client shared scene experience
Passthrough environment, scene sharing flow
BP_SharedSpacesPawn
Composition-based pawn for shared scenes
Pawn composition pattern, Passthrough setup
BP_OculusSceneActor
Room capture and geometry reconstruction
Scene API capture, mesh reconstruction
BP_Scene
Scene data serialization and deserialization
UUID + Transforms + Meshes + Labels serialization
NetMulticast_LoadScene
Network transfer of scene data
Multicast RPC, scene replication
GetDeviceSupportsLocalMultiplayer (C++)
Single C++ utility function
Device capability check
OnlineSubsystem=Null config
LAN multiplayer without platform services
Local network session management

Runtime behavior

The sample operates in a host-client model over LAN (OnlineSubsystem=Null):
  1. Host captures room: BP_OculusSceneActor captures the host’s room geometry from the Scene API, including mesh data, transforms, UUIDs, and semantic labels (walls, floor, ceiling, furniture).
  2. Scene serialization: BP_Scene serializes the captured room data into a transferable format containing UUIDs, transforms, mesh vertices, and semantic labels.
  3. Network transfer: NetMulticast_LoadScene sends the serialized scene data to all connected clients via multicast RPC.
  4. Client reconstruction: Clients deserialize the data and reconstruct the room geometry in their local space, aligned using shared spatial anchors.
  5. Visibility toggling: Users can toggle visibility of scene elements by semantic label (for example, hide walls but show furniture).
Both host and client see the shared room geometry overlaid on their passthrough environment.

Key concepts

Blueprint-first with minimal C++

The sample uses Blueprint for all logic except one utility function:
// Only C++ function in the sample
bool GetDeviceSupportsLocalMultiplayer()
{
    // Checks device capability for local multiplayer
}
All scene capture, serialization, network transfer, and reconstruction logic is implemented in Blueprints.

Scene data serialization

BP_Scene serializes room geometry for network transfer:
`BP_Scene` contains:
├── Anchor UUIDs (spatial anchor identifiers)
├── Transforms (position, rotation, scale per element)
├── Meshes (vertex and triangle data)
└── Labels (semantic: wall, floor, ceiling, desk, couch)

Composition-based pawn

BP_SharedSpacesPawn uses a composition pattern rather than inheritance, combining:
  • Passthrough rendering component
  • Spatial anchor management
  • Network replication
  • Scene visualization
This pattern keeps each responsibility isolated and allows selective feature enablement.

LAN multiplayer with OnlineSubsystem=Null

The sample uses OnlineSubsystem=Null for local network multiplayer without requiring Meta platform services or user authentication. Devices discover and connect over the local WiFi network.

Extend the sample

  • Add persistent room sharing using cloud-saved anchors so clients can rejoin without the host re-capturing.
  • Implement occlusion using the shared scene geometry so virtual objects hide behind reconstructed walls.
  • Add interactive elements anchored to semantic labels (for example, virtual art on walls, items on desks).
  • Combine with Depth API for hybrid occlusion using both scene geometry and real-time depth.