Ray of lights

Previous topic - Next topic

Albert

For bloom we have to do some things.
First, we have to copy the whole screen and apply a tolerance (only keep the bright spots).
Second, we want to blur this copied screen.
Finally we can copy this screen over our original screen.
I couldn't found a fast algorithm for this. The only way to do the TOLERANCE and the BLUR is from shader. :(

Here is a test without any shader. I tuned up all the effect to see, but it's wrong and it's even worse if you start to move around the screen.



And if I switch on my Horizontal blur shader, then the shader works, but the scene falls apart. Why???



Here is the project in the attachment.
To enable the shader look here:
Code (glbasic) Select

//IF YOU USE THIS SHADER THE RENDER FALL APART??
//X_SETSHADER 13
DRAWSPRITE map[mx][my], cx, cy
//X_SETSHADER -1





[attachment deleted by admin]

mentalthink

Thanks Albert, I try more later, but have a good look.

:nw: :nw: :nw:

Kinds Regards,
Iván J.

mentalthink

Albert, agains you do it, absolutely fantastic, it´s very very nice the effect image, and touching a little the parameters, you have a fake 8 bits effects, like a dirty image in a old CPC from de Asmtrad.

Thanks again.

Iván J.

Albert

Iván, if you can use this effect, then I would love to see what you can achieve it. So use it freely, if you manage to mix the parameters and get something fun, share with us.

Kitty Hello

For a radial blur, there's an old technique that requires no shaders:
http://nehe.gamedev.net/tutorial/radial_blur__rendering_to_a_texture/18004/

Basicall he does:
-Render the blur objects to a texture.
-Optionally: Scale the texture down to 1/4 of the original size (for more speed)
-Draw the very same texture on itself like:
Code (glbasic) Select

USESCREEN 1
FOR i=0 TO 10
   ALPHAMODE 0.5
   ZOOMSPRITE 1, 0,0, 1.05, 1.05
NEXT
USESCREEN -1

-Draw that sprite now over the final scene
Code (glbasic) Select

ALPHAMODE 0.9
   STRETCHSPRITE 1, 0,0,screenx, screeny



You get the idea...

Albert

Thanks Gernot, this is what I'm used for the lightray algorithm just with some doublebuffering or what :)
But this NeHe tutorial gave me an idea to blur the screen without zooming, just displacing a bit. Here is my results:




chve

I am new still in GLBasic forum and I have just donwloaded "Ray of lights" Albert.
It is awesome!!!  :good: :good: :good:


Congratulations!!

Hatonastick

Those examples are seriously cool!  Now I'm tempted to think up ways and programs I can use them in.  :good:
Mat. 5: 14 - 16

Android: Toshiba Thrive Tablet (3.2), Samsung Galaxy Tab 2 (4.1.2).
Netbook: Samsung N150+ Netbook (Win 7 32-bit + Ubuntu 11.10).
Desktop: Intel i5 Desktop with NVIDIA GeForce GTX 460 (Win 8.1 64-bit).

Qedo

@Albert
I'm interested in the Bloom effect and I'd like to study your code which is unfortunately no longer available in the forum.
Could you attach it?
Thanks
Ciao