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 environmentDepthImageSupported and environmentDepthConfidenceImageSupported require that you start an AR session before support can be determined. If there is no AR session, these properties return false
. They might return true
later when a session has been started.
Optional feature support
ARCore implements the following optional features of AR Foundation's XROcclusionSubsystem. The availability of features depends on device hardware and software. Refer to Requirements for more information.
Feature | Descriptor Property | Supported |
---|---|---|
Environment Depth Image | environonmentDepthImageSupported | Yes |
Environment Depth Confidence Image | environmentDepthConfidenceImageSupported | Yes |
Environment Depth Temporal Smoothing | environmentDepthImageSupported | Yes |
Human Segmentation Stencil Image | humanSegmentationStencilImageSupported | |
Human Segmentation Depth Image | humanSegmentationDepthImageSupported |
Note
Refer to AR Foundation Occlusion platform support for more information on the optional features of the occlusion subsystem.
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.