iphoneopengl-esglblendfunc

How does the OpenGL Blend equation work?


opengl ver: opengl es 1.x platform: iphone

The blending equation:

(Rs Sr + Rd Dr, Gs Sg + Gd Dg, Bs Sb + Bd Db, As Sa + Ad Da)

How does it work? I don't understand if I set both src and des to GL_ONE, and I have src color red (255,0,0) and des color black (0,0,0), the result will be (0,0,0)

Can someone explain how the equation work, or maybe show some calculation.

Thanks


Solution

  • if you set src and dst to GL_ONE, you will not get black.

    The result is (Rs + Rd, Gs + Gd, Bs + Bd) (as Sr = Sg = Sb = Dr = Dg = Db = 1)

    Which in your case of (255,0.0) and (0,0,0) will give (255,0,0).