Radial blur filter and rotating sprite #490
-
Hi, have issue with radial blur when its applied on rotating sprite. When filter is applied it makes sprite wobble like washing machine. Thank you const sprite: Sprite; // circle image
const motionBlurPoint = new Point(0, 0);
const motionBlur = new RadialBlurFilter({
center: this.motionBlurPoint,
angle: 0,
kernelSize: 15,
});
sprite.filters = [this.motionBlur];
// on ticker
// update sprite angle and then update centre cords
const bounds = sprite.getBounds();
motionBlurPoint.x = bounds.width * 0.5;
motionBlurPoint.y = bounds.height * 0.5;
motionBlur.center = motionBlurPoint; |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Looks like issue gets worse if rotation speed is increased |
Beta Was this translation helpful? Give feedback.
-
Ok after debuging shader code found reason. As element was rotated it bounds were growing and at some point went out of screen. |
Beta Was this translation helpful? Give feedback.
Ok after debuging shader code found reason. As element was rotated it bounds were growing and at some point went out of screen.
And realized that filters default behaviour is to push it back into screen
clipToViewport
. So wobbling was caused by changing bounds that pushed filter result back in screen. Fixed by settingclipToViewport
tofalse