Particles & Simulation

Many small things moving at once: particles, flow fields and simulations, computed on the GPU.

Take them in this order: each one uses what the ones before it showed. The same shaders, newest first, are on the topic’s page.

Sign in and the exercises you pass are marked here. Nothing is kept otherwise.

  1. Step 1 of 6

    Particle Swarm

    Two hundred thousand sparks in a buffer on the GPU, moved sixty times a second by a compute kernel, chase their places on crossing spiral arms around a leader that wanders the picture; they burn down and are born again beside it, leave streaks behind them, and buzz like a swarm of bees that follows the leader across the stereo field.

    Teaches: Compute shaders and GPU buffers

    Builds on Flowing Color Field, Cracked Clay, Ember Tunnel

    6 exercises
    1. One step at a time Make this step
    2. A place of its own Make this step
    3. Trails and a leader Make this step
    4. Particle swarm Finish it
    5. Match the sliders Find the values
    6. Find the bug Put it right
  2. Step 2 of 6

    Curl-Noise Flow

    Ninety thousand sparks carried on a current made from noise, not down its slopes but along its contour lines, so they never pile up; the current drifts through time, whirls slowly around the middle, and glows where it runs fast, while three voices of a D minor chord swell with the water at three places on the picture.

    Teaches: Compute particles following a flow field, with trails

    Builds on Flowing Color Field, Cracked Clay, Particle Swarm

    5 exercises
    1. Turned a quarter: the curl Make this step
    2. A current that changes Make this step
    3. Curl-noise flow Finish it
    4. Match the sliders Find the values
    5. Find the bug Put it right
  3. Step 3 of 6

    Murmuration

    Four thousand starlings over the kiln at dusk, and not one of them knows the shape of the flock. Each bird looks only at the birds near it and follows three rules, keep a little apart, fly the way they fly, stay among them, and the flock's folding, swirling cloud comes out of that. A falcon circles above, and every fifteen seconds it stoops into the flock, which tears open around it and closes again.

    Teaches: Boids: separation, alignment, cohesion

    Builds on Cracked Clay, Glass Orb

    2 exercises
    1. Match the sliders Find the values
    2. Find the bug Put it right
  4. Step 4 of 6

    Spiral Galaxy

    A spiral galaxy seen at a slant, from 160,000 stars on orbits. Each orbit is an oval turned a little further than the one inside it, so the ovals crowd into two arms that turn slowly while the stars drive through them. Young stars and ember gas light up where an arm squeezes them, a lane of dust runs inside each arm, and the core is a ball of old stars under a warm haze.

    Teaches: Stars on orbits, density waves, dust lanes

    Builds on Flowing Color Field, Floating 3D Scene, Cracked Clay, Particle Swarm, Curl-Noise Flow, Murmuration

    3 exercises
    1. Ovals that crowd Make this step
    2. Match the sliders Find the values
    3. Find the bug Put it right
  5. Step 5 of 6

    Fireflies

    A meadow at night below the kiln, and two thousand fireflies, each a clock that flashes as it comes round. Each one sees the fireflies near it and nudges its own clock towards theirs, and out of those small nudges the meadow falls into step until it flashes as one. Every thirty seconds the kiln door opens, its glare scatters their beat, and they find it again. Bells ring as the fireflies flash, scattered at first, then together.

    Teaches: Coupled oscillators: particles that see each other blink in time

    Builds on Cracked Clay, Glass Orb, Murmuration

    4 exercises
    1. A clock each Make this step
    2. Seeing the neighbors Make this step
    3. Match the sliders Find the values
    4. Find the bug Put it right
  6. Step 6 of 6

    Crawling Glaze

    A glaze that crawls over dark clay in worms, spots and holes, grown by two chemicals on a grid of cells. One is fed in everywhere, the other eats it to make more of itself and dies away, and both spread to their neighbors at different speeds. From thirty drops, the Gray-Scott model grows a pattern nobody drew, and the feed and kill change a little across the plate and over the minute, so it keeps moving.

    Teaches: Reaction-diffusion, two chemicals that feed, spread and die into a growing pattern

    Builds on Flowing Color Field

    5 exercises
    1. Feed and kill Make this step
    2. Glaze on clay Make this step
    3. Crawling Glaze Finish it
    4. Match the sliders Find the values
    5. Find the bug Put it right

Other paths Start here Noise & Texture Shapes & Symmetry 3D Scenes Light & Materials Atmosphere Fractals Geometry Sound & Rhythm