Create a Material that shows only intersection between two objects

Yes you’re almost there. I did a quick test to make sure it’s working as I thought, this is the end result:

The important thing is that the stencil value is for the entire mesh unfortunately, so the mesh that needs to be cut has to be rendered twice:

  • One with the original normal orientation, and a stencil value of 0
  • One with inverted normals (to render the interior faces) with a stencil value of 1

Now you should be able to identify the pixels that belong to the interior faces and that are not covered by any exterior faces:

The material for these 2 meshes is the same, and has nothing special beside the box mask as you did.
The material for the “cutter box” is fairly simple too:

Hope that helps!

1 Like