I'm trying to understang how can I improve bloom effect quality using all known to me optimizations.
Currently I'm making it as follows:
- Create new texture using some threshold to extracts areas which should glow
- Downsample that texture 4 times (using bilinear filtering - GL_LINEAR)
- Blur each texture horizontally using 5x5 gaussian blur.
- Blur each texture vertically using 5x5 gaussian blur.
- Composite each blurred texture with final image.
I've implemented gaussian blur using Incremental Gaussian Algorithm and set radius to 5. However because of size of last texture after composition bloom has very low quality especially when moving camera:
It doesn't look clear here but you can see it near bunny tail.
Simple workaround to that issue was increasing the radius for smaller textures but then image was more blurred.
Similar effect is when I use solution presented by Philip Rideout.
I get better results when I use blur shader presented here. However I still see some kind of vertical stripes.
I also tried to improve the algorithm by blurring the image and then downsampling it. Then I repeated whole process for the rest of images. But I haven't spotted any difference.
I'm also wonder how it is done in Unreal Engine. I mean how effective blur radius is computed. Documentation claims that each Bloom Size value is "the size in percent of the screen width" and each texture is smaller from previous one 2 times.