Friday 12 April 2013

A Bloom by any other name would smells as sweet

So this blog, as mentioned in the title, is about an effect that has made games look so, so, so sweet. And that effect is bloom. Now back in the day, when I was a kid there were no fancy shaders like bloom to make things look awesome. When you played games you played them with harsh edges, blocky models, and everything was rendered EXACTLY how it was originally, and you liked it. But today shaders are everywhere in games, you can't imagine games without them anymore and one of the most used effect is bloom. Bloom is an effect that, essentially, blurs an area of a model or a model itself that is emitting or reflecting, or generally sending light into the camera so that it gives the lights are softer and brighter look.


So how is this done, well the first part is to know that bloom has 2 main parts, one is the creation of something called a glowmap. A glowmap is just a texture used to map the parts of the scene which will emit light. Remember to disable the colour writes then draw all the non-lighting stuff to the frame buffer object. The GPU will write the depth values to the FBO. The other part of bloom is the enabling of the colour writes again and drawing of all the glowing parts of the scene. So to reiterate, to create bloom render the glowmap then blur it using a Gaussian blur. Once this is done blend it the rendered scene using additive blending. This matches the edited scene perfectly as I used semitransparent layers coloured white to increase the brightness of the colours.














Sources

http://devmaster.net/posts/3100/shader-effects-glow-bloom

No comments:

Post a Comment