the Twarchive

This is a record of a twitter thread, originally posted in 2020

Thew
@AmazingThew

good evening I'm thinking about the spark VFX from Burnout Revenge on the Xbox 360

I wish to high five whatever tech artist was responsible for this trick; just unbelievably good

Thew
@AmazingThew

Fundamentally it's just The Akira Taillights Thing: Particles move in world space, but are rendered as trails connecting their last few SCREEN-SPACE positions

The concept is simple but there are a lot of weird practicalities to work out

Thew
@AmazingThew

effectively every particle consists of:
- a world-space position, which is usually animated on a simple ballistic trajectory
- a "chain" of the last few screen-space positions, which are connected by ribbons when the particle is rendered

Thew
@AmazingThew

But! Screenspace positions are 2D, but somehow perspective still works: trails closer to the camera get fatter

which means there's some kind of Cool Tricks going on

Thew
@AmazingThew

Oh yeah, in addition to perspective, occlusion works too! Particle trails can still go behind solid objects, which means the chain vertices definitely have 3D positions, somehow

Thew
@AmazingThew

this is one of those problems where a "correct" solution doesn't exist because the terms are contradictory (chain verts must effectively be both 3D and 2D at the same time), so somebody has to make up a Cool Trick that Mostly Works

the most fun category of problem

Thew
@AmazingThew

I *think* what they're doing here is storing chain verts in 3D, but in *clip space*, and then projecting BACK into world space before DRAWING the ribbons

i.e. each vert has a 2D viewport pos + a Z depth into the frustum

Thus verts are pinned in screenspace but can vary distance

Thew
@AmazingThew

the Z value would get more and more wrong on each frame as the camera moves

you could conceivably try to mitigate this with more tricks (subtract Z delta from prev camera pos, maybe)

but it might work fine enough already? particularly since chains are only like 4 frames long

Thew
@AmazingThew

Too hard to find a video clip for this, but: A neat LoD trick is it sometimes stores the chain values for a CLUSTER of sparks instead of each one individually. Apparently drawing tons of ribbons wasn't a bottleneck, but they needed to reduce the memory cost of all the chains

Thew
@AmazingThew

(the visual result of this is that sometimes blobs of distant sparks will all have parallel trails. It works great; I never even noticed it until going over videos frame by frame today lol)

Thew
@AmazingThew

(also I think past a certain distance it stops tracking trails and falls back to traditional stretched-billboard particles. Not 100% sure about this though)

Thew
@AmazingThew

Two particularly cool things here:
- The way the camera shake turns the trails into squiggles
- The bit at about 0:14 where the camera is suddenly knocked backwards, causing the trails to reverse direction as the particles are now moving away from the screen instead of towards it

Thew
@AmazingThew

Side note:
I've been grabbing most of these clips from this youtube playlist:

so, uh, credit to this dude with one of the most jaw-dropping title cards I have ever seen

attached image

YouTube
Burnout Revenge! | Walkthrough [COMPLETE]

Thew
@AmazingThew

Anyway I really want to borrow this effect some day but, interestingly, it's really only effective in a game where the camera undergoes REALLY large, abrupt movements

It works perfectly in Burnout bc the camera constantly cuts away to show crashes, but most games aren't Burnout