Create a Material that shows only intersection between two objects

Hello!

Does your white box has distance field enabled? If that’s the case that could explain the white spots in the middle of the surface, so make sure distance field is disabled for this mesh.

For the black spots in the corners that’s probably because the distance field resolution is too low for the kind a precision you need. You can try to increase the distance field resolution scale of your grey mesh but it’s not guaranteed to be perfect, and it will quickly increase your memory consumption.

I’m not sure if this approach could work, but what I would try, in the grey box material, is to write a 1 in the stencil buffer for the pixel that are masked out and a 0 otherwise. Now in your white box material you can read the stencil buffer and mask the pixels where the value is not 1 (you might need to set you white material as translucent for it to work though).

1 Like