Occlusion
This page supplements the AR Foundation Occlusion manual. The following sections only contain information about APIs where Google's Android XR runtime exhibits 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.
Optional feature support
Android XR implements the following optional features of AR Foundation's XROcclusionSubsystem
:
Feature | Descriptor Property | Supported |
---|---|---|
Environment Depth Image | environment |
Yes |
Environment Depth Confidence Image | environment |
Yes |
Environment Depth Temporal Smoothing | environment |
Yes |
Human Segmentation Stencil Image | human |
|
Human Segmentation Depth Image | human |
Testing occlusion
AR Foundation provides the HMDOcclusion
sample to demonstrate occlusion. To test occlusion on Android XR with the occlusion sample:
- Download the AR Foundation Samples app from the AR Foundations Samples GitHub repository and open it in Unity
6000.0.23f1
. - Open the
HMDOcclusion
scene in Unity fromAssets/Scenes/Occlusion
. - Create a new material and set its shader to
Assets/Shaders/Occlusion/OcclusionSimpleLit/OcclusionSimpleLit.shader
. Refer to Creating Materials for more information about creating and applying materials. - Apply the new material to a sample cube in the scene and position as desired.
- Open the AROcclusionManager in the Inspector window, and disable Temporal Smoothing.
Note
You can also add the avruntime
permissions request script so that apk prompts for necessary permissions at launch.