can anyone here provide me examples of _good_ bloom code? By good I mean reasonably optimized, well written C/C++ and modern GLSL code that produces quality picture? There are plenty tutorials on the web but somehow nothing has yet satisfied my taste Any clues would be appreciated.

take screenfilter it so lower levels do not blur.downsizesmudge it horizontally (yay 2d guassian blur)smudge it verticallyrepeat about 3 timesadd each layer over your original scene.

guassian blur can be achieved with 3 samples:0.3125*sample[x-1.2] + 0.375*sample[x] + 0.3125*sample[x+1.2]the 1.2 and numbers give you a result equal to 1 with a 5-pixel-wide kernel thanks to GL_LINEAR sampling.you can smudge it in one pass if you want 9 lookups instead of 6+a write I suppose. separate directions means you can scale up the kernel size a bit more easily without squaring the number of lookups, but hey, your implementation your code.the downsize part allows your smudging to spread further away.

that's what fte does. only stuff above the threshold gets blured. the downsizing stuff is meant to average each pixel rather than just dropping random ones to avoid random flickering.the spread is pixel-based, which limits the distance bloom spreads. at higher resolutions, you might need to increase the number of downsize iterations, which is a significant annoyance. As I only use a fixed iteration count, the speed doesn't drop too exponentially with higher resolutions, but stuff doesn't spread so far either.

Bad bloom is a pet peeve of mine, though it's gotten a lot better over the last couple of years.Use multiple iterations like Spike said, it makes a huge difference visually.Blur during downsampling to avoid pixelation, reduces crawling pixels when moving around.Bluring with small kernel size during upsampling reduces the 'bilinear-look', incase you can afford it.Don't use straight addition in LDR, it blows out stuff and creates garish colors, prefer 'screen' blending or something similar.Subtract unblurred frame from blurred for certain things (eg. sky lighting spilling over edges).Google for "Kawase" light streak filter for filter with a less uniform look.You can select brightest pixels in low res buffer and splat pointsprites (inferring color).Don't overdo it