bloom effect

Posted By: Buluen

bloom effect - 01/10/05 13:35

is there a bloom/glow effect for 6.22? I think theres one for 6.31 but im experimenting on how good I can make 6.2 look with dx8 shaders. And bloom would be
perfect. I know its possible for ps less then 2.0
Posted By: Drew

Re: bloom effect - 01/10/05 15:01

its 2.0 though....hope it helps

http://www.conitecserver.com/ubbthreads/showflat.php?Cat=&Number=468850&page=0&view=collapsed&sb=5&o=&fpart=1#468850
Posted By: Buluen

Re: bloom effect - 01/10/05 22:16

is it hlsl?
Posted By: Matt_Aufderheide

Re: bloom effect - 01/11/05 01:45

Yes it is.. this wont work with Dx8 sorry.. however a decent blur/bloom is possible with Dx8..All my shader is is do a bunch of samples and offsetts them a bit each time so it looks like a blur
Posted By: Buluen

Re: bloom effect - 01/11/05 07:46

hmm I found code that doesn't require shaders and gives about the same effect im looking for I think I will go with that thanks for trying to help heh.
Posted By: Metal_Thrasher

Re: bloom effect - 01/11/05 09:00

Quote:

doesn't require shaders



I could use ir for my mini-game...where'd you find it?
Posted By: Buluen

Re: bloom effect - 01/11/05 09:31

http://www.conitecserver.com/ubbthreads/showflat.php?Cat=&Number=348769&page=&view=&sb=5&o=&fpart=all&vc=1
im using the soft filter code for there but for some reason I cannot get it to work properly. The filter/blur effect is almost pure white making it seem like fog. maybe someone could help me out.

" Based on the Gamasutra article I got blur working in 3DGS. It uses render to texture so it will probably only work in commerical and pro. You need a 320x240 white pcx named 320x240.pcx in the path. You need to be running at 1024x768.

If you want to increase the blur you need to use a smaller image like 160x120 or 80x60. You also need to change the blurcam size_x and size_y to the same size as the image. Additionally you need to change the blurmap.x to fit the blurmap perfectly on the screen. 277 is perfect for 320x240. 69 is perfect for 80x60. Other resolutions (like 800x600) require a different blurmap.x.

As stated in the Gamasutra article there are artifacts but these can be mitigated by increasing the alpha of the blurmap. Making the blurmap less transparent also increases the blur. There will probably be less artifacts the more you blur too (less at 80x60).

---

Explaination of how it works:

You have Camera and Blurcam. Blurcam takes the exact same picture that Camera does except that it does NOT include blurmap in the picture. Camera has a view entity on layer 1 named Blurmap. Blurmap is a sprite (basically a panel) that is 320x240. Blurmap is transparent. Blurcam renders itself to Blurmap (render to texture). Blurmap (a 320x240 texture) is stretched across the 1024x78 view causing it be "blury" except that blurmap is also transparent and therefore you have the regular view and then the blury view superimposed on top.

Frame rate: The only frame rate hit you take is from the extra 320x240 render per view that Blurcam has to render. The blurrier the less of a frame rate hit you take (because the Blurcam render is smaller).

The frame rate hit I noted was LITTLE to NONE.

---

entity blurmap
{
type = <320x240.pcx>;
layer = 2; // display above view entities with layer 1
flags = visible,transparent;// visible on screen from the start
view = CAMERA; // same camera parameters as the default view
albedo = 0; // gouraud shading from sun position
x = 277; // place 277 quants ahead of the view
y = 0; // center horizontally
z = 0; // center vertically
}

view blurcam
{
layer = 0;
pos_x = 0;
pos_y = 0;
size_x = 320;
size_y = 240;
offset_x = 0;
offset_y = 0;
flags = visible;
}

function main()
{
blurmap.alpha=50;
blurcam.bmap=bmap_for_entity(blurmap,0);
cameramove();
}

function cameramove() {
proc_late();
while(1) {
vec_set(blurcam.pos,camera.pos);
vec_set(blurcam.pan,camera.pan);
wait(1);
}
}
"
I think it may be my white pcx file thats causing the trouble.
Posted By: Drew

Re: bloom effect - 01/11/05 10:01

do you have pro? i believe this is a pro version only code
© 2024 lite-C Forums