Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Bitmap animation vs MovieClip animation

Guest
Jun 29, 2011 Jun 29, 2011

Hello,


After reading some articles about increasing performance, I read that if you would cache your movieclip animation to a sequence of bitmaps,

that this would be much faster. So after spending lots of hours I created a bitmap animation class that converts a movieclip to a bitmapanimation.
When I completed it, and did a performance test with about 40 movieclips on a stage size of (1024x900) and set the frameRate to 100 fps
It runned on 58 frames per second. (30 mb memory)


But when I tested it without converting it to bitmaps by doing it the old and simple way of adding the movieclip dynamically on the stage with
also 40 movieclips, it runned even better (61 fps). (4mb) And it did not use so much memory as the bitmap approach was doing.

Then I thought perhaps I was doing something wrong with convertinh to Bitmaps, and found on the internet also a Bitmap Animation Class,

and after testing this one, I got the same result. It seems to run faster if you don't convert it to a bitmap sequence.
I only have experienced negative points, like slower framerates, using more memory, and the prerendering causes a calculation performance pause when compileing. (this is even with the fix to pass the already rendered frames of the movieclip to the next bitmap animatioin class)


I am now confused of what is the best way of creating better pefromance when using the same movieclip animation (like 80 times at once).


Could someone please tell me ?

Thanks,

Regards, Chris.

TOPICS
ActionScript
1.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 29, 2011 Jun 29, 2011

if your bitmap doesn't change (ie, there's not alpha change, rotation change, scaling), you can just enable the cacheAsBitmap property of your movieclip to realize the benefit of animating your bitmap.

your_mc.cacheAsBitmap=true;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 30, 2011 Jun 30, 2011

Hello Kglad, thanks for your reply.
By saying if your bitmap doens't change, do you mean the cachedBitmap? In your example your_mc stays at the same place and
does not get scaled or tweened. But within this movieclip there is a animation that will be converted into bitmaps when enabling cacheAsBitap.

In that case, I tested it and enabling cacheAsBitmap caused a dramatically drop in framerate.


I used a simple shape tween in my example with I created in the Flash IDE.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 30, 2011 Jun 30, 2011

google:  flash cacheAsBitmap

so, you can understand when movieclip's cached bitmap will be changed.  if you change it too frequently, there's no benefit to enabling cacheAsBitmap and may even impair performance.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 30, 2011 Jun 30, 2011

thanks, I will do some more study with cacheAsBitmaps on google!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 30, 2011 Jun 30, 2011
LATEST

you're welcome.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines