Depth API Overview
Health and Safety Recommendation: While building mixed reality experiences, we highly recommend that you evaluate 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 using Depth.
The Depth API provides real-time depth maps that apps can use to sense the environment. Primarily, it enhances mixed reality (MR) by allowing virtual objects to be occluded by real-world objects and surfaces, which makes them appear integrated into the actual environment. Occlusion is crucial because it prevents virtual content from appearing as a layer over the real world, which can disrupt immersion.
The
Scene Model enables the creation of room-scale, mixed reality experiences featuring realistic occlusion. However, it cannot handle occlusion for objects that are dynamically moving within the user’s view, such as hands, limbs, other people, and pets. To achieve realistic occlusion with these dynamic elements, you must also use the Depth API.
Use cases | Depth API | Scene API |
---|
Static Occlusion: the occluding real-world environment remains immobile (static) throughout the lifetime of the app, i.e. no moving objects such as hands, people or chairs. | ✔ | ✔ |
Dynamic Occlusion: the occluding real-world environment contains mobile (dynamic) elements, e.g. the users hands, other people, pets. | ✔ | ✖ |
Raycasting: Computing intersection of a ray and real-world surfaces. Supports use cases like content placement. | ✔ | ✔ |
Physics/Collisions: interactions between virtual content and the real-world, like a virtual ball bouncing off of a physical couch. | ✖ | ✔ |
How do I start with Depth API? Depth API is only supported on Quest 3.
Before you begin working with Depth API, familiarize yourself with
Passthrough. Having Passthrough in your app is a requirement for receiving environment depth.
The Occlusions
Getting started section will give more information on the main use case for Depth API.