The Bloom Post Processing Effect
How does the effect work and how can it be implemented in OpenGL?
Bloom is a very popular post-processing effect in games. It is based on a real-world phenomenon that is causing bright lights to bleed over into darker areas when seen through a lens. While the physically correct implementation wouldn’t be feasible for real-time graphics, there are a few tricks to simulate it efficiently. The implementation takes a few steps but is generally easy to do. However, bloom has to be used with care. Many games have overused the effect, but when applied correctly it can add beautiful highlights.
Physics
Even a mathematically perfect lens cannot focus light into a single point. Instead, the light is focussed on a small bright area with smaller, less bright concentric rings around it. This pattern is called Airy disk and occurs because of the diffraction of the light within the lens. And as you can imagine, camera lenses are never mathematically perfect which enhances the effect.
Under normal conditions with mostly even lighting, this effect isn’t noticeable. However, when a very intense light source is directly next to a very dark area, the Airy disk is bright enough to spill over. Because of this, the light bleeds into the darkness and there is no clearly defined edge between the two.