Engine trails

Started by
9 comments, last by ATEFred 15 years, 3 months ago
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.

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.


Agreed.
One way of easily doing this is having a pre-made cylinder or whatever shape model that is boned. Then just move the bones according to the ships position history. If you have an animation system already in place that does skinning, there is effectively no work required.

This topic is closed to new replies.

Advertisement