See through mesh with tool Hololens

Hi,

I’m programing some stuff for AR, and I would like to do this : The player has a tool, let’s say a glass plane, and when he puts the plane on a 3D mesh object, he can see inside (everything on the object thats between the tool and the player’s eyes is masked).

It’s like i cut through the object, but as i move the tool away the parts that were masked reapears.

Thing is, I’ve got no idea how to do that ^^" (I’m working with URP also). I guess this will be a matter of shaders and stuff…

Can anyone help ?

Thanks

What you likely want is a stencil shader that prevents the mesh from rendering wherever the stencil has written to. This would be a custom material on your “glass plane” that should render before opaques (URP also uses this property to do rendering ordering for a given camera) write to the stencil, then your mesh should only render where the stencil has not been written to.

You might be able to crib off of this shader in our ARFoundation samples

1 Like