"Stacking" transparent materials?

Hello.

I’m new to graphics and materials, so I need some help.
Let’s hope I can at least explain what I want to do.

Let’s say I have a semi-transparent material (alpha 0.2) used to “gray out” some parts of the level by creating a floating plane that covers the objects.
It works well, but in a situation where two of those materials stack (one above the other), objects underneath are less visible (because they are under not one, but two semitransparent materials).
That’s logical and I understand why this is, but I would like to know if it is possible to override this so that if an area is covered by more than one plane it would still look as if only one of them was there.
I don’t know how this could be done and I don’t think it is possible, but I have seen a lot of things that are very counter intuitive to me with regards to materials, so I just have to ask.

Maybe something like checking what material is below that one and creating a mask accordingly?

Thanks for help.

I went for a very complex solution where I made translucent materials face and a trace line can detect the presence of multiple stacked mats and replace the material into a “nothing material” opacity 0. it was simple until i decided to save/load the setup and now its a nightmare.

Rather than using the materials opacity slider, you can use a scene color sampler. Other translucent materials will not appear in the sample, so only the nearest translucent object will be visible.

1 Like