Waves & noise · 03 · Perlin noise
Smooth randomness from a grid of arrows
Perlin noise puts a random gradient arrow on every grid corner. For any point, the four corners around it each vote with the dot product of their arrow and the offset to the point (amber numbers), and the votes are blended with a smooth fade curve. The result is random but continuous. Stack octaves, each twice the frequency and half the strength, for fractal detail. Drag the probe; the strip below is a slice along its row.
vᵢ = gᵢ · (p − cornerᵢ)
fade(t) = 6t⁵ − 15t⁴ + 10t³
n = lerp(lerp(v₀₀, v₁₀, u), lerp(v₀₁, v₁₁, u), v)
fBm = Σ ½ᵏ · n(2ᵏ p)
Grid cell{{r.cell}}
Position in cell (x, y){{r.local}}
Fade weights (u, v){{r.fadeW}}
Corner votes{{r.votes}}
Noise n (−1 … 1){{r.n}}
Mapped to 0 … 1{{r.n01}}
Used for terrain heightmaps, clouds, fire and water shaders, camera shake, and organic wandering motion.