{
 "id": "shell-fur-rendering",
 "title": "Shell and fin fur rendering",
 "aliases": [
  "shell texturing",
  "shells and fins",
  "volumetric fur shells"
 ],
 "domain": "materials",
 "subdomain": "hair and fur",
 "stage": "material",
 "realtime": "realtime",
 "platforms": [
  "webgl2",
  "webgpu",
  "desktop-gpu",
  "mobile-gpu",
  "unity",
  "unreal",
  "godot"
 ],
 "year_introduced": 2001,
 "inputs": [
  "mesh",
  "texture"
 ],
 "outputs": [
  "radiance"
 ],
 "style": "both",
 "dynamic": "dynamic",
 "summary": "Renders short fur by drawing the mesh many times, each copy pushed out a little along the normal with a strand-density alpha texture, plus extruded fin quads along silhouettes. It is cheap, GPU friendly and easy to animate.",
 "how_it_works": "Shells: draw N offset copies of the skin mesh, shell k displaced by k/N times the fur length along the vertex normal. A texture or procedural hash holds a random strand pattern; each shell keeps only texels whose strand height exceeds k/N, so layers stack into tapered strands when viewed from above. Colour darkens toward the root for fake self-shadowing, and lighting uses a Kajiya-Kay-style tangent or a simple normal blend. Forces such as gravity, wind or animation velocity bend higher shells by an increasing offset. Shells look like stacked slices at the silhouette, so Lengyel's fins add quads extruded perpendicular to the surface along edges facing sideways, textured with a side view of the fur. Modern versions generate the shells with instancing and a hash-based strand mask in the fragment shader, avoiding a texture entirely.",
 "when_to_use": "Choose it for short fur on characters, creatures and stylised props where overdraw is acceptable and strands do not need to be individual curves. Prefer `strand-based-real-time-hair` for long hair with simulation and silhouettes. Prefer `kajiya-kay-hair-shading` on hair cards for long styles. For stylised grass or carpet the same shell approach works with a different mask. For path-traced fur use `disney-hair-bsdf`.",
 "cost": {
  "class": "medium",
  "notes": "Scales with shell count times covered pixels; 16-64 shells is typical and is overdraw-bound."
 },
 "failure_modes": [
  "Visible layering and gaps at silhouettes when viewed from low angles, unless fins or more shells are added",
  "Heavy overdraw and alpha-test cost when many characters are covered with fur",
  "Shimmering strand pattern when shells alias at distance without LOD shell reduction",
  "Strands penetrate or stretch where vertex normals change sharply, because offsets follow the normal",
  "Shadow casting is poor since shells are alpha-tested slices"
 ],
 "sources": [
  {
   "role": "primary",
   "key": "doi:10.1145/364338.364407",
   "type": "paper",
   "title": "Real-time fur over arbitrary surfaces",
   "authors": [
    "Jerome Lengyel",
    "Emil Praun",
    "Adam Finkelstein",
    "Hugues Hoppe"
   ],
   "year": 2001,
   "venue": "Proceedings of the 2001 symposium on Interactive 3D graphics",
   "url": "https://doi.org/10.1145/364338.364407",
   "ids": {
    "doi": "10.1145/364338.364407"
   },
   "license": null,
   "extra": {
    "csl_type": "proceedings-article"
   },
   "provenance": {
    "title": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/364338.364407",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/364338.364407",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/364338.364407",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/364338.364407",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/364338.364407",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": 1,
   "__bib": "lengyel2001over"
  },
  {
   "role": "implementation",
   "key": "gh:gokayfem/glsl-studies",
   "ids": {
    "repo": "gokayfem/glsl-studies"
   },
   "type": "code",
   "title": "gokayfem/glsl-studies",
   "authors": [
    "Gökay Aydoğan"
   ],
   "year": 2026,
   "venue": "GitHub",
   "url": "https://github.com/gokayfem/glsl-studies",
   "license": "MIT",
   "description": "454 procedural graphics studies in GLSL ES 3.00 for WebGL2, from woven cloth and animal fur to glacial terrain and atmospheric optics. Each study includes shader source and a rendered preview.",
   "extra": {
    "stars": 924,
    "stars_checked": "2026-11-30",
    "language": "GLSL",
    "archived": false,
    "fork": false,
    "pushed_at": "2026-11-30T13:13:54Z",
    "homepage": null,
    "license_name": "MIT License"
   },
   "provenance": {
    "title": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/gokayfem/glsl-studies",
     "checked_at": "2026-11-30T21:49:39.376Z"
    },
    "authors": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/gokayfem/glsl-studies",
     "checked_at": "2026-11-30T21:49:39.376Z"
    },
    "year": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/gokayfem/glsl-studies",
     "checked_at": "2026-11-30T21:49:39.376Z"
    },
    "venue": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/gokayfem/glsl-studies",
     "checked_at": "2026-11-30T21:49:39.376Z"
    },
    "url": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/gokayfem/glsl-studies",
     "checked_at": "2026-11-30T21:49:39.376Z"
    },
    "license": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/gokayfem/glsl-studies",
     "checked_at": "2026-11-30T21:49:39.376Z"
    }
   },
   "status": "verified",
   "title_sim": null,
   "checked_at": "2026-11-30T21:49:39.376Z",
   "__bib": "aydoan2026gokayfem"
  }
 ],
 "presets": [
  {
   "id": "shell-fur-rendering-live",
   "title": "Concentric volumetric fur shells — procedural tapered strands, root AO and wind sway",
   "runtime": "glsl-fragment",
   "params": {
    "SHELLS": 24,
    "FUR_LENGTH": 0.16,
    "STRAND_DENSITY": 46,
    "GRAVITY_SWAY": 0.32
   },
   "basis": "original",
   "license_note": "MIT — written for this index",
   "code": "const int SHELLS = 24; // P\nconst float FUR_LENGTH = 0.16; // P\nconst float STRAND_DENSITY = 46.0; // P\nconst float GRAVITY_SWAY = 0.32; // P\n\nvec2 hash22(vec2 p) {\n  vec3 q = fract(vec3(p.xyx) * vec3(0.1031, 0.1030, 0.0973));\n  q += dot(q, q.yzx + 33.33);\n  return fract((q.xx + q.yz) * q.zy);\n}\n\n// Cube-face octahedral projection avoids spherical UV pinching at poles\nvec2 sphereFaceUV(vec3 d) {\n  vec3 a = abs(d);\n  if (a.x >= a.y && a.x >= a.z) return d.yz / a.x + vec2(d.x > 0.0 ? 2.0 : -2.0, 0.0);\n  if (a.y >= a.x && a.y >= a.z) return d.xz / a.y + vec2(0.0, d.y > 0.0 ? 4.0 : -4.0);\n  return d.xy / a.z + vec2(d.z > 0.0 ? 6.0 : -6.0, 0.0);\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  vec3 ro = vec3(0.0, 0.08, 2.55);\n  vec3 rd = normalize(vec3(uv, -1.55));\n\n  float baseR = 0.68;\n  float furL = clamp(FUR_LENGTH, 0.01, 0.36);\n  float outerR = baseR + furL;\n\n  vec3 bg = mix(vec3(0.045, 0.055, 0.075), vec3(0.14, 0.16, 0.21), clamp(uv.y + 0.55, 0.0, 1.0));\n  float b = dot(ro, rd);\n  float cOut = dot(ro, ro) - outerR * outerR;\n  float hOut = b * b - cOut;\n  if (hOut < 0.0) {\n    fragColor = vec4(pow(clamp(aces(bg), 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);\n    return;\n  }\n\n  float tEnter = max(-b - sqrt(hOut), 0.0);\n  float tExit = -b + sqrt(hOut);\n  float cIn = dot(ro, ro) - baseR * baseR;\n  float hIn = b * b - cIn;\n  if (hIn > 0.0) tExit = min(tExit, -b - sqrt(hIn));\n\n  float yaw = iTime * 0.28;\n  if (iMouse.z > 0.5 || length(iMouse.xy) > 1.0) {\n    yaw = (iMouse.x / iResolution.x - 0.5) * 3.14159;\n  }\n  float cy = cos(yaw), sy = sin(yaw);\n  mat2 rotY = mat2(cy, -sy, sy, cy);\n\n  vec3 lightDir = normalize(vec3(0.62, 0.72, 0.55));\n  vec3 rimDir = normalize(vec3(-0.75, 0.35, -0.45));\n  int nShells = clamp(SHELLS, 4, 48);\n  float dens = max(STRAND_DENSITY, 8.0);\n  float sway = max(GRAVITY_SWAY, 0.0);\n\n  // March front-to-back through concentric fur shells\n  vec3 accum = vec3(0.0);\n  float alpha = 0.0;\n  for (int i = 0; i < 48; i++) {\n    if (i >= nShells || alpha > 0.98) break;\n    float f = (float(i) + 0.5) / float(nShells);\n    float t = mix(tEnter, tExit, f);\n    vec3 wp = ro + rd * t;\n    float r = length(wp);\n    float hNorm = clamp((r - baseR) / furL, 0.0, 1.0);\n    vec3 n = wp / max(r, 1e-4);\n\n    // Gravity droop + animated wind wave increasing quadratically from root to tip\n    vec3 wind = vec3(sin(iTime * 1.8 + wp.y * 3.0) * 0.35, -0.65, cos(iTime * 1.4 + wp.x * 3.0) * 0.25);\n    vec3 bentDir = normalize(n - wind * (hNorm * hNorm * sway * 0.55));\n    vec3 locDir = vec3(rotY * bentDir.xz, bentDir.y).xzy;\n    vec2 fuv = sphereFaceUV(locDir) * dens;\n    vec2 cell = floor(fuv);\n    vec2 frac = fract(fuv) - 0.5;\n    vec2 rnd = hash22(cell);\n    vec2 jitter = (rnd - 0.5) * 0.42;\n\n    float strandH = 0.32 + 0.68 * hash22(cell + vec2(17.3, 41.9)).x;\n    float taper = mix(0.46, 0.05, hNorm / max(strandH, 0.01));\n    float dist = length(frac - jitter);\n    float hitStrand = (hNorm < strandH) ? smoothstep(taper + 0.06, taper - 0.06, dist) : 0.0;\n\n    if (hitStrand > 0.01) {\n      // Subtle warm feline/fox coat striping + root-to-tip self-occlusion\n      float stripe = 0.5 + 0.5 * sin(locDir.y * 14.0 + sin(locDir.x * 7.0) * 1.2);\n      vec3 rootCol = vec3(0.24, 0.13, 0.07);\n      vec3 tipCol = mix(vec3(0.86, 0.54, 0.26), vec3(0.95, 0.84, 0.68), stripe * 0.55);\n      vec3 furCol = mix(rootCol, tipCol, pow(hNorm, 0.65));\n      float rootAO = mix(0.16, 1.0, pow(hNorm, 0.78));\n      float wrapDiff = clamp((dot(n, lightDir) + 0.35) / 1.35, 0.0, 1.0);\n      float rim = pow(1.0 - max(dot(n, -rd), 0.0), 3.0) * (0.35 + 0.65 * max(dot(n, rimDir) + 0.4, 0.0));\n      vec3 lit = furCol * rootAO * (vec3(0.14, 0.16, 0.22) + vec3(1.55, 1.42, 1.24) * wrapDiff) + vec3(0.75, 0.82, 0.95) * rim * rootAO * 0.65;\n      float aLayer = hitStrand * (1.0 - alpha);\n      accum += lit * aLayer;\n      alpha += aLayer;\n    }\n  }\n\n  // Inner skin core if ray reaches baseR\n  if (hIn > 0.0 && alpha < 0.99) {\n    vec3 wp = ro + rd * tExit;\n    vec3 n = normalize(wp);\n    float nl = max(dot(n, lightDir), 0.0);\n    vec3 skin = vec3(0.18, 0.10, 0.06) * (0.15 + 0.7 * nl);\n    accum += skin * (1.0 - alpha);\n    alpha = 1.0;\n  }\n  vec3 col = mix(bg, accum, alpha);\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": "shell-fur-rendering",
     "runtime": "glsl-fragment",
     "checked_at": "2026-11-30T16:15:34.232Z",
     "renderer": "Chromium 145.0.7632.6 headless, WebGL2 via ANGLE/SwiftShader, 512×512, iTime=1.5",
     "stats": {
      "mean": 0.5493,
      "std": 0.1546,
      "unique_colors": 532
     },
     "image": "/specimens/shell-fur-rendering-live.webp",
     "reason": null
    }
   }
  }
 ],
 "related": [
  "kajiya-kay-hair-shading",
  "strand-based-real-time-hair",
  "triplanar-mapping"
 ],
 "extends": [],
 "supersedes": [],
 "combines_with": [
  {
   "id": "kajiya-kay-hair-shading",
   "why": "Each shell can use the fibre tangent lobes to get a directional highlight along the strand."
  }
 ],
 "provenance": {
  "prose": "original text written for this index (research draft, editorially reviewed)",
  "sources_verified_at": "2026-11-29T15:51:27.588Z",
  "draft": "data/drafts/materials/shell-fur-rendering.json"
 },
 "solves": [
  "cheap fur on animal character for games",
  "want short fuzzy fur without strand geometry",
  "fur shows visible slices at silhouette",
  "need wind or gravity bending fuzzy surface",
  "stylised furry or grassy surface using layered shells"
 ],
 "authority": "Lengyel et al., 2001",
 "url": "https://texelatlas.vercel.app/t/shell-fur-rendering/",
 "execution_fidelity": "conceptual-diagram",
 "fidelity_label": "Visual Diagram",
 "benchmark_eligible": false,
 "gpu_weight": {
  "weight_x": 36.7,
  "tier": "heavy",
  "p50_ms": 1.2074,
  "p95_ms": 1.2413,
  "baseline_p50_ms": 0.0329,
  "gpu": "Tesla T4/PCIe/SSE2",
  "resolution": "1920x1080",
  "method": "opengl-timer-query",
  "frames": 40,
  "preset_id": "shell-fur-rendering-live",
  "execution_fidelity": "conceptual-diagram",
  "fidelity_label": "Visual Diagram",
  "benchmark_eligible": false,
  "generated_at": "2026-11-30T21:07:47Z",
  "l4": {
   "weight_x": 29.43,
   "tier": "heavy",
   "p50_ms": 0.468,
   "p95_ms": 0.4721,
   "speedup_x": 2.58,
   "gpu": "NVIDIA L4/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0159
  },
  "a100": {
   "weight_x": 23.67,
   "tier": "heavy",
   "p50_ms": 0.6816,
   "p95_ms": 0.6865,
   "speedup_x": 1.77,
   "gpu": "NVIDIA A100-SXM4-40GB/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0288
  }
 }
}