Glow shader

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply

Do u like it?

it's cool
13
57%
it's ok
9
39%
I don't like it
1
4%
 
Total votes: 23

stefbuet
Competition winner
Posts: 495
Joined: Sun Dec 09, 2007 4:13 pm
Location: france

Glow shader

Post by stefbuet »

First of all, here is what I've done so far:

http://www.youtube.com/watch?v=r-LeScVhq4c

It seems pretty cool like this, but it's not finished.
I don't know if my method to do that is good, I haven't seen anything about that kind of effect, so I did my shader myself. It's my FIRST working shader and I'm prood of it :)
When it'll be done, I'll post it in snippet topics.
-> run @ 100fps with geforce 260GTX

Does anyone have any link about glow shaders? Not glow with lighting for things like bloom. Glow like my video.
In fact I got some problems, the glow size is not the same in funtion of the camera position... Maybe I could do something with a depth texture to change it.

If you have any documentation, it would be nie to share it.
Thanks.

EDIT:
Image

Stef.[/img]
Last edited by stefbuet on Tue Apr 20, 2010 11:32 pm, edited 1 time in total.
MasterD
Posts: 153
Joined: Sun Feb 15, 2004 4:17 pm
Location: Lübeck, Germany
Contact:

Post by MasterD »

Looking very nice. But, please don't let me get you done, 100FPS on a 260GTX looks like there is some stuff to improve. So, you have a nice looking shader ... go, make it fast! :-D
(You know, I suck at this. I'm always happy if I can stay below the Shader 2.0 instruction count limit ... )

I bet you know this one, but anyway: http://http.developer.nvidia.com/GPUGem ... _ch21.html
Figure 21-7 looks like your effect, imho.
YASS - Yet another Space Shooter
under Devolpment, see http://yass-engine.de
stefbuet
Competition winner
Posts: 495
Joined: Sun Dec 09, 2007 4:13 pm
Location: france

Post by stefbuet »

Well, I didn't see your link in fact :P
too bad, shader code is in assembler :(
I know how to greatly reduce my shader computation cost
from x² to 2x.
Edit :
500FPS with best quality
1000FPS normal quality
I'm not using the GPU gems blurring method, even if everybody is using it. my own method is making something really cool which look like more a lighting effect (a kind of cross appear...) and also I didn't managed to get something cool with the blur method...
Viz_Fuerte
Posts: 91
Joined: Sun Oct 19, 2008 5:29 pm
Location: Valencia (Spain)
Contact:

Post by Viz_Fuerte »

If you have any questions on how to do this type of effect, I suggest that you download the examples I did.
Also, it have source code so you can study it and apply it to whatever you want.

http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=36308
stefbuet
Competition winner
Posts: 495
Joined: Sun Dec 09, 2007 4:13 pm
Location: france

Post by stefbuet »

Well, I think I got what I needed but I have to clear the code.
I didn't see any glow effect on your thread?

By the way, here is what I have:
Image
Viz_Fuerte
Posts: 91
Joined: Sun Oct 19, 2008 5:29 pm
Location: Valencia (Spain)
Contact:

Post by Viz_Fuerte »

Well, Bloom/glow... These effects are similar :lol:
All you have to set it all values to get the bright colors stand out more.

PD: Your effect is very good :wink:
Virion
Competition winner
Posts: 2149
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

good job i like this very much =)
My company: https://kloena.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
freetimecoder
Posts: 226
Joined: Fri Aug 22, 2008 8:50 pm
Contact:

Post by freetimecoder »

Do want! :)
Looks like an evil ninja sith.

How do you manage the textures? Do you have two passes for the color and the glow texture and combine them afterwards? How is the glow strength regulated?

greetings
Virion
Competition winner
Posts: 2149
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

by the way irrlicht support OpenGL 3.2? :o
My company: https://kloena.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
xDan
Competition winner
Posts: 673
Joined: Thu Mar 30, 2006 1:23 pm
Location: UK
Contact:

Post by xDan »

Awesome ninja 8)
How do you manage the textures? Do you have two passes for the color and the glow texture and combine them afterwards? How is the glow strength regulated?
Question ++;
stefbuet
Competition winner
Posts: 495
Joined: Sun Dec 09, 2007 4:13 pm
Location: france

Post by stefbuet »

I have a diffuse texture and a "glow" texture: white where the glow have to be or black if no glow.
Then I do the effect in 2 passes :
during the first pass, I do a kind of horizontal blur, but it's not blur. for each pixel, I add their neighbour pixels colors divided by their distance^2.
during the 2nd pass, I do the same on the vertical axis, and then I had some colors to the center which was white (0xffffff) and the borders which are white gradients (<0xffffff). I modulate the color amplitude too, and to finish I blend the glow texture with the scene texture with normal additing method.
But I think I maybe should try alpha blending. (see on the following img : left bottom hand corner : red circle glow have a white center instead of red, it's because the scene texture is white here. But if I were doing alpha blending it should be red...)

To have a bigger glow, I can either multiply the glow texture before blending it with the scene texture, but this is really limited, or change during "blurring" passes the distance of neighbour pixels. But this is a point I'm still working on.

Here is a exemple of a red center color and border color.
Previous one was white center color and red border...
Image
Image
Image
xDan
Competition winner
Posts: 673
Joined: Thu Mar 30, 2006 1:23 pm
Location: UK
Contact:

Post by xDan »

Interesting, thanks. I only noticed the two colours now you mentioned it but that's a cool effect!
freetimecoder
Posts: 226
Joined: Fri Aug 22, 2008 8:50 pm
Contact:

Post by freetimecoder »

Maybe you could make the colors and strength dependent on the color of the glow texture. Red color is read glow and green is green glow. That way it would be easy to implement an object with e.g. different colored screens.

greetings
Mel
Competition winner
Posts: 2293
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Post by Mel »

It is a really interesting effect. You could use Multi Render Target to render the glow and the difuse in one pass.

It looks like Phantasy Star Universe weapons.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
B@z
Posts: 876
Joined: Thu Jan 31, 2008 5:05 pm
Location: Hungary

Post by B@z »

meh needs this!
when will you release the code? :3
Image
Image
Post Reply