# Applying correct light physics to gaussian blur formulas for glow

I am trying to make a glow shader using separable gaussian blurring.

I have recently been inspired by the short youtube video "computer color is broken" and I have messed with it with color interpolation and boy his suggestion is beautiful!

A big thing the video talks about is that this principal should be applied to blurring, however I am pretty confused. I don't really know what to square when and what to sqrt when when values are being added. My current theory is each texture sample for the gaussian blur gets raised by the power of two weighted with a bell curve and added to a sum like usual. At the end the sum is square rooted, but i'm not sure if that is correct. Could someone please confirm? Would this make an appreciable difference that made things worth it?

• No the power is 2.2 usually (read about gamma correction) Commented Jun 30, 2016 at 11:14
• So wait add the sum of your pixels with each one raised to the 2.2 power. And then take that sum by the 1/2.2 power? Commented Jul 1, 2016 at 5:09
• Depends on how pedantic you want to be, a gamma correction of 2.2 certainly is close to srgb but if you really want to be pedantically correct google dor linear to srgb Commented Jul 1, 2016 at 5:27

As noted in the comments, the actual transform is not literally squaring and square-rooting, that's just an approximation (and not that good of one). For the true sRGB gamma transform, see the equations in this Wikipedia article (look down the page for the equations involving $C_\text{srgb}$ and $C_\text{linear}$).