Class

Shader

Output

RGBA

synopsis

The composite shader mixes two RGBA inputs according to a blend mode. 


A

Input A.

B

Input B.

operation

The following blend modes are available:

A
Passthrough A

B
Passthrough B

Atop
A * B.a + B * (1 - A.a)

Average
(A + B) / 2

Cojoint Over
A + B * (1 - A.a) /B.a, A if A.a > B.a

Difference
abs(A - B)

Disjoint Over
A + B * (1 - A.a) / B.a, A + B if A.a + B.a < 1

Divide
A / B, 0 if B == 0
Exclusion
A + B - 2 * A * B
From
B - A
Geometric
2 * A * B / (A + B)
Hard Light
Screen, A * B if A < 0.5
Hypot Diagonal
sqr(A * A + B * B)
In
A * B.a
Mask
B * A.a
Matte
A * A.a + B * (1 - A.a)

Max
max(A, B)

Min
min(A, B)

Minus
A - B
Multiply
A * B
Out
A * (1 - B.a)
Over
A + B * (1 - A.a)
Overlay
Screen, A * B if B < 0.5
Plus
A + B
Screen
A + B - A * B if A and B in 0..1, else max(A, B)
Soft Light
Softer version of Hard Light
Stencil
B * (1 - A.a)
Under
A * (1 - B.a) + B
Xor
A * (1 - B.a) + B * (1 - A.a)

alpha_operation

The alpha channel operation can be:

  • Same: Apply the same operation to Alpha as on RGB.
  • A: Use the alpha from A.
  • B: Use the alpha from B.
 

 

  • No labels