Home Technical Talk

Flash CS5,filters and cpu performance

polycounter lvl 10
Offline / Send Message
melviso polycounter lvl 10
I wanted to ask if there is a workaround to improving performance of playback in Flash after adding filters like blur,glow e.t.c.Noticed some sort of lag in Flash.
Someone said something about converting the object with filters to bitmap in Flash.How is that done?I am kinda tired of exporting frames to photoshop to add filters.I use Flash cs5 or do the newer versions handle filters better.I use a quad core processor and 4 gig ram.
Thanks.

Replies

  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    Cache as bitmap is a quick and cheap trick in flash to speed up sometimes cases such as filters or very complex vector shapes that would take to much time to recompute on every frame. What it does is that it caches the complex content within that movieClip as a Bitmap - so it doesn't redraw it on every frame when running.

    8325684198_564e839286_o.gif

    The thing is you can only cache as bitmap MovieClips (or displayObjectContainers in AS3 language vocabulary). The gif shows you the basics, create your content, wrap it into a MC and check "cache for bitmap".

    You can do the same in Actionscript by setting
    myMovieClipInstanceName.cacheAsBitmap = true;
    


    The thing is with these cache as bitmap, it only gets you better performance if you don't:
    • rotate
    • scale
    • skew
    the movieclip container with the cacheAsBitmap flag set. Because if you do that flash has to re-update that cached bitmap which comes close to wasted effort.
    So you can pretty much only re-position that cached bitmap otherwise you'll loose its benefit.

    If you are making something that depends heavenly on performance such as high fps games avoiding this stuff is essential and like you said baking it in advance might be a better call.
  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    Thanks for the explanation.Understood everything clearly.
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    melviso wrote: »
    Thanks for the explanation.Understood everything clearly.
    nice to hear
Sign In or Register to comment.