May be obvious but took me a bit to realize. We wanted to have a character walk from behind a wall using ARKit. We can detect the plane but needed to mask off the character. I would normally use a Depth-only write in a pre-pass to occlude the objects.
I couldn’t figure out a way to do this in UE4 for opaque materials. I could change them to transparent and use a post past or a stencil mask but then the objects render wrong in the transparent layer. They have complex shaders.
Hack solution is to apply the same screen space camera material to the object I want to use as a mask. Works a charm.