Flow Field / Vector Field
also: vector field
Vector fields are classical mathematics; the long-form generative "flow field" technique was popularized in the 2010s (e.g. Tyler Hobbs).
community / folk Name — "Flow field" (and "vector field") are descriptive folk terms borrowed from mathematics/physics rather than a coined algorithm name; no single coiner of the phrase in its generative-art sense is attested. The technique was popularized by 2010s long-form practitioners (e.g. Tyler Hobbs), but popularizing a technique is not the same as coining its name — the coiner and date remain unresolved (to be confirmed).
In one line A field that assigns a direction vector to every point of the plane; particles released into it trace paths by following the local direction. The angle is most often derived from Perlin/Simplex noise.
The code
The actual sketch behind the demo above — sandboxed and reproducible. This is the whole thing.
flow-field/index.html
const SEED = Math.floor(Math.random()*1e9);
const PALETTES = [
['#1f3a93','#e74c3c','#f1c40f','#27ae60','#2c3e50'],
['#264653','#2a9d8f','#e9c46a','#f4a261','#e76f51'],
['#220a32','#7b2cbf','#c77dff','#e0aaff','#ffd6ff'],
['#0a0908','#22333b','#eae0d5','#c6ac8f','#5e503f'],
];
function setup() {
randomSeed(SEED); noiseSeed(SEED);
const s = Math.min(windowWidth, windowHeight);
createCanvas(s, s);
pixelDensity(2);
noStroke();
const palette = random(PALETTES);
background(palette.shift());
const N = 2400; // particles
const STEPS = 220; // path length
const FREQ = 0.0025; // noise spatial frequency
const SPEED = s * 0.0018;
const STEP_SIZE = s * 0.0035;
for (let i = 0; i < N; i++) {
let x = random(width);
let y = random(height);
fill(random(palette) + '20');
for (let j = 0; j < STEPS; j++) {
// map noise → angle (×TWO_PI gives strong direction)
const a = noise(x*FREQ, y*FREQ) * TWO_PI * 2.0;
x += cos(a) * STEP_SIZE;
y += sin(a) * STEP_SIZE;
if (x < 0 || y < 0 || x >= width || y >= height) break;
circle(x, y, SPEED);
}
}
}How it works
Build a grid covering the canvas. For each cell, sample a noise function at the cell's coordinates and map the result to an angle, giving every cell a direction. Then seed particles at random positions and, each step, look up the angle of the cell the particle is in, advance the particle a small distance along that angle, and draw a segment of its trail. Repeating this for many particles over many steps yields the characteristic combed, streamline texture. The noise frequency controls how tightly the field curls; the step size and particle count control density.
Parameters
noiseScale: number — Spatial frequency of the noise; lower values produce broader, calmer curls.stepLength: numberparticleCount: number
Lineage
Frequently combined with
- Perlin / Simplex Noise · 34 works
- Fragment Shader (GLSL) · 16 works
- Particle System · 14 works
- HSL / Hue Cycle · 11 works
- Bezier / Catmull-Rom Splines · 9 works
- Voronoi Diagram · 4 works
- Marching Squares / Contours · 4 works
- Raymarching with SDFs · 4 works
- Quadtree / Recursive Quad Split · 3 works
- Plotter-style Hatching · 3 works
- Domain Warping · 3 works
- Boids / Flocking · 2 works
Works using this algorithm (50)
References
Last updated 2026-07-16