{
 "id": "semi-sharp-creases",
 "title": "Semi-Sharp Creases",
 "aliases": [],
 "domain": "geometry",
 "subdomain": "subdivision surfaces",
 "stage": "geometry",
 "realtime": "realtime",
 "platforms": [
  "cpu",
  "blender",
  "unity",
  "unreal",
  "desktop-gpu"
 ],
 "year_introduced": 1998,
 "inputs": [
  "mesh"
 ],
 "outputs": [
  "mesh"
 ],
 "style": "both",
 "dynamic": "both",
 "summary": "Gives each subdivision edge a real-valued sharpness: for that many levels it follows sharp (crease) rules, then switches to smooth rules. Lets a coarse cage carry bevels and hard-to-soft transitions without extra edge loops.",
 "how_it_works": "Tag edges with a sharpness s >= 0. At each subdivision level, edges with s > 0 use the crease rules (new edge point on the edge midpoint; vertices on two creases follow a cubic B-spline curve along the crease) and their children receive s-1. Edges with s <= 0 use the standard smooth rule. A fractional s blends between the sharp and smooth outcomes, giving a continuum from soft bevel to hard line. A crease vertex touched by three or more creases is a corner. Integer sharpness ties the visual result to the number of subdivision levels used for display, so renderers evaluate the limit surface with the same sharpness semantics. The rules are defined on top of Catmull-Clark and extend to Loop.",
 "when_to_use": "Choose it when modelling hard-surface or mechanical forms on a subdivision cage and you want crisp edges that stay editable by a single number. Prefer extra support loops when the DCC pipeline or target engine does not support crease tags, and `catmull-clark-subdivision` alone for organic shapes.",
 "cost": {
  "class": "cheap",
  "notes": "Negligible beyond plain subdivision: a handful of extra branches per edge at each refinement level."
 },
 "failure_modes": [
  "Results differ if a viewer uses fewer subdivision levels than the sharpness value",
  "Creases ending inside a smooth region leave a visible dart-shaped pinch",
  "Fractional sharpness varies between implementations unless they follow the same blending rule",
  "Exports to formats without crease support silently turn them into smooth edges"
 ],
 "sources": [
  {
   "role": "primary",
   "key": "doi:10.1145/280814.280826",
   "type": "paper",
   "title": "Subdivision surfaces in character animation",
   "authors": [
    "Tony DeRose",
    "Michael Kass",
    "Tien Truong"
   ],
   "year": 1998,
   "venue": "Proceedings of the 25th annual conference on Computer graphics and interactive techniques  - SIGGRAPH '98",
   "url": "https://doi.org/10.1145/280814.280826",
   "ids": {
    "doi": "10.1145/280814.280826"
   },
   "license": null,
   "extra": {
    "csl_type": "proceedings-article"
   },
   "provenance": {
    "title": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/280814.280826",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/280814.280826",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/280814.280826",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/280814.280826",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/280814.280826",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": 1,
   "__bib": "derose1998subdivision"
  },
  {
   "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": "semi-sharp-creases-live",
   "title": "Semi-Sharp Creases — smooth C^2 fillet s=0 (left) vs tunable sharpness weight s (right)",
   "runtime": "glsl-fragment",
   "params": {
    "P_SHARPNESS": 3.5,
    "P_ZEBRA_VIS": 0.7,
    "P_ROT_SPEED": 0.7,
    "P_SPLIT": 0.48
   },
   "basis": "original",
   "license_note": "MIT — written for this index.",
   "code": "const float P_SHARPNESS = 3.5; // P Crease Weight s [0.0, 6.0, 0.1]\nconst float P_ZEBRA_VIS = 0.70; // P Zebra Curvature [0.0, 1.0, 0.05]\nconst float P_ROT_SPEED = 0.70; // P Spin Speed [0.0, 2.2, 0.05]\nconst float P_SPLIT = 0.48; // P Smooth / Crease Split [0.0, 1.0, 0.02]\n\nmat2 rot2(float a) { float c = cos(a), s = sin(a); return mat2(c, -s, s, c); }\n\nfloat sdRoundBox(vec3 p, vec3 b, float r) {\n  vec3 q = abs(p) - b + vec3(r);\n  return length(max(q, 0.0)) + min(max(q.x, max(q.y, q.z)), 0.0) - r;\n}\n\nfloat smin(float a, float b, float k) {\n  float h = clamp(0.5 + 0.5 * (b - a) / max(k, 1e-4), 0.0, 1.0);\n  return mix(b, a, h) - k * h * (1.0 - h);\n}\n\n// Mechanical cross-block with semi-sharp crease edges whose bevel radius decays as 2^(-s)\nfloat mapCreaseObj(vec3 p, float sharpness, float spin, out float creaseDist) {\n  vec3 q = p;\n  q.xz = rot2(spin * 0.55) * q.xz;\n  q.yz = rot2(0.45) * q.yz;\n\n  // Semi-sharp subdivision rule: sharpness s delays smooth averaging for s levels => fillet radius ~ r0 * 2^(-s)\n  float rCrease = 0.24 * pow(0.5, clamp(sharpness, 0.0, 6.0)) + 0.004;\n  float dMain = sdRoundBox(q, vec3(0.56, 0.56, 0.56), rCrease);\n  float dRib = sdRoundBox(q, vec3(0.76, 0.24, 0.24), rCrease * 0.85);\n  float dRib2 = sdRoundBox(q, vec3(0.24, 0.76, 0.24), rCrease * 0.85);\n  float d = smin(dMain, min(dRib, dRib2), rCrease * 0.9);\n\n  // Measure proximity to the tagged crease lines on the cube boundary\n  vec3 aq = abs(q);\n  float eXY = length(aq.xy - vec2(0.56));\n  float eYZ = length(aq.yz - vec2(0.56));\n  float eXZ = length(aq.xz - vec2(0.56));\n  creaseDist = min(eXY, min(eYZ, eXZ));\n  return d;\n}\n\nvec3 calcNormal(vec3 p, float sharpness, float spin) {\n  vec2 e = vec2(0.0018, 0.0);\n  float tmp;\n  return normalize(vec3(\n    mapCreaseObj(p + e.xyy, sharpness, spin, tmp) - mapCreaseObj(p - e.xyy, sharpness, spin, tmp),\n    mapCreaseObj(p + e.yxy, sharpness, spin, tmp) - mapCreaseObj(p - e.yxy, sharpness, spin, tmp),\n    mapCreaseObj(p + e.yyx, sharpness, spin, tmp) - mapCreaseObj(p - e.yyx, sharpness, spin, tmp)\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 screenX = fragCoord.x / max(iResolution.x, 1.0);\n  float split = clamp(P_SPLIT, 0.0, 1.0);\n  bool isCrease = screenX >= split;\n  float sharp = isCrease ? clamp(P_SHARPNESS, 0.0, 6.0) : 0.0;\n  float zebraAmt = clamp(P_ZEBRA_VIS, 0.0, 1.0);\n  float spin = iTime * max(P_ROT_SPEED, 0.0);\n\n  vec3 ro = vec3(0.0, 0.04, 2.55);\n  vec3 rd = normalize(vec3(uv, -1.55));\n\n  vec3 col = mix(vec3(0.025, 0.035, 0.055), vec3(0.072, 0.092, 0.138), smoothstep(-0.55, 0.55, uv.y));\n\n  float t = 0.0;\n  bool hit = false;\n  float cDist = 1.0;\n  for (int i = 0; i < 64; i++) {\n    float d = mapCreaseObj(ro + rd * t, sharp, spin, cDist);\n    if (d < 0.0018) { hit = true; break; }\n    t += d * 0.85;\n    if (t > 8.0) break;\n  }\n\n  if (hit) {\n    vec3 p = ro + rd * t;\n    vec3 n = calcNormal(p, sharp, spin);\n    vec3 rDir = reflect(rd, n);\n\n    // Studio zebra reflection stripes reveal exact G1/G2 continuity across the semi-sharp crease!\n    float zebra = smoothstep(-0.12, 0.12, sin(rDir.y * 26.0 + rDir.x * 10.0));\n    vec3 zebraCol = mix(vec3(0.10, 0.14, 0.22), vec3(0.92, 0.96, 1.0), zebra);\n\n    vec3 l1 = normalize(vec3(0.58, 0.82, 0.55));\n    float diff = max(dot(n, l1), 0.0);\n    float spec = pow(max(dot(n, normalize(l1 - rd)), 0.0), 64.0);\n    float fres = 0.10 + 0.90 * pow(1.0 - max(dot(n, -rd), 0.0), 4.0);\n\n    vec3 baseAlb = isCrease ? vec3(0.20, 0.68, 0.82) : vec3(0.76, 0.54, 0.36);\n    vec3 litCol = baseAlb * (0.28 + 0.82 * diff) + vec3(1.0) * spec * 0.65;\n    col = mix(litCol, zebraCol * (0.72 + 0.28 * baseAlb), zebraAmt * (0.45 + 0.45 * fres));\n\n    // Tag semi-sharp crease edges with crisp amber line on right side\n    if (isCrease && sharp > 0.2) {\n      float tagLine = smoothstep(0.038, 0.008, cDist);\n      col = mix(col, vec3(1.0, 0.78, 0.20), tagLine * 0.82 * clamp(sharp / 2.5, 0.0, 1.0));\n    }\n  }\n\n  float sep = smoothstep(0.0035, 0.0008, abs(screenX - split));\n  col = mix(col, vec3(0.95, 0.97, 1.0), sep);\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": "semi-sharp-creases",
     "runtime": "glsl-fragment",
     "checked_at": "2026-11-30T19:53:35.000Z",
     "renderer": "Headless EGL Tesla T4/PCIe/SSE2, OpenGL 3.30 Core, 512×512, iTime=1.5",
     "stats": {
      "mean": 0.5923,
      "std": 0.2167,
      "min": 0.1853,
      "max": 0.9046
     },
     "image": "/specimens/semi-sharp-creases-live.webp",
     "reason": null
    }
   }
  }
 ],
 "related": [
  "catmull-clark-subdivision",
  "loop-subdivision"
 ],
 "extends": [
  "catmull-clark-subdivision"
 ],
 "supersedes": [],
 "combines_with": [
  {
   "id": "catmull-clark-subdivision",
   "why": "Edge sharpness tags modify the refinement rules at each level."
  }
 ],
 "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/semi-sharp-creases.json"
 },
 "solves": [
  "subdivision surface rounds off hard edges",
  "need partially sharp edges on a smooth model",
  "control edge sharpness on subdivided mesh",
  "hard-surface models look blobby when subdivided"
 ],
 "authority": "DeRose et al., 1998",
 "url": "https://texelatlas.vercel.app/t/semi-sharp-creases/",
 "execution_fidelity": "conceptual-diagram",
 "fidelity_label": "Visual Diagram",
 "benchmark_eligible": false,
 "gpu_weight": {
  "weight_x": 21.52,
  "tier": "heavy",
  "p50_ms": 0.667,
  "p95_ms": 0.6933,
  "baseline_p50_ms": 0.0329,
  "gpu": "Tesla T4/PCIe/SSE2",
  "resolution": "1920x1080",
  "method": "opengl-timer-query",
  "frames": 36,
  "preset_id": "semi-sharp-creases-live",
  "execution_fidelity": "conceptual-diagram",
  "fidelity_label": "Visual Diagram",
  "benchmark_eligible": false,
  "generated_at": "2026-11-30T21:07:47Z",
  "l4": {
   "weight_x": 17.53,
   "tier": "moderate",
   "p50_ms": 0.2788,
   "p95_ms": 0.2986,
   "speedup_x": 2.39,
   "gpu": "NVIDIA L4/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0159
  },
  "a100": {
   "weight_x": 14.12,
   "tier": "moderate",
   "p50_ms": 0.4067,
   "p95_ms": 0.4136,
   "speedup_x": 1.64,
   "gpu": "NVIDIA A100-SXM4-40GB/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0288
  }
 }
}