SDK for Unity
Occlusion & Effects
Manual
Occlusion & Effects
Occlusion Set Up
-
Set up Phantom Scene (See: Setup Guide)
-
On the ARFoundation Game Object, find the RGB Camera Component (ARFoundation -> AR Session Origin -> RGB Camera)
-
Attach the “Merge Depth Maps” Component to the Camera.
-
On the Merge Depth Maps component
a. In the Unify Depth variable slot, find and attach the shader named “UnifyDepth” (Path: “Hidden/PhantomTech/UnifyDepth”)
b. Set the LidarRange variable to match the device you are building for. (Recommended: 5 for Android, 7 for iOS)
-
Attach the “Occlusion” Component to the RGB Camera.
-
On the Occlusion Component
a. In the “Occlusion Shader” variable slot, find and attach the shader named “Occlusion” (Path: “Hidden/PhantomTech/Occlusion”)



Done
To test Occlusion is working, in both the Merge Depth Maps component, and the Occlusion component, you can set a test image to see occlusion in your scene.
Notes:
Occlusion will only work on objects with shaders that write depth data to the ZBuffer. Transparent shaders will not be occluded.