culling meshes within the volume of another mesh

I am trying to paste this mesh as “Decal” or “Splat”

alt text

But when it gets stamped to the ground I want it to render the mesh inside of it as a see through or culled. That way the full crater can be seen.

alt text

Are there any functions or something that can assist in this? Preferably C#?

I was thinking maybe if I capped off the crater and used UVW Unwrap and made the cap fully transparent then save it as a TIFF it would be easier to write up a code to render anything foreign inside the mesh as un-rendrable.

Or the same thing except make the cap “separate” from the mesh. and act as a window or rendertotexture and exclude terrain in layers somehow?

But thats the thing. I dont know how to use layers and renderers together or even go about tampering with the renderer without scripting it to some extent.

There’s a great depth mask shader on the Unity community wiki, located here. It does what you’re looking for.