Feb 5, 2010

a GLSL depth of field filter with bokeh

This is my first attempt to make a depth of field filter with bokeh (http://en.wikipedia.org/wiki/Bokeh).
I couldn`t find any code example of bokeh effect, so I had to do it from a scratch. Basically I alligned texture samples circularly, instead of vertically and horizontally. That did the trick..

To do: make the bokeh shape hectagonal when apertuare value is raised.

GLSL frag. shader: http://www.pasteall.org/11375


  1. Fantastic!

    I'm loving it on my virus and blood demos in three.js.

    Did you ever write some details for the filter - like how to use the manual DOF, and what "depthblur" flag does? There's some depths to this filter I'd like to explore! (haha)


  2. Howdy! I could have sworn I've visited your blog before but after looking at some of the articles I realized it's new to me. Anyways, I'm certainly happy I found it and I'll be book-marking it and checking back often! Check out our Hosting Discount Coupons