Author Topic: Bloom/Fake HDR Theory  (Read 2800 times)


  • Guest
Bloom/Fake HDR Theory
« on: 2008-Jul-11 »
As some of you probably know I'm currently writing on an easy to use effect system for GLBasic. I have thought about how to achive bloom and here is the theory how I will try to achieve a good Bloom effect:

1. Copy the rendered screen so you have 2 screen textures in the shader
2. If the red-value OR the green-value OR the blue-value of the current pixel >= 127 then set all 3 color values to 255
-> this will lead to a Bloom screen texture similar to glow textures that are used in games like Hellgate London or Tron 2.0. But instead of 2 renderpasses where we use glow textures for our models we will use the new monochrome texture for fullscreen bloom. Of course the value of 127 can be edited, I will use a uniform variable in the system for that.
3. The difficult part: blurring the texture. The easiest way to do that would be to apply a Gaussian blur. There are examples on the net and my experiments have thought me that the results are better when using 2 Gaussian blurs (one level and one upright) instead of one combined blur pass.
4. blending the original screen texture and the Bloom screen texture together. Gernot had a nice example of doing multitexturing on the shader and you can combine the screen texture and bloom screen texture in a similar way.

I don't know if that was interesting. It's a quite short theory and I might be unclear on some things but you should get an idea of what's going on in the effect system  =D