Geometry clipmaps
Cache terrain heights as a stack of nested, camera-centered regular grids of equal size but doubling spacing, updated incrementally as the viewer moves.
Also known as clipmap terrain, geometry clipmap
In the family Performance, LOD & compression, terrain LOD
Where it runs
Built inOfficial add-onPluginNone foundNot researched
| Engine | Support | How |
|---|---|---|
| three.js r187 | None found | |
| Babylon.js 9.38.0 | None found | |
| Godot 4.7 | Plugin | Install Terrain3D (GDExtension) docs Third-party Terrain3D uses a geometry clipmap mesh. |
| Unity | None found | |
| Unreal 5.7 | None found | |
| Blender 5.2 | None found | |
| WebGPU W3C | None found | |
| Metal | None found |
How it works
Each LOD level is a square window of the heightmap of fixed vertex count; level k covers twice the world extent of level k-1 at half the sampling density. All levels are centered on the viewer, so detail falls off roughly with distance and the triangle count is nearly constant.
As the camera moves, each level shifts in toroidal fashion: only the strip of new rows and columns entering the window is uploaded or generated, the rest is reused. Because the grids are regular, they are drawn as instanced ring meshes with heights fetched in the vertex shader.
Seams between levels are hidden by blending heights over a transition band at each ring's outer edge (geomorphing) and by stitching or skirt triangles; the original also compresses the height data and synthesizes extra detail at the finest levels.
When to choose it
Reach for it when
- terrain mesh needs lod around the camera
- huge heightmap rendering with constant triangle count
- terrain vertices pop when lod changes
- open world ground detail near viewer only
- avoid cpu quadtree traversal for terrain
Choose it for very large heightfield terrain viewed from near the ground, when you want constant triangle budget and no CPU quadtree traversal. Prefer CDLOD terrain when you want adaptive detail per quadtree node (flat areas cost less) and smoother per-node morphing. Prefer Nanite virtualized geometry when terrain is arbitrary mesh rather than a heightfield, and use Interactive Hydraulic Erosion on Heightfields style data as the height source.
Field marks
- Cannot represent overhangs, caves or cliffs, since terrain is a single-valued height function
- Vertices swim or visibly pop when the clip window snaps and morphing is too short
- Cracks between rings if stitching and morph ranges disagree
- Uniform detail in flat regions wastes triangles compared with adaptive schemes
- Normals computed from coarse levels look faceted unless a separate normal map is used
Presets
Geometry Clipmaps — nested doubling LOD rings & morph bands (left) vs blended alpine terrain (right)
{
"P_RING_SCALE": 1,
"P_WIRE_GAIN": 0.9,
"P_CAM_SPEED": 0.7,
"P_SPLIT": 0.5
}Show GLSL (144 lines)
const float P_RING_SCALE = 1.0; // P Clipmap Scale [0.5, 2.0, 0.05]
const float P_WIRE_GAIN = 0.90; // P Grid Wireframe [0.0, 1.5, 0.05]
const float P_CAM_SPEED = 0.70; // P Flyover Speed [0.0, 2.0, 0.05]
const float P_SPLIT = 0.50; // P LOD Rings / Lit Split [0.0, 1.0, 0.02]
float hash21(vec2 p) {
p = fract(p * vec2(127.1, 311.7));
p += dot(p, p + 34.5);
return fract(p.x * p.y);
}
float noise2(vec2 p) {
vec2 i = floor(p);
vec2 f = fract(p);
f = f * f * (3.0 - 2.0 * f);
return mix(
mix(hash21(i), hash21(i + vec2(1.0, 0.0)), f.x),
mix(hash21(i + vec2(0.0, 1.0)), hash21(i + vec2(1.0, 1.0)), f.x),
f.y
);
}
// Multi-octave ridged alpine terrain heightfield
float terrainH(vec2 p) {
float h = 0.0;
float amp = 0.55;
float freq = 0.45;
for (int i = 0; i < 5; i++) {
float n = 1.0 - abs(noise2(p * freq) * 2.0 - 1.0);
h += n * n * amp;
p = mat2(0.8, 0.6, -0.6, 0.8) * p;
freq *= 2.05;
amp *= 0.48;
}
return h - 0.58;
}
vec3 terrainNormal(vec2 p) {
float e = 0.025;
float hx = terrainH(p + vec2(e, 0.0)) - terrainH(p - vec2(e, 0.0));
float hz = terrainH(p + vec2(0.0, e)) - terrainH(p - vec2(0.0, e));
return normalize(vec3(-hx, 2.0 * e, -hz));
}
vec3 lodPalette(float lvl) {
if (lvl < 0.5) return vec3(0.18, 0.90, 0.82); // L0 finest
if (lvl < 1.5) return vec3(0.28, 0.72, 0.98); // L1 2x
if (lvl < 2.5) return vec3(0.96, 0.78, 0.22); // L2 4x
if (lvl < 3.5) return vec3(0.96, 0.44, 0.20); // L3 8x
return vec3(0.76, 0.30, 0.88); // L4 16x
}
vec3 aces(vec3 x) {
x = max(x, 0.0);
return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14);
}
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
float screenX = fragCoord.x / max(iResolution.x, 1.0);
float split = clamp(P_SPLIT, 0.0, 1.0);
bool isLit = screenX >= split;
float ringScale = clamp(P_RING_SCALE, 0.45, 2.2);
float wireGain = clamp(P_WIRE_GAIN, 0.0, 1.5);
float flyZ = -iTime * max(P_CAM_SPEED, 0.0) * 1.1;
vec3 ro = vec3(0.0, 1.85, 2.2 + flyZ);
vec3 ta = vec3(0.0, 0.15, -3.2 + flyZ);
vec3 fwd = normalize(ta - ro);
vec3 right = normalize(cross(fwd, vec3(0.0, 1.0, 0.0)));
vec3 up = cross(right, fwd);
vec3 rd = normalize(fwd * 1.45 + right * uv.x + up * uv.y);
// Horizon sky
vec3 skyCol = mix(vec3(0.46, 0.62, 0.82), vec3(0.10, 0.20, 0.42), smoothstep(-0.08, 0.55, rd.y));
vec3 col = skyCol;
// Raymarch heightfield terrain
float t = 0.2;
bool hit = false;
for (int i = 0; i < 80; i++) {
vec3 p = ro + rd * t;
float h = terrainH(p.xz);
float d = p.y - h;
if (d < 0.008 * t) { hit = true; break; }
t += max(d * 0.55, 0.035);
if (t > 26.0) break;
}
if (hit) {
vec3 p = ro + rd * t;
vec3 n = terrainNormal(p.xz);
vec3 lDir = normalize(vec3(0.62, 0.68, 0.40));
float diff = max(dot(n, lDir), 0.0);
// Clipmap center anchored on camera XZ footprint: Chebyshev L-infinity square rings!
vec2 rel = abs(p.xz - ro.xz) / ringScale;
float cheb = max(rel.x, rel.y);
float contLvl = max(log2(max(cheb * 0.48, 0.5)), 0.0);
float lvl = floor(contLvl);
float ringFrac = fract(contLvl);
// Doubling grid cell spacing per clipmap level: 2^lvl * baseSpacing
float spacing = 0.18 * pow(2.0, min(lvl, 5.0)) * ringScale;
vec2 gUV = p.xz / spacing;
vec2 gf = abs(fract(gUV - 0.5) - 0.5);
float wire = smoothstep(0.075, 0.015, min(gf.x, gf.y));
// Diagonal triangle split edge inside each clipmap quad
float diag = smoothstep(0.06, 0.012, abs(fract(gUV.x + gUV.y) - 0.5));
wire = max(wire, diag * 0.45);
// Highlight concentric square ring transition morph band (outer 15% of each ring)
float morphBand = smoothstep(0.82, 0.96, ringFrac);
float ringSeam = smoothstep(0.04, 0.008, abs(ringFrac - 0.98));
// Natural alpine coloring (valley forest -> rock -> snow peaks)
float snow = smoothstep(0.08, 0.36, p.y) * smoothstep(0.45, 0.78, n.y);
vec3 ground = mix(vec3(0.16, 0.28, 0.18), vec3(0.38, 0.35, 0.32), smoothstep(-0.22, 0.16, p.y));
ground = mix(ground, vec3(0.92, 0.95, 0.98), snow);
vec3 litTerrain = ground * (0.24 + 0.92 * diff) + vec3(0.12, 0.20, 0.34) * (0.5 + 0.5 * n.y) * 0.28;
if (!isLit) {
// Left: nested clipmap LOD rings color-coded with doubling grid resolution & morph bands
vec3 ringCol = lodPalette(lvl);
vec3 nextCol = lodPalette(lvl + 1.0);
vec3 lodMix = mix(ringCol, nextCol, morphBand * 0.65);
col = mix(litTerrain * 0.42, lodMix * (0.35 + 0.75 * diff), 0.74);
col = mix(col, vec3(0.03, 0.05, 0.09), wire * 0.68 * min(wireGain, 1.2));
col = mix(col, vec3(1.0, 0.98, 0.85), ringSeam * 0.85);
} else {
// Right: seamless shaded terrain with subtle morph-band wireframe hint
col = litTerrain;
col = mix(col, vec3(0.10, 0.16, 0.24), wire * 0.12 * min(wireGain, 1.0));
}
float fog = 1.0 - exp(-t * t * 0.0045);
col = mix(col, skyCol, clamp(fog, 0.0, 0.88));
}
float sep = smoothstep(0.0035, 0.0008, abs(screenX - split));
col = mix(col, vec3(0.95, 0.97, 1.0), sep);
fragColor = vec4(pow(clamp(aces(col), 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);
}Attribution: MIT — written for this index.
Measured GPU weight & timing
| Preset | GPU | Weight / p50 / p95 | Method |
|---|---|---|---|
| geometry-clipmaps-terrain-live | Tesla T4 1920x1080 | 182× baseline (extreme) · 5.64 ms / 5.74 ms | opengl-timer-query · 36 frames · GPU Weight Atlas · Colab T4 sweep |
| geometry-clipmaps-terrain-live | NVIDIA L4 1920x1080 | 163× baseline (extreme) · 2.59 ms / 2.61 ms · 2.2× faster on L4 | opengl-timer-query · Cross-architecture validation |
| geometry-clipmaps-terrain-live | NVIDIA A100-SXM4-40GB 1920x1080 | 133× baseline (extreme) · 3.82 ms / 3.85 ms · 1.5× faster on A100 | opengl-timer-query · Cross-architecture validation |
Lineage
From the citation graph (Crossref reference lists): its primary source cites Geometry Images, Hardware tessellation: PN triangles and displacement.
Crosses
- Mesh-shader amplified geometry clipmaps with zero CPU draw calls: Concentric terrain clipmap rings generated and frustum-culled directly inside GPU task and mesh shaders eliminate CPU footprint updates, index-buffer stitching tables, and T-junction seam skirts across continental draw distances.
- Sparse virtual texturing: Clipmap rings give a camera-centered mesh whose color and normals come from a streamed virtual texture.
Sources
- primaryFrank Losasso, Hugues Hoppe (2004). Geometry clipmaps. ACM Transactions on Graphics.Verified via crossref · 2026-11-29doi:10.1145/1015706.1015799