Over the weekend, I was finally able to get ribbon trails into the game.
A ribbon trail is basically a bunch of axis-constrained billboards, so let’s start out with an axis-constrained billboard.
Nothing interesting here, we basically have a rectangle plane that’s being rotated along the blue vector.
When you put them side by side, there’s no problem. However if you start turning, there’s going to be problems because of gaps.
What we need to do is make intersecting edges match each other. This changes the the shape of the billboards into trapezoids.
How do we create the trapezoid? We’ll need to get the correct angle to generate the top point and the bottom point. We want to get a vector that is 90 degrees to this.
How do we get this green arrow? If you look closely the green vector is the average of the blue and red. So all we have to do is add the normalized vectors of blue and red, then normalize it.
Now to actually put this to use:
It’s a very good idea to draw the vectors to help with debugging. It’ll save you a lot of time if you don’t get it right the first time!
Now increase the update time from every 1 second to 0.1 seconds and add some fade.
Just play around with the texture, update speed, how many segments it should be, etc… and voilĂ , you got yourself your very own ribbon trail.









Nice tutorial; I found your site from a video you put on You Tube for the Thruster effect Flashed helped you with http://www.youtube.com/watch?v=pEymPIiCGwU – Would be great if you could cover that some time :-)
And naturally the comments appear just as Ace and I are sidetracked by work for a week. ;)
Thanks for the comment, though! Ace was thinking of fiddling with the engine effects on the side while we’re working on other parts of the game, since we’d gotten the idea in our heads while getting the engine trails going.
We actually took those thruster effects off and replaced them with EVE-like effects. These 3d effects look great up close, however, in a game like SFX with ships zoomed out, you can’t really make out the cool effect.
I could write a tutorial covering later on, however I do like to spend more of my time on make Cool New Stuff(tm). :)