This is an update from the previous post on DoF bokeh shader.
The main addition is an option of pentagonal shape bokeh. The technique is hackish, but it works. Still I am looking for a more simpler way to make procedural n-gonal shapes of sampling.
The shader is made on 2006 iMac with Mobility Radeon card so it should work on any hardware supporting OpenGL
Screenshots are captured with high sample count, but the point is to show the features and capabilities of the shader.
some of the main features explained with images:
threshold & gain:
brings out highlights by "threshold" value and enhances them with "gain"
as you can see this is the main part that makes the distinct look of the bokeh blur. Without bringing out highlights, the blur looks like just a regular circular blur.
adds chromatic aberration for the blur (small overlay image shows r,g,b color offset of the sample)
shifts the weights of the samples on the bokeh edges
pentagon shape of the bokeh (still needs some work)
edit: i have removed the "scale" factor, it is now automatic.
GLSL frag shader: HERE