Does a gaussian blur based bloom/glow shader require gamma correction? Any other tips? Hello I have a simple application with some bright 2d mono-color shapes I am hoping to make appear emissive with a nice glow around them. To do that I am producing multiple gaussian blurs of varying kernels and resolutions and adding them all together to create a composite glow.

I have seen many guides mention this and even mention what sizes and kernels they are using to produce their bloom however they never mention the math they used to put them all together. Right now I am assuming it was just regular additive blending.

I was wondering what tips you might have to put this glow effect together effectively as far as if I should do anything other than just adding pixels together to combine the various maps. Should I do something with the weight on certain textures used in the composite? 

I am just trying to composite everything in an optimal manner.

My main concern is whether or not I should gamma correct my glow map or if that is accounted with the weights from the gaussian sampling or source material. Should I gamma correct my blurred composite before adding it to the source image?
In short:

You should not gamma correct your glow map. In fact, you should do everything in a linear color space. At the very end, when doing any color grading (which is the very last step), you convert the final image to the right color space. The color space include that gamma correction.

In long:

Gamma correction is a step in the encoding of images. It is usually done so that we use more bits to store the shadows and less bits to store the highlights, since we see less detail in the highlights anyway. It is also part of some color spaces. These color spaces make sure the image looks the way it is supposed to. It is the final step, often part of color grading. Just before it is send out to the display, or saved to a file. This means that everything before should be in a linear color space.

Usually things would look like this:


Load textures and convert them to a linear space, so you do not double gamma correct..
Render the image.
Do the post effects.
Convert the image to the final color space with color grading. Probably sRGB Gamma. Converting to the color space includes the gamma correcting.

Color grading is not necessary, but optional.


When having everything at linear and doing the gamma correction at the very end, you will need a high precision for the color. Using floating point framebuffers is recommended. When using the default 8-bit framebuffer the whole way, you end up getting banding effects when gamma correcting.

This setup is not always done for games, to my knowledge, since most people will barely notice it or even care about it. In the film industry, VFX and animation, using the proper color space is more important.

When not doing it the 'right' way, the textures are not converted to linear and at the end, there is no gamma correction. Lights are supposed to have a quadratic falloff to be physically correct, but when gamma correcting it with a gamma of 2.0, it becomes a linear falloff. Lights can therefore get a linear falloff and look normal. As Noah Witherspoon pointed out, when blending and blurring you should use a linear color space, however this is not always done either.

The reasons for not doing it the 'right' way, is probably that it still looks fine. You do not need to do it this way, to end up with good graphics. It is always a matter of what the artist likes the most.