Jump to content
Search Community

BlurFilter & Performance

ngfl test
Moderator Tag

Recommended Posts

Hi there,

 

Am attempting to perform a simple animation using a combination of the blurFilter plugin and some basic scaling. The idea being that my image (which is just a bunch of Sprites) should tween from a blur of 50/50 and then scale up to simulate a zoom. Now, without the blur tween, the scaling works fine and is nice and smooth. However, if I add the blur tween and then run the scale tween when the blur is finished it runs like crap and CPU usage rockets. I can understand that un-blurring and scaling at the same time would be processor intensive, surely running them concurrently shouldn't make a difference though?

 

Just wondering how the blurFilter plugin works and is there any way to remove whatever overhead it is using before I commence the scale tween? I've tried to remove the blurFilter via "myObj.filters = null" in between blur and scale but it doesn't help, nor does using cacheAsBitmap.

 

Any ideas? am happy to post some code if it helps.

Link to comment
Share on other sites

Yeah, it's tough to troubleshoot blind, but if you want to remove the filter at the end of the tween, just use the remove:true in the filter object, like:

 

TweenMax.from(mc, 1, {blurFilter:{blurX:50, blurY:50, remove:true}});

 

Filters are indeed very processor-intensive, but this has nothing to do with TweenLite/Max. It's just a reality in Flash when dealing with filters.

 

Have you tried making your entire object a BitmapData? Are you currently using a bunch of vectors? That may help a bit.

Link to comment
Share on other sites

Yeah, it's tough to troubleshoot blind, but if you want to remove the filter at the end of the tween, just use the remove:true in the filter object, like:

 

TweenMax.from(mc, 1, {blurFilter:{blurX:50, blurY:50, remove:true}});

 

Filters are indeed very processor-intensive, but this has nothing to do with TweenLite/Max. It's just a reality in Flash when dealing with filters.

 

Have you tried making your entire object a BitmapData? Are you currently using a bunch of vectors? That may help a bit.

 

Thanks for your reply, I actually fixed this by overlaying a BitMap version, blurring that and then removing it before starting the scaling - works perfectly. I shall try the filter removal option though, interested to see how that effects performance.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...