How to remove the overlay material?

Hello!
How to remove overlay materials (example in the picture)?
It is necessary - if two pipes intersect and their materials are duplicated, then make it so that it would not be visible.
I guess you need to look in the direction of the shader?

I will be grateful for any advice!


Gentlemen, you really need a solution!
How can I be?

do you need to use transparent material?

Yes, under the conditions of the problem this is not discussed

so maybe its this issue,

Thank you, but it’s not quite that.
Or I did not apply it correctly.
The pipe in the picture consists of + -20 objects, each has its own mesh.
And what you offer works only if the mesh is on one object.

The pipe drawing algorithm assumes exactly such an implementation (from several objects).

Maybe I need to dig the other way? For example blur?
I will be grateful for anyone?