A flow field assigns a velocity to every point in space. Release thousands of particles into it, move each one a little per frame, and keep a faded memory of where they were: you get the silky, streaming look of wind maps and many generative posters. The three choices that matter are how to build the field, how to step the particles, and how to leave trails.

Drop particles into the arrows and let the flow carry them. Image: Twisp, Public domain, via Wikimedia Commons.
Mental Model
- A particle at position obeys . The field is a function you design.
- Using noise directly as an angle gives a field with sources and sinks, so particles bunch up. Curl noise has none, so they stay spread out.
- The step method matters for orbits. Euler spirals outward in swirling fields; midpoint (RK2) holds the radius.
- Trails are free: fade the previous frame, then draw the new points on top.
1. Noise as a Vector Field
The simplest field maps 2D noise to an angle:
with a scale that sets the size of features. It is easy and looks good, but it has regions where streamlines converge (sinks) and diverge (sources). Particles pile up in sinks, thin out in sources, and the picture clumps over time. See Noise Functions for the used here.
2. Curl Noise
Take a smooth scalar noise as a potential (a stream function) and define the velocity as its rotated gradient:
The divergence is
because mixed partial derivatives of a smooth function commute. No sources, no sinks: the flow is incompressible, so an initially uniform cloud of particles stays uniform. There is a second property: along a trajectory , so in a steady field each particle travels along a contour line of . If also changes with time, particles drift across contours and you get the evolving swirls. In 3D the same construction uses a vector potential and , and always (Bridson and colleagues, 2007).
Derivatives of noise are usually taken by central differences, which is simpler than writing analytic derivatives for each noise type:
def curl(psi, x, y, e=1e-3):
dpdx = (psi(x + e, y) - psi(x - e, y)) / (2 * e)
dpdy = (psi(x, y + e) - psi(x, y - e)) / (2 * e)
return dpdy, -dpdxI checked this on a grid with using central differences. The divergence of the curl field came out at about while the velocities were of order 3.5. The gradient field of the same potential, in contrast, had divergence up to about 26. Central differences commute exactly on a grid, which is why the first one is zero to rounding error.
Intuition
Think of as the height of a landscape. The curl field is the flow that circulates along the contours of that landscape, never uphill or downhill, so it cannot gather anywhere.
3. Advection: Euler and RK2
To move particles, integrate numerically. Forward Euler takes one slope sample at the start of the step:
The midpoint method (RK2) samples again halfway:
The difference shows in rotation. For a particle should circle forever at constant radius. Euler multiplies the radius by per step; midpoint by . With and 628 steps (ten revolutions), starting at radius 1, running both gives radius 22.7 for Euler and 1.008 for RK2, matching those formulas. Curl noise is made of swirls, so Euler particles are flung out of vortices over time; RK2 doubles the field evaluations and fixes most of it. For art at 60 frames per second with small , Euler is often good enough, and one extra sample per particle is cheap on a GPU. See Numerical Integration for RK4 and error orders.
Particles that leave the domain need a rule: wrap around, or respawn at a random position. A random lifetime that respawns each particle after some frames also hides any drift.
4. Trails with a Fading Buffer
Do not store trail history per particle. Keep one accumulation buffer the size of the screen. Each frame:
- Multiply the buffer by a fade factor slightly below 1 (or draw a translucent black quad over it).
- Draw every particle at its new position, additively.
- Display the buffer.
A particle’s contribution after frames is scaled by . For the effective trail length is frames and the half-life frames. Higher gives longer streaks; never fades and saturates. Fading is done on a float buffer if you can, because an 8-bit buffer rounds small values to zero and leaves a ghost residue that never disappears at close to 1. Color by speed, by angle, or by particle age for variety. In TouchDesigner, this is a Feedback TOP with a Level TOP multiplying by and a Composite TOP adding the new points.
5. Particles in 3D
The same pipeline works in 3D with a curl-noise field, a position texture, and an update that reads only the position (the field supplies the velocity). Strange attractors from Strange Attractors Beyond Lorenz are flow fields with a built-in shape: seeding thousands of particles and advecting them through the Halvorsen or Lorenz equations gives the density-style images from that page, with real motion. The GPU side, with positions stored in textures and updated in a shader, is covered in GPU Particle Systems.
Related
- Noise Functions: the potential
- GPU Particle Systems: running millions of particles
- Numerical Integration: Euler vs RK2 vs RK4
- Strange Attractors Beyond Lorenz: flows with fractal attractors
- Dynamical Systems Basics: divergence and phase-space volume
- Attractor and MediaPipe: particles driven by hand input