docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    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 environmentDepthImageSupported Yes
    Environment Depth Confidence Image environmentDepthConfidenceImageSupported Yes
    Environment Depth Temporal Smoothing environmentDepthTemporalSmoothingSupported Yes
    Human Segmentation Stencil Image humanSegmentationStencilImageSupported
    Human Segmentation Depth Image humanSegmentationDepthImageSupported

    Testing occlusion

    AR Foundation provides the HMDOcclusion sample to demonstrate occlusion. To test occlusion on Android XR with the occlusion sample:

    1. Download the AR Foundation Samples app from the AR Foundations Samples GitHub repository and open it in Unity 6000.0.23f1.
    2. Open the HMDOcclusion scene in Unity from Assets/Scenes/Occlusion.
    3. 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.
    4. Apply the new material to a sample cube in the scene and position as desired.
    5. 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.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)