With current releases, we should cache the effect, so if the content within the effect does not change, it should not have additional runtime cost. If someone has a good filter shader that looks good and works better than the one we have, that also would be welcome.
Oh, you might try HTML5 with the default WebGL target, it will fallback to canvas if WebGL is not supported, but we have a shader version of the DropShadowFilter which might run better?
Yes, there is an animation within the container sprite (one of the tiles moves), clearly this is complex in terms of calculating the shadow.
I’m reluctant to move from a ‘one size fits all’ approach at the moment, but will look into the suggested options so I can change it, if it appears sensible, later on.
I did a little experiment this morning. I created a drop shadow that had no blur - the performance was the same as with the blur.
I created my own drop shadow (separate sprite, with duplicated assets tinted black) and the performance was fine (adding a blur to it, unfortunately, was similarly laggy.)
What I found surprising was that the drop shadow, when setting blurX & blurY to 0, was still slow. I think there must be something else in the filter which makes it so.
Perhaps it runs the blur, regardless, when it should skip the blur if it is a blur of zero.
There is the implied cacheAsBitmap, though, when using a filter. You could test cacheAsBitmap = true instead of a filter, and compare that performance as well
Where is the actual blur code? (and glow code) I had a quick look, but couldn’t find it. (I found the API stuff, but not the code that would do the business!)
I’m not 100% content with this existing blur algorithm, it doesn’t seem quite right, but it’s good enough for us to get some of these filters (in software). Similar goes for the shader-based effect. Happy for any help here