How to highlight intersection between objects?

Hello, I’m new to Unity and I’m developing an augmented reality app.

My situation is as follows: I have two objects in the scene, a neighborhood model and a cube. The mockup will be the object I am going to enlarge and the cube will be like the acrylic box where the mockup is. The cube represents the viewing area and will be transparent. The model has an animation in which it moves and scales and the cube remains fixed.

I need something to assign to the cube so that when expanding the model, the parts that stick out of the cube will have 50% colorless transparency (all gray) and the part of the model inside the cube (in intersection) remains transparent and with the colors and textures.

The idea is to present the mockup on an initial scale that is inside the cube (acrylic box) then the model’s animation will zoom in on the mockup at certain points, the whole mockup will be much larger than the cube. the outside of the cube is transparent and colorless, and the inside remains uncolored and colored to give more prominence to what it is showing.

Can someone help me?

Not entirely suited to your exact needs but this should help.

Though intended for the minimap the Off Screen Target script could be modified to fit your need. More of a hobby for me but I did my best to explain square routes of Vector3’s in this blog post.