Projects > cpp > Issues > Bug #863

We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.

Create Issue on Github

jpg textures are rendered incorrectly in alpha blend

Bug #863 [Rejected] 2011-11-17 01:02 . Updated about 11 years ago

This bug is reported by JianFeng Zhou, NetDragon

As the screenshot, they use jpeg file as the background texture, but the alpha blend is incorrect when the program run on iphone 4.2 device. If call CCDirector::setAlphaBlending(false), the color will be ok.
I cannot reproduce this bug on my ipad2 ios5.0.1

Should we do something after loading JPG file and before pasting it into OpenGL texture cache? For example, check the alpha bits.

_ccx_jpg_bg_alpha_error.jpg (78.9 kB), 2011-11-17 01:02 2011-11-25 00:27
  • Subject changed from jpg textures is rendered incorrectly in alpha blend to jpg textures are rendered incorrectly in alpha blend 2011-11-27 06:53

So far, NetDragon deal with is bug by these approaches:
# CCDirector::setAlphaBlending(false). The value is true by default, setting to false make the jpg rendered correctly
# Step1 bring in a new bug, the edge of map tiles have a black line. So they called CCTexture2D::setAliasTexParameters(), then the black line changed to an unexpected color, darker then their green tile
# Finally, they cut the map tiles 1 pixels more, use setAlphaBlending(false) & without setAliasTexParameters(), the problem is fixed temporarily.

zhangxm 2011-11-29 18:18
  • Target version changed from cocos2d-1.0.1-x-0.10.0 to cocos2d-1.0.1-x-0.11.0
zhangxm 2011-12-27 23:01
  • Status changed from New to Rejected
  • Target version changed from cocos2d-1.0.1-x-0.11.0 to 9

It is about the usage of OpenGL blend feature, not a bug. 2012-05-25 08:03
  • Project changed from cocos2d-x to cpp
  • Category deleted (1)
  • Target version deleted (9)

Atom PDF

Start date:2011-11-17
Due date:
% Done:


Target version:-