Issues with dropshadow filters

Hi, im getting some issues with drop shadows on latest haxelib version:

            output = new DropShadowFilter(inputDropShadow.distance,
                                          inputDropShadow.angle,
                                          inputDropShadow.color,
                                          inputDropShadow.alpha,
                                          inputDropShadow.blurX,
                                          inputDropShadow.blurY,
                                          inputDropShadow.strength,
                                          inputDropShadow.quality,
                                          inputDropShadow.inner);

Firstly an inner shadow doesnt seem to work:

inputDropShadow.distance: 1
inputDropShadow.angle: 45
inputDropShadow.color: 8947848
inputDropShadow.alpha: 0.2
inputDropShadow.blurX: 2
inputDropShadow.blurY: 2
inputDropShadow.strength: 1
inputDropShadow.quality: 3
inputDropShadow.inner: true

image

And an outer shadow doesnt look right either:

inputDropShadow.distance: 1
inputDropShadow.angle: 45
inputDropShadow.color: 0
inputDropShadow.alpha: 0.2
inputDropShadow.blurX: 2
inputDropShadow.blurY: 2
inputDropShadow.strength: 1
inputDropShadow.quality: 3
inputDropShadow.inner: false

image

IIRC filters have only just been added (?), so im guessing they will need a few iterations before they get the Goldilocks approval, but i figured it mention the issues just in case no was aware of them.

Cheers,
Ian

Yep, ultimately this has to do with the blur implementation we have. If we can get it to improve, then it should be possible to approximate these filters more accurately

1 Like

Thanks Josh - i figured that was the case.

As a follow up to this, filters also are affecting clip rects. Examples:

With filters (components with a filter dont get clipped):
image

Without filters (.progress { filter: none }):
image

Again, just an FYI… for now ill disable filters in HaxeUI :slight_smile:

Can you tell what method is being affected? Is this sprite.getBounds, or some other method, that is affecting the rectangle?

Im not 100% sure - ill do a little digging and see.