AR Shader Occlusion component
The ARShaderOcclusion component sets depth render texture information directly to global shader memory, instead of working through the AR Camera Background component. With shader occlusion, you're able to customize occlusion functionality by writing your own shaders. You can use the occlusion and confidence textures to apply techniques such as custom edge smoothing and visual effects.
The AR Shader Occlusion component subscribes to AROcclusionManager.frameReceived to receive depth textures, then uses Shader.SetGlobalTexture to make occlusion textures globally available for use in shaders.
AR Shader Occlusion component.
Add the AR Shader Occlusion component to your scene
To enable shader occlusion, add the ARShaderOcclusion
and AROcclusionManager to your Camera as outlined in Managers.
Shader occlusion samples
HMD occlusion shader example image.
For general information on writing shaders, consult the Writing shaders page in the Unity manual.
The AR Foundation Samples app provides an example of how to use HMD occlusion with shaders in the HMD Occlusion sample scene.