Overview
This section describes how to mask objects in the foreground in Augmented Reality (i.e. rendered in the Foreground pass), also known as Alpha Holdout. This is useful when part of a virtual object should be hidden by a real life object such as objects appearing out of the floor.
Setup
For each Cesium Camera, add the objects that should mask AR objects (example: the floor or a wall) to the list of Foreground objects. They should now appear in the key channel.
In this example we want the sphere to hide the cube. The cube and sphere are in the foreground. The next step will set the sphere as mask.
Masking Objects
Select the material “M_AR_Mask” in the “PRIME VSAR Tools” menu and drag and drop it on the masking objects.
⚠️ In order to find “M_AR_Mask” when using the assets browser, “Show Engine Content” and “Show Plugin Content” must be enabled in View Options.
The masking objects are now invisible on the Fill channel and masking in the Key channel (alpha holdout).
The sphere is invisible in the Fill channel and masking the cube in the Key channel.