Interactive demo

Perlin Noise

Perlin noise, invented by Ken Perlin in 1983, creates smooth and natural-looking randomness. It is the basis of countless procedural textures, clouds and landscapes.

Your browser does not support the HTML5 canvas tag.

The arrows are the random gradients at the grid points. Switch the interpolation to Linear to see why the fade curve matters.

Controls

Legend

  • Grid point and its gradient

Noise types compared

NoiseOutputBuilt fromWork per sampleSmooth
Value NoiseScalar fieldRandom values on a grid4 grid pointsYes
Perlin Noise this pageScalar 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 NoiseVector fieldDerivatives of a noise field4 noise samplesYes
Noise Terrain GeneratorHeightmapStacked noise layersLayers × octaves–

1. A grid of gradients

Every grid point gets a random unit vector, its gradient. The noise is exactly 0 at every grid point; around it, the noise rises in the direction the gradient points to.

2. Dot products

For a point inside a cell, the vectors from the four corners to the point are multiplied with the gradients of the corners (dot product). This gives one value per corner.

3. Smooth blending

The four values are blended with the fade curve 6t⁵ − 15t⁴ + 10t³. Its first and second derivatives are zero at the cell edges, so no creases appear. With linear blending the grid shows clearly.