Non additive opacity shader?

I’m wondering if there are any shader setting to get the following result (the right), where two quads of the same semi-transparent material does not add to each others opacity, while still staying transparent to other materials as this red opac quad lying under the other quads.

I’m currently using “Blend SrcAlpha OneMinusSrcAlpha” in my shader (the left).

1837186--117798--upload_2014-11-5_20-1-38.png

There could be if you use the stencil buffer. Just mark the stencil buffer where you write the grey quads and don’t render them again where the stencil buffer is marked.

Stencil {
   Ref 1
   ReadMask 1
   Comp NotEqual
   Pass Replace
}
1 Like