knocked back - CAD lines

Im trying to find a way to create some CAD lines but with some fade on occluded objects
You can see the large cube partially hiding the 2nd cube but where the cube overlaps I need to reduce its colour slightly to indicate it’s behind the 1st cube. Is this possible without any comp work?

Many thanks

If it’s not animated can’t you just assign a new shader to those polygon lines?

It seems very difficult I cant just add a new shader to the 2nd cube, all lines need to be the same colour but slightly faded, but only the lines hidden by the first cube.
I was just trying to work out if there is a method without having to render twice maybe with a thinner line then comp it in. The example is a very simple visual of a very complicated challenge here.

I didn’t mean the whole cube, just add an edge loop where is needed and apply a new shader to those faces according to the camera view.

I thought of a way to do it, however, it’s not perfect. Rather than masking the opacity slot, use the EdgesTex for the Refraction and set the IOR to 1. Afterward, add a V-Ray Material Override attribute and set duplicate of the first V-Ray Mtl (only with a different Diffuse color) for the Refraction Material. This way objects viewed through refractions should have another line color. The problem is that this includes self-refractions as well.