Flash Bokeh
Sometimes your best efforts to convince clients to originality end up in the trash... but on the other hand there is nothing wrong with it – just shake the dust off and share. This time it's the colourful realtime bokeh effect inspired by this tutorial and programmed for tictoc as a proof-of-concept demo.
Click the image above to preview. Due to expensive alpha and blending processing it may slow down your browser/computer a bit. I've tried two approaches there:
-
Adding and removing circles to the display list (with
cacheAsBitmapturned on). -
Drawing circles onto (transparent and non-transparent) bitmap using
draw()method.
Both methods eat similar processor time. Haven't tried using any GPU wmodes, not sure if that would help at all here, I'll leave it to you - the code is very simple and there's a lot of room for improvements and optimisations.
Considering the recent HTML5 vs Flash war, the challenge is to code a similar effect using JS + HTML5's canvas and compare the speed – is anyone up for it?
Grab the source (AS3, Flash CS4 was used to tween the circle shapes but you could entirely use drawing API if needed) and enjoy!
11:00 AM | posts | 4 Comments | Tags: as3, fx, sourceComments
- felix on May 1, 2010, at 07:18 PM
- Mike on June 5, 2010, at 01:47 AM
- John on November 2, 2010, at 12:03 PM
- Daniel on April 23, 2011, at 12:42 AM
Adding comments disabled for now.

