Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Vanz

Space ship trail effects

This topic is 5304 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Seen some discussions on this in the search but nothing all that usefull. Was wondering how to accomplish something like: or... I don''t really like the homeworld exhausts (2nd pic) because I think they are too long and too bright and look too cartooney. jmho... I kind of like the first one best. I am currently doing this: 1. Create a polygon mesh aft of the ship, using points of where the ship has been (see pic) 2. Make 2 polygon meshes perpendicular to each other so that it doesn''t look thin from the top (see pic) 3. Then depending on the thrust use points further away or closer to the ship 4. Map an exhaust gradient texture to the polygon stream them alpha blend to get the glow. This method looks good but not nearly as good as the top 2 pics. I also notice that in a big battle seen on Homeworld there are a ton of trails and fps is still high, so I don''t think they are using any kind of particle system. Any suggestions on how to do this better... rhuala

Share this post


Link to post
Share on other sites
Advertisement
"4. Map an exhaust gradient texture to the polygon stream them alpha blend to get the glow."

You will want to use addative blending (istead of alpha blending). Look it up - it is used to simulate glows, engine flares, light flashes, lasers, explosions etc (The pictures you''ve displayed use addative blending).
Also, I think the second picture looks pretty awful because it is too long and bright, but also the trail just stops mid air without fading out properly. So be sure to fade the trail into nothing at the far end.

Share this post


Link to post
Share on other sites
I was planning on implementing this effect with a particle system; but I am not planning to have anywhere near the number of ships as in HomeWorld II.

_______________________________________
Understanding is a three edged sword...

Share this post


Link to post
Share on other sites
Homeworld''s engine trail uses an axis aligned billboarding system. When a trail is made from point a to point b it is just a quad facing the camera, but oriented along the axis of travel. Take a look at the homeworld source code available on the relic developer network.

Share this post


Link to post
Share on other sites
quote:

Homeworld''s engine trail uses an axis aligned billboarding system. When a trail is made from point a to point b it is just a quad facing the camera, but oriented along the axis of travel.



That makes sense; but the trail is not a straight line if memory serves. How are they bending the trail stream?


_______________________________________
Understanding is a three edged sword...

Share this post


Link to post
Share on other sites
"Could you do a pixel shader? "

I really want and think there is a simpler less cpu intensive way...

"Homeworld''s engine trail uses an axis aligned billboarding system. When a trail is made from point a to point b it is just a quad facing the camera, but oriented along the axis of travel. Take a look at the homeworld source code available on the relic developer network. "

Sphet, could you please post the code or tell me the file name it''s in. I have the source but after about an hour of looking through a stack of files I couldn''t find (shader.c seemed closest) ... or better yet how about just elaborate your explanation a bit, like how would one create a billbaord oriented along the axis of travel for a quad that is shaped like a piece of string in 3d space...

"You will want to use addative blending... "
jack_1313, do you have any links or info on this, the gamedev search and google don''t turn up great help. I read a game conferencing article awhile back on how the game Tron was done, is this the same system, I may be able to find that article...''

Thanks for your replies...

rhuala

Share this post


Link to post
Share on other sites
oh yeah, one other quick question, is there a way to get a texture to display on both sides of a polygon...

Share this post


Link to post
Share on other sites
yeah, just set the cull render state to false

and look at the freespace open source I''ve implemented a simpler effect (was shooting for some thing diferent than you) and FS has lots of the beam rendering (as I call it) as well as a working trail system you can probly rip off. also were always looking for good programers

also use tristrips for rendering

Share this post


Link to post
Share on other sites
while I''m here this is how FS generates the two verts for each point on the spline (this is actualy from the beam rendering code but it''s prety much identical)

void beam_calc_facing_pts( vector *top, vector *bot, vector *fvec, vector *pos, float w, float z_add )
{
vector uvec, rvec;
vector temp;

temp = *pos;

vm_vec_sub( &rvec, &Eye_position, &temp );
vm_vec_normalize( &rvec );

vm_vec_crossprod(&uvec,fvec,&rvec);
vm_vec_normalize(&uvec);

vm_vec_scale_add( top, &temp, &uvec, w/2.0f );
vm_vec_scale_add( bot, &temp, &uvec, -w/2.0f );
}


you see you take the cross product between the normalized vector from the point to your eye position and the forward vector of the segment (this can be determined in trails as the relitive position of the next segment from the last, exept for the first and last segment were you can just use the point it''self for one of the two) and then scale the result by the width of the trail at that segment both positivly and negitivly and that will be the two points for youre segment, just pop them into a tristrip vertex buffer then render it.
simple :D

Bobboau, bringing you products that work... in theory

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!