Skip to content

Projects · 2026

Flow field

Thousands of particles drifting along a smooth noise field, drawn live on a canvas.

Demo · Flow fieldOpen full screen ↗

A flow field assigns a direction to every point on the screen. Particles follow those directions and leave fading trails, which turns a grid of numbers into something that looks like wind or water.

How it works

  1. A seeded noise function gives a smooth value for any point.
  2. That value becomes an angle, and each particle takes a small step in that direction.
  3. Every frame paints a nearly transparent layer over the canvas, so old trails fade slowly.
const angle = noise(p.x * scale, p.y * scale + time) * Math.PI * 4;
p.x += Math.cos(angle) * 1.4;
p.y += Math.sin(angle) * 1.4;

Press New field for a different seed and palette, and change the particle count with the slider.

Built withJavaScriptCanvas 2D

Suggested