Comment by codeanticode Tuesday Oct 08, 2013 at 15:15 GMT
factor refers to the alpha channel of the source color (denoted as B in the reference), at least that's the case in OpenGL.
A related note regarding blendMode() in P2D and P3D is that not all the blending modes are available with those renderers (because some blending operations like burn or overlay cannot be modeled using the standard blending equations in OpenGL), see the discussion in this issue from the processing repo processing/processing#2075
The documentation could be made much clearer with just a few changes. If you call the parameters c1 and c2, use the same names in the BLEND formula, C = A_factor + B. Can you say instead "returns c1_factor + c2"? And then you simple must explain what "factor" is. It's not a parameter. Is it a global variable? Are you sure that's even the right formula? Shouldn't it be "c1 + factor*(c2 - c1)"? Where factor ranges from 0 to 1.
I am provisionally adding @alignedleft to this. He's great at this. I think the priority is to get the blendMode() reference visual and on par with the blend(). If anything changes to explain what factor is or to modify the equations, they should happen with both reference entries.
Activity
processing-bugs commented on Jun 9, 2014
Tuesday Oct 08, 2013 at 15:15 GMT
factor refers to the alpha channel of the source color (denoted as B in the reference), at least that's the case in OpenGL.
A related note regarding blendMode() in P2D and P3D is that not all the blending modes are available with those renderers (because some blending operations like burn or overlay cannot be modeled using the standard blending equations in OpenGL), see the discussion in this issue from the processing repo processing/processing#2075
mvs202 commented on Nov 30, 2014
re http://processing.org/reference/javadoc/core/processing/core/PImage.html#blendColor(int,%20int,%20int)
The documentation could be made much clearer with just a few changes. If you call the parameters c1 and c2, use the same names in the BLEND formula, C = A_factor + B. Can you say instead "returns c1_factor + c2"? And then you simple must explain what "factor" is. It's not a parameter. Is it a global variable? Are you sure that's even the right formula? Shouldn't it be "c1 + factor*(c2 - c1)"? Where factor ranges from 0 to 1.
REAS commented on Oct 2, 2015
I am provisionally adding @alignedleft to this. He's great at this. I think the priority is to get the blendMode() reference visual and on par with the blend(). If anything changes to explain what factor is or to modify the equations, they should happen with both reference entries.
REAS commented on Oct 2, 2015
Here's an awesome reference for this from @JakubValtar: processing/processing#2921