{
 "id": "catmull-clark-subdivision",
 "title": "Catmull-Clark Subdivision",
 "aliases": [
  "CC subdivision",
  "subdiv"
 ],
 "domain": "geometry",
 "subdomain": "subdivision surfaces",
 "stage": "geometry",
 "realtime": "realtime",
 "platforms": [
  "cpu",
  "webgpu",
  "webgl2",
  "desktop-gpu",
  "blender",
  "unity",
  "unreal"
 ],
 "year_introduced": 1978,
 "inputs": [
  "mesh"
 ],
 "outputs": [
  "mesh"
 ],
 "style": "both",
 "dynamic": "both",
 "summary": "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.",
 "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_use": "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 `qem-mesh-simplification` plus normal maps when you need a game-ready low-poly rather than a smooth limit.",
 "cost": {
  "class": "medium",
  "notes": "Cost grows 4x in faces per level. Real-time engines evaluate the limit surface in tessellation or compute with adaptive patch counts."
 },
 "failure_modes": [
  "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"
 ],
 "sources": [
  {
   "role": "primary",
   "key": "doi:10.1016/0010-4485(78)90110-0",
   "type": "paper",
   "title": "Recursively generated B-spline surfaces on arbitrary topological meshes",
   "authors": [
    "E. Catmull",
    "J. Clark"
   ],
   "year": 1978,
   "venue": "Computer-Aided Design",
   "url": "https://doi.org/10.1016/0010-4485(78)90110-0",
   "ids": {
    "doi": "10.1016/0010-4485(78)90110-0"
   },
   "license": null,
   "extra": {
    "csl_type": "journal-article"
   },
   "provenance": {
    "title": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1016/0010-4485(78)90110-0",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1016/0010-4485(78)90110-0",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1016/0010-4485(78)90110-0",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1016/0010-4485(78)90110-0",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1016/0010-4485(78)90110-0",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": 1,
   "__bib": "catmull1978recursively"
  },
  {
   "role": "implementation",
   "key": "gh:pixaranimationstudios/opensubdiv",
   "type": "code",
   "title": "PixarAnimationStudios/OpenSubdiv",
   "description": "An Open-Source subdivision surface library.",
   "authors": [
    "PixarAnimationStudios"
   ],
   "year": 2012,
   "venue": "GitHub",
   "url": "https://github.com/PixarAnimationStudios/OpenSubdiv",
   "ids": {
    "repo": "PixarAnimationStudios/OpenSubdiv"
   },
   "license": "NOASSERTION",
   "extra": {
    "stars": 3092,
    "stars_checked": "2026-11-29",
    "archived": false,
    "fork": false,
    "pushed_at": "2026-10-26T15:09:38Z",
    "language": "C++",
    "homepage": "https://www.opensubdiv.org",
    "license_name": "Other"
   },
   "provenance": {
    "title": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/PixarAnimationStudios/OpenSubdiv",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/PixarAnimationStudios/OpenSubdiv",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/PixarAnimationStudios/OpenSubdiv",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/PixarAnimationStudios/OpenSubdiv",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/PixarAnimationStudios/OpenSubdiv",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "license": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/PixarAnimationStudios/OpenSubdiv",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": null,
   "__bib": "pixaranimationstudios2012pixaranimationstudios"
  }
 ],
 "presets": [
  {
   "id": "catmull-clark-subdivision-live",
   "title": "Catmull-Clark subdivision — coarse quad control cage morphing into C2 limit surface with zebra stripes",
   "runtime": "glsl-fragment",
   "params": {
    "P_SUBDIV_LEVEL": 2.2,
    "P_CAGE_WIRE": 0.85,
    "P_ZEBRA_STRIPE": 0.65,
    "P_ROT_SPEED": 1
   },
   "basis": "original",
   "license_note": "Original interactive WebGL2 fragment shader written for Texel Atlas (MIT).",
   "code": "const float P_SUBDIV_LEVEL = 2.2; // P Subdiv Level [0.0, 3.0, 0.05]\nconst float P_CAGE_WIRE = 0.85; // P Control Cage [0.0, 1.5, 0.05]\nconst float P_ZEBRA_STRIPE = 0.65; // P Curvature Zebra [0.0, 1.0, 0.02]\nconst float P_ROT_SPEED = 1.0; // P Spin Speed [0.0, 2.5, 0.05]\n\nmat2 rot2(float a) { float c = cos(a), s = sin(a); return mat2(c, -s, s, c); }\n\nfloat sdBox(vec3 p, vec3 b) {\n  vec3 q = abs(p) - b;\n  return length(max(q, 0.0)) + min(max(q.x, max(q.y, q.z)), 0.0);\n}\n\n// Smooth minimum (polynomial smin) modeling Catmull-Clark B-spline corner & crease smoothing\nfloat smin(float a, float b, float k) {\n  if (k <= 1e-4) return min(a, b);\n  float h = clamp(0.5 + 0.5 * (b - a) / k, 0.0, 1.0);\n  return mix(b, a, h) - k * h * (1.0 - h);\n}\n\n// 3-axis quad cross control polyhedron (18-quad genus-0 cage) -> C2 limit surface as subdiv increases\nfloat mapSubdiv(vec3 p, float level, float spin) {\n  vec3 q = p;\n  q.xz = rot2(spin * 0.42) * q.xz;\n  q.yz = rot2(0.38 + 0.12 * sin(spin * 0.5)) * q.yz;\n\n  float tSmooth = clamp(level / 3.0, 0.0, 1.0);\n  // Catmull-Clark shrinkage + bevel radius converge exponentially (1 - 2^-level) toward limit surface\n  float bevel = 0.012 + 0.24 * (1.0 - exp(-level * 1.15));\n  float shrink = 1.0 - 0.14 * tSmooth;\n  float kBlend = 0.01 + 0.28 * (1.0 - exp(-level * 1.1));\n\n  float dX = sdBox(q, vec3(0.86 * shrink, 0.30, 0.30) - vec3(bevel)) - bevel;\n  float dY = sdBox(q, vec3(0.30, 0.86 * shrink, 0.30) - vec3(bevel)) - bevel;\n  float dZ = sdBox(q, vec3(0.30, 0.30, 0.86 * shrink) - vec3(bevel)) - bevel;\n  return smin(smin(dX, dY, kBlend), dZ, kBlend) * 0.88;\n}\n\n// Distance to edges of the unsubdivided Level-0 quad control cage (wireframe hull)\nfloat mapControlCage(vec3 p, float spin) {\n  vec3 q = p;\n  q.xz = rot2(spin * 0.42) * q.xz;\n  q.yz = rot2(0.38 + 0.12 * sin(spin * 0.5)) * q.yz;\n\n  float dX = sdBox(q, vec3(0.86, 0.30, 0.30));\n  float dY = sdBox(q, vec3(0.30, 0.86, 0.30));\n  float dZ = sdBox(q, vec3(0.30, 0.30, 0.86));\n  float dUnion = min(dX, min(dY, dZ));\n\n  // Extract sharp outer cage edges where two coordinate planes of a box meet\n  vec3 a = abs(q);\n  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))));\n  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))));\n  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))));\n  float wire = min(eX, min(eY, eZ));\n  return max(abs(dUnion) - 0.014, wire - 0.011);\n}\n\nvec3 calcNormal(vec3 p, float level, float spin) {\n  vec2 e = vec2(0.0025, 0.0);\n  return normalize(vec3(\n    mapSubdiv(p + e.xyy, level, spin) - mapSubdiv(p - e.xyy, level, spin),\n    mapSubdiv(p + e.yxy, level, spin) - mapSubdiv(p - e.yxy, level, spin),\n    mapSubdiv(p + e.yyx, level, spin) - mapSubdiv(p - e.yyx, level, spin)\n  ));\n}\n\nvec3 aces(vec3 x) {\n  x = max(x, 0.0);\n  return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14);\n}\n\nvoid mainImage(out vec4 fragColor, in vec2 fragCoord) {\n  vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;\n  float spin = iTime * max(P_ROT_SPEED, 0.0);\n  float level = clamp(P_SUBDIV_LEVEL, 0.0, 3.0);\n  float cageVis = clamp(P_CAGE_WIRE, 0.0, 1.6);\n  float zebraAmt = clamp(P_ZEBRA_STRIPE, 0.0, 1.0);\n\n  vec3 ro = vec3(0.0, 0.12, 2.55);\n  vec3 rd = normalize(vec3(uv, -1.52));\n\n  vec3 col = mix(vec3(0.032, 0.042, 0.068), vec3(0.095, 0.118, 0.170), smoothstep(-0.55, 0.55, uv.y));\n  vec2 bgG = abs(fract(uv * 10.0 - 0.5) - 0.5);\n  col += vec3(0.018, 0.028, 0.045) * smoothstep(0.03, 0.0, min(bgG.x, bgG.y));\n\n  // Raymarch subdivided Catmull-Clark surface\n  float t = 0.0;\n  bool hit = false;\n  for (int i = 0; i < 64; i++) {\n    float d = mapSubdiv(ro + rd * t, level, spin);\n    if (d < 0.002) { hit = true; break; }\n    t += d;\n    if (t > 9.0) break;\n  }\n\n  if (hit) {\n    vec3 p = ro + rd * t;\n    vec3 n = calcNormal(p, level, spin);\n\n    // Object-space coordinates for subdivided quad grid overlay (density doubles at each subdivision level!)\n    vec3 objP = p;\n    objP.xz = rot2(spin * 0.42) * objP.xz;\n    objP.yz = rot2(0.38 + 0.12 * sin(spin * 0.5)) * objP.yz;\n\n    float quadFreq = 3.33 * pow(2.0, floor(level + 0.35));\n    vec3 gf = abs(fract(objP * quadFreq - 0.5) - 0.5);\n    // Project out the coordinate most aligned with normal to get clean surface quad-loop wireframes\n    vec3 an = abs(n);\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));\n    float quadLine = smoothstep(0.055, 0.012, qEdge);\n\n    // Reflection zebra stripes (classic CAD C2 continuity diagnostic!)\n    vec3 rDir = reflect(rd, n);\n    float zebra = smoothstep(-0.12, 0.12, sin(rDir.y * 22.0 + rDir.x * 8.0));\n\n    vec3 l1 = normalize(vec3(0.62, 0.84, 0.58));\n    vec3 l2 = normalize(vec3(-0.72, -0.25, 0.55));\n    float diff1 = max(dot(n, l1), 0.0);\n    float diff2 = max(dot(n, l2), 0.0);\n    vec3 hVec = normalize(l1 - rd);\n    float spec = pow(max(dot(n, hVec), 0.0), 48.0) * 0.58;\n    float rim = pow(1.0 - max(dot(n, -rd), 0.0), 2.8) * 0.34;\n\n    vec3 clayAlb = vec3(0.24, 0.62, 0.86);\n    vec3 zebraAlb = mix(vec3(0.09, 0.12, 0.18), vec3(0.94, 0.96, 0.99), zebra);\n    vec3 alb = mix(clayAlb, zebraAlb, zebraAmt * 0.72);\n\n    col = alb * (0.26 + 0.84 * diff1 + 0.24 * diff2) + vec3(spec) + vec3(0.45, 0.78, 1.0) * rim;\n    col = mix(col, vec3(0.10, 0.92, 0.82), quadLine * 0.42);\n  }\n\n  // Transparently overlay the coarse Level-0 quad control cage wireframe in bright amber\n  if (cageVis > 0.01) {\n    float tc = 0.2;\n    for (int i = 0; i < 48; i++) {\n      float dc = mapControlCage(ro + rd * tc, spin);\n      if (dc < 0.004) {\n        float occFade = (!hit || tc < t + 0.04) ? 1.0 : 0.32;\n        col = mix(col, vec3(1.0, 0.74, 0.22), 0.82 * occFade * min(cageVis, 1.2));\n        break;\n      }\n      tc += max(dc * 0.75, 0.012);\n      if (tc > 6.5) break;\n    }\n  }\n\n  fragColor = vec4(pow(clamp(aces(col), 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);\n}",
   "execution_fidelity": "conceptual-diagram",
   "proof": {
    "kind": "rendered",
    "label": "rendered 2026-11-30",
    "ok": true,
    "proof": {
     "ok": true,
     "technique": "catmull-clark-subdivision",
     "runtime": "glsl-fragment",
     "checked_at": "2026-11-30T19:04:27.000Z",
     "renderer": "Headless EGL Tesla T4/PCIe/SSE2, OpenGL 3.30 Core, 512×512, iTime=1.5",
     "stats": {
      "mean": 0.6361,
      "std": 0.2145,
      "min": 0.2136,
      "max": 0.9345
     },
     "image": "/specimens/catmull-clark-subdivision-live.webp",
     "reason": null
    }
   }
  }
 ],
 "related": [
  "loop-subdivision",
  "semi-sharp-creases",
  "qem-mesh-simplification"
 ],
 "extends": [],
 "supersedes": [],
 "combines_with": [
  {
   "id": "semi-sharp-creases",
   "why": "Crease sharpness tags per edge guide the subdivision rules for hard edges."
  }
 ],
 "provenance": {
  "prose": "original text written for this index (research draft, editorially reviewed)",
  "sources_verified_at": "2026-11-29T15:51:27.588Z",
  "draft": "data/drafts/geometry/catmull-clark-subdivision.json"
 },
 "solves": [
  "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"
 ],
 "authority": "Catmull & Clark, 1978",
 "url": "https://texelatlas.vercel.app/t/catmull-clark-subdivision/",
 "execution_fidelity": "conceptual-diagram",
 "fidelity_label": "Visual Diagram",
 "benchmark_eligible": false,
 "gpu_weight": {
  "weight_x": 35.64,
  "tier": "heavy",
  "p50_ms": 1.1191,
  "p95_ms": 1.1678,
  "baseline_p50_ms": 0.0329,
  "gpu": "Tesla T4/PCIe/SSE2",
  "resolution": "1920x1080",
  "method": "opengl-timer-query",
  "frames": 40,
  "preset_id": "catmull-clark-subdivision-live",
  "execution_fidelity": "conceptual-diagram",
  "fidelity_label": "Visual Diagram",
  "benchmark_eligible": false,
  "generated_at": "2026-11-30T21:07:47Z",
  "l4": {
   "weight_x": 37.14,
   "tier": "heavy",
   "p50_ms": 0.5868,
   "p95_ms": 0.6003,
   "speedup_x": 1.91,
   "gpu": "NVIDIA L4/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0159
  },
  "a100": {
   "weight_x": 22.73,
   "tier": "heavy",
   "p50_ms": 0.6547,
   "p95_ms": 0.6634,
   "speedup_x": 1.71,
   "gpu": "NVIDIA A100-SXM4-40GB/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0288
  }
 }
}