is a visual effect where the bright parts of an image seem to have fringes that
extend beyond their boundaries. Sources
of bright light “bleed” into other areas of the image.
: Elephant’s Dream
can mimic this effect by determining which parts of the image are bright. Then,
blur those bright parts, and add the blurred result back into the image.
How to create bloom (Greg's recipe)
- Pass 1:
Render the scene to texture using FBO1.
- Pass 2:
Render a full-screen quad using the texture from pass 1 to texture using
FBO2. In the fragment shader,
fragments with brightness below a threshold to zero.
- Pass 3:
Render a full-screen quad to the default framebuffer. In the fragment shader,
a blur using the texture in FBO2
it to the original image using the texture in FBO1.