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 comment:

  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)