MeshGPT
Learns a vocabulary of triangle tokens with a graph-convolutional encoder and vector quantisation, then trains a decoder-only transformer to emit meshes triangle by triangle.
In the family Generative & learned 3D, autoregressive artist-like 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 | |
| Unreal 5.7 | None found | |
| Blender 5.2 | None found | |
| WebGPU W3C | None found | |
| Metal | None found |
How it works
Each triangle in a training mesh is described by its vertices and local geometry, encoded by a graph convolution over the mesh, and quantised into a discrete codebook index (residual vector quantisation). A mesh therefore becomes a sequence of triangle tokens in a canonical order, and a GPT-style transformer is trained to predict the next token. Sampling produces a sequence that is decoded back into triangles. Because meshes are generated natively as compact, sharp-edged triangle sets rather than extracted from a field, results look like artist-made meshes, with large flat faces and coarse triangle counts, unlike iso-surface output.
When to choose it
Reach for it when
- want generated meshes with clean artist-like triangles
- need to learn mesh generation as token sequences
- unconditional low-poly asset generation
- marching-cubes style outputs are too dense and messy
Choose it to study or reproduce token-based mesh generation, or for unconditional/class-conditioned low-poly assets. Prefer MeshAnything when you need conditioning on a dense shape or point cloud, MeshFlow for parallel generation with continuous latents, and Hunyuan3D 2.0 or TRELLIS (Structured 3D Latents) when the target is a high-detail textured scan-like asset.
Field marks
- Errors in a long token sequence give holes, flipped or overlapping triangles
- Quantisation limits vertex precision
- Limited face counts per mesh (hundreds to a few thousand triangles)
- Official release code is research-grade; the popular community reimplementation differs from the paper in details
Presets
MeshGPT — autoregressive triangle-token decoding (left) vs completed faceted mesh (right)
{
"P_SEQ_PROG": 0.72,
"P_TRI_RES": 10,
"P_ROT_SPEED": 0.58,
"P_SPLIT": 0.48
}Show GLSL (119 lines)
const float P_SEQ_PROG = 0.72; // P Token Progress [0.15, 1.0, 0.02]
const float P_TRI_RES = 10.0; // P Triangle Scale [5.0, 16.0, 0.5]
const float P_ROT_SPEED = 0.58; // P Orbit Speed [0.0, 2.2, 0.05]
const float P_SPLIT = 0.48; // P Tokens / Mesh Split [0.0, 1.0, 0.02]
mat2 rot2(float a) { float c = cos(a), s = sin(a); return mat2(c, -s, s, c); }
vec3 hash31(float x) {
vec3 p = fract(vec3(x) * vec3(0.1031, 0.1030, 0.0973));
p += dot(p, p.yzx + 33.33);
return fract((p.xxy + p.yzz) * p.zyx);
}
// Sculpted architectural chair/bust polyhedron
float mapObj(vec3 p, float spin) {
vec3 q = p;
q.xz = rot2(spin * 0.45) * q.xz;
q.yz = rot2(0.24) * q.yz;
float r = length(q);
vec3 d = q / max(r, 1e-4);
float shape = 0.68 + 0.12 * cos(d.y * 4.5) + 0.08 * sin(atan(d.z, d.x) * 4.0) * (1.0 - abs(d.y));
return (r - shape) * 0.82;
}
vec3 calcNormal(vec3 p, float spin) {
vec2 e = vec2(0.0025, 0.0);
return normalize(vec3(
mapObj(p + e.xyy, spin) - mapObj(p - e.xyy, spin),
mapObj(p + e.yxy, spin) - mapObj(p - e.yxy, spin),
mapObj(p + e.yyx, spin) - mapObj(p - e.yyx, spin)
));
}
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 prog = clamp(P_SEQ_PROG, 0.1, 1.0);
float triRes = clamp(P_TRI_RES, 4.0, 18.0);
float spin = iTime * max(P_ROT_SPEED, 0.0);
vec3 ro = vec3(0.0, 0.10, 2.30);
vec3 rd = normalize(vec3(uv, -1.55));
vec3 bg = mix(vec3(0.022, 0.028, 0.048), vec3(0.058, 0.072, 0.118), smoothstep(-0.55, 0.55, uv.y));
vec3 col = bg;
float t = 0.0;
bool hit = false;
for (int i = 0; i < 56; i++) {
float d = mapObj(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.45) * objP.xz;
objP.yz = rot2(0.24) * objP.yz;
// Quantized spherical triangle-grid tokenization (VQ-VAE triangle codebook)
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(triRes * 1.8, triRes);
vec2 cell = floor(g);
vec2 f = fract(g);
float upper = step(f.x, f.y);
vec3 bary = (upper > 0.5) ? vec3(1.0 - f.y, f.x, f.y - f.x) : vec3(1.0 - f.x, f.y, f.x - f.y);
float edgeD = min(bary.x, min(bary.y, bary.z));
float wire = smoothstep(0.065, 0.015, edgeD);
// Flat-shaded quantized facet normal
vec2 cUV = (cell + ((upper > 0.5) ? vec2(0.33, 0.67) : vec2(0.67, 0.33))) / vec2(triRes * 1.8, triRes);
float phi = cUV.x * 3.14159265;
float th = cUV.y * 1.5707963;
vec3 flatObjN = normalize(vec3(cos(th) * cos(phi), sin(th), cos(th) * sin(phi)));
vec3 flatN = flatObjN;
flatN.yz = rot2(-0.24) * flatN.yz;
flatN.xz = rot2(-spin * 0.45) * flatN.xz;
flatN = normalize(mix(n, flatN, 0.68));
// Autoregressive bottom-to-top triangle token sequence order
float seqOrder = clamp((cUV.y + 1.0) * 0.5 + (cUV.x + 1.0) * 0.04, 0.0, 1.0);
float waveFront = mod(prog + 0.22 * sin(iTime * 0.75), 1.02);
float tokId = cell.y * 37.0 + cell.x * 2.0 + upper;
vec3 tokCol = 0.32 + 0.58 * hash31(tokId);
vec3 l1 = normalize(vec3(0.58, 0.80, 0.55));
float diff = max(dot(flatN, l1), 0.0);
float spec = pow(max(dot(flatN, normalize(l1 - rd)), 0.0), 32.0);
if (screenX < split) {
// Left: Autoregressive token sequence construction with glowing active-token frontier
float generated = smoothstep(waveFront + 0.03, waveFront - 0.02, seqOrder);
float frontier = exp(-abs(seqOrder - waveFront) * 38.0);
vec3 activeFace = tokCol * (0.35 + 0.75 * diff) + vec3(1.0, 0.86, 0.35) * frontier * 1.4;
activeFace = mix(activeFace, vec3(0.95, 0.98, 1.0), wire * 0.55);
// Un-generated future triangles shown as faint ghost wireframe
vec3 ghost = bg + vec3(0.14, 0.34, 0.52) * wire * 0.55;
col = mix(ghost, activeFace, generated);
} else {
// Right: Completed clean artist-like MeshGPT triangle mesh
vec3 base = vec3(0.76, 0.80, 0.88) * (0.28 + 0.82 * diff) + vec3(1.0) * spec * 0.38;
col = mix(base, vec3(0.10, 0.24, 0.42), wire * 0.68);
}
}
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 |
|---|---|---|---|
| meshgpt-live | Tesla T4 1920x1080 | 20.7× baseline (heavy) · 0.682 ms / 0.707 ms | opengl-timer-query · 32 frames · GPU Weight Atlas · Colab T4 sweep |
| meshgpt-live | NVIDIA L4 1920x1080 | 16.8× baseline (moderate) · 0.267 ms / 0.275 ms · 2.5× faster on L4 | opengl-timer-query · Cross-architecture validation |
| meshgpt-live | NVIDIA A100-SXM4-40GB 1920x1080 | 12.9× baseline (moderate) · 0.372 ms / 0.386 ms · 1.8× faster on A100 | opengl-timer-query · Cross-architecture validation |
Lineage
From the citation graph (Crossref reference lists): its primary source cites Point-E, Score Distillation Sampling (DreamFusion), PolyGen autoregressive mesh generation, DeepSDF (neural signed distance functions), Quadric Error Metric Simplification; cited by LL3M (Large Language 3D Modelers), MeshAnything, MeshFlow.
Sources
- primaryYawar Siddiqui, Antonio Alliegro, Alexey Artemov, Tatiana Tommasi, Daniele Sirigatti, Vladislav Rosov et al. (2023). MeshGPT: Generating Triangle Meshes with Decoder-Only Transformers. arXiv preprint (cs.CV).Verified via arxiv · 2026-11-29arXiv:2311.15475
- primaryYawar Siddiqui, Antonio Alliegro, Alexey Artemov, Tatiana Tommasi, Daniele Sirigatti, Vladislav Rosov et al. (2024). MeshGPT: Generating Triangle Meshes with Decoder-Only Transformers. 2024 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR).Verified via crossref · 2026-11-29doi:10.1109/cvpr52733.2024.01855
- implementationlucidrains (2023). lucidrains/meshgpt-pytorch. Implementation of MeshGPT, SOTA Mesh generation using Attention, in PytorchGitHub API · license MIT · 2026-11-29