LogoLogo
  • Home
  • Projects
  • About
  • Contact

Starling ‘God Ray’ Filter

by Devon O.· March 10, 2013· in Actionscript, Shaders· 22 comments
While cruising the internet today looking for interesting things to try out, I ran across this fun little GPU Gem about creating a post-process volumetric lighting effect. With a little bit of work I quickly ported it over to an AGAL shader (you can see it on Wonderfl here). Then I figured what the hell, why not make it into a Starling filter. I should say right off the bat that this won’t work in ‘baseline constrained’ mode (i.e. no mobile apps), but if you’re working on a web or desktop project, this filter will give you an effect like this. The entire filter is below. Enjoy.   [crayon-603b32549b272192750481/]
Read More

Alpha in Starling Filters and Basic Branching in AGAL

by Devon O.· December 09, 2012· in Actionscript, Shaders· 3 comments tags: agal, starling
Back in September, a Chris posted a comment on this blog asking about a Starling filter that would create a circular mask over an image. Being the lazy sort I am, I never got back to the commenter (Sorry, Chris). Some stuff I was doing at work the other day reminded me of the question, though; and, although it’s a relatively simple thing to do, the task raises two interesting problems I thought deserved a whole post rather than just a quick response. In plain English to create a circular mask we would want to do something like this: Find the distance of every pixel in an image from the center of our circle. If that distance is greater than the radius of our circle then we should set its alpha to zero. Well, to find distances we can turn to the good ol’ Pythagorean theorem – distance equals the square root of distance x times distance x plus distance y times distance y (I’m still amazed I use information I learned in high school in my day to day life. Who’d a thunk those teachers were on to something?). In a sort of pseudo/AS3 code, our operation may look […]
Read More

One More Filter For Starling

by Devon O.· September 10, 2012· in Actionscript, Flash, Games, Shaders· 5 comments tags: starling
As an addendum to the post I made yesterday, here is one other filter which can be used in the Starling framework that could probably come in quite handy for a few. In essence, it’s sort of a spotlight effect that illuminates a specified oval area of a Starling DisplayObject. Though I mainly see it being used for games where you only want to light up an area around your player (to move the light around, you just adjust the centerX and centerY properties), I suppose it could also produce a nice vignette effect as well. In any case you can see an example here. After the swf loads (around 200k or so), move your mouse around to see the filter in action. And if you’re looking for a flickering torch/dying flashlight or old movie effect, you can set the useFlicker property to true. In the example, clicking the image will toggle the flicker. As usual, feel free to play around and use it as you’d like. [crayon-603b3254a468e613482393/]
Read More

Filters in Starling

by Devon O.· September 08, 2012· in Actionscript, Flash, Shaders· 15 comments tags: agal, starling
Just in case you happened to miss it, the most recent version of the Starling Framework (the one which you can pull from Github, that is) now supports custom filters. You can check out the official announcement here. Using filters in Starling couldn’t be easier – you just assign a filter to the filter property of any Starling DisplayObject, like so: myStarlingMovieclip.filter = myStarlingFilter; Creating your own filters is also pretty easy – assuming, that is, you have a moderate handle on AGAL and can write a decent fragment shader. To do so, just extend the FragmentFilter class and in the createPrograms method drop in your own fragment shader. In the activate method, you can upload whatever constants the shader requires to the Context3D instance (which is accessible as the variable ‘context’). I’ve written two myself, so far: a PixelateFilter (which was improved by Daniel Sperl of the Starling / Gamua team), and a NewsprintFilter which produces a kind of black and white halftone effect (the controls of this filter are kinda touchy and can produce some very bizarre and unexpected results. The default settings make a nice effect, in my opinion, and you could just leave them as is if […]
Read More

Learning AGAL with AGALMacroAssembler and OpenGL Examples

by Devon O.· June 03, 2012· in Actionscript, Flash, Shaders· 16 comments tags: agal, agalmacroassembler, glsl, opengl, stage3d
So the other day I sat down and thought to myself: self, it’s high time you learn you some of this new fancy pants AGAL that’s all the rage these days. Now, after a few days of playing around I am by no means a master at the art of shader programming, but due to the still huge lack of available material on the subject, I figured I’d share a few things I’ve learned. Please feel free to post some comments correcting me where I’m wrong as I’m bound to be. I’m hoping though, that this may help out a few folks who, like me, learned programming via actionscript and have never actually written a shader in their life. I’m not going to go into the very basics of AGAL and uploading index and vertex data. There are plenty of tutorials out there about that. And if you’re looking for a book, this one by Christer Kaitila (aka Breakdance McFunkypants) is fantastic. In fact, here, I’m only going to use the utmost basic of vertex shaders and focus entirely on fragment shaders. I know when most people start getting into shader programming they jump straight into the world of 3D. If […]
Read More
  • 1
  • 2
  • 3
  • 4
Devon O. Wolfgang

AIR | Unity3D | AR/VR

Unity Certified Developer

Technical Reviewer of “The Essential Guide to Flash CS4 AIR Development” and “Starling Game Development Essentials”

Reviewer of “The Starling Handbook”

Unity Engineer at Touch Press.

Categories
  • Actionscript (95)
  • AIR (16)
  • Flash (99)
  • Games (7)
  • Liberty (13)
  • Life (53)
  • Shaders (20)
  • Unity3D (21)
Recent Comments
  • MainDepth on Unity Ripple or Shock Wave Effect
  • Devon O. on Unity Ripple or Shock Wave Effect
  • Feral_Pug on Unity Ripple or Shock Wave Effect
  • bavvireal on Unity3D Endless Runner Part I – Curved Worlds
  • Danielius Vargonas on Custom Post Processing with the LWRP
Archives
  • December 2020 (1)
  • December 2019 (1)
  • September 2019 (1)
  • February 2019 (2)
  • December 2018 (1)
  • July 2018 (1)
  • June 2018 (1)
  • May 2018 (2)
  • January 2018 (1)
  • December 2017 (2)
  • October 2017 (1)
  • September 2017 (2)
  • January 2017 (1)
  • July 2016 (1)
  • December 2015 (2)
  • March 2015 (1)
  • September 2014 (1)
  • January 2014 (1)
  • August 2013 (1)
  • July 2013 (1)
  • May 2013 (1)
  • March 2013 (2)
  • December 2012 (1)
  • November 2012 (1)
  • September 2012 (3)
  • June 2012 (2)
  • May 2012 (1)
  • April 2012 (1)
  • December 2011 (2)
  • October 2011 (3)
  • September 2011 (1)
  • August 2011 (1)
  • July 2011 (1)
  • May 2011 (2)
  • April 2011 (2)
  • March 2011 (1)
  • February 2011 (1)
  • January 2011 (2)
  • December 2010 (3)
  • October 2010 (5)
  • September 2010 (1)
  • July 2010 (2)
  • May 2010 (5)
  • April 2010 (2)
  • March 2010 (7)
  • February 2010 (5)
  • January 2010 (5)
  • December 2009 (3)
  • November 2009 (1)
  • October 2009 (5)
  • September 2009 (5)
  • August 2009 (1)
  • July 2009 (1)
  • June 2009 (2)
  • May 2009 (6)
  • April 2009 (4)
  • March 2009 (2)
  • February 2009 (4)
  • January 2009 (1)
  • December 2008 (5)
  • November 2008 (2)
  • September 2008 (1)
  • August 2008 (6)
  • July 2008 (6)
  • June 2008 (9)
  • May 2008 (4)
  • April 2008 (3)
  • March 2008 (4)
  • February 2008 (9)
  • January 2008 (7)
  • December 2007 (6)
Copyright © 2021 Devon O. Wolfgang