hi all! i have an animation(5 frames) for background for iPad. But fps is too low when i play animation. Actually there should be effect like one frame smoothly turn into next frame. To reach that effect i decided to use CCFadeIn and CCFadeOut actions or change opacity in the "tick" method. But anyway fps is too low. In which way i can increase fps? Maybe there is other way to reach that effect?
how to increase fps?
(20 posts) (8 voices)-
Posted 1 year ago #
-
Is this on the device or simulator?
Posted 1 year ago # -
now it is on the simulator but i will check out it on the device(approximately through 1 hour and 30 minutes)
Posted 1 year ago # -
for background for iPad
Are you animating the full background image? This could be the reason for the low fps. Ok, simulator is slower than on device, but you won't get good results on device, too.
Some time ago, I tested this on iPad:
- 1 background image RGB565
+ 1 layer on top, full size RGBA8888
= 60 fpsOne additional layer slowed it down by 20 fps.
If you don't need to animate the complete background image, try to use a layer on top of the background for the animation and make this layer as small as possible.
Posted 1 year ago # -
ok, thanks to all. I decided to use static background.
Posted 1 year ago # -
What we did that raised our FPS from 40 to 60 was to simply split 1024x768 background into segments of 256x256 each
Posted 1 year ago # -
Nice idea. Thank you.
Posted 1 year ago # -
I can second what MikeSz said.
I build my background ( 320 * 480 ) out of 80*80 tiles in a CCSpriteBatchNode.
I then do this twice, and alphablends between the two for effects.
Looks wicked, and runs like Ben Johnson on steroids ( hmm ... ) on an old 3G.Posted 1 year ago # -
Frankly speaking I don't see why 80x80 pixels would be optimal size... I'd understand 128x128 but 80x80... Not really
Anyways, the reason is the lack/inproper NPOT (Non-Power of Two) rendering. Back in the old days graphics card could only render chunks that were POT. So if you tried to render something like 257x257, it would take as much texture bandwidth as 512x512 image. So what I think happens on iPad is that this 1024x768 is actually treated as 1024x1024 texture. Split it into smaller pieces and it works brilliantly
Of course - once you split it too much, you start to have hell-of-a-lot smaller sprites, and that kills the GPU as well. I made tests and 128x128 worked very well, so did 256x256. But when I tried 16x16 the fps dropped really low - which is not surprising, as you need 3072 images of that size to cover the background ;)
But why 80x80 and not 128x128 or 64x64 ? I've got no clue either
Posted 1 year ago # -
Weeeeeellllll ... *spits and snorts*
I am actually dynamically building an endless map, and 80 * 80 fits in both directions, plus it gave me enough randomness in my map. Check my blog, and you can see it in action.
As I understand it, rendering 80*80 doesnt take any longer than ... very very fast ... it only has a slightly larger memory footprint because I waste up to 128 * 128. So pushed hard, I could probably have gained a bit of memory using 64*64 ... but hey ... these are small numbers, and we all make mistakes. Ex last week I met this gorgeous woman, but ended up dating her daughter.
My point was, that I can render 2 full screens, and alfablend them, build from 80*80 pixel tiles, without any problems on a 3G, and I at least suspect, that rendering several smaller tiles from a spritemap, actually might be easier on memory, that rendering those large ones.
Posted 1 year ago # -
Ah, ok then ;) Misunderstood a bit, thought that you meant that 80x80 is some 'magic' number ;) But yeah - if it works than it works, good for you ;)
PS: Let's just hope your new date is not underage :P
Posted 1 year ago # -
Looking back, I have no idea why I didn't chose 64 * 64
Posted 1 year ago # -
I've been reading this forum for about a year, and this is the best comment I have read to date:
"... last week I met this gorgeous woman, but ended up dating her daughter."
THIS HAPPENED TO ME, except is was an Aunt / Niece combination, and it was Halloween, and I ended up with the Aunt, and I was dressed up as Rocky Balboa, and in the morning she stole one of my houseplants.
Posted 1 year ago # -
Pics or it didn't happen ...
Posted 1 year ago # -
and in the morning she stole one of my houseplants.
Well worth the price I think. Maybe I can find someone to steal my dead orchid…
Posted 1 year ago # -
OK, you asked for it, here is a picture:

It is called a "Goldfish" plant, and I really miss it.
Posted 1 year ago # -
An aunt for a plant ... that is a fair trade!
Posted 1 year ago # -
If she stole one of your houseplants, doesn't that mean you failed to "treat" her right? That's how the Halloween thing works, right?
Posted 1 year ago # -
Hopefully she's at least feeding the fish!
Posted 1 year ago #
Reply
You must log in to post.