Particles
A particles layer is a particle system: sparks, dust, snow, embers, confetti or stars. It makes many small sprites, each with its own path, and draws them all in one fast step.
Make sparks, dust or snow
- Open the command palette (/, or ⌘/ / Ctrl+/) and choose particles.
- Starlight adds soft dots that drift up and fade in and out, added onto what is under them (
blend: add). It selects the new layer. - Edit it in the particles section of Properties: how many are born each second (rate), how long each lives (life), where they are born (emitter), which way and how fast they fly (angle, spread, speed), their size and color.
- transform:
- particles:
rate: 80
life: 3s
emitter: { shape: line, length: 1600 }
angle: -90 # up
spread: 20
speed: 160
turbulence: { amount: 40 }
overLife: { opacity: [0, 1, 0], color: ["#FFFFFF", $accent] }
blend: add
position: { x: 960, y: 1060 }
anchor: 0
- The emitter sits at the layer's point. Move it with the transform around it.
- The layer's own animation (its clock) moves, scales, turns and fades the whole cloud, like any layer. When the transform around it moves, the cloud moves with it.
- For light, sparks and glows use
blend: add: overlapping particles get brighter.
The settings
Every setting goes inside the particles: map, and every one is optional: - particles: {} already works.
| Prop | Meaning |
|---|---|
of | The sprite: an asset, or a comp (drawn every frame). Without it, a soft dot. size is its longer side. |
rate / life | Particles born each second (default 40), and how long each one lives (default 2s). |
emitter | Where they are born: shape point (default), line (with length), rect or ellipse (with size, for example 600x200), and from area (inside) or edge (on the outline). |
angle / spread | The direction they fly: 0 is right, 90 is down, -90 is up (default). spread is how wide the cone is, in degrees (360: every way). angle: outward sends them away from the middle of the emitter. |
speed | px each second (default 120). |
gravity / drag | { x, y } in px/s²: { x: 0, y: 400 } pulls down, a sideways one is wind. drag slows them (1 slows a particle to about a third of its speed in a second). |
turbulence | { amount, scale, evolve, octaves }: a swirling push off the path. amount is how far, in px; scale the size of the swirls; evolve how many times the swirls change over the loop (a whole number). |
size / color | The size at birth in px (default 12), and the tint (a colour or a token). |
spin / rotation | Each particle turns at a random speed up to spin °/s, either way. rotation gives each a random start angle. |
overLife | { size, opacity, color }: keyframe lists over each particle's life, from birth (0) to death (1). opacity: [0, 1, 0] fades each one in and out; color: ["#FFFFFF", "#FF4800"] cools it from white to orange. |
lifeRandom, speedRandom, sizeRandom | How much each varies, from 0 to 1: 0.3 is ±30 %. |
trail | { length, samples, fade }: copies of each particle's own past, the last length ago (default 150ms), fading. |
seed | Another whole number gives another pattern of the same system. A new or duplicated particles layer gets its own. |
max | The most sprites it draws (default 2000, up to 20000). See How many particles. |
Why it always loops
Each particle's path is worked out from the scene time alone: Starlight never moves it a little each frame. So a frame is always the same, whether you play, scrub or export it.
- The particles born in one loop are born again in the next, so the loop never jumps. The ones born near the end of the loop are still flying at its start: the system never starts empty.
- A layer that shows for part of the loop (a span) shows the system already running.
- Keep
lifeshorter than the loop. A longer life shows each particle twice at once. - Changing the scene length with keep key times gives a new pattern of the same system; stretch keeps the pattern and slows it down.
- Turbulence pushes particles off their paths. It does not carry them along a stream. Particles do not flock, collide with each other or flow like a fluid.
How many particles
About rate × life particles are alive at once: 40 a second for 2 seconds is about 80. Each trail sample is one more sprite per particle.
maxcaps the sprites one particles layer draws. Whenrate × lifeneeds more, Starlight lowers the rate to fit and says so under the section in Properties.- Keep a whole scene under about 20 000 sprites. Past that, Properties and Claude's scene writes say so.
- Each surface, each tile of a
tile-xstrip and each use of a comp that holds the layer counts on its own. - On a big surface the cost is mostly how much of the surface the particles cover, and the effects on them (a glow over the whole cloud is a whole-surface pass).