Jump to content
  • Advertisement
Sign in to follow this  
PdG

Engine trails

This topic is 3556 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

This time not bugs or problem :) but i need only a suggestion. I'd like to implement on my game the "trails" effect on the engine to give a moving sensation to the scene. Something like Homeworld 2: beautiful trails On this screenshot i see that every trails are composed by a sphere with a lot of blending near the edge, and a polyline, blurred and transparent. But i've no idea how make it. The trails are 3D, so i cannot use sprites or similar tricks, i need a mesh, but: 1) how should be done this mesh? There's a rigid part (the sphere) and a deformable part (the trails) that follows the trajectory of the ship. 2) how can i obtain the bright and fogged aspect? there's no solid edges, they're blended, and inside it there's a brighter part. Any idea or suggestion will be appreciated :)

Share this post


Link to post
Share on other sites
Advertisement
You can do trails using sprites :)
I can give you some details on how I would do it...
a typical particle has a lifetime, a color, position and a scale.

Starting from the back of the ship (the engine), you initialize your particle, the scale of the particle is dependent on the ship. The closer the ship is to you, the bigger the particle.

Also, the color of the particle totally depends on you but the opacity (alpha) of the particle should depend on the lifetime. As the particle gets older, reduce it's opacity ;)

I hope this helps.
Take care

Share this post


Link to post
Share on other sites
You really don't want to do trails like that using sprite particles, once your ships start moving fast you'll need so many sprites to make an unbroken trail you'll totally kill your framerate.

What you need to do is keep a history of the points that the ship has passed along (perhaps one every few frames). Then you construct a strip of quads between those points and use a transparent line texture so you get nice soft glowy edges.

Like particles you'll have to construct the strip so it's always facing the viewer. Search for particle billboarding to find the maths for that. Essentially for every history point you'll need to find the vector along the path (historyPoint - historyPoint[i+1]) and the vector to the camera. Take the cross product of the two and extend your quad along that vector by the thickness you want your trail to be.

For the ball next to the engine either have another trail with a larger line texture, or just overlay a billboarded sprite on top of the existing trail.

Share this post


Link to post
Share on other sites
Quote:
Original post by OrangyTang
You really don't want to do trails like that using sprite particles, once your ships start moving fast you'll need so many sprites to make an unbroken trail you'll totally kill your framerate.
If your ships have a well defined maximum speed, the particle approach may still work, and is relatively easy to implement. Make sure to emit particles based on distance travelled (rather than time elapsed), or variable speeds will cause anomalies.

Share this post


Link to post
Share on other sites
Quote:
Original post by swiftcoder
Quote:
Original post by OrangyTang
You really don't want to do trails like that using sprite particles, once your ships start moving fast you'll need so many sprites to make an unbroken trail you'll totally kill your framerate.
If your ships have a well defined maximum speed, the particle approach may still work, and is relatively easy to implement. Make sure to emit particles based on distance travelled (rather than time elapsed), or variable speeds will cause anomalies.
I actually liked the "anomolies" caused by a particle system for engine trails. As long as it doesn't completely break up you get fainter/longer lines when going fast and thicker/shorter lines when going slow which added quite nicely to the illusion of movement [smile]


Cheers
Jack

Share this post


Link to post
Share on other sites
Ok.. i've read your opinion and i want to try the "quad" approach, just to see how it works.
The particle system could be killer for fps and i like a more 3d approach.
Just one remark: a quad has no depht, so if put the camera into an "unluky" position, i cannot see it.
Should i try to billboard it or a cylinder is better than a quad?

Share this post


Link to post
Share on other sites
Quote:
Original post by PdG
Ok.. i've read your opinion and i want to try the "quad" approach, just to see how it works.
The particle system could be killer for fps and i like a more 3d approach.
Just one remark: a quad has no depht, so if put the camera into an "unluky" position, i cannot see it.
Should i try to billboard it or a cylinder is better than a quad?
You'd be better making a + shape of the quads. Billboarding would look odd, and cylinders would use more polys. Using two interlocking quads usually looks surprisingly good.

Share this post


Link to post
Share on other sites
Quote:
Original post by Evil Steve
Quote:
Original post by PdG
Ok.. i've read your opinion and i want to try the "quad" approach, just to see how it works.
The particle system could be killer for fps and i like a more 3d approach.
Just one remark: a quad has no depht, so if put the camera into an "unluky" position, i cannot see it.
Should i try to billboard it or a cylinder is better than a quad?
You'd be better making a + shape of the quads. Billboarding would look odd, and cylinders would use more polys. Using two interlocking quads usually looks surprisingly good.


Thank you, i'll try.
Anyway i'll try also to reinstall the beautiful homeworld 2, just to see how it works.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!