{
 "id": "mesh-neural-cellular-automata",
 "title": "Mesh Neural Cellular Automata (MeshNCA)",
 "aliases": [
  "MeshNCA"
 ],
 "domain": "genai",
 "subdomain": "local-rule texture synthesis on meshes",
 "stage": "generation",
 "realtime": "interactive",
 "platforms": [
  "cuda",
  "python",
  "webgl2"
 ],
 "year_introduced": 2024,
 "inputs": [
  "mesh",
  "ldr-image",
  "text-prompt"
 ],
 "outputs": [
  "texture"
 ],
 "style": "both",
 "dynamic": "dynamic",
 "summary": "Runs a tiny learned update rule on the vertices of a mesh, so a texture grows from local neighbour communication and can be evaluated in real time on any triangulation.",
 "how_it_works": "Every vertex carries a hidden state vector. At each step it perceives neighbours through learned differential-style filters adapted to mesh connectivity (gradient and Laplacian proxies) and applies a small MLP to update its state, with stochastic update masks. The rule is trained once per target appearance (an exemplar image or text prompt via image-model losses) by unrolling steps and comparing multi-view renders against the style target. Because the rule is local and mesh-agnostic, the same trained automaton produces a texture on unseen meshes and keeps working under deformation or vertex insertion, with cheap per-step cost.",
 "when_to_use": "Choose it for dynamic, self-organising textures on meshes of any topology (including animated or edited meshes) where the pattern is a repetitive style, not a unique image. Prefer `neural-cellular-automata-textures` for the 2D predecessor, and `syncmvd`, `text2tex` or `paint3d` when you need one-off prompt-specific textures.",
 "cost": {
  "class": "heavy",
  "notes": "Per-step compute is small; training per style takes minutes to hours."
 },
 "failure_modes": [
  "Only suited to stationary, texture-like patterns; no semantic layouts or large-scale structure",
  "Resolution is tied to vertex density, so coarse meshes give coarse textures",
  "Training can be unstable and one rule only covers one style",
  "Artifacts on very irregular triangulations with extreme valence"
 ],
 "sources": [
  {
   "role": "primary",
   "key": "arxiv:2311.02820",
   "type": "paper",
   "title": "Mesh Neural Cellular Automata",
   "authors": [
    "Ehsan Pajouheshgar",
    "Yitao Xu",
    "Alexander Mordvintsev",
    "Eyvind Niklasson",
    "Tong Zhang",
    "Sabine Süsstrunk"
   ],
   "year": 2023,
   "venue": "ACM Transactions on Graphics (TOG), Volume 43, Issue 4 Article No.: 122, Pages 1 - 16; 19 July 2024",
   "url": "https://arxiv.org/abs/2311.02820",
   "ids": {
    "arxiv": "2311.02820",
    "doi": "10.1145/3658127"
   },
   "license": null,
   "extra": {
    "arxiv_version": "2",
    "category": "cs.CV"
   },
   "provenance": {
    "title": {
     "authority": "arxiv",
     "endpoint": "https://export.arxiv.org/api/query?id_list=2311.02820",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "arxiv",
     "endpoint": "https://export.arxiv.org/api/query?id_list=2311.02820",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "arxiv",
     "endpoint": "https://export.arxiv.org/api/query?id_list=2311.02820",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "arxiv",
     "endpoint": "https://export.arxiv.org/api/query?id_list=2311.02820",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "arxiv",
     "endpoint": "https://export.arxiv.org/api/query?id_list=2311.02820",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": 1,
   "__bib": "pajouheshgar2023mesh"
  },
  {
   "role": "primary",
   "key": "doi:10.1145/3658127",
   "type": "paper",
   "title": "Mesh Neural Cellular Automata",
   "authors": [
    "Ehsan Pajouheshgar",
    "Yitao Xu",
    "Alexander Mordvintsev",
    "Eyvind Niklasson",
    "Tong Zhang",
    "Sabine Süsstrunk"
   ],
   "year": 2024,
   "venue": "ACM Transactions on Graphics",
   "url": "https://doi.org/10.1145/3658127",
   "ids": {
    "doi": "10.1145/3658127"
   },
   "license": null,
   "extra": {
    "csl_type": "journal-article"
   },
   "provenance": {
    "title": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/3658127",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/3658127",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/3658127",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/3658127",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/3658127",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": 1,
   "__bib": "pajouheshgar2024mesh"
  },
  {
   "role": "implementation",
   "key": "gh:ivrl/meshnca",
   "type": "code",
   "title": "IVRL/MeshNCA",
   "description": "Official implementation of the paper titled \"Mesh Neural Cellular Automata\"",
   "authors": [
    "IVRL"
   ],
   "year": 2024,
   "venue": "GitHub",
   "url": "https://github.com/IVRL/MeshNCA",
   "ids": {
    "repo": "IVRL/MeshNCA"
   },
   "license": null,
   "extra": {
    "stars": 30,
    "stars_checked": "2026-11-29",
    "archived": false,
    "fork": false,
    "pushed_at": "2024-12-02T13:23:14Z",
    "language": "Jupyter Notebook",
    "homepage": "https://meshnca.github.io",
    "license_name": null
   },
   "provenance": {
    "title": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/IVRL/MeshNCA",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/IVRL/MeshNCA",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/IVRL/MeshNCA",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/IVRL/MeshNCA",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/IVRL/MeshNCA",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "license": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/IVRL/MeshNCA",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": null,
   "__bib": "ivrl2024ivrl"
  }
 ],
 "presets": [
  {
   "id": "mesh-neural-cellular-automata-live",
   "title": "MeshNCA — base mesh & geodesic neighborhood (left) vs growing surface NCA pattern (right)",
   "runtime": "glsl-fragment",
   "params": {
    "P_GROWTH": 0.82,
    "P_CELL_FREQ": 7,
    "P_ROT_SPEED": 0.65,
    "P_SPLIT": 0.46
   },
   "basis": "original",
   "license_note": "MIT — written for this index.",
   "code": "const float P_GROWTH = 0.82; // P NCA Growth [0.1, 1.0, 0.02]\nconst float P_CELL_FREQ = 7.0; // P Pattern Freq [3.0, 12.0, 0.25]\nconst float P_ROT_SPEED = 0.65; // P Orbit Speed [0.0, 2.2, 0.05]\nconst float P_SPLIT = 0.46; // P Base Mesh / MeshNCA [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// 3D sculpted organic manifold (multi-lobed torus-sphere) for MeshNCA vertex updates\nfloat mapMesh(vec3 p, float spin) {\n  vec3 q = p;\n  q.xz = rot2(spin * 0.48) * q.xz;\n  q.yz = rot2(0.32) * q.yz;\n  float dSph = length(q) - 0.66;\n  vec2 qt = vec2(length(q.xz) - 0.56, q.y);\n  float dTor = length(qt) - 0.24;\n  // Smooth blend between core orb and equatorial ring\n  float h = clamp(0.5 + 0.5 * (dTor - dSph) / 0.22, 0.0, 1.0);\n  float d = mix(dTor, dSph, h) - 0.22 * h * (1.0 - h);\n  d += 0.03 * sin(q.x * 7.0) * cos(q.y * 7.0) * sin(q.z * 7.0);\n  return d * 0.82;\n}\n\nvec3 calcNormal(vec3 p, float spin) {\n  vec2 e = vec2(0.0025, 0.0);\n  return normalize(vec3(\n    mapMesh(p + e.xyy, spin) - mapMesh(p - e.xyy, spin),\n    mapMesh(p + e.yxy, spin) - mapMesh(p - e.yxy, spin),\n    mapMesh(p + e.yyx, spin) - mapMesh(p - e.yyx, spin)\n  ));\n}\n\n// Evaluate intrinsic 3D manifold NCA pattern using tangent-plane geodesic frequencies\nvec3 evalMeshNCA(vec3 objP, float t, float freq, float growth) {\n  vec3 q = objP * freq;\n  for (int i = 0; i < 3; i++) {\n    vec3 w = sin(q.yzx * 1.35 + vec3(0.0, 1.7, 3.1) + t * 0.28);\n    q += w * 0.42;\n  }\n  float g1 = sin(q.x + cos(q.y * 1.2 + q.z));\n  float g2 = cos(q.y - sin(q.z * 1.15 - q.x));\n  float spot = smoothstep(-0.25, 0.65, g1 * g2);\n  float vein = exp(-abs(g1 + g2 * 0.55) * 4.5);\n\n  // Geodesic growth front spreading from north pole seed\n  float geoDist = length(objP - vec3(0.0, 0.68, 0.0));\n  float mask = smoothstep(growth * 1.85 + 0.12, growth * 1.85 - 0.14, geoDist);\n  float front = exp(-abs(geoDist - growth * 1.85) * 18.0);\n\n  vec3 base = vec3(0.06, 0.13, 0.22);\n  vec3 teal = vec3(0.10, 0.72, 0.68);\n  vec3 gold = vec3(0.98, 0.68, 0.20);\n  vec3 pat = mix(base, teal, spot);\n  pat = mix(pat, gold, vein * 0.88);\n  pat += vec3(0.35, 0.98, 0.90) * front * 0.55;\n  return mix(vec3(0.32, 0.35, 0.40), pat, mask);\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  float spin = iTime * max(P_ROT_SPEED, 0.0);\n  float freq = clamp(P_CELL_FREQ, 2.5, 14.0);\n  float growth = clamp(P_GROWTH, 0.08, 1.0);\n\n  vec3 ro = vec3(0.0, 0.12, 2.35);\n  vec3 rd = normalize(vec3(uv, -1.55));\n\n  vec3 col = mix(vec3(0.025, 0.034, 0.056), vec3(0.065, 0.088, 0.135), smoothstep(-0.55, 0.55, uv.y));\n\n  float t = 0.0;\n  bool hit = false;\n  for (int i = 0; i < 56; i++) {\n    float d = mapMesh(ro + rd * t, spin);\n    if (d < 0.0025) { hit = true; break; }\n    t += d;\n    if (t > 5.0) break;\n  }\n\n  if (hit) {\n    vec3 p = ro + rd * t;\n    vec3 n = calcNormal(p, spin);\n    vec3 objP = p;\n    objP.xz = rot2(spin * 0.48) * objP.xz;\n    objP.yz = rot2(0.32) * objP.yz;\n\n    vec3 l1 = normalize(vec3(0.62, 0.78, 0.55));\n    vec3 l2 = normalize(vec3(-0.72, -0.25, 0.45));\n    float diff1 = max(dot(n, l1), 0.0);\n    float diff2 = max(dot(n, l2), 0.0);\n    float fres = pow(1.0 - max(dot(n, -rd), 0.0), 3.0);\n    float spec = pow(max(dot(n, normalize(l1 - rd)), 0.0), 36.0);\n\n    // Intrinsic triangulated mesh wireframe via spherical coordinates\n    vec3 dn = normalize(objP + vec3(1e-5));\n    vec2 sp = vec2(atan(dn.z, dn.x) / 3.14159265, asin(clamp(dn.y, -0.999, 0.999)) / 1.5707963);\n    vec2 g = sp * vec2(22.0, 12.0);\n    vec2 f = fract(g);\n    float diag = abs(f.x - f.y);\n    float edge = min(min(f.x, 1.0 - f.x), min(min(f.y, 1.0 - f.y), diag * 0.707));\n    float wire = smoothstep(0.055, 0.015, edge);\n\n    if (screenX < split) {\n      // Left: Base mesh topology + 1-ring geodesic neighborhood stencil highlight\n      vec3 clay = vec3(0.34, 0.39, 0.46) * (0.28 + 0.75 * diff1 + 0.25 * diff2);\n      clay = mix(clay, vec3(0.16, 0.68, 0.88), wire * 0.55);\n      float seedRing = exp(-abs(length(objP - vec3(0.0, 0.68, 0.0)) - 0.22) * 32.0);\n      clay += vec3(0.98, 0.65, 0.18) * seedRing * 1.1;\n      clay += vec3(0.24, 0.52, 0.76) * fres * 0.4;\n      col = clay;\n    } else {\n      // Right: MeshNCA surface state with tactile specular sheen\n      vec3 ncaAlbedo = evalMeshNCA(objP, iTime, freq, growth);\n      col = ncaAlbedo * (0.30 + 0.82 * diff1 + 0.28 * diff2)\n          + vec3(0.92, 0.97, 1.0) * spec * 0.42\n          + vec3(0.22, 0.84, 0.86) * fres * 0.45;\n      col = mix(col, vec3(0.06, 0.12, 0.18), wire * 0.16);\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": "mesh-neural-cellular-automata",
     "runtime": "glsl-fragment",
     "checked_at": "2026-11-30T20:35:52.000Z",
     "renderer": "Headless EGL Tesla T4/PCIe/SSE2, OpenGL 3.30 Core, 512×512, iTime=1.5",
     "stats": {
      "mean": 0.5799,
      "std": 0.1917,
      "min": 0.1825,
      "max": 0.9314
     },
     "image": "/specimens/mesh-neural-cellular-automata-live.webp",
     "reason": null
    }
   }
  }
 ],
 "related": [
  "neural-cellular-automata-textures",
  "syncmvd"
 ],
 "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/genai/mesh-neural-cellular-automata.json"
 },
 "solves": [
  "grow textures directly on arbitrary 3d meshes",
  "texture synthesis should work on any mesh topology",
  "want self-organizing patterns across a surface",
  "avoid uv seams when painting procedural patterns"
 ],
 "authority": "Pajouheshgar et al., 2023",
 "url": "https://texelatlas.vercel.app/t/mesh-neural-cellular-automata/",
 "execution_fidelity": "conceptual-diagram",
 "fidelity_label": "Visual Diagram",
 "benchmark_eligible": false,
 "gpu_weight": {
  "weight_x": 15.73,
  "tier": "moderate",
  "p50_ms": 0.5175,
  "p95_ms": 0.5446,
  "baseline_p50_ms": 0.0329,
  "gpu": "Tesla T4/PCIe/SSE2",
  "resolution": "1920x1080",
  "method": "opengl-timer-query",
  "frames": 32,
  "preset_id": "mesh-neural-cellular-automata-live",
  "execution_fidelity": "conceptual-diagram",
  "fidelity_label": "Visual Diagram",
  "benchmark_eligible": false,
  "generated_at": "2026-11-30T21:07:47Z",
  "l4": {
   "weight_x": 13.07,
   "tier": "moderate",
   "p50_ms": 0.2078,
   "p95_ms": 0.2091,
   "speedup_x": 2.49,
   "gpu": "NVIDIA L4/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0159
  },
  "a100": {
   "weight_x": 10.56,
   "tier": "moderate",
   "p50_ms": 0.3042,
   "p95_ms": 0.3068,
   "speedup_x": 1.7,
   "gpu": "NVIDIA A100-SXM4-40GB/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0288
  }
 }
}