Mesh Neural Cellular Automata (MeshNCA)
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.
Also known as MeshNCA
In the family Generative & learned 3D, local-rule texture synthesis on meshes
Where it runs
Built inOfficial add-onPluginNone foundNot researched
| Engine | Support | How |
|---|---|---|
| three.js r187 | None found | |
| Babylon.js 9.38.0 | None found | |
| Godot 4.7 | Not applicable | Offline reconstruction/generative method, not an engine feature. |
| Unity | None found | Research technique with no built-in Unity implementation. |
| Unreal 5.7 | None found | Research technique with no built-in Unreal Engine implementation. |
| Blender 5.2 | None found | |
| WebGPU W3C | None found | |
| Metal | None found |
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 choose it
Reach for it when
- 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
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 for Textures for the 2D predecessor, and SyncMVD, Text2Tex or Paint3D when you need one-off prompt-specific textures.
Field marks
- 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
Presets
MeshNCA — base mesh & geodesic neighborhood (left) vs growing surface NCA pattern (right)
{
"P_GROWTH": 0.82,
"P_CELL_FREQ": 7,
"P_ROT_SPEED": 0.65,
"P_SPLIT": 0.46
}Show GLSL (130 lines)
const float P_GROWTH = 0.82; // P NCA Growth [0.1, 1.0, 0.02]
const float P_CELL_FREQ = 7.0; // P Pattern Freq [3.0, 12.0, 0.25]
const float P_ROT_SPEED = 0.65; // P Orbit Speed [0.0, 2.2, 0.05]
const float P_SPLIT = 0.46; // P Base Mesh / MeshNCA [0.0, 1.0, 0.02]
mat2 rot2(float a) { float c = cos(a), s = sin(a); return mat2(c, -s, s, c); }
// 3D sculpted organic manifold (multi-lobed torus-sphere) for MeshNCA vertex updates
float mapMesh(vec3 p, float spin) {
vec3 q = p;
q.xz = rot2(spin * 0.48) * q.xz;
q.yz = rot2(0.32) * q.yz;
float dSph = length(q) - 0.66;
vec2 qt = vec2(length(q.xz) - 0.56, q.y);
float dTor = length(qt) - 0.24;
// Smooth blend between core orb and equatorial ring
float h = clamp(0.5 + 0.5 * (dTor - dSph) / 0.22, 0.0, 1.0);
float d = mix(dTor, dSph, h) - 0.22 * h * (1.0 - h);
d += 0.03 * sin(q.x * 7.0) * cos(q.y * 7.0) * sin(q.z * 7.0);
return d * 0.82;
}
vec3 calcNormal(vec3 p, float spin) {
vec2 e = vec2(0.0025, 0.0);
return normalize(vec3(
mapMesh(p + e.xyy, spin) - mapMesh(p - e.xyy, spin),
mapMesh(p + e.yxy, spin) - mapMesh(p - e.yxy, spin),
mapMesh(p + e.yyx, spin) - mapMesh(p - e.yyx, spin)
));
}
// Evaluate intrinsic 3D manifold NCA pattern using tangent-plane geodesic frequencies
vec3 evalMeshNCA(vec3 objP, float t, float freq, float growth) {
vec3 q = objP * freq;
for (int i = 0; i < 3; i++) {
vec3 w = sin(q.yzx * 1.35 + vec3(0.0, 1.7, 3.1) + t * 0.28);
q += w * 0.42;
}
float g1 = sin(q.x + cos(q.y * 1.2 + q.z));
float g2 = cos(q.y - sin(q.z * 1.15 - q.x));
float spot = smoothstep(-0.25, 0.65, g1 * g2);
float vein = exp(-abs(g1 + g2 * 0.55) * 4.5);
// Geodesic growth front spreading from north pole seed
float geoDist = length(objP - vec3(0.0, 0.68, 0.0));
float mask = smoothstep(growth * 1.85 + 0.12, growth * 1.85 - 0.14, geoDist);
float front = exp(-abs(geoDist - growth * 1.85) * 18.0);
vec3 base = vec3(0.06, 0.13, 0.22);
vec3 teal = vec3(0.10, 0.72, 0.68);
vec3 gold = vec3(0.98, 0.68, 0.20);
vec3 pat = mix(base, teal, spot);
pat = mix(pat, gold, vein * 0.88);
pat += vec3(0.35, 0.98, 0.90) * front * 0.55;
return mix(vec3(0.32, 0.35, 0.40), pat, mask);
}
vec3 aces(vec3 x) {
x = max(x, 0.0);
return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14);
}
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
float screenX = fragCoord.x / max(iResolution.x, 1.0);
float split = clamp(P_SPLIT, 0.0, 1.0);
float spin = iTime * max(P_ROT_SPEED, 0.0);
float freq = clamp(P_CELL_FREQ, 2.5, 14.0);
float growth = clamp(P_GROWTH, 0.08, 1.0);
vec3 ro = vec3(0.0, 0.12, 2.35);
vec3 rd = normalize(vec3(uv, -1.55));
vec3 col = mix(vec3(0.025, 0.034, 0.056), vec3(0.065, 0.088, 0.135), smoothstep(-0.55, 0.55, uv.y));
float t = 0.0;
bool hit = false;
for (int i = 0; i < 56; i++) {
float d = mapMesh(ro + rd * t, spin);
if (d < 0.0025) { hit = true; break; }
t += d;
if (t > 5.0) break;
}
if (hit) {
vec3 p = ro + rd * t;
vec3 n = calcNormal(p, spin);
vec3 objP = p;
objP.xz = rot2(spin * 0.48) * objP.xz;
objP.yz = rot2(0.32) * objP.yz;
vec3 l1 = normalize(vec3(0.62, 0.78, 0.55));
vec3 l2 = normalize(vec3(-0.72, -0.25, 0.45));
float diff1 = max(dot(n, l1), 0.0);
float diff2 = max(dot(n, l2), 0.0);
float fres = pow(1.0 - max(dot(n, -rd), 0.0), 3.0);
float spec = pow(max(dot(n, normalize(l1 - rd)), 0.0), 36.0);
// Intrinsic triangulated mesh wireframe via spherical coordinates
vec3 dn = normalize(objP + vec3(1e-5));
vec2 sp = vec2(atan(dn.z, dn.x) / 3.14159265, asin(clamp(dn.y, -0.999, 0.999)) / 1.5707963);
vec2 g = sp * vec2(22.0, 12.0);
vec2 f = fract(g);
float diag = abs(f.x - f.y);
float edge = min(min(f.x, 1.0 - f.x), min(min(f.y, 1.0 - f.y), diag * 0.707));
float wire = smoothstep(0.055, 0.015, edge);
if (screenX < split) {
// Left: Base mesh topology + 1-ring geodesic neighborhood stencil highlight
vec3 clay = vec3(0.34, 0.39, 0.46) * (0.28 + 0.75 * diff1 + 0.25 * diff2);
clay = mix(clay, vec3(0.16, 0.68, 0.88), wire * 0.55);
float seedRing = exp(-abs(length(objP - vec3(0.0, 0.68, 0.0)) - 0.22) * 32.0);
clay += vec3(0.98, 0.65, 0.18) * seedRing * 1.1;
clay += vec3(0.24, 0.52, 0.76) * fres * 0.4;
col = clay;
} else {
// Right: MeshNCA surface state with tactile specular sheen
vec3 ncaAlbedo = evalMeshNCA(objP, iTime, freq, growth);
col = ncaAlbedo * (0.30 + 0.82 * diff1 + 0.28 * diff2)
+ vec3(0.92, 0.97, 1.0) * spec * 0.42
+ vec3(0.22, 0.84, 0.86) * fres * 0.45;
col = mix(col, vec3(0.06, 0.12, 0.18), wire * 0.16);
}
}
float sep = smoothstep(0.0035, 0.0008, abs(screenX - split));
col = mix(col, vec3(0.95, 0.97, 1.0), sep);
fragColor = vec4(pow(clamp(aces(col), 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);
}Attribution: MIT — written for this index.
Measured GPU weight & timing
| Preset | GPU | Weight / p50 / p95 | Method |
|---|---|---|---|
| mesh-neural-cellular-automata-live | Tesla T4 1920x1080 | 15.7× baseline (moderate) · 0.517 ms / 0.545 ms | opengl-timer-query · 32 frames · GPU Weight Atlas · Colab T4 sweep |
| mesh-neural-cellular-automata-live | NVIDIA L4 1920x1080 | 13.1× baseline (moderate) · 0.208 ms / 0.209 ms · 2.5× faster on L4 | opengl-timer-query · Cross-architecture validation |
| mesh-neural-cellular-automata-live | NVIDIA A100-SXM4-40GB 1920x1080 | 10.6× baseline (moderate) · 0.304 ms / 0.307 ms · 1.7× faster on A100 | opengl-timer-query · Cross-architecture validation |
Lineage
From the citation graph (Crossref reference lists): its primary source cites Single-photo SVBRDF capture.
Sources
- primaryEhsan Pajouheshgar, Yitao Xu, Alexander Mordvintsev, Eyvind Niklasson, Tong Zhang, Sabine Süsstrunk (2023). Mesh Neural Cellular Automata. ACM Transactions on Graphics (TOG), Volume 43, Issue 4 Article No.: 122, Pages 1 - 16; 19 July 2024.Verified via arxiv · 2026-11-29doi:10.1145/3658127 · arXiv:2311.02820
- primaryEhsan Pajouheshgar, Yitao Xu, Alexander Mordvintsev, Eyvind Niklasson, Tong Zhang, Sabine Süsstrunk (2024). Mesh Neural Cellular Automata. ACM Transactions on Graphics.Verified via crossref · 2026-11-29doi:10.1145/3658127
- implementationIVRL (2024). IVRL/MeshNCA. Official implementation of the paper titled "Mesh Neural Cellular Automata"GitHub API · no license declared · 2026-11-29