I make bloom to LDR, that's why saturate(). I don't like bloom output in HDR (personal preference). The default setup of file as it is uses Sigma value of 6, which is equal to a blur of 35 pixel wide (both horizontal and vertical) in fullscreen, or when computed on 512 texture when screen is 1920x1080 it is 9 pixel wide blur. In my setup I use Sigma of 24 which is a lot wider; 149 pixel wide blur, which on 512 texture is 40 pixel wide blur. I am aware that computing against depth cause some aliasing... the mix I use using;
bloom += lerp( srcbloom * Sigma.x, bloom1, smoothstep( d-d1, d, d1 ));
bloom += lerp( srcbloom * Sigma.x, bloom2, smoothstep( d-d2, d, d2 ));
Makes this a bit less of an issue because it mixes smoothly when depth between 2 objects is not too large. In some cases there may be some aliasing but it is manageable.
Interesting. Similar bicubic as done in Prepass?Partially possible to implement bicubic filtering in postpass shader for low resolution textures, huge quality boost, but still with artifacts noticable when rotating camera on small bright objects, so bigger blurring range must be used anyway.
I'll do some testing.
PS.
This works correctly. Some reference material where it comes from:for(int i = 1; i < LOOPCOUNT && SigmaSum < Q; ++i)
http://http.developer.nvidia.com/GPUGem ... _ch40.html
SigmaSum basically contains the completeness of Gaussian curve... if SigmaSum=1.0 then there's no further weight left to compute. The weights themselves are computed using Sigma.xyz. Q is quality factor because Gaussian has a lot of values with very low value which cannot be seen in game anyway. So by setting Q to something like 0.9 one would compute the Gaussian curve until it reaches a total weight of 0.9 and then exit the loop. It has almost no visual difference but is much cheaper.
Sigma=24 needs a total of 139 loops to become complete but already reaches 90% of the bell curve after 39 loops. The last 10% is very heavy and you cant see difference as it's too minimal. So I just build that quality factor in to exit loop and not doing very heavy computation for nothing.