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);
3 reposts34 likes
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);
3 reposts34 likes
I made a simplified disc blur example of this with GameMaker, here: github.com/XorDev/Bokeh...
And if you have no idea what gamma correction is, I wrote about the topic in detail here: mini.gmshaders.com/p/gamma