3

Hey guys I have a doubt about the color burn function in the mix RGB nodeenter image description here in the blender. The formula for the color burn is 1-(1-a)/b, but when I change the first input to 0.8 and the second input to 0 then the color burn function outputs like the image I have provided down below, but based on the formula 1-(1-0.8)/0 gives the value undefined therefore I have a great confusion in the working principle of the color burn function, please guys help me out!

1 Answers1

6

Your formula doesn't take into account the Fac. It is true when Fac=1 though.

The formula for color burn can be found in the source code here. It is

$$\mathrm{result} = 1 - {1 - a \over (1-f) + fb}$$

where $a$ is Color1, $b$ is Color2, and $f$ is Fac. The computation is done component-wise (separately for each RGB component), it's clamped to the 0-1 range, and $\mathrm{result}$ is zero if the denominator is zero.

So for the pictured node, you get $1-(1-0.8)/0.5 = 0.6$.

scurest
  • 10,349
  • 13
  • 31
  • Hey scurest I have similar doubts about how smooth minimum, smooth maximum, and color dodge work, because for smooth minimum and smooth maximum there is no defined formula, is there any simple formula please help me out! Thanks in advance. – Anim goggles Sep 02 '22 at 03:55
  • @scurest Hi! Could you please update full functions of the blend modes with Factor applied to each of them? Please check out my post for more details: https://blender.stackexchange.com/questions/302085/what-are-the-exact-functions-of-blend-modes – Orange Cat Oct 02 '23 at 02:25