StealThis .dev

Noise Flow Field

A canvas flow-field where thousands of particles drift along a value-noise vector field, painting organic fading streamlines you can retune live.

Open in Lab
canvas vanilla-js
Targets: JS HTML

Code

The Noise Flow Field renders a living generative artwork on a single <canvas>. A grid of angles is derived from a self-contained value-noise function, and hundreds to thousands of particles read that field frame by frame, steering toward the local flow direction. Instead of clearing every frame, the canvas is painted with a low-opacity dark rectangle so older positions decay slowly, leaving silky streamlines that reveal the shape of the hidden vector field.

Three controls let you shape the piece in real time: a particle-count slider trades density for performance, a field-scale slider zooms the noise between tight turbulence and broad sweeping currents, and a reset button reseeds the noise and scatters fresh particles. A play/pause toggle and a live FPS / particle readout round out the interaction, and the whole thing is keyboard-operable with visible focus rings.

Under the hood this demonstrates the Canvas 2D API together with requestAnimationFrame for the animation loop and devicePixelRatio scaling for crisp rendering on high-density displays. The value-noise implementation — a hashed integer lattice with smooth interpolation — needs no external library, so the entire effect is pure vanilla JavaScript.