Doing more advanced composites in an AR/XR Setup where you have an element in both the AR scene and XR scene that overlap can be challenging. For opaque objects, but even more so for translucent ones.
To make the objects behave seamlessly we have added a set of tools. It will essentially hide any material in the XR world that is in front of a holdout.
In the content browser navigate to
you might need to check "Show Engine Content" to see it
Drag an "XRARTransferManager” into the scene
it will automatically collect all XRHoldout actors for building the render mask
To verify it is picking up the holdouts, you can enter PIE mode and look at the "XRWallDepth" texture
it should show the mask of the holdouts as seen in the viewport
Add GetXRARTransferOpacity to material
Now that the mask is being generated, you can use the material function “GetXRARTransferOpacity” in any material and it should update automatically
we recommend using either masked or translucent materials
an example implementation can be found in the TestXRARTransferActor (it shows a cube with the XRARTransferDraw example material applied)
Test the setup
Place your own material or the test actor in the scene in front of the holdout
Run the level in Live, Preview Live or WYSIWYG mode for this to look correct. Learn more about how to Run levels in Edit, Preview Live and LIVE mode
The XR option "Disable Custom Depth" must be disabled, as this is using custom depth. The XRARTransferManager disables this automatically.