I have a full-screen bitmap with various degrees of transparency which sits atop the rest of my view (except for the HUD) and it seems to really reduce the performance of my application. I was wondering what sorts of things I could do to address this problem? I've thought of slicing it up so that the transparent regions are smaller .pngs, and the rest an opaque bitmap, but am less than convinced of its merit. Any suggestions are welcome--thanks in advance!
24 bit .png overlay reducing framerate
(5 posts) (3 voices)-
Posted 1 year ago #
-
See the Programming Guide : Best Practices.
http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:best_practicesTry to reduce the texture pixel format: use 16 bit, or pvr images. You are triggering the fill-rate limitation.
Just remember that the textures use power of 2 values:An image of 260x520 will occupy 512x1024!
But an image of 256x512 will occupy 256x512!Posted 1 year ago # -
Thanks, riq. Yeah, I've been through the best practices and for this case my only option is a full 24 bit image. i'm hoping it's possible to break this down, perhaps committing it to the same sprite sheet as the HUD since that's the only thing drawn on top of it.
Seems I'm experiencing the same thing as in this post: http://www.cocos2d-iphone.org/forum/topic/6755 (and the one it links to).
Anyway, there's lots I can try, I was just hoping to find some advice from someone who's been through this already. Thanks again!
Posted 1 year ago # -
Transparent images kill performance. The alpha/opacity/transparency calculations apparently take a lot of time. Slicing your background image into different parts in a way that reduces the number of empty/zero-alpha regions will give a tremendous increase to your frame rate.
The only difficulty is correctly aligning the sliced images, which isn't that hard if you can wrestle your art team into giving you the coordinates :)
Posted 1 year ago # -
very right! i sliced it up last night and am back at a steady 60fps (was dipping to ~40). thanks for the help!
Posted 1 year ago #
Reply
You must log in to post.