About the Screen Blend Mode

Hello, fellow Blenderers.

I have a question regarding the Screen Blend Mode inside the MixRGB node. I know how the blend mode works (you can learn it reading this if you don’t), and precisely due to that is that I don’t understand the purpose of the Factor. As far as I know, the blend mode is symmetric, which means that the order/precedence of the inputs is not relevant (a Screen b = b Screen a). That makes me wonder why should I need to choose to go more for an input over the other. So, the question is clear: what does this parameter do?

I guess the same question is applicable to other Blend Modes.

Álex.

The Fac input lerps between Color1 unchanged and the blended result.

Fac 0 = Color1 unchanged
Fac 1 = Color1 and Color2 blended with 100% effect
Fac 0.5 = … with 50% effect

1 Like

Oh, I see. Yeah, I supposed it should do something like this, given that the operation couldn’t be affected itself without altering it. Only to further detail this thing to anyone interested, I’ll post here the complete formula now that I know what the Factor does:

1 - (1 - c1)(1 - c2 * f)

Where f is the Factor.

Thanks for the answer, doubt clarified! :smile:


EDIT: I return here a time after setting my question as answered just to prove my formula.

As we can see in the Blender source code, the formula for the screen blend mode is not what I wrote… or is it?

Turns out it is.

There, we find the formula (adapting it to more readable terms):

1 - (1 - c1)((1 - f,1 - f,1 - f) + f(1 - c2))

Which starts to make sense after a couple of minutes of reasoning and carefully following the math, giving a result that seems correct intuitively according to what we would expect the screen blend mode to do. But still I wondered: does the “official” formula do the same as mine? Or, mathematically speaking, are both expressions equivalent?

The first thing we have to do is isolating the portion of them that differ, namely:

1 - (1 - c1)((1 - f,1 - f,1 - f) + f(1 - c2))

1 - (1 - c1)(1 - c2 * f)

Now we can equal both portions and check if the equality holds. If it does, the two formulae do exactly the same. So let’s play around with the algebra:

(1 - f,1 - f,1 - f) + f(1 - c2) = 1 - c2 * f
(1 - f,1 - f,1 - f) + f - f * c2 = 1 - c2 * f
(1 - f,1 - f,1 - f) + f = 1

And finally, remembering that when talking shaders reals become a 3-vector of components “real,real,real” when working with other vectors[*]:

(1 - f,1 - f,1 - f) + f = 1
(1 - f,1 - f,1 - f) + (f,f,f) = (1,1,1)
(1,1,1) = (1,1,1)
QED

The funny thing is that I find my formula far simpler than the official one, let alone more intuitive. Does someone know why the Blender team chose their formula, or if they are even aware of this?

Have a good day!

[*] Well, not always, but they do in the cases seen in this proof.