May 21, 2013, 11:49:55 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Prowlie Welcome back! The site migration is complete and normal service resumed.
Advanced search
Pages: [1]   Go Down
Print
Author Topic: Blur FX, CPU usage and Cache Bitmap  (Read 2439 times)
0 Members and 1 Guest are viewing this topic.
aleq
Full Member
***
Offline Offline

Posts: 153


« on: April 17, 2009, 09:56:13 PM »

Hi

I would like to make a camera effect, where the animation in the front (consisting of other symbols, that are moving around with frame by frame technique, and no tweening included) is blurred, and the one in the background is sharp, and then fading to the opposite.

I am aware, that I have to use filters with caution, as they might slow down the older computers significantly. But then I got this idea, to try and switch my Graphic Symbol to Movie Clip and turn on Cache as Bitmap. I haven't really used this feature alot, but I've heard that it is good idea to use on complex vector graphics, to save CPU power, unless I want to scale the symbol (in or out), which then would result in rastering/pixelating (where you start to see the pixels of an image, which looks pretty ugly).

So my actial questions are:

1). In what situation, do you use Cache as Bitmap?

2). Do you think that it would be a good idea to use Cache as Bitmap, for my Blur technique?

3). Is there anything else, you can tell about Cache as Bitmap as a whole: when to use it and avoid it.

I would have tested this my self, but I have no older computer (with slow CPU) to test the SWF on.


Thanks in advance Smiley
Logged
Ranoka
MotM
Heroic
**
Offline Offline

Posts: 2194


« Reply #1 on: November 29, 2009, 05:27:58 AM »

Hey aleq,

1) I would use Cache as Bitmap on a background symbol that doesn't have any animation inside of it. Especially if I want to pan it, or if there are other symbols/animation going on in-front of it. When Flash needs to re-render it, should take less time.

2) Blur is a bitmap effect, so Flash automatically caches your MC as a bitmap whether you like it or not. So setting Cache as Bitmap on in this case won't make any difference.

3) Using one of the bitmap effects isn't bad for performance, as long as you aren't updating the symbol every frame. ie, if the symbol doesn't have any animation and isn't being re-sized then using a static bitmap effect that isn't being motion tweened will be pretty efficient.

Also, turning Cache as Bitmap on for something that is being updated each frame (is a character animation or special effect), then turning Cache as Bitmap can reduce performance because Flash has to re-draw it, and then turn it into a bitmap, which takes longer than the normal just re-draw it process.

By the way,
For a lot of Flash games, the programmers will be using bitmap caching techniques on the character animations, but not in the same way mentioned above though. They'll effectively be generating a character sheet with each frame represented as a different image on the sheet -- just like those mario/sonic sprite sheets you've seen. But they'll be doing it dynamically with code on the fly, to get the benefit of vector's small file space, and bitmap's performance boost.

Incidently, rendering vector takes more cpu and less memory. rendering bitmaps takes less cpu but more memory. So sometimes that needs to be taken into account (like on mobiles with limited memory).

Hope that helps!
Logged
Brackenwood
   

 Logged
Pages: [1]   Go Up
Print
Jump to:  

Theme by Pieter, based on Black Rain by Crip Powered by SMF 1.1.16 | SMF © 2011, Simple Machines XHTML | CSS

Page created in 0.058 seconds with 25 queries.