Skip to main content
gamedev.net
🔒 Locked

Glowing effect

Started by Chman_a11w 9 replies 2.4k views
Original Post
Chman_a11w
Chman_a11w
How would make that using OpenGL ? (the engine blast effect) Any advices or piece of code are welcome ! Thanks, Chman [edited by - Chman_a11w on May 24, 2004 1:34:22 PM]
Cibressus
Cibressus
thats just a billboarded polystrip with the texture fades off like that on the alpha channel.
mikeman
mikeman
I'm no guru at these stuff,but I made a similar effect once in a futuristic race game.I used a quad that starts from the engine and its length is determined by the speed of the vehicle(more speed=longer trail).I applied a texture to it that gives that "glow" appearance.It's not hard to do,just used Photoshop and the gradient tool and experiment.I make the texture so as it appears bright in the center and dark at the edges.
Finally I used additive blending like this:
glBlendFunc(GL_ONE,GL_ONE);
and I set the color for the two vertices that are near the engine to glColor3f(1,1,1) and for the two vertices that are far from the engine to glColor3f(0,0,0),thus achieving a nice interpolation effect.
I think my way is way simplistic,but it gave me pretty good results.The biggest problem is that i use just a fixed-oriented quad(parallel to the ground) and so with some camera angles it looks really thin(but the same thing seems to me that is happening in these pics you posted).I guess there is a way to make it face the camera(without changing its shape),but I haven't try it.

-EDIT:Cibressus,i just saw your post.I'm wondering,how do you achieve that billboarding,since the quad is not square?


[edited by - mikeman on May 24, 2004 2:11:11 PM]
Chman_a11w
Chman_a11w
Ok thanks for all !
Very usefull

mikeman the way to make the polygon face the camera is called billboarding
Your comment was very useful ! Many thanks !
mikeman
mikeman
quote:
Original post by Chman_a11w
Ok thanks for all !
Very usefull

mikeman the way to make the polygon face the camera is called billboarding
Your comment was very useful ! Many thanks !


I know what billboarding is,I just asked if it works for non-square quads.We want the quad to face the camera,but we also want it to give the appearance of depth and not look like a 2D rectangle,which exactly what happens with billboarding(at least the way I do it).The trail we want is not a sprite,but a 3D entity.I don't think billboarding will do the job.I'm thinking more of a 6-faces box with the glow textures seamlessly applied to each face.

[edited by - mikeman on May 24, 2004 3:11:48 PM]
weyland
weyland
here''s some info on different types of billboarding ...

http://www.flipcode.com/articles/article_rtr2billboards.shtml

there''s some info on "beams" and stripping quads and aligning them, exactly what you need
mikeman
mikeman
Very useful article,weyland.
I think for our effect we need the axial billboarding,although the article does mention that with some camera angles the results are not so good.For example,if the viewer is right behind the vehicle,the beam will appear very thin(or,as the article states:"like the cutout it is").
Rasmadrak
Rasmadrak
why not simply use "stop piece" ?

if you got two quads for the tail, use another quad to act as a cap for those (with a "glowing ball" texture)

if aligned properly there should be a small or no seam.


__ ____________
\ / "Beam" /|
\/___________/B|
/\ \ |
/__\___________\|

"Game Maker For Life, probably never professional thou." =)
weyland
weyland
hmm, using two quads crossed like you say never really works well for "laser beam" effects, even alpha blending them (instead of additive blending gives a number of weird artifacts) ...

"The curved beams are axial billboards made of a number of quadrilaterals. To create a continuous beam these quadrilaterals are joined at their corners, and so are no longer rectangular." (from that link I posted before)

This is what they used for Homeworld 2, axial billboards, after you align them join the corners together, and yes, with some curves and/or camera angles it loses it''s nice gradient properties but it looks very nice 90% of the time.

BTW: I love chman''s old flash site go go go !
Madster
Madster
actually in Homeworld if you mess with the camera a bit you can get that thin "like the cutout it is" look...

What Rasmadrak suggests is a very good idea, but i got another suggestion instead....

at every joint in the tail add that glowing ball polygon, and now modulate the transparency of that relative to the angle towards the eye, such that when you're looking at it by the side its transparent and when looking at it perpendicularly its opaque.
Do the same for the beam.

That way it should look good from any angle.


Seen this for light beams in Red Faction.... understated title that one =)

edit: the glowing ball should be billboarded as well

[edited by - madster on June 6, 2004 3:20:44 AM]
Working on a fully self-funded project

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.