Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone Cocos2D - list of blending modes available for a sprite and how to set them

I am googling around to find a list of all blending modes allowed by sprites on Cocos2D, but could not find one. Quartz can do these blending modes, and I am sure Cocos2D can do it too.

  • ModeNormal
  • ModeMultiply
  • ModeScreen
  • ModeOverlay
  • ModeDarken
  • ModeLighten
  • ModeColorDodge
  • ModeColorBurn
  • ModeSoftLight
  • ModeHardLight
  • ModeDifference
  • ModeExclusion
  • ModeHue
  • ModeSaturation
  • ModeColor
  • ModeLuminosity

The only one I could find on google was "additive", that I think is screen. That is set like this:

[proxy setBlendFunc: (ccBlendFunc) { GL_SRC_ALPHA, GL_ONE }];  // example of additive blending

I am not even sure if this is screen.

So, where do I find such a list and instructions on how to set each one?

thanks.

like image 898
Duck Avatar asked Jan 18 '23 07:01

Duck


1 Answers

You will find a detailed description of OpenGL blend modes here. And if you want to try things out, there's a wonderful visual glBlendFunc online tool.

like image 127
LearnCocos2D Avatar answered Feb 20 '23 00:02

LearnCocos2D