AR Occlusion Manager component
The occlusion manager exposes per-frame images representing depth or stencil images. Incorporating depth images into the rendering process achieves realistic blending of augmented and real-world content by ensuring physical objects occlude virtual content located behind them in shared AR space.
Add the AROcclusionManager component to a Camera with the ARCameraBackground component to automatically enable the background rendering pass to incorporate any available depth information when rendering the depth buffer. To add the ARCameraBackground
and AROcclusionManager
to your camera, follow the steps outlined in Managers.

AR Occlusion Manager component
Supported depth images
The types of depth images supported are:
Type of depth image |
Description |
Environment Depth |
Distance from the device to any part of the environment in the camera field of view. |
Human Depth |
Distance from the device to any part of a human recognized within the camera field of view. |
Human Stencil |
Value designating, for each pixel, whether that pixel contains a recognized human. |
AR Occlusion Manager settings
The following table describes the properties of the AR Occlusion Manager component:
Property |
Description |
Environment Depth Mode |
The mode for generating the environment depth texture. There are four options: - Disabled: No environment depth texture produced.
- Fastest: Minimal rendering quality. Minimal frame computation.
- Medium: Medium rendering quality. Medium frame computation.
- Best: Best rendering quality. Increased frame computation.
|
Temporal Smoothing |
Whether temporal smoothing should be applied to the environment depth image, if supported on the chosen platform. Temporal smoothing reduces noise to provide smoother images and more consistent occlusion. |
Human Segmentation Stencil Mode |
The mode for generating human segmentation stencil texture: - Disabled: No human stencil texture produced.
- Fastest: Minimal rendering quality. Minimal frame computation.
- Medium: Medium rendering quality. Medium frame computation.
- Best: Best rendering quality. Increased frame computation.
|
Human Segmentation Depth Mode |
The mode for generating human segmentation depth texture: - Disabled: No human stencil texture produced.
- Fastest: Minimal rendering quality. Minimal frame computation.
- Best: Best rendering quality. Increased frame computation.
|
Occlusion Preference Mode |
If both environment texture and human stencil & depth textures are available, this mode specifies which should be used for occlusion. There are three options: - Prefer Environment Occlusion
- Prefer Human Occlusion
- No Occlusion
|
Note
Use Occlusion Preference Mode to choose the type of depth image to use on ARKit. Human stencil depth images are only supported on ARKit. Environment and depth images are never simultaneously enabled.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.