1
votes

I've been using Cocos2d 2.0 recently and I've noticed there's a drop in frame rate by about 10-20 frames if I'm using sprites that are half the screen size or larger. This is troublesome as I need at least one full screen sprite for the background.

I've done everything I can to lower draw calls and texture memory, but the only thing that raises the fps back up to 60 is removing the background sprite.

Is there something different about cocos2d 2.0 that I'm missing when it comes to making sprites? I've tried this on multiple devices (iPads and iPhones) and they all have the same problem.

UPDATE: I've noticed that the size of the sprite itself, not its texture, is affecting the frame rate. If I scale the sprite to 0.5 on both the x and y, then I'm at 60fps. If I scale just the x or y axis, then frame rate jumps between 50 and 60 (10 fps better than full screen).

1
How many sprites have you added into your scene? If you just put one background your fps shouldn't drop.Yannick Loriot
I've actually lowered the number of sprites from ~45 to ~30, but the only thing that seems to make a difference is the background sprite. I was using a placeholder before that was half the size and fps was 60, but as soon as I started using larger sprites the framerate drops. I've even tested this with various sizes and anything over half the screen size on the device is causing the drop, unless it is the only sprite in the scene.Chris Strater
What is the format of your background sprite and its size? Is it possible to decrease the quality?Yannick Loriot
Size of the of sprite is the screen size of the device it's on, so right now we have iPhone, iPhone Retina, and iPad with iPad Retina on the way. All sprites are in the pvr.ccz format.Chris Strater
I should note that I did not have this problem with cocos2d 1.x. Could this be a shader or OpenGL ES 2.0 problem?Chris Strater

1 Answers

0
votes

Figured it out. All we had to do was turn our scene's CCLayerColor into a CCLayer. Seeing as we are using a full size background sprite, it was unnecessary to re-draw the background every frame anyway.