Starling Filter Collection

I mentioned this earlier, but it was really just a footnote at the bottom of a previous post, so it may have been easily overlooked. In any case, I’ve set up a Github repo containing a collection of filters for the Starling framework I’ve written (or ported as the case may be) which may be used for personal or professional projects. Of course, if you’re not a fan of Starling or are using another Stage3D framework, you could always just grab the AGAL from these and use it elsewhere.

At the the moment, the collection contains these items:

Warp Filter:

does bezier curve warping on the left and right edges of the display object being filtered. Could be animated to produce a Mac ‘genie’ style effect.

Two Spotlight Filters:

The thing I disliked most about the original version though, is that on rectangular textures, the effect will be oval shaped (stretched by the texture itself). The new version (Spotlight2Filter.as) remains round on any texture and also allows you to adjust the color of the light. No flicker though.

Motion Blur Filter:

Sine Wave Filter:

warps an image in a sine wave fashion. Set to extremes this can be used as a ‘bad tv’ effect. There’s a ticker parameter that lets you animate the effect without adjusting any other settings. There’s also a ‘isHorizontal’ boolean property. Setting this to false will create more of a weird distortion effect rather than a wave effect. Just check out the

Glass Filter:

Hex Filter:

a pixelate effect that creates hex shaped pixels. Oddly enough, this doesn’t seem to work properly in some Flash players (Chrome’s ‘Pepperflash’ for sure, but others seem not to work as well. Go figure). It’s also not compatible with Context3DProfile.BASELINE_CONSTRAINED mode. It’s a pretty cool effect, but use it at your own risk – some viewers may not see what you expect.

Scratched Film Filter:

creates a subtly sepia toned (more black and white, actually) effect with animated scratches. The jury’s still out on this one, really, and I almost didn’t include it. But then I thought, this would make a cool effect on a horror game’s splash page. I don’t know – it may be useful.

Flashlight Filter:

this is my personal favorite and I think it could be useful in a huge number of games. It creates a ‘light cone’ effect with a large number of adjustable parameters (including light color). You can actually do a full 360 degree sweep and use it as a 3rd spotlight option, if you were so inclined. Only downside is that it isn’t compatible with Context3DProfile.BASELINE_CONSTRAINED mode.

If you use any of these and have problems, post a comment here or submit an issue on Github and I’ll promptly ignore it until I have some free time some day. And if you use any of these and don’t have problems, share a link – it would be interesting to see what people come up with.

If you have any filters of your own you’d like to see included, let me know and maybe I’ll add it in or make you contributor on Github. It’d be nice to build up a large definitive collection.

hi, I found the flashlight filter particularly interesting, I was wondering if it’s possible to use it in a scenario with multiple light sources in one pass. currently as far as I can see the filter removes everything outside the cone, and it would be awesome if there is a way to still keep the directional light information for example for pixels/vertices outside the cone. Thanks!

ionut.pusca ·January 16, 2015

Hi,

I was trying to use your chroma filter but I always end up with a blank image.