{
 "id": "climbing-plants-simulation",
 "title": "Interactive Climbing Plant Modeling",
 "aliases": [
  "ivy growth",
  "vine simulation"
 ],
 "domain": "procgen",
 "subdomain": "plants and vegetation",
 "stage": "procedural",
 "realtime": "interactive",
 "platforms": [
  "cpu",
  "desktop-gpu"
 ],
 "year_introduced": 2017,
 "inputs": [
  "mesh"
 ],
 "outputs": [
  "curves",
  "mesh"
 ],
 "style": "photoreal",
 "dynamic": "both",
 "summary": "Simulates climbing vines such as ivy growing over scene geometry, using a physically motivated stem model with attachment, free-hanging behaviour and user guidance.",
 "how_it_works": "Each plant is a tree of stem segments that grow at their tips toward light-like or user-chosen goals. A tip senses the scene surface; when it touches geometry it attaches and follows the surface, while tips that lose contact may hang under gravity or search for a new support. Stem mechanics treat the plant as a flexible rod with bending resistance so free segments sag and swing. The authors expose artist controls (growth seeds, directional hints, painting areas to cover) and keep the simulation interactive so the user can steer growth on complex scenes, then instantiate leaves along stems. It is an agent-based growth model constrained by collision with the scene.",
 "when_to_use": "Choose it for dressing buildings, ruins and sculptures with convincing ivy or vines, where coverage should depend on the actual geometry. Prefer `space-colonization-trees` for free-standing trees, `l-systems` for stylised plants, and `ecosystem-plant-distribution` when you need to place many plants across a landscape rather than grow one on a wall.",
 "cost": {
  "class": "offline",
  "notes": "Per-step collision and attachment queries against scene geometry; interactive in the paper's setup, minutes for dense coverage of large scenes."
 },
 "failure_modes": [
  "Stems penetrate thin geometry or clump in concave corners",
  "Dense leaf instancing is expensive and often needs LOD or impostors",
  "Result depends on the seed placement and guidance, so unguided runs can leave bare areas",
  "Reference code is not widely available, so replicating the exact behaviour requires reimplementation"
 ],
 "sources": [
  {
   "role": "primary",
   "key": "doi:10.1111/cgf.13106",
   "type": "paper",
   "title": "Interactive Modeling and Authoring of Climbing Plants",
   "authors": [
    "Torsten Hädrich",
    "Bedrich Benes",
    "Oliver Deussen",
    "Sören Pirk"
   ],
   "year": 2017,
   "venue": "Computer Graphics Forum",
   "url": "https://doi.org/10.1111/cgf.13106",
   "ids": {
    "doi": "10.1111/cgf.13106"
   },
   "license": null,
   "extra": {
    "csl_type": "journal-article"
   },
   "provenance": {
    "title": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1111/cgf.13106",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1111/cgf.13106",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1111/cgf.13106",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1111/cgf.13106",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1111/cgf.13106",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": 1,
   "__bib": "hdrich2017interactive"
  }
 ],
 "presets": [
  {
   "id": "climbing-plants-simulation-live",
   "title": "Climbing Plant Simulation — clinging vine tendrils & anchor nodes (left) vs sunlit ivy foliage on stone pillar (right)",
   "runtime": "glsl-fragment",
   "params": {
    "P_VINE_GROW": 0.86,
    "P_LEAF_DENS": 0.9,
    "P_ROT_SPEED": 0.48,
    "P_SPLIT": 0.46
   },
   "basis": "original",
   "license_note": "MIT — written for this index.",
   "code": "const float P_VINE_GROW = 0.86; // P Climb Height [0.2, 1.0, 0.02]\nconst float P_LEAF_DENS = 0.90; // P Leaf Density [0.1, 1.3, 0.04]\nconst float P_ROT_SPEED = 0.48; // P Orbit Speed [0.0, 2.2, 0.05]\nconst float P_SPLIT = 0.46; // P Stems / Ivy 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\n// Evaluate helical thigmotropic vine clinging to stone column (radius 0.42)\n// Returns vec3(distToVineStem, distToLeafBlade, climbMask)\nvec3 evalClimbingVine(vec3 p, float growH, float leafDens) {\n  float r = length(p.xz);\n  float ang = atan(p.z, p.x);\n  float yMax = mix(-0.62, 0.72, growH);\n  float grown = smoothstep(yMax + 0.08, yMax - 0.08, p.y);\n\n  // 3 phototropic climbing primary vines spiraling upward around the cylinder surface\n  float dStem = 1e5;\n  float dLeaf = 1e5;\n  for (int v = 0; v < 3; v++) {\n    float fv = float(v);\n    float phase = fv * 2.094395 + p.y * (3.8 + fv * 0.45) + 0.25 * sin(p.y * 5.0 + fv);\n    float dAng = atan(sin(ang - phase), cos(ang - phase));\n    float arcD = abs(dAng) * 0.42;\n    float radD = abs(r - 0.432);\n    float dV = length(vec2(arcD, radD)) - 0.018;\n    dStem = min(dStem, dV);\n\n    // Alternating botanical ivy leaves sprouting off the clinging vine stem!\n    float leafRow = floor(p.y * 11.0 + fv * 3.1);\n    float yLocal = fract(p.y * 11.0 + fv * 3.1) - 0.5;\n    float side = (mod(leafRow, 2.0) > 0.5) ? 1.0 : -1.0;\n    float leafAngOff = dAng - side * 0.16;\n    vec2 lUV = vec2(leafAngOff * 0.42, yLocal / 11.0);\n    // Heart/ivy-lobe leaf silhouette\n    float rL = length(lUV * vec2(1.0, 1.25));\n    float lobe = 0.052 * (0.78 + 0.22 * cos(atan(lUV.y, lUV.x) * 3.0)) * leafDens;\n    float dL = max(rL - lobe, abs(r - 0.455) - 0.018);\n    dLeaf = min(dLeaf, dL);\n  }\n  return vec3(dStem, dLeaf, grown);\n}\n\n// Combined scene SDF: stone column (mat=1), vine stem (mat=2), ivy leaves (mat=3)\nvec2 mapScene(vec3 p, float growH, float leafDens, bool withLeaves) {\n  // Fluted ancient stone column + capital\n  float ang = atan(p.z, p.x);\n  float dCol = max(length(p.xz) - (0.42 - 0.01 * cos(ang * 12.0)), abs(p.y) - 0.78);\n  vec2 res = vec2(dCol, 1.0);\n\n  vec3 vine = evalClimbingVine(p, growH, leafDens);\n  if (vine.z > 0.05) {\n    float dS = mix(1.0, vine.x, vine.z);\n    if (dS < res.x) res = vec2(dS, 2.0);\n    if (withLeaves) {\n      float dL = mix(1.0, vine.y, vine.z);\n      if (dL < res.x) res = vec2(dL, 3.0);\n    }\n  }\n  return vec2(res.x * 0.78, res.y);\n}\n\nvec3 calcNormal(vec3 p, float growH, float leafDens, bool withLeaves) {\n  vec2 e = vec2(0.0025, 0.0);\n  return normalize(vec3(\n    mapScene(p + e.xyy, growH, leafDens, withLeaves).x - mapScene(p - e.xyy, growH, leafDens, withLeaves).x,\n    mapScene(p + e.yxy, growH, leafDens, withLeaves).x - mapScene(p - e.yxy, growH, leafDens, withLeaves).x,\n    mapScene(p + e.yyx, growH, leafDens, withLeaves).x - mapScene(p - e.yyx, growH, leafDens, withLeaves).x\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 withLeaves = screenX >= split;\n  float growH = clamp(P_VINE_GROW, 0.15, 1.0);\n  float leafDens = clamp(P_LEAF_DENS, 0.1, 1.4);\n  float spin = iTime * max(P_ROT_SPEED, 0.0) * 0.45;\n\n  vec3 ro = vec3(0.0, 0.08, 2.22);\n  vec3 rd = normalize(vec3(uv, -1.52));\n  ro.xz = rot2(spin) * ro.xz;\n  rd.xz = rot2(spin) * rd.xz;\n\n  vec3 col = mix(vec3(0.032, 0.042, 0.062), vec3(0.085, 0.115, 0.165), smoothstep(-0.55, 0.55, uv.y));\n\n  float t = 0.0;\n  vec2 hit = vec2(1e5, 0.0);\n  for (int i = 0; i < 64; i++) {\n    vec2 h = mapScene(ro + rd * t, growH, leafDens, withLeaves);\n    if (h.x < 0.0022) { hit = vec2(t, h.y); break; }\n    t += h.x;\n    if (t > 5.0) break;\n  }\n\n  if (hit.x < 1e4) {\n    vec3 p = ro + rd * hit.x;\n    vec3 n = calcNormal(p, growH, leafDens, withLeaves);\n    vec3 l1 = normalize(vec3(0.62, 0.78, 0.52));\n    vec3 l2 = normalize(vec3(-0.68, 0.18, -0.55));\n    float diff1 = max(dot(n, l1), 0.0);\n    float diff2 = max(dot(n, l2), 0.0);\n    float spec = pow(max(dot(n, normalize(l1 - rd)), 0.0), 28.0);\n\n    vec3 alb;\n    if (hit.y < 1.5) {\n      // Limestone column\n      float grain = 0.5 + 0.5 * sin(p.y * 18.0 + sin(p.x * 12.0));\n      alb = mix(vec3(0.60, 0.56, 0.50), vec3(0.76, 0.72, 0.64), grain);\n    } else if (hit.y < 2.5) {\n      // Woody climbing stem + bright cyan thigmotropic anchor nodes on left side!\n      alb = vec3(0.30, 0.24, 0.14);\n      if (!withLeaves) {\n        float anchor = smoothstep(0.78, 0.96, sin(p.y * 42.0));\n        alb = mix(vec3(0.24, 0.86, 0.58), vec3(0.98, 0.82, 0.24), anchor);\n      }\n    } else {\n      // Lush translucent sunlit ivy leaves\n      float leafVar = 0.5 + 0.5 * sin(p.y * 24.0 + p.x * 18.0);\n      alb = mix(vec3(0.12, 0.42, 0.14), vec3(0.42, 0.72, 0.18), leafVar);\n    }\n\n    col = alb * (0.24 + 0.84 * diff1 + 0.24 * diff2) + vec3(0.96, 0.98, 0.90) * spec * (hit.y > 2.5 ? 0.36 : 0.14);\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": "climbing-plants-simulation",
     "runtime": "glsl-fragment",
     "checked_at": "2026-11-30T20:35:46.000Z",
     "renderer": "Headless EGL Tesla T4/PCIe/SSE2, OpenGL 3.30 Core, 512×512, iTime=1.5",
     "stats": {
      "mean": 0.5803,
      "std": 0.228,
      "min": 0.2122,
      "max": 0.9014
     },
     "image": "/specimens/climbing-plants-simulation-live.webp",
     "reason": null
    }
   }
  }
 ],
 "related": [
  "space-colonization-trees",
  "l-systems",
  "ecosystem-plant-distribution"
 ],
 "extends": [],
 "supersedes": [],
 "combines_with": [],
 "provenance": {
  "prose": "original text written for this index (research draft, editorially reviewed)",
  "sources_verified_at": "2026-11-29T15:51:27.588Z",
  "draft": "data/drafts/procgen/climbing-plants-simulation.json"
 },
 "solves": [
  "need ivy to grow across buildings and ruins",
  "vines should follow and cling to existing geometry",
  "dress sculptures with hanging creepers",
  "hand-placing vines on walls takes forever"
 ],
 "authority": "Hädrich et al., 2017",
 "url": "https://texelatlas.vercel.app/t/climbing-plants-simulation/",
 "execution_fidelity": "conceptual-diagram",
 "fidelity_label": "Visual Diagram",
 "benchmark_eligible": false,
 "gpu_weight": {
  "weight_x": 98.12,
  "tier": "extreme",
  "p50_ms": 3.2283,
  "p95_ms": 3.5529,
  "baseline_p50_ms": 0.0329,
  "gpu": "Tesla T4/PCIe/SSE2",
  "resolution": "1920x1080",
  "method": "opengl-timer-query",
  "frames": 32,
  "preset_id": "climbing-plants-simulation-live",
  "execution_fidelity": "conceptual-diagram",
  "fidelity_label": "Visual Diagram",
  "benchmark_eligible": false,
  "generated_at": "2026-11-30T21:07:47Z",
  "l4": {
   "weight_x": 82.64,
   "tier": "extreme",
   "p50_ms": 1.314,
   "p95_ms": 1.3962,
   "speedup_x": 2.46,
   "gpu": "NVIDIA L4/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0159
  },
  "a100": {
   "weight_x": 63.66,
   "tier": "extreme",
   "p50_ms": 1.8335,
   "p95_ms": 2.0777,
   "speedup_x": 1.76,
   "gpu": "NVIDIA A100-SXM4-40GB/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0288
  }
 }
}