I wrote another bloom effect algorithm with improved quality. It uses a cascaded algorithm like my old bloom algorithm.
Some months ago, someone found the bug that
Cascaded Blur bloom effect causes strange flashes on screen. On Sep 10, Gig reminded me of this bug and I fixed it now. The bug that caused strange flashes seemed to be fixed, but some small flickers remained — what we call "aliasing". I tried to remove the aliasing, but it turned out that the current Cascaded Blur algorithm is not capable of antialiasing. So I tried another approach, and finally wrote another bloom effect algorithm with
much less aliasing.
PerformanceCascaded Blur 2 is slower than the original Cascaded Blur, but not as slow as the original OpenArena bloom algorithm (r_bloom_cascade=0). Tested on my Lenovo X121e (AMD E-300 1.3GHz with integrated Radeon HD 6310).
Variables- r_bloom_cascade 0=original algorithm, 1=original Cascaded Blur, 2=Cascaded Blur 2
- r_bloom_cascade_blur shift distance of the intermediate image to approximate a gaussian kernel. Value higher than 0.5 does more harm than good. 0=no intermediate blur. 0.32 seems to be appropriate.
- r_bloom_cascade_intensity brightness of the bloom effect. Bloom buffer is likely to saturate when r_bloom_cascade_intensity is high.
- r_bloom_cascade_alpha amount of the wet(blurred) image
- r_bloom_cascade_dry amount of the dry(not blurred) image
- r_bloom_cascade2_lpf_level decides the quality of the input-stage antlialias filter. If the display resolution of your monitor is 2048x1536, the antialias filter would do sampling (2048/256)*(1536/256)=48 times, which is too much. r_bloom_cascade2_lpf_level limits the sampling count to r_bloom_cascade2_lpf_level^2 time(s).
- r_bloom_cascade2_darken count of the darken filters used prior to the bloom algorithm.
These still need tuning.
note: Attached tr_bloom.c is combined with
fromhell's bloom reflection effect and the original Cascaded Blur bloom effect (with glitches fixed)
—
Sorry for my poor English skill (。>﹏<) (and I'm so sleepy when writing this)