---
id: "procedural-kit-modeling"
title: "Procedural Kit Modeling with Verification (procgen-kit)"
aliases: [parametric kit builder, LLM-driven kit modeling]
domain: "procgen"
stage: "procedural"
realtime: "offline"
platforms: [cpu, python]
year_introduced: 2025
inputs: [text-prompt]
outputs: [mesh, graph]
style: "both"
dynamic: "static"
cost: "offline"
authority: "wrong-nebula, 2026"
url: "https://texelatlas.vercel.app/t/procedural-kit-modeling/"
sources_verified_at: "2026-11-29"
---
# Procedural Kit Modeling with Verification (procgen-kit) (wrong-nebula, 2026)

> Describe a modular 3D kit as a short script that builds a parametric geometry graph, then mechanically check it: closed manifold meshes, every control swept across its range, touching parts and collision.

## Reach for it when

- llm-generated modular props have broken geometry
- need parametric walls and gates that stay valid at any setting
- check meshes are closed and manifold automatically
- script a game-ready kit and verify collisions
- sliders produce overlapping or leaking parts

## How it works

A kit builder script (typically written by a language model) declares parts, controls and their relationships; a native core turns it into a parametric geometry graph whose geometry is regenerated when controls change. A verification harness then sweeps each control to its limits and checks invariants: meshes stay closed and manifold, parts that should touch do touch, and collision tests (e.g. with convex decompositions in a physics engine) pass. Failures give the author concrete diagnostics to fix, so correctness is machine-checked instead of eyeballed. Renders (beauty, clay, parts passes) support review. This differs from random procedural generation: the output is a controllable, verified asset family.

## When to use it

Choose it when an LLM or script must produce parametric, game-ready modular kits (walls, gates, props) whose geometry has to be valid at every parameter setting. Prefer [CGA Shape Grammar (Procedural Buildings)](https://texelatlas.vercel.app/t/cga-shape-grammar.md) for rule-based building facades at city scale, [Greebling](https://texelatlas.vercel.app/t/greebling.md) for decorative surface noise, and [Infinigen (Procedural Photorealistic Worlds)](https://texelatlas.vercel.app/t/infinigen.md) for photorealistic natural scenes.

## Cost

offline — Native geometry build is fast; the verification sweep multiplies cost by number of controls and test poses.
Measured GPU Weight: 29.68× baseline (heavy) — 0.9765 ms median / 1.0122 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 27.37× baseline (heavy) — 0.4352 ms median (2.24× faster on L4).
Ampere A100 scaling: 18.62× baseline (moderate) — 0.5362 ms median (1.82× faster on A100).

## Failure modes

- Verification only covers swept controls and the checks it implements; unmodelled interactions can still fail
- Quality of the kit is bounded by the builder script, which a weak model may get geometrically wrong
- Complex organic forms are outside the parametric-part vocabulary
- Requires building the C++ core and a Python toolchain

## Dataflow

- Inputs: text-prompt
- Outputs: mesh, graph
- Platforms: cpu, python

## Presets

### Procedural Kit Modeling — manifold, contact-joint & clearance checks (left) vs parametric CAD assembly sweep (right) (glsl-fragment; rendered 2026-11-30)

```json
{
  "P_ARCH_SPAN": 0.58,
  "P_COL_HEIGHT": 0.72,
  "P_FLANGE_RAD": 0.28,
  "P_SPLIT": 0.48
}
```

```glsl
const float P_ARCH_SPAN = 0.58; // P Arch Span [0.35, 0.82, 0.02]
const float P_COL_HEIGHT = 0.72; // P Column Height [0.42, 0.95, 0.02]
const float P_FLANGE_RAD = 0.28; // P Flange Radius [0.16, 0.38, 0.02]
const float P_SPLIT = 0.48; // P Verify / CAD Split [0.0, 1.0, 0.02]

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);
}

float sdCylinder(vec3 p, float r, float h) {
  vec2 d = abs(vec2(length(p.xz), p.y)) - vec2(r, h);
  return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));
}

// Modular parametric architectural kit with exact contact constraints between base -> columns -> entablature -> finial!
vec2 mapKit(vec3 p, float span, float colH, float flR) {
  float baseTop = -0.52;
  float colTop = baseTop + colH;

  // Part 1: Stepped plinth base (exact top plane y = baseTop)
  float dBase = sdBox(p - vec3(0.0, baseTop - 0.09, 0.0), vec3(span + flR + 0.08, 0.09, flR + 0.14)) - 0.015;
  vec2 res = vec2(dBase, 1.0);

  // Part 2: Twin interlocking fluted columns mating flush on y = baseTop and y = colTop
  vec3 pSym = vec3(abs(p.x) - span * 0.78, p.y - (baseTop + colH * 0.5), p.z);
  float ang = atan(pSym.z, pSym.x);
  float flute = 0.012 * cos(ang * 10.0);
  float dCol = sdCylinder(pSym, flR * 0.56 + flute, colH * 0.5);
  // Lower & upper mating collar flanges snapped to exact joint planes
  float dCollarB = sdCylinder(vec3(pSym.x, p.y - (baseTop + 0.035), pSym.z), flR * 0.78, 0.035);
  float dCollarT = sdCylinder(vec3(pSym.x, p.y - (colTop - 0.035), pSym.z), flR * 0.78, 0.035);
  float dCols = min(dCol, min(dCollarB, dCollarT));
  if (dCols < res.x) res = vec2(dCols, 2.0);

  // Part 3: Spanning architrave beam & carved arch void resting flush on y = colTop
  float beamH = 0.24;
  vec3 pBeam = p - vec3(0.0, colTop + beamH * 0.5, 0.0);
  float dBeam = sdBox(pBeam, vec3(span + flR * 0.92, beamH * 0.5, flR * 0.72)) - 0.012;
  float archCut = length(vec2(p.x, p.y - colTop)) - (span * 0.55);
  dBeam = max(dBeam, -archCut);
  if (dBeam < res.x) res = vec2(dBeam, 3.0);

  // Part 4: Crown lantern finial snapped flush on top of architrave (y = colTop + beamH)
  float finialY = colTop + beamH;
  float dFinial = min(
    sdCylinder(p - vec3(0.0, finialY + 0.08, 0.0), flR * 0.45, 0.08),
    length(p - vec3(0.0, finialY + 0.22, 0.0)) - flR * 0.36
  );
  if (dFinial < res.x) res = vec2(dFinial, 4.0);

  return res;
}

vec3 calcNormal(vec3 p, float span, float colH, float flR) {
  vec2 e = vec2(0.002, 0.0);
  return normalize(vec3(
    mapKit(p + e.xyy, span, colH, flR).x - mapKit(p - e.xyy, span, colH, flR).x,
    mapKit(p + e.yxy, span, colH, flR).x - mapKit(p - e.yxy, span, colH, flR).x,
    mapKit(p + e.yyx, span, colH, flR).x - mapKit(p - e.yyx, span, colH, flR).x
  ));
}

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 sx = fragCoord.x / max(iResolution.x, 1.0);
  float split = clamp(P_SPLIT, 0.0, 1.0);
  bool showCAD = sx >= split;

  // Gently sweep parameters around user slider targets to demonstrate continuous mechanical verification!
  float sweep = sin(iTime * 0.75);
  float span = clamp(P_ARCH_SPAN + 0.10 * sweep, 0.32, 0.88);
  float colH = clamp(P_COL_HEIGHT + 0.10 * cos(iTime * 0.62), 0.38, 0.98);
  float flR = clamp(P_FLANGE_RAD, 0.14, 0.40);

  float orb = iTime * 0.34 + 0.35;
  vec3 ro = vec3(2.45 * sin(orb), 0.42, 2.45 * cos(orb));
  vec3 ta = vec3(0.0, -0.05, 0.0);
  vec3 fw = normalize(ta - ro);
  vec3 ri = normalize(cross(fw, vec3(0.0, 1.0, 0.0)));
  vec3 up = cross(ri, fw);
  vec3 rd = normalize(fw * 1.48 + ri * uv.x + up * uv.y);

  vec3 bg = mix(vec3(0.05, 0.065, 0.095), vec3(0.14, 0.18, 0.26), smoothstep(-0.3, 0.6, rd.y));
  vec3 col = bg;

  // Floor plane at y = -0.715
  float tHit = 1e5;
  float hitId = 0.0;
  if (rd.y < -0.005) {
    float tf = (-0.715 - ro.y) / rd.y;
    if (tf > 0.05 && tf < 14.0) { tHit = tf; hitId = 10.0; }
  }

  float t = 0.05;
  for (int i = 0; i < 64; i++) {
    vec2 h = mapKit(ro + rd * t, span, colH, flR);
    if (h.x < 0.0018) {
      if (t < tHit) { tHit = t; hitId = h.y; }
      break;
    }
    t += h.x;
    if (t > min(tHit, 7.5)) break;
  }

  if (hitId > 0.5) {
    vec3 p = ro + rd * tHit;
    vec3 v = -rd;
    vec3 L = normalize(vec3(0.62, 0.82, 0.52));

    if (hitId > 9.0) {
      // Studio blueprint floor grid
      vec2 g = abs(fract(p.xz * 2.5) - 0.5);
      float line = smoothstep(0.035, 0.008, min(0.5 - g.x, 0.5 - g.y));
      vec3 fCol = mix(vec3(0.07, 0.09, 0.13), vec3(0.22, 0.34, 0.48), line * 0.65);
      float ao = smoothstep(0.15, 1.25, length(p.xz));
      col = mix(fCol * (0.45 + 0.55 * ao), bg, 1.0 - exp(-tHit * 0.14));
    } else {
      vec3 n = calcNormal(p, span, colH, flR);
      float baseTop = -0.52;
      float colTop = baseTop + colH;
      float finY = colTop + 0.24;

      if (!showCAD) {
        // Left: Mechanical verification diagnostic overlay (per-part manifold ID colors + bright green mating-joint verification rings!)
        vec3 partCol = vec3(0.22, 0.52, 0.82);
        if (hitId > 1.5 && hitId < 2.5) partCol = vec3(0.28, 0.72, 0.68);
        else if (hitId > 2.5 && hitId < 3.5) partCol = vec3(0.84, 0.56, 0.22);
        else if (hitId > 3.5) partCol = vec3(0.72, 0.38, 0.86);

        float ndl = 0.38 + 0.62 * max(dot(n, L), 0.0);
        // Subtle parametric iso-slice wireframe confirming watertight closed manifold
        float iso = smoothstep(0.05, 0.012, abs(fract(p.y * 10.0) - 0.5));
        col = partCol * ndl + vec3(0.85, 0.94, 1.0) * iso * 0.14;

        // Glowing emerald snap rings at exact mathematical contact planes (touching-part verification PASS!)
        float j1 = smoothstep(0.022, 0.004, abs(p.y - baseTop));
        float j2 = smoothstep(0.022, 0.004, abs(p.y - colTop));
        float j3 = smoothstep(0.022, 0.004, abs(p.y - finY));
        float jointGlow = clamp(j1 + j2 + j3, 0.0, 1.0);
        col = mix(col, vec3(0.18, 1.0, 0.45) * 1.45, jointGlow);
      } else {
        // Right: Crisp shaded stone & brushed-bronze parametric kit assembly
        vec3 alb = vec3(0.76, 0.73, 0.68);
        float met = 0.0;
        if (hitId > 3.5) { alb = vec3(0.86, 0.68, 0.36); met = 0.75; }
        else if (hitId > 2.5) alb = vec3(0.82, 0.79, 0.74);

        vec3 H = normalize(L + v);
        float ndl = max(dot(n, L), 0.0);
        float spec = pow(max(dot(n, H), 0.0), mix(24.0, 68.0, met)) * mix(0.35, 1.25, met);
        vec3 skyFill = mix(vec3(0.16, 0.20, 0.28), vec3(0.40, 0.52, 0.72), 0.5 + 0.5 * n.y);
        col = alb * (vec3(1.32, 1.22, 1.05) * ndl + skyFill * 0.48) + mix(vec3(1.0), alb, met) * spec;
      }
    }
  }

  float sep = smoothstep(0.0035, 0.0008, abs(sx - 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.

## Sources

1. [primary] wrong-nebula (2026) wrong-nebula/procgen-kit. https://github.com/wrong-nebula/procgen-kit License: MIT. (verified via github on 2026-11-29)

## Cite this entry

Texel. "Procedural Kit Modeling with Verification (procgen-kit)." https://texelatlas.vercel.app/t/procedural-kit-modeling/ (accessed 2026-12-01).
