Occlusion
ARCore provides support for occlusion based on environment depth images it generates every frame. These depth images provide a distance in meters from the device to the environment.
This page is a supplement to the AR Foundation Occlusion manual. The following sections only contain information about APIs where ARCore exhibits unique platform-specific behavior.
Tip
When developing an AR app, refer to both the AR Foundation documentation as well as the required packages for each platform you support.
Check if occlusion is supported
- The XROcclusionSubsystemDescriptor properties supportsEnvironmentDepthImage and supportsEnvironmentDepthConfidenceImage require that you start an AR session before support can be determined. If there is no AR session, these properties return
false
. They might returntrue
later when a session has been started.
Supported textures
The ARCore implementation of AR Foundation Occlusion supports AROcclusionManager.environmentDepthTexture but does not support the other Textures related to human segmentation.
Environment depth
The XROcclusionSubsystem provides access to two types of environment depth: raw and smoothed.
- Raw: The raw, unsmoothed depth data. This is useful for custom processing where raw data is necessary and corresponds to ARCore's ArFrame_acquireRawDepthImage16Bits function.
- Smoothed: Depth data with smoothing applied. This is useful when performing occlusion and corresponds to ARCore's ArFrame_acquireDepthImage16Bits function.
Note
Both raw and smoothed are always available if depth is supported, regardless of the value of environmentDepthTemporalSmoothingEnabled.
Requirements
Environment depth requires a device with depth support. Refer to ARCore supported devices for a list of devices that support depth.