FPS drops when drawing full screen background

I use CCSprite to draw my background which entirely cover the full screen.
Normally the game without drawing bg texture is running normally at 60 fps, but when add it the performance drops to around 15-25 fps.

I googled search and try the solution to wrap the bg CCSprite in another CCSprite which created as empty placeholder, but it won’t work either. Take a look http://www.cocos2d-iphone.org/forum/topic/5196/page/2#post-45297 or http://stackoverflow.com/questions/3899903/how-to-draw-a-background-fast-in-cocos2d.

Please note that, fps drops when testing with simulator, but when I test it on real device (iPad 2) the fps is back at 60 fps. The sample project i used is a tutorial from cocos2d-x, and i add another background to draw.
I am not sure whether we can set which iPad or iPad 2 to test against in simulator.

Do you have this kind of issue ?

PS. I also notice the fps drops to around 40 when doing the switching scene, I use CCTransitionFadeBL, and CCTransitionFade. But for all not being seen the fps drops when testing on real device.


Screen_Shot_2011-12-21_at_10.42.20_AM.png (716.8 KB)


Screen_Shot_2011-12-21_at_10.41.38_AM.png (1393.3 KB)

A secret weapon for you.
@ pBgSprite->setBlendFunc( (ccBlendFunc){GL_ONE, GL_ZERO} ); @
Have a try.

I have tried that but no fps gained as tested on simulator.

I used the following code.

CCSprite *bg = CCSprite::spriteWithFile("desert_background_hh.jpg"); bg->setAnchorPoint( ccp( 0, 0)); bg->setPosition( ccp(0, 0)); bg->setBlendFunc( (ccBlendFunc){GL_ONE, GL_ZERO}); this->addChild(bg);

Any further advice.

Please note that, fps drops when testing with simulator, but when I test it on real device (iPad 2) the fps is back at 60 fps. The sample project i used is a tutorial from cocos2d-x, and i add another background to draw.I am not sure whether we can set which iPad or iPad 2 to test against in simulator.

iOS Simulator render graphics slow than device. so, test fps on your device.

I take that as a note as always, thanks you guys !

In addition as per Walzer’s suggestion on setting the blending function, I can feel it’s a little bit running smoother. Thanks for that.
And thanks again YuLei.