-
Senior Member
Bitmap Caching Bitmaps
Currently working on a game that reqires a lot of mc's on the screen at one time. They are all PNG images and i know what Bitmap cahing dose with vectors.
But... Dose it give any performace boost if i bitmap cach my PNG images?
I figured that bitmaps were automaticly cached, so in theroy its caching each bitmap twice?
92.7 Fresh FM for all your South Aussies - Doof Doof music FTW people!
-
Flash Gordon
Well it won't help if you cache each PNG seperatly..
But if you have like many PNG's that don't change it's position, you
could put them all in one MovieClip, and chache that clip as bitmap.
Bitmap caching gives you a performance boost, if the content does not
change and you don't rotate/skew/resize.
Hope you understand my krautenglish...
My letters on the F1 key have faded, how are yours today?
-
FK's Geezer Mod
Can you explain that more, how to use it, maybe an example. I'm just not getting the cache bitmap thing at all.
-
Flash Gordon
It is quite easy, as far as i understood.
If you have some vectors anywhere, the Flashplayer gotta make pixels outta those vectors to display them. On each frame, the player renders, he calculates those pixels again. If you now tell the player, that the vectors won't change (and nothing more you actually do, setting cacheAsBitmap to true) the player can reuse those already calculated pixels.
If you understood this,it is quite easy to get, when you can't use this caching:
If you want to move the vectors only half a pixel, they have to be rerendered, as
the pixels changed. Same goes for resizing, skewing rotating, well everything, when the pixels can't be reused.
This gets really effective, if you have a vector graphics, which is replicated over and over again and is only moved around or put a filter on..
As for filters: the player has to use a cached bitmap anyways..
Much more i don't know about it.
[edit]
See the "Bitmap cache [5]" section of frantos collected links
http://www.franto.com/blog2/collecte...strom-examples
for examples.. how much faster .. great!
[edit2]
Damn those Paralax examples are down... In his example he
cached PNGs/Vectors and moved them in a 3d like environment,
performance boost of factor 30 in fps...
But the magaris example is still up:
http://www.margaris.de/flash8/bitmap/bitmapcache.html
[edit 3]
In the magaris example the yellow "blobs" are cached for each size
once, just b4 u ask, how he did the resizing
Last edited by McUsher; 11-26-2005 at 05:50 PM.
My letters on the F1 key have faded, how are yours today?
-
FK's Geezer Mod
I'll have to try it. So this won't make the swf any smaller, but will make it easier on the processor to render it?
-
Flash Gordon
Exactly.. it is only about frames per second.
My letters on the F1 key have faded, how are yours today?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|