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”)
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.
Occlusion will only work on objects with shaders that write depth data to the ZBuffer. Transparent shaders will not be occluded.