Health and Safety Recommendation: While building mixed reality experiences, we highly recommend evaluating your content to offer your users a comfortable and safe experience. Please refer to the Health and Safety and Design guidelines before designing and developing your app.
Scene empowers you to quickly build complex and environment aware experiences with rich interactions in the user’s physical environment. Combined with Passthrough and Spatial Anchors, Scene capabilities enable you to build Mixed Reality experiences and create new possibilities for social connections, entertainment, productivity, and more.
For a complete API reference as part of the OpenXR spec, read XR_FB_scene.
How Does This Work?
Scene includes two important concepts: Space Setup and Scene Model.
Space setup
Space setup is a system flow that lets users walk around and capture their scene to generate a Scene Model. Users have complete control over the capture experience and decide what they want to share about their environment. An app can query the system to check whether a Scene Model of the user’s space exists or invoke the Space setup if needed.
Scene Model
Scene Model is a single, comprehensive, up-to-date representation of the real physical world that is easy to index and query. Scene Model provides a geometric and semantic representation of the user’s space so you can build room-scale mixed reality experiences. For example, attach a virtual screen to the user’s wall or have a virtual character navigate on the floor with realistic occlusion. In addition, you can bring physical world objects into virtual reality. For example, users can see their real desk or couch in the virtual world to play or work more comfortably.
The fundamental elements of a Scene Model are Scene Anchors, with each anchor attached with geometric components and semantic labels. For example, the system organizes a user’s living room around individual anchors with semantic labels, such as the floor, ceiling, walls, desk, and couch. Each anchor is also associated with a simple geometric representation, 2D boundary, or 3D bounding box.
Scene Model is managed and persisted by the operating system. All apps can access Scene Model. Scene Model makes it easy for you to understand the environment around the user and blend virtual content into that environment.
Multiple Spaces
Starting from v62, Space Setup allows the user to scan and maintain multiple rooms (spaces) instead of a single room. The user can scan a new room without erasing a previous room. The OS maintains up to 15 rooms, and might be able to locate some or all of the rooms depending on the current user’s location.
Supporting Multiple Rooms and Application Compatibility
Our SDKs for all platforms (OpenXR, Unity, Unreal) have been designed to support multiple rooms. However, Space Setup before v62 provided only a single room, so your existing applications might not behave as expected when more than one room is available. Existing applications will not have multiple rooms returned, starting from v65, new SDK versions will support multiple rooms being returned by default.
Build Mixed Reality Using Scene
Before you begin with Scene, make sure to use the latest version of the Meta Quest operating system and the the Meta XR Core SDK, which is available individually or as part of the Meta XR All-in-One SDK. Do the following:
Scene functionality is supported on the Meta Quest 2, Meta Quest Pro or Meta Quest 3 operating software version 40 or later. Ensure the headset is connected to the internet and has the latest version installed. To verify the latest version, in the Meta Quest headset, go to Quick Settings > About and check the latest version, which should begin with the number 40 or higher.
Then, you’ll need to include the extension headers specific to Scene and Spatial Anchors in your source code. Set up the following header #includes in your code:
#include <openxr/openxr.h>
Creating an Instance and Session
To use Scene through the FB OpenXR Extensions, you must create an OpenXR instance by enumerating the extension headers in the previous code block. For details on creating OpenXR instances, read Creating Instances and Sessions. For example:
In this example, the app is of type ovrApp, a struct defined in the attached XrSceneModel sample app. The FunPtrs field in the sample app is a struct defined as follows: