Occluder material (for masking)

Hey everyone,

I’ve been searching for a solution for this for a while now, and haven’t cracked it yet.

I’d like to have a material that could be applied to a mesh, to turn it into an occluder.
By that I mean something that hides what appears behind the mesh, without the mesh itself being visible.

A good example of that is when you have a face filter on Instagram, TikTok, etc with glasses on. As you turn your head from side to side, you don’t want to see the parts that should be hidden by your head IRL, so you put in a head mesh in the right position, with an occluder material.
That means the mesh is invisible, but it effectively asks as a mask.

In this particular case I will be rendering out a video as a final product, but I can’t really go down the multiple video outputs with custom render passes, as that won’t scale for what I need.
Is there really no way of creating that material blueprint? I’ve searched high and low and nothing got it just perfect.

I’d really appreciate your help!

Thanks

oh, and in an ideal world the mesh would still receive shadows!

Bump! i could really use someone’s advice on this

Does this basic XR functionality really not exist in Unreal?