Jump to content
Search Community

Potential bug with blurFilter? [SOLVED]

tomaugerdotcom test
Moderator Tag

Recommended Posts

I've encountered a very strange thing - in all likelihood I'm just approaching things the wrong way, but take a look at this simple demo: http://www.tomauger.com/sandbox/greensock/screwmeter_blur.html

 

If you watch it for a while with "blur OFF" notice how all the numbers align consistently across the baseline (allowing for slight variance because some numbers are designed to go a little lower for visual balance).

 

If you then switch to "blur ON" you'll see that suddenly the numbers start to jumble a little. And not consistently. You may need to watch (and squint - it's only off by about 1 px up or down) carefully! Could it be a rounding error creeping in?

 

The only difference is in this code:

if (blurOn) new TweenMax(_ribbon, ANIMATION_TIME_SECONDS / 2, { blurFilter: { blurY: Math.abs(new_y - _ribbon.y) * BLUR_FACTOR }, repeat: 1, yoyo: true, ease:Cubic.easeInOut } );
new TweenMax(_ribbon, ANIMATION_TIME_SECONDS, { y: new_y, ease:Cubic.easeInOut } );

 

So the second tween (over .3 secs) is designed to move the numbers (the numbers are a vertical "ribbon" of digits from 0 - 9). This creates the ticker effect.

 

The first tween which is only turned on when the blurON switch is set, just adds a motion blur. Because I wanted the blur to be at its most intense in the middle of the "roll", I use half the animation time (.15) and set a yoyo behaviour.

 

This blur tween as I understand it should have no actual bearing on the y position tween, and yet it seems to?

 

I've also tried playing with OverwriteManager

OverwriteManager.init(OverwriteManager.AUTO);

but that has no effect, at least not in my case.

 

Is this a bug? Should I not be using two tweens? I thought as long as I was tweening different properties, there should be no collision, particularly if OM is set to AUTO.

 

This is production code, so any help would be greatly appreciated! I'd love to take advantage of the blurFilter plugin! Great work on V11!

Link to comment
Share on other sites

great demonstration of the problem and cool effect.

 

I'm pretty certain that the problem has to do with the fact that when you blur something with flash it automatically becomes a bitmap and those bitmaps have to be placed on whole pixel values. I'm guessing that there might be some rounding going on and its jumping to the wrong pixel.

 

what you might want to do is simplify / isolate your blur tween as much as possible (one number/one tween).

 

put an onComplete function on the tween to trace the y value of the clip after the tween completes.

 

 

----

it almost seems that the blur doesn't fully go away. did you try putting remove:true in your deblur tween?

 

TweenMax.to(mc, 1, {blurFilter:{blurX:20, remove:true}});

Link to comment
Share on other sites

Right on Carl, thanks so much for the great suggestions. In the end, remove:true did the trick - you were right, the blur was causing bitmap cacheing and the pixel jump disappeared as soon as the filter was completely removed at the end of the tween.

 

Thanks a million for your help!

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...