Hello everyone,
i'm using cocos2d to render a certain scene in my application, as CA was too limited. I've got most of the scene itself done, and am currently working on optimizing. It's a landscape with clouds flying through it, sometimes raining. But even without the rain, i'm at a average FPS of 45, spiking 5 FPS around that (40-50 is normal). With the rain (made using a CCParticleRain particlesystem), it drops to 20-25.
However, when i remove the background image (the sky), i'm at a constant fps of 60 without the rain, and 25-30 with the rain (however the rain moves much less sluggish so i suppose the bigger drop is because of more drops actually being calculated in comparison). After i discovered that that background image was the cause, i've been looking in ways to render this image more efficiently. It's a simple fullscreen image, 197KB on disk non-retina and 590 KB on disk retina, in PNG format.
What i've already tried is using a atlas. Currently i'm cutting up the image in 2 even pieces with a CCSpriteBatchNode and adding them to that batchnode, but that did not increase the FPS, or only very marginally. I've also tried adding them to an empty CCSprite, as suggested here: http://www.cocos2d-iphone.org/forum/topic/5196/page/2 (2nd post from the bottom). This also barely helped. I've also used the CCBackgroundSprite suggested in that thread, without any help.
I'm using Cocos2D version 0.99.5. Also, likely not unimportant, i'm using cocos2d in combination with UIKit. I'm developing the scene in a seperate 'tech demo' as I like to call it, and i've added the director to a UIView. This UIView will be added in the rest of the app later and displayed fullscreen. I'm rendering the sky, the landscape and the clouds all in seperate CCLayers. I always add the sky to the scene first, and i've tried both adding all other layers to the scene directly or to the backgroundlayer.
I believe that is all the information for now. I'll be looking further and adding details as I find them, but after 2 days of searching I have not yet found anything working so I would like your input. Thanks in advance! ;)