0

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

genpfault
  • 51,148
  • 11
  • 85
  • 139
Leo
  • 385
  • 5
  • 17

1 Answers1

0

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).

Bahbar
  • 17,760
  • 43
  • 62
  • Ya, that is what I think the result will be. I am using cocos2d and the outcome is not what I expected. So there must be something wrong with my game logic – Leo Oct 15 '10 at 01:14