Perlin Noise (gradient lattice noise)
A smooth, band-limited pseudo-random scalar field built by placing random gradient vectors on an integer lattice and blending their dot products. The original building block for procedural textures and terrain.
Also known as classic Perlin noise, gradient noise
In the family Procedural generation, noise functions
Where it runs
Built inOfficial add-onPluginNone foundNot researched
| Engine | Support | How |
|---|---|---|
| three.js r187 | Official add-on | import { ImprovedNoise } from 'three/addons/math/ImprovedNoise.js' docs |
| Babylon.js 9.38.0 | Official add-on | new BABYLON.PerlinNoiseProceduralTexture('n', size, scene) from @babylonjs/procedural-textures docs |
| Godot 4.7 | Built in | FastNoiseLite.noise_type = FastNoiseLite.TYPE_PERLIN docs |
| Unity | Built in | Mathf.PerlinNoise(x, y) docs 2D only; Unity.Mathematics adds 3D/4D. |
| Unreal 5.7 | Built in | Material Noise expression > Function = Gradient (texture based) docs Gradient noise, formerly labeled Perlin. |
| Blender 5.2 | Built in | Shader Editor > Add > Texture > Noise Texture docs |
| WebGPU W3C | None found | |
| Metal | None found |
How it works
Space is divided into unit cells. Each lattice corner gets a pseudo-random gradient vector, chosen by hashing the integer coordinates through a permutation table, so the field is a pure function of position with no stored data. For a sample point you take the offset vector to each corner of its cell, dot it with that corner's gradient, and blend the results with a smooth interpolant. Because every corner contributes exactly zero at its own location, the field passes through zero at lattice points and has a characteristic feature size of about one cell, which makes it band-limited and a good octave for spectral synthesis. Original 1985 noise used a cubic Hermite blend (3t^2-2t^3), which leaves visible second-derivative discontinuities; that flaw is what the 2002 revision fixes. Cost scales as 2^n corners in n dimensions.
When to choose it
Reach for it when
- need a cheap smooth random field
- procedural clouds, marble or bump maps from noise
- random values look harsh and uncorrelated
- seedable repeatable noise for heightfields
Choose it when you need a cheap, repeatable, seedable smooth field for clouds, marble, bump maps or heightfields, and axis-aligned artifacts are tolerable. Prefer Improved Perlin Noise for anything you will differentiate or use as a normal map, Simplex Noise for 4D or higher dimensions or less grid bias, and Worley (Cellular) Noise when you want cell or crack structures rather than blobs.
Field marks
- Axis-aligned grid bias: features and zero-crossings line up with lattice axes, visible as faint squares at low frequency
- Cubic Hermite fade gives second-derivative discontinuities, visible as creases in bump-mapped or lit surfaces
- Output is zero at every integer lattice point, so unrotated stacked octaves reinforce the same lattice pattern
- Range is not exactly [-1,1]; real amplitude is smaller and varies by dimension, which breaks naive thresholding
Presets
Classic Perlin gradient noise with lattice gradients shown, 3 octaves
{
"SCALE": 5,
"OCTAVES": 3
}Show GLSL (36 lines)
// Classic 2D Perlin gradient noise: lattice with random unit gradients (white ticks), value mapped to terrain-like colours, 3 octaves.
const float SCALE = 5.0;
const int OCTAVES = 3;
vec2 grad(vec2 i) {
float a = 6.2831853 * fract(sin(dot(i, vec2(127.1, 311.7))) * 43758.5453);
return vec2(cos(a), sin(a));
}
float noise(vec2 p) {
vec2 i = floor(p), f = fract(p), u = f * f * (3.0 - 2.0 * f);
return mix(mix(dot(grad(i), f), dot(grad(i + vec2(1, 0)), f - vec2(1, 0)), u.x),
mix(dot(grad(i + vec2(0, 1)), f - vec2(0, 1)), dot(grad(i + vec2(1, 1)), f - vec2(1, 1)), u.x), u.y);
}
float segd(vec2 p, vec2 a, vec2 b) {
vec2 pa = p - a, ba = b - a;
return length(pa - ba * clamp(dot(pa, ba) / dot(ba, ba), 0.0, 1.0));
}
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = fragCoord / iResolution.xy;
vec2 p = uv * SCALE;
float h = 0.0, amp = 0.5, fr = 1.0;
for (int o = 0; o < OCTAVES; o++) { h += amp * noise(p * fr); amp *= 0.5; fr *= 2.0; }
h = h * 1.6 + 0.5;
vec3 col = h < 0.45 ? mix(vec3(0.05, 0.15, 0.4), vec3(0.2, 0.5, 0.7), h / 0.45)
: h < 0.75 ? mix(vec3(0.25, 0.5, 0.2), vec3(0.6, 0.55, 0.3), (h - 0.45) / 0.3)
: mix(vec3(0.5, 0.45, 0.4), vec3(1.0), clamp((h - 0.75) * 3.0, 0.0, 1.0));
col *= 0.85 + 0.15 * sin(h * 60.0);
// lattice and first-octave gradients
vec2 id = floor(p + 0.5);
float g = segd(p, id, id + grad(id) * 0.3);
vec2 f = abs(fract(p) - 0.5);
col = mix(col, vec3(0.0), smoothstep(0.02, 0.0, min(f.x, f.y) - 0.48) * 0.35);
col = mix(col, vec3(1.0), smoothstep(0.02, 0.01, g));
col = mix(col, vec3(1.0), smoothstep(0.06, 0.04, length(p - id)));
fragColor = vec4(pow(col, vec3(0.8)), 1.0);
}
Attribution: written for this index
Measured GPU weight & timing
| Preset | GPU | Weight / p50 / p95 | Method |
|---|---|---|---|
| perlin-noise-specimen | Tesla T4 1920x1080 | 6.76× baseline (moderate) · 0.223 ms / 0.235 ms | opengl-timer-query · 40 frames · GPU Weight Atlas · Colab T4 sweep |
| perlin-noise-specimen | NVIDIA L4 1920x1080 | 6.09× baseline (moderate) · 0.097 ms / 0.097 ms · 2.3× faster on L4 | opengl-timer-query · Cross-architecture validation |
| perlin-noise-specimen | NVIDIA A100-SXM4-40GB 1920x1080 | 4.17× baseline (light) · 0.120 ms / 0.120 ms · 1.9× faster on A100 | opengl-timer-query · Cross-architecture validation |
Lineage
From the citation graph (Crossref reference lists): cited by Curl noise for procedural fluid motion, Histogram-preserving blending (stochastic texturing), Shallow Water Equations (Height-field Water), Interactive watercolor rendering with temporal coherence, Weathering simulation (weathered stone).
Crosses
- Fractal Brownian Motion and Multifractals: Summing octaves of this noise yields the natural-looking spectrum fBm needs.
Sources
- primaryKen Perlin (1985). An image synthesizer. Proceedings of the 12th annual conference on Computer graphics and interactive techniques - SIGGRAPH '85.Verified via crossref · 2026-11-29doi:10.1145/325334.325247
- tutorialPatricio Gonzalez Vivo. The Book of Shaders: Noise. thebookofshaders.com.Verified via live page · 2026-11-29
- tutorialInigo Quilez. Gradient Noise - Derivatives. iquilezles.org.Verified via live page · 2026-11-29