Skip to content

Tutorials · Particle Effects · Chapter 6

Flipbooks and spin

25 minutes Uses: ParticleEmitter

By the end

  • The fire as flames: flame-sheet.png, eight frames played over each flame’s life
  • Sparks that point along their flight, their frame picked by their speed: spark-sheet.png
  • Forge smoke, forge_smoke, billowing and turning: the rotation controls and Rotation Over Life
On this page

Flames from a sheet

Every particle so far has drawn one picture, a soft dot. A flame is not a dot: it is a tongue with a point, and it changes shape as it burns. A particle can draw a different picture at each moment of its life if you give it a sheet, one image with several pictures laid out in a grid. It plays them like the pages of a flip book.

The starter brought the sheet. To look at it, double-click flame-sheet.png in Assets, under art. It opens in the Sprite sheet tab.

The Sprite sheet tab showing flame-sheet.png drawn large, on a dark ground: eight soft white flame tongues, each a pointed shape that leans a little differently, four across the top and four across the bottom, with a thin blue line down the middle and across, the tab’s own grid for cutting clips
The sheet: eight flame tongues, four across and two down. The thin blue lines are the tab’s own grid, which has nothing to do with the emitter.
  1. Select forge_fire. Set Texture to flame-sheet.png.
  2. In the same Sprite group, tick Texture Sheet. A new sheet is a strip of 4 by 1, so set Rows to 2 and Last to 7. Columns stays 4, First stays 0 and Driver stays Lifetime.
  3. Press Ctrl+S, then F5 to see the flames, and F5 again to stop.
forge_fire selected, its Inspector narrowed with the search box to the rows that mention sheet: under Sprite, Texture … ticked, with Columns 4, Rows 2, First 0, Last 7 and Driver Lifetime; the node sits in the forge’s mouth in the Viewport
Texture Sheet
Switches on a sheet: the Texture is read as a grid of pictures, and each particle draws one of them at a time, not the whole image. The row is cut short in the Inspector as Texture …. Off, every particle draws the whole texture.
Columns, Rows
How many pictures lie across the sheet and down it, each at least 1. flame-sheet.png is 4 across and 2 down, so each flame is a quarter of its width and half its height. Count them from the picture and type them in: a wrong count draws a slice of two pictures at once.
First, Last
The pictures a particle plays, counted from 0 along the top row from the left, and then along the next row. Last is included. Here 0 to 7, all eight. A sheet of several animations is cut by these two: 0 to 3 plays the first row alone.
Driver
What picks the picture a particle draws. Lifetime walks from First to Last once, from birth to death, so every flame flickers through all eight pictures as it burns. Speed picks the picture by how fast the particle is going: the first when it is slow, the last from its Max up, as the next section’s sparks do. There is no clock that runs the frames by itself.
Close up of the forge’s mouth as chapter 5 left it: the fire as soft round blobs, white at the coals, then yellow and orange, with small orange sparks above them
Close up, for comparison: chapter 5’s fire of soft dots.
The same close up with the sheet: the fire now as pointed flame tongues, white at the coals, yellow and orange higher, with small bright orange bars, the sparks, above them and a grey plume of smoke rising from the top of the forge’s stone
Close up: flames. The small bars above them are the sparks, which get a sheet of their own next, and the grey is the forge smoke, which you add last.
The same close up eight steps later: the flames in the same colours but in other shapes, some taller and more upright, a few new ones at the coals, the sparks in other places
Eight steps later, an eighth of a second: each flame has moved on to a later frame.

Sparks that point where they fly

The sparks get a sheet as well, with a different job. spark-sheet.png is four pictures in a row: a round dot, then a short streak, a longer one and a long one. The sparks should be a dot while they hang at the top of their flight and a streak while they fly, which is a matter of speed, not of age, so the sheet is driven by speed.

  1. Select forge_sparks. Set Texture to spark-sheet.png.
  2. Tick Texture Sheet. The new sheet is already 4 by 1, from 0 to 3, which is what this one needs. Set Driver to Speed, and Max to 160.
  3. Open the Rotation group and tick Align To Velocity.
  4. Press Ctrl+S.
forge_sparks selected, its Inspector narrowed with the search box to the rows that mention sheet: under Sprite, Texture … ticked, with Columns 4, Rows 1, First 0, Last 3, Driver Speed and Max 160.00
forge_sparks selected, its Inspector narrowed with the search box to the rows that mention align: under Rotation, Align To Vel… ticked
Max
With Driver on Speed, the speed, in world units a second, from which a particle draws the last picture. The speeds from 0 up to Max are cut into equal slices, one for each picture, and a particle draws the picture for the slice it is in. Here 160, the top of the sparks’ Speed Range, so four slices of 40: below 40 the dot, then two streaks, and from 120 up the longest. A spark leaving at 110 draws the third picture and rounds off to a dot as it slows. Zero pins every particle to the first picture.
Align To Velocity
Turns each particle to point along its own flight, so a streak lies the way the spark is going. It takes the place of any spin: Start Rotation, Rotation Spread and the spin below are ignored while it is ticked.
Close up of the forge’s mouth with the flames and sparks, Align To Velocity off: the sparks are small bright bars that all lie flat, side by side with each other, whichever way they are flying
Close up, for comparison, Align To Velocity off: every spark lies the same way.
The same close up with Align To Velocity on: the sparks are bright bars tilted to the line they are flying along, the quick ones leaning towards the upper right, the slower ones shorter and rounder
Close up: each spark points along its flight, long while it is quick and rounder as it slows.

Smoke that turns

The third emitter is a plume of grey smoke over the forge’s stone, and it turns as well as billowing. A turn is the last group of controls, Rotation. A particle is born at an angle, spins at a speed, and a width of chance sits round each of the two so that no two puffs are alike.

  1. Select Town, press + Add node and choose Particles. Rename it forge_smoke, and set its Position to 114 and 246, above the forge’s stone.
  2. Set Rate to 8, Lifetime to 3, Speed to 16, Direction to 0.1 and -1, Spread to 0.3 and Gravity to -5.
  3. Set Start Color to 0.42, 0.42, 0.45, alpha 0.65, and End Color to 0.35, 0.35, 0.38, alpha 0.
  4. Set Start Size to 10, End Size to 30, Capacity to 32 and Sort Layer to 1, behind the forge’s stone, which is on 2, so the smoke shows above it.
  5. Set Texture to smoke-sheet.png, and tick Texture Sheet: Rows 2 and Last 7, as for the fire. The smoke’s eight pictures are puffs, and Lifetime walks them as it thins.
  6. Open Rotation. Set Start Rotation to 0, Rotation Spread to 6.3, Angular Velocity to 0.6 and Angular Velocity Spread to 1.6.
  7. Above, in Over Lifetime, tick Rotation Over Life and open it. Click the right point and set its y to 0.2, as in chapter 5; the left point stays at 1.
  8. Press Ctrl+S.
forge_smoke selected, its Inspector narrowed with the search box to the rows that mention rotation: the Node’s Rotation 0°, under Over Lifetime the row Rotation… ticked with a small preview of a curve that slopes down to the right, and under Rotation, Start Rotation 0° and Rotation Sp… 6.3 on a slider
forge_smoke selected, its Inspector narrowed with the search box to the rows that mention angular: Spread 0.3, and under Rotation two rows both cut short as Angular Vel…, the first 0.6 rad/s and the second 1.6 rad/s

The first picture’s top row, Rotation 0°, is the node’s own, and not the particles’: leave it. The two pictures find the particles’ fields by two different words, since Angular Velocity’s name and its tooltip never say rotation. Two of the labels are cut short as Angular Vel…: the first is Angular Velocity, the second Angular Velocity Spread.

Start Rotation
The angle each particle is born at. In the scene file it is in radians, and the Inspector shows it in degrees, as 0°. At 0° a picture is drawn as it is on the sheet, upright. Here 0°, with a spread round it.
Rotation Spread
A random width round Start Rotation, in radians: each particle is born within half of it either side. 0 gives every particle the same angle; a whole turn is 6.28. Here 6.3, a little more than a whole turn, so each puff starts at any angle. 0 to 7 is its range.
Angular Velocity
How fast each particle spins, in radians a second; a negative number turns it the other way. 0.6 is a slow turn, a little under a tenth of a revolution a second. 0 to 1 suits smoke, and a leaf or a chip of debris wants 2 or 3.
Angular Velocity Spread
A random width round Angular Velocity, in radians a second, as Rotation Spread is round the angle. Here 1.6, wider than twice 0.6, so some puffs spin the other way. 0 gives every particle the same spin.
Rotation Over Life
A curve that multiplies the spin, not the angle, across a particle’s life: 1 leaves it, 0 stops the turn. Here 1 at birth and 0.2 at death, so a puff turns briskly as it leaves the forge and almost stops as it thins out. The curve is drawn as the other over-life curves are, in chapter 5.
Close up of the plume of forge smoke above the forge’s stone with no turn and no spin: a soft grey column of puffs that rises and thins, a little more even in its outline
Close up, for comparison, no turn and no spin: every puff the way it is drawn on the sheet.
The same close up with the turn and the spin: the same plume, its outline a little more ragged, as though its puffs were set at different angles
Close up: each puff at its own angle, turning. The difference is small, as the note below says.

What a sheet costs

The forge fire, the forge sparks and the forge smoke

The forge fire

FieldValue
Everything from chapter 5as in its table
Textureflame-sheet.png
Texture Sheetticked: Columns 4, Rows 2, First 0, Last 7, Driver Lifetime

The forge sparks

FieldValue
Everything from chapter 5as in its table
Texturespark-sheet.png
Texture Sheetticked: Columns 4, Rows 1, First 0, Last 3, Driver Speed, Max 160
Align To Velocityticked

The forge smoke

FieldValue
Position114, 246
Rate8
Lifetime3
Speed16
Direction0.1, -1
Spread0.3
Gravity-5
Start Color0.42, 0.42, 0.45, alpha 0.65
End Color0.35, 0.35, 0.38, alpha 0
Start Size10
End Size30
Capacity32
Sort Layer1
Texturesmoke-sheet.png
Texture Sheetticked: Columns 4, Rows 2, First 0, Last 7, Driver Lifetime
Start Rotation0°
Rotation Spread6.3
Angular Velocity0.6
Angular Velocity Spread1.6
Rotation Over Lifepoints 0 (1), 1 (0.2)

Every other field is as a new Particles node has it.

Check it works