Post

Reminder to use gamma correction in your Gaussian blurs for that rich bokeh effect. Inside the blur loop: blur_sum += pow(tex_rgb, GAMMA); And encode for the final color: gl_FragColor.rgb = pow(blur_sum / blur_num, 1.0/GAMMA);

Pow is relatively expensive, but you can do a gamma of 2.0 just by multiplying tex_rgb * tex_rgb and using one sqrt on the resulting average. It’s a good approximation for gamma 2.2 and much cheaper!