well, i guess it's time to reveal the awesomeness that is my bloom filter

the idea came to me when i was sitting on the tram on my way home from a party, experienceing a pretty sweet LSD afterglow

Basically i figured that we waste(read; throw away) so much relevant data when we code stuff. And mainly, for this i was refering to light.. for example, when we add colors together we usually saturate them at 255 to avoid an overflow, and damn thats a waste.. so anyways, i thought of the great idea to use that insight to make a bloom filter, and started coding it as soon as i got home..
as cool as it looks, its actually REALLY simple.. you take the 2 images you want to add, be it source1+source1 or source1+source2, you add them as usual BUT instead of saturating, you pop the overflow into a "glow-buffer", you then blur that buffer with an appropriate blur(in my case a standard slow as hell blur, since i was too lazy to code a box blur for this) and add it to your original scene..
something like this:
function makestuffglow;
begin
for x = 0 to width do
for y = 0 to height do
if source1[x,y]+source2[x,y]>255 then glow_buff[x,y]=(source1[x,y]+source2[x,y])-256 else source1[x,y]=saturate(source1[x,y]+source2[x,y]);
end;
end;
awesome_fast_boxblur(glow_buff);
source1=saturate(source1+glow_buff);
end;
and thats pretty much it.. the Luminance and Saturation parameters i use are just for controlling the brightness/saturation of the glow map before blurring and adding it all together..
there ya go, now let me see you use it wisely in some realtime productions.. and remember, credit where credit is due, or i'll come to your house!!
