Interactive demo

Curl Noise

The curl of a noise field is a velocity field that never compresses or expands, like an incompressible fluid. Particles that follow it swirl like smoke but never bunch up, which makes curl noise a favorite for visual effects.

Your browser does not support the HTML5 canvas tag.

Switch the field to Gradient: the particles now run uphill and gather on the peaks of the noise. In the curl field they follow its contour lines instead.

Controls

Display

Legend

  • Particle trails
  • Noise field (potential), light = high
  • Flow direction

Noise types compared

NoiseOutputBuilt fromWork per sampleSmooth
Value NoiseScalar fieldRandom values on a grid4 grid pointsYes
Perlin NoiseScalar fieldRandom gradients on a grid4 grid pointsYes
Simplex NoiseScalar fieldGradients on a triangle grid3 cornersYes
Worley NoiseScalar fieldRandom feature points9 to 25 cellsNo
Blue NoisePoint setRandom candidates around existing pointsUp to 30 tries per point–
Fractal NoiseScalar fieldOctaves of a base noise1 base noise per octaveYes
Diamond-SquareHeightmapDisplaced midpoints of a grid4 neighbors per pointNo
Colors of NoiseSignal or imageWhite noise filtered by frequency1 FFT for all samples–
Domain WarpingScalar fieldFractal noise at warped positionsUp to 5 fractal noisesYes
Curl Noise this pageVector fieldDerivatives of a noise field4 noise samplesYes
Noise Terrain GeneratorHeightmapStacked noise layersLayers × octaves–

1. Curl of a potential

The noise ψ(x, y) serves as a potential. The velocity is v = (∂ψ/∂y, −∂ψ/∂x), the gradient turned by 90°. It runs along the contour lines of ψ, so the particles circle around the highs and lows of the noise.

2. No sources, no sinks

The divergence of this field is zero everywhere: as much flows into every small area as flows out of it, so the particles stay evenly spread. The gradient field (∂ψ/∂x, ∂ψ/∂y) has sources and sinks, and the particles pile up in its sinks.

3. Around obstacles

To make the flow avoid an obstacle, the potential is multiplied by a smooth ramp of the distance to it. On the boundary the potential becomes zero, so the boundary is a contour line and the flow glides along it instead of passing through.

Credits