LL3M (Large Language 3D Modelers) × Model Synthesis
Prompted kits, synthesised levels. From a text prompt, generate a modular kit whose pieces share socket dimensions by construction, then let model synthesis assemble large consistent levels from a small example built with those pieces.
Open in StudioReproduced462× · 14.3 ms
Verified proof

Split-screen WebGL2 proof comparing prompted modular architectural tiles placed without adjacency constraints (left, showing dead-end clipped arches, socket gaps, and mismatched heights) against shared-socket parametric modules assembled via model synthesis into a coherent multi-tier vaulted citadel with seamless bridge and archway connections (right).
Chromium Headless ANGLE/SwiftShader WebGL2 · 512x512 · enforces shared socket dimensions and model-synthesis neighbor adjacency so prompted modular kits assemble into coherent multi-level architecture
Show GLSL proof (185 lines)
const float P_ARCH_SPAN = 0.62; // P Socket Arch Width [0.35, 0.82, 0.02]
const float P_KIT_STYLE = 0.55; // P Sandstone-Obsidian Style [0.0, 1.0, 0.05]
const float P_TOWER_HEIGHT = 1.15; // P Tier Elevation [0.7, 1.6, 0.05]
const float P_CAM_ORBIT = 0.50; // P Turntable Speed [0.0, 1.4, 0.05]
float hash21(vec2 p) {
p = fract(p * vec2(127.1, 311.7));
p += dot(p, p + 34.5);
return fract(p.x * p.y);
}
float sdBox(vec3 p, vec3 b) {
vec3 q = abs(p) - b;
return length(max(q, 0.0)) + min(max(q.x, max(q.y, q.z)), 0.0);
}
// Shared-socket modular tile library evaluated in local cell space p in [-0.5, 0.5]^3
// tileType: 0=courtyard floor, 1=arched wall X, 2=arched wall Z, 3=corner bastion tower, 4=upper bridge
float evalModularTile(vec3 p, int tileType, float socketDrift) {
float d = p.y + 0.50;
if (tileType == 0) {
// Paved courtyard plinth with recessed center tile
float slab = sdBox(p - vec3(0.0, -0.45, 0.0), vec3(0.49 - socketDrift, 0.06, 0.49 - socketDrift));
return slab;
}
if (tileType == 1 || tileType == 2) {
vec3 q = (tileType == 2) ? vec3(p.z, p.y, p.x) : p;
float wall = sdBox(q - vec3(0.0, 0.02, 0.0), vec3(0.50 - socketDrift, 0.52, 0.16));
// Shared parametric archway socket cutout
float archW = 0.30 * P_ARCH_SPAN;
float archCut = min(
sdBox(q - vec3(0.0, -0.18, 0.0), vec3(archW, 0.28, 0.35)),
length(vec2(q.x, q.y - 0.10)) - archW
);
wall = max(wall, -archCut);
// Crown cornice trim
float trim = sdBox(q - vec3(0.0, 0.52, 0.0), vec3(0.50 - socketDrift, 0.05, 0.21));
return min(min(d, wall), trim);
}
if (tileType == 3) {
// Corner bastion tower with upper parapet merlons
float h = 0.72 * P_TOWER_HEIGHT;
float body = sdBox(p - vec3(0.0, h * 0.5 - 0.48, 0.0), vec3(0.38 - socketDrift, h * 0.5, 0.38 - socketDrift));
float crown = sdBox(p - vec3(0.0, h - 0.46, 0.0), vec3(0.43 - socketDrift, 0.06, 0.43 - socketDrift));
// Four corner merlons
vec3 mp = vec3(abs(p.x) - 0.31, p.y - (h - 0.35), abs(p.z) - 0.31);
float merlon = sdBox(mp, vec3(0.09, 0.09, 0.09));
return min(d, min(body, min(crown, merlon)));
}
// tileType == 4: elevated skybridge spanning seamlessly between towers
float bh = 0.48 * P_TOWER_HEIGHT;
float deck = sdBox(p - vec3(0.0, bh - 0.48, 0.0), vec3(0.50 - socketDrift, 0.08, 0.22));
float rail = sdBox(vec3(p.x, p.y - (bh - 0.36), abs(p.z) - 0.19), vec3(0.50 - socketDrift, 0.07, 0.03));
float archUnder = length(vec2(p.x, p.y - (bh - 0.76))) - 0.34;
float pier = max(sdBox(p - vec3(0.0, (bh - 0.48) * 0.5 - 0.24, 0.0), vec3(0.50 - socketDrift, (bh + 0.02) * 0.5, 0.18)), -archUnder);
return min(d, min(deck, min(rail, pier)));
}
// Model-synthesis adjacency tile assignment vs unconstrained random scatter
int getTileId(vec2 cell, bool synthesized) {
if (abs(cell.x) > 2.0 || abs(cell.y) > 2.0) return -1;
if (!synthesized) {
// Left: unconstrained random module scatter (broken sockets & dead ends)
float r = hash21(cell + 14.2);
if (r < 0.22) return 0;
if (r < 0.46) return 1;
if (r < 0.68) return 2;
if (r < 0.86) return 3;
return 4;
}
// Right: model-synthesis valid adjacency layout (bastion corners, arched cloister perimeter, central skybridge)
float ax = abs(cell.x);
float az = abs(cell.y);
if (ax == 2.0 && az == 2.0) return 3;
if (ax == 2.0 && az < 2.0) return 2;
if (az == 2.0 && ax < 2.0) return 1;
if (az == 0.0 && ax <= 1.0) return 4;
return 0;
}
float mapLevel(vec3 p, bool synthesized, out int hitType) {
float d = p.y + 0.52;
hitType = -1;
vec2 baseCell = floor(p.xz + 0.5);
// Evaluate 3x3 cell neighborhood so SDF stays exact across tile boundaries
for (int dz = -1; dz <= 1; dz++) {
for (int dx = -1; dx <= 1; dx++) {
vec2 c = baseCell + vec2(float(dx), float(dz));
int tid = getTileId(c, synthesized);
if (tid < 0) continue;
vec3 lp = vec3(p.x - c.x, p.y, p.z - c.y);
float drift = synthesized ? 0.0 : (0.04 + 0.06 * hash21(c + 3.1));
float yOff = synthesized ? 0.0 : (hash21(c + 9.7) - 0.5) * 0.22;
float td = evalModularTile(lp - vec3(0.0, yOff, 0.0), tid, drift);
if (td < d) {
d = td;
hitType = tid;
}
}
}
return d;
}
vec3 calcN(vec3 p, bool synth) {
float e = 0.004;
int m;
return normalize(vec3(
mapLevel(p + vec3(e, 0.0, 0.0), synth, m) - mapLevel(p - vec3(e, 0.0, 0.0), synth, m),
mapLevel(p + vec3(0.0, e, 0.0), synth, m) - mapLevel(p - vec3(0.0, e, 0.0), synth, m),
mapLevel(p + vec3(0.0, 0.0, e), synth, m) - mapLevel(p - vec3(0.0, 0.0, e), synth, m)
));
}
vec3 acesTone(vec3 x) {
return clamp((x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14), 0.0, 1.0);
}
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
bool synth = uv.x > 0.0;
vec2 suv = vec2(synth ? (uv.x - 0.25) : (uv.x + 0.25), uv.y);
suv.x *= 1.85;
float ang = 0.65 + iTime * 0.28 * P_CAM_ORBIT;
vec3 ro = vec3(cos(ang) * 5.6, 3.85, sin(ang) * 5.6);
vec3 target = vec3(0.0, 0.05, 0.0);
vec3 fwd = normalize(target - ro);
vec3 right = normalize(cross(vec3(0.0, 1.0, 0.0), fwd));
vec3 up = cross(fwd, right);
vec3 rd = normalize(fwd * 1.75 + right * suv.x + up * suv.y);
vec3 sky = mix(vec3(0.16, 0.20, 0.28), vec3(0.68, 0.74, 0.82), clamp(rd.y * 1.8 + 0.35, 0.0, 1.0));
vec3 col = sky;
float t = 0.0;
int hType = -1;
for (int i = 0; i < 72; i++) {
vec3 p = ro + rd * t;
float d = mapLevel(p, synth, hType);
if (d < 0.003 || t > 18.0) break;
t += d * 0.72;
}
vec3 sunDir = normalize(vec3(0.62, 0.78, 0.38));
if (t < 17.5) {
vec3 wp = ro + rd * t;
vec3 N = calcN(wp, synth);
float ndl = max(dot(N, sunDir), 0.0);
// Short soft shadow march
float sh = 1.0;
float ts = 0.05;
int sm;
for (int s = 0; s < 16; s++) {
float sd = mapLevel(wp + N * 0.02 + sunDir * ts, synth, sm);
sh = min(sh, clamp(6.0 * sd / max(ts, 0.05), 0.0, 1.0));
ts += clamp(sd, 0.05, 0.28);
if (sh < 0.05) break;
}
// Prompted style palette (warm limestone/terracotta <-> slate-basalt/brass)
vec3 stoneA = mix(vec3(0.76, 0.66, 0.52), vec3(0.28, 0.32, 0.38), P_KIT_STYLE);
vec3 accentA = mix(vec3(0.64, 0.34, 0.22), vec3(0.68, 0.52, 0.24), P_KIT_STYLE);
vec3 alb = stoneA;
if (hType == 3) alb = mix(stoneA, accentA, 0.35);
else if (hType == 4) alb = mix(stoneA, accentA, 0.52);
else if (hType == -1) alb = vec3(0.24, 0.25, 0.27);
// Highlight shared socket boundary seams cleanly on synthesized side vs warning red gaps on left
vec2 cellFrac = abs(fract(wp.xz + 0.5) - 0.5);
float seam = smoothstep(0.46, 0.498, max(cellFrac.x, cellFrac.y)) * step(-0.46, wp.y);
if (synth) alb = mix(alb, vec3(0.25, 0.85, 0.72), seam * 0.22);
else alb = mix(alb, vec3(0.90, 0.24, 0.18), seam * 0.38);
vec3 direct = alb * vec3(1.25, 1.16, 1.02) * ndl * (0.25 + 0.75 * sh);
vec3 amb = alb * mix(vec3(0.14, 0.16, 0.22), vec3(0.32, 0.38, 0.48), N.y * 0.5 + 0.5);
col = direct + amb;
float fog = 1.0 - exp(-max(t - 5.0, 0.0) * 0.09);
col = mix(col, sky, clamp(fog, 0.0, 0.78));
}
col = acesTone(col * 1.08);
if (abs(uv.x) < 0.003) col = vec3(0.95, 0.93, 0.89);
fragColor = vec4(pow(clamp(col, 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);
}Why they connect
LL3M (Large Language 3D Modelers) takes a text prompt and outputs mesh, material-params and the Blender script (graph) that made them. The prompt fixes a grid size and socket profiles as shared named parameters, so every tile's boundary faces match. Model Synthesis consumes the meshes (with their grid labels) from a small hand-placed example made of those tiles, extracts which tiles may sit next to each other along each axis, and outputs a much larger mesh and voxel arrangement that contains only local configurations seen in the example.
How to build it
Write a kit specification (cell size, wall thickness, door socket profile) and ask LL3M's planner for one script with shared parameters and one function per tile. Run a validation script that checks each tile's bounding box and boundary faces against the sockets, and feed failures back to the coding agent. In Blender, place a small example level by hand from the tiles. Extract adjacency from it, run model synthesis in Python with chunked solving, and instance the tiles in Blender or an engine. Regenerate the kit with a new style prompt and reuse the same adjacency to restyle the level.
Field marks
- Generated tiles drift from the socket dimensions, leaving gaps or z-fighting.
- Style varies between tiles generated from the same prompt.
- A tiny example over-constrains synthesis and causes contradictions.
- The original hosted LLM backend is retired, so results depend on the substitute model.
Prior art
- A Database-Driven Framework for 3D Level Generation with LLMs. Partial: uses LLMs offline to build reusable databases of room and facility modules and assembles levels from them with constraint-based placement; modules are not generated as socket-matched meshes and assembly is not model synthesis.
Searches run (4)
- arXiv: all:"LLM" AND all:"modular" AND all:"level generation" → 2 results
- GitHub repos: LLM modular "level generation" → 0 results
- arXiv: all:"model synthesis" AND all:"procedural modeling" → 0 results
- GitHub repos: "model synthesis" "procedural modeling" → 0 results