This is my second attempt to create a depth of field shader with bokeh. the first one is here:
And I am really glad that it got popular quite fast.
This one is much more flexible and I have added few new features.
• variable sample count to increase quality/performance
• option to blur depth buffer to reduce hard edges
• option to dither the samples with noise or pattern
• bokeh chromatic aberration/fringing
• bokeh bias to bring out bokeh edges
• image thresholding to bring out highlights when image is out of focus
yet to do
• add multi-shape bokeh (does anyone knows how to make procedural pentagon or hexagon?)
• bokeh vignetting at screen edges
• some minor fixes
fragment shader HERE