Catmull-Clark Subdivision
Refines a quad-dominant control cage by inserting face, edge and vertex points each level, converging to a bicubic B-spline surface almost everywhere. The standard smooth-surface representation in film and modelling tools.
Also known as CC subdivision, subdiv
In the family Geometry, meshing & signed distance fields, subdivision surfaces
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 | None found | |
| Unity | None found | |
| Unreal 5.7 | Official add-on | Geometry Script plugin: Apply PolyGroup Catmull Clark Subd docs |
| Blender 5.2 | Built in | Add Modifier > Generate > Subdivision Surface > Catmull-Clark docs OpenSubdiv backend. |
| WebGPU W3C | None found | |
| Metal | None found |
How it works
Each step adds a point at every face centroid and a point on every edge (average of the two end points and the two adjacent face points), then moves each original vertex using a weighted blend of its old position, the average of adjacent face points and the average of adjacent edge midpoints, with weights depending on valence. Every face is replaced by quads, so after the first step the mesh is all quads. Regular regions (valence 4) become uniform bicubic B-spline patches; extraordinary vertices remain, with C1 continuity only. Production systems avoid explicit refinement: they evaluate patches directly with feature-adaptive subdivision, isolating extraordinary vertices over a few levels and drawing B-spline patches via tessellation hardware.
When to choose it
Reach for it when
- low-poly cage should become a smooth surface
- character model looks faceted and blocky
- need smooth limit surface from quad modelling
- want to sculpt with a coarse mesh and get a smooth result
- hard-surface model needs smoothing without losing edge flow
Choose it for authored characters and hard-surface models where a coarse cage drives a smooth limit surface and you want subdivision-friendly edge flow. Prefer Loop Subdivision for pure triangle meshes, Semi-Sharp Creases as an add-on when only some edges must stay crisp, and Quadric Error Metric Simplification plus normal maps when you need a game-ready low-poly rather than a smooth limit.
Field marks
- Pinching and curvature spikes at extraordinary vertices, particularly valence 3 and 5 with poor edge flow
- Shrinkage: the limit surface sits inside the cage, so tight features need extra loops
- Non-quad inputs produce triangles that make extraordinary points on the first step
- UV seams need dedicated face-varying rules or texture stretching and cracks appear on boundaries
Presets
Catmull-Clark subdivision — coarse quad control cage morphing into C2 limit surface with zebra stripes
{
"P_SUBDIV_LEVEL": 2.2,
"P_CAGE_WIRE": 0.85,
"P_ZEBRA_STRIPE": 0.65,
"P_ROT_SPEED": 1
}Show GLSL (148 lines)
const float P_SUBDIV_LEVEL = 2.2; // P Subdiv Level [0.0, 3.0, 0.05]
const float P_CAGE_WIRE = 0.85; // P Control Cage [0.0, 1.5, 0.05]
const float P_ZEBRA_STRIPE = 0.65; // P Curvature Zebra [0.0, 1.0, 0.02]
const float P_ROT_SPEED = 1.0; // P Spin Speed [0.0, 2.5, 0.05]
mat2 rot2(float a) { float c = cos(a), s = sin(a); return mat2(c, -s, s, c); }
float sdBox(vec3 p, vec3 b) {
vec3 q = abs(p) - b;
return length(max(q, 0.0)) + min(max(q.x, max(q.y, q.z)), 0.0);
}
// Smooth minimum (polynomial smin) modeling Catmull-Clark B-spline corner & crease smoothing
float smin(float a, float b, float k) {
if (k <= 1e-4) return min(a, b);
float h = clamp(0.5 + 0.5 * (b - a) / k, 0.0, 1.0);
return mix(b, a, h) - k * h * (1.0 - h);
}
// 3-axis quad cross control polyhedron (18-quad genus-0 cage) -> C2 limit surface as subdiv increases
float mapSubdiv(vec3 p, float level, float spin) {
vec3 q = p;
q.xz = rot2(spin * 0.42) * q.xz;
q.yz = rot2(0.38 + 0.12 * sin(spin * 0.5)) * q.yz;
float tSmooth = clamp(level / 3.0, 0.0, 1.0);
// Catmull-Clark shrinkage + bevel radius converge exponentially (1 - 2^-level) toward limit surface
float bevel = 0.012 + 0.24 * (1.0 - exp(-level * 1.15));
float shrink = 1.0 - 0.14 * tSmooth;
float kBlend = 0.01 + 0.28 * (1.0 - exp(-level * 1.1));
float dX = sdBox(q, vec3(0.86 * shrink, 0.30, 0.30) - vec3(bevel)) - bevel;
float dY = sdBox(q, vec3(0.30, 0.86 * shrink, 0.30) - vec3(bevel)) - bevel;
float dZ = sdBox(q, vec3(0.30, 0.30, 0.86 * shrink) - vec3(bevel)) - bevel;
return smin(smin(dX, dY, kBlend), dZ, kBlend) * 0.88;
}
// Distance to edges of the unsubdivided Level-0 quad control cage (wireframe hull)
float mapControlCage(vec3 p, float spin) {
vec3 q = p;
q.xz = rot2(spin * 0.42) * q.xz;
q.yz = rot2(0.38 + 0.12 * sin(spin * 0.5)) * q.yz;
float dX = sdBox(q, vec3(0.86, 0.30, 0.30));
float dY = sdBox(q, vec3(0.30, 0.86, 0.30));
float dZ = sdBox(q, vec3(0.30, 0.30, 0.86));
float dUnion = min(dX, min(dY, dZ));
// Extract sharp outer cage edges where two coordinate planes of a box meet
vec3 a = abs(q);
float eX = min(max(abs(a.y - 0.30), abs(a.z - 0.30)), max(abs(a.x - 0.86), min(abs(a.y - 0.30), abs(a.z - 0.30))));
float eY = min(max(abs(a.x - 0.30), abs(a.z - 0.30)), max(abs(a.y - 0.86), min(abs(a.x - 0.30), abs(a.z - 0.30))));
float eZ = min(max(abs(a.x - 0.30), abs(a.y - 0.30)), max(abs(a.z - 0.86), min(abs(a.x - 0.30), abs(a.y - 0.30))));
float wire = min(eX, min(eY, eZ));
return max(abs(dUnion) - 0.014, wire - 0.011);
}
vec3 calcNormal(vec3 p, float level, float spin) {
vec2 e = vec2(0.0025, 0.0);
return normalize(vec3(
mapSubdiv(p + e.xyy, level, spin) - mapSubdiv(p - e.xyy, level, spin),
mapSubdiv(p + e.yxy, level, spin) - mapSubdiv(p - e.yxy, level, spin),
mapSubdiv(p + e.yyx, level, spin) - mapSubdiv(p - e.yyx, level, spin)
));
}
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 spin = iTime * max(P_ROT_SPEED, 0.0);
float level = clamp(P_SUBDIV_LEVEL, 0.0, 3.0);
float cageVis = clamp(P_CAGE_WIRE, 0.0, 1.6);
float zebraAmt = clamp(P_ZEBRA_STRIPE, 0.0, 1.0);
vec3 ro = vec3(0.0, 0.12, 2.55);
vec3 rd = normalize(vec3(uv, -1.52));
vec3 col = mix(vec3(0.032, 0.042, 0.068), vec3(0.095, 0.118, 0.170), smoothstep(-0.55, 0.55, uv.y));
vec2 bgG = abs(fract(uv * 10.0 - 0.5) - 0.5);
col += vec3(0.018, 0.028, 0.045) * smoothstep(0.03, 0.0, min(bgG.x, bgG.y));
// Raymarch subdivided Catmull-Clark surface
float t = 0.0;
bool hit = false;
for (int i = 0; i < 64; i++) {
float d = mapSubdiv(ro + rd * t, level, spin);
if (d < 0.002) { hit = true; break; }
t += d;
if (t > 9.0) break;
}
if (hit) {
vec3 p = ro + rd * t;
vec3 n = calcNormal(p, level, spin);
// Object-space coordinates for subdivided quad grid overlay (density doubles at each subdivision level!)
vec3 objP = p;
objP.xz = rot2(spin * 0.42) * objP.xz;
objP.yz = rot2(0.38 + 0.12 * sin(spin * 0.5)) * objP.yz;
float quadFreq = 3.33 * pow(2.0, floor(level + 0.35));
vec3 gf = abs(fract(objP * quadFreq - 0.5) - 0.5);
// Project out the coordinate most aligned with normal to get clean surface quad-loop wireframes
vec3 an = abs(n);
float qEdge = (an.x > an.y && an.x > an.z) ? min(gf.y, gf.z) : ((an.y > an.z) ? min(gf.x, gf.z) : min(gf.x, gf.y));
float quadLine = smoothstep(0.055, 0.012, qEdge);
// Reflection zebra stripes (classic CAD C2 continuity diagnostic!)
vec3 rDir = reflect(rd, n);
float zebra = smoothstep(-0.12, 0.12, sin(rDir.y * 22.0 + rDir.x * 8.0));
vec3 l1 = normalize(vec3(0.62, 0.84, 0.58));
vec3 l2 = normalize(vec3(-0.72, -0.25, 0.55));
float diff1 = max(dot(n, l1), 0.0);
float diff2 = max(dot(n, l2), 0.0);
vec3 hVec = normalize(l1 - rd);
float spec = pow(max(dot(n, hVec), 0.0), 48.0) * 0.58;
float rim = pow(1.0 - max(dot(n, -rd), 0.0), 2.8) * 0.34;
vec3 clayAlb = vec3(0.24, 0.62, 0.86);
vec3 zebraAlb = mix(vec3(0.09, 0.12, 0.18), vec3(0.94, 0.96, 0.99), zebra);
vec3 alb = mix(clayAlb, zebraAlb, zebraAmt * 0.72);
col = alb * (0.26 + 0.84 * diff1 + 0.24 * diff2) + vec3(spec) + vec3(0.45, 0.78, 1.0) * rim;
col = mix(col, vec3(0.10, 0.92, 0.82), quadLine * 0.42);
}
// Transparently overlay the coarse Level-0 quad control cage wireframe in bright amber
if (cageVis > 0.01) {
float tc = 0.2;
for (int i = 0; i < 48; i++) {
float dc = mapControlCage(ro + rd * tc, spin);
if (dc < 0.004) {
float occFade = (!hit || tc < t + 0.04) ? 1.0 : 0.32;
col = mix(col, vec3(1.0, 0.74, 0.22), 0.82 * occFade * min(cageVis, 1.2));
break;
}
tc += max(dc * 0.75, 0.012);
if (tc > 6.5) break;
}
}
fragColor = vec4(pow(clamp(aces(col), 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);
}Attribution: Original interactive WebGL2 fragment shader written for Texel Atlas (MIT).
Measured GPU weight & timing
| Preset | GPU | Weight / p50 / p95 | Method |
|---|---|---|---|
| catmull-clark-subdivision-live | Tesla T4 1920x1080 | 35.6× baseline (heavy) · 1.12 ms / 1.17 ms | opengl-timer-query · 40 frames · GPU Weight Atlas · Colab T4 sweep |
| catmull-clark-subdivision-live | NVIDIA L4 1920x1080 | 37.1× baseline (heavy) · 0.587 ms / 0.600 ms · 1.9× faster on L4 | opengl-timer-query · Cross-architecture validation |
| catmull-clark-subdivision-live | NVIDIA A100-SXM4-40GB 1920x1080 | 22.7× baseline (heavy) · 0.655 ms / 0.663 ms · 1.7× faster on A100 | opengl-timer-query · Cross-architecture validation |
Lineage
From the citation graph (Crossref reference lists): cited by Instant Field-Aligned Meshes, Procedural City Generation (L-system Road Networks).
Crosses
- Semi-Sharp Creases: Crease sharpness tags per edge guide the subdivision rules for hard edges.
Sources
- primaryE. Catmull, J. Clark (1978). Recursively generated B-spline surfaces on arbitrary topological meshes. Computer-Aided Design.Verified via crossref · 2026-11-29doi:10.1016/0010-4485(78)90110-0
- implementationPixarAnimationStudios (2012). PixarAnimationStudios/OpenSubdiv. An Open-Source subdivision surface library.GitHub API · license NOASSERTION · 2026-11-29