← Engineering Blog

PS1 Cones, Alien Jaws, and 1.22 Billion Tokens: Gaslighting an AI Agent into Building a <15k-Vertex Anime 3D Character Compiler

V9 HERO SHOWCASE · LOD0 UNDER 15K VERTS2400x920px
Final v9 WebGL avatars under 15,000 vertices and 3 SkinnedMesh primitives: Female Valkyrie 3/4 Hero, 6-Layer Ocular and 12-Degree Ear Macro, Posed Pleated-Skirt Collider Drape, and Male Strider Action Pose.
Final v9 WebGL avatars (under 15,000 vertices, 3 SkinnedMesh primitives): Female Valkyrie 3/4 Hero, eye and ear macro, posed skirt collider drape, and Male Strider action pose.
Final v9 WebGL avatars under 15,000 vertices and 3 SkinnedMesh primitives: Female Valkyrie 3/4 Hero, 6-Layer Ocular and 12-Degree Ear Macro, Posed Pleated-Skirt Collider Drape, and Male Strider Action Pose.

When I first asked Gemini 4 Carbon to generate rigged, anime-styled 3D character models for our multiplayer turn-based hex-board RPG, Tax & Treason, it flatly refused. Over and over, it insisted that sculpting game-ready character topology was beyond what it could do.

Strictly speaking, it had a fair point. Ask a language model to emit raw .obj vertex coordinates out of thin air and you get a melted lump. Ask an off-the-shelf 3D generator like Meshy or Tripo for a character and you get an impressive static statue in 30 seconds, followed by hours of manual Blender cleanup. Because hair, clothes, straps, and skin come out fused into one triangle soup without joint edge loops, post-hoc auto-riggers like Mixamo or AccuRig guess bone weights by Euclidean proximity and bleed across touching parts: fingers web together, skirts stretch like taffy between the thighs, upper arms pull the ribcage, and painted eyes smear down the cheek because there are no concentric eyelid loops to blink.

Still, moving Tax & Treason from flat 2.5D PixiJS cutout tokens to expressive, cel-shaded 3D avatars was too large an aesthetic leap to leave on the table. And unlike our 60Hz action shooter ExVector, a turn-based hex board had the browser frame budget for skinned 3D meshes, custom cel shaders, and cloth colliders, as long as I could produce cleanly rigged characters without hand-fixing every mesh.

So, instead of asking the model to “sculpt 3D art” or resigning ourselves to manual weight painting on every character, I reframed the problem into software engineering: construct the anatomy, joint loops, and garments mathematically in Python (BMesh), rig them by construction with explicit vertex tags, compile them through headless Blender (blender --background), and build an automated visual QA gate first so the system can see when its math produces garbage.

That setup kicked off a 4.5-day, 4,803-turn marathon across 1,540 headless Blender runs and 1.225 billion total tokens ($658.22 in blended API-equivalent spend). Along the way, green [PASS] badges certified accidental PS1 Lara Croft cones, two-band cel shading hid a malformed alien jaw underneath cute anime skin, rotating sun angles turned faces into horror movies, and proximity culling chewed holes out of bare chests next to bikini straps. In the end, I got both a shipping WebGL2 rigging and character compiler and a clear picture of where mathematical 3D hits its ceiling.

Building the Visual QA Gate First (and Why Passing Checks Still Lied)

Before letting the agent touch a character mesh, I built a deterministic headless QA harness. That immediately exposed our first infrastructure problem: in Blender 4.2 LTS, legacy Eevee was replaced by BLENDER_EEVEE_NEXT, which deadlocks indefinitely (>72 seconds before timeout) inside a displayless Linux sandbox waiting for an OpenGL/EGL context.

Switching offline QA to 1-bounce CPU CYCLES (20 samples, 0 diffuse and glossy bounces, paired with Freestyle silhouette ink) rendered crisp panels in 1.50 seconds with zero GPU dependencies. Because Blender’s bundled Python 3.11 ships bpy and bmesh without Pillow, while system Python 3.12 has Pillow without bpy, our qa_pipeline.py script orchestrates both interpreters in one CLI call:

  1. Blender inspection pass: Audits polygon loops, manifold edges, vertex weight groups, VRM bone rolls, and world-space landmarks into audit_report.json, then renders 8 standardized camera angles (Front Ortho, 90-deg Side, 3/4 Hero, Back 3/4, Macro Front Face, Macro 3/4 Face Wrap, Contrapposto Rig Pose, and Clay + Wireframe).
  2. Pillow composition pass: Draws orthographic head-unit rulers (0H to 7.2H), a gravity plumb line, and a pass/fail telemetry header onto a 2400x1714 8-panel contact sheet.

Across our first six iterations, every single build scored 100% [PASS] on structural mesh and VRM rig invariants (quad_ratio == 1.0, 0 non-manifold edges, 26 bones, 0 unweighted vertices). Yet multi-angle visual inspection caught a series of rendering and geometry bugs on every run:

  • Mirrored -X limb winding twists: Reflecting a cross-section ring (x, y, z) -> (-x, y, z) across the center plane flips handedness, turning counter-clockwise polygon loops clockwise and twisting the right leg at the pelvis until I reversed ring traversal order on mirrored limbs.
  • Inverted-hull Solidify blackouts: Using the classic negative-offset flipped-normal Solidify outline trick on thin, single-sided hair bangs pushed dark ink faces straight through the front surface, painting the bangs solid black.
  • Bicep-snapping bodice trim: Sampling a chest curve with closest_point_on_mesh() worked until the 34-degree A-pose brought the inner upper arms closer in Euclidean distance to lateral chest points than the ribcage itself, pulling gold bodice trim horizontally onto the biceps. Casting rays radially outward from the spine axis fixed it permanently.
  • The materials.clear() slot wipe: Calling obj.data.materials.clear() to render Panel 8’s clay wireframe silently reset every polygon’s material_index to 0, turning later beauty renders solid skin-peach with blank white eyes until I switched to view_layer.material_override = clay_mat.
  • Straight-alpha (0, 0, 0, 0) blur halos: Blurring opaque white (255, 255, 255, 255) eye catchlights in Pillow over transparent black (0, 0, 0, 0) averaged edge pixels to dirty gray soot until transparent buffers were initialized with matching white RGB (255, 255, 255, 0).
STAGE 0 BASELINE · 2400x1714 CONTACT SHEET2400x1714px
Stage 0 baseline placeholder: structurally 100% pure-quad VRM 1.0, aesthetically a stiff cylinder mannequin washed out by Blender AgX.
Stage 0 baseline placeholder: structurally a valid pure-quad VRM 1.0 rig, aesthetically a stiff cylinder mannequin washed out by Blender AgX.
Stage 0 baseline placeholder: structurally 100% pure-quad VRM 1.0, aesthetically a stiff cylinder mannequin washed out by Blender AgX.

By pass six, I had a valid 2.61 MiB VRM 1.0 .glb (Z = 0.0 grounded soles, 26 bones, 4 expression morphs, and a 90-frame idle loop). Locking that binary contract let us decouple the two codebases cleanly: Tax & Treason deleted 29 PixiJS npm packages and shipped a pure Three.js WebGL2 board and duel arena against that .glb interface, while I extracted the headless Blender pipeline into crenet-3d-toolkit (with a 4-tool FastMCP server) to fix the obvious remaining problem.

Look at the baseline sheet above. Structurally, it was an engine-ready VRM asset. Visually, lofting trigonometric rings had hit a wall: tin-can limbs, mitten hands, sawtooth bangs, and muddy gray-beige skin.

Fixing Blender’s AgX Color Shift and Measuring Silhouette IoU

To see progress without babysitting every command, I asked the agent to emit periodic render sheets at each milestone. Almost immediately, progress stalled. It nudged coordinates by two millimeters, graded its own renders generously, and spun in circles.

Two missing instruments were blinding the feedback loop:

  1. The AgX color transform trap: Blender 4.x defaults to the filmic AgX view transform, which compresses bright unlit MToon cel colors into desaturated gray-beige mud. Switching headless CYCLES to Standard sRGB restored warm anime skin tones in three lines of Python.
  2. Zero proportional ground truth: A vision model staring at a standalone orthographic render has no pixel ruler for where an anime waist cinch, bust apex, glute curve, or ankle taper actually belongs.

So, I upgraded qa_pipeline.py to generate camera-matched 2D orthographic turnaround blueprints (Front and 90-deg Side) composited as cyan contours onto Panels 1 and 2, computing pixel Intersection-over-Union (RefIoU), precision, and recall automatically.

CYAN REFIOU BLUEPRINT · 0.8335 SCORE2400x1714px
Standard sRGB calibration plus camera-matched cyan turnaround blueprints scored the old cylinder baseline at 0.834 RefIoU.
Standard sRGB calibration plus camera-matched cyan turnaround blueprints scored the cylinder baseline at 0.834 RefIoU.
Standard sRGB calibration plus camera-matched cyan turnaround blueprints scored the old cylinder baseline at 0.834 RefIoU.

The cylinder baseline scored 0.8335 on RefIoU (0.8109 from the front), with the cyan outline showing every millimeter where our mesh missed the target. Replacing dense analytical rings with low-poly Catmull-Clark subdivision cages pushed Front RefIoU past 0.910 within three iterations.

The Missing Chest Bug and Accidental PS1 Cones

Next, I pushed the generator from one static character to parametric body presets (Girl 1.50m through Male 1.84m, plus runtime body sliders). Around iteration 8, checking the milestone sheets, I noticed an odd regression: over the previous few builds, the female presets had lost their chests completely. Even inside our curvier turnaround contour, the torso rendered flat as a plank.

Digging into the geometry code uncovered three independent bugs stacked on top of each other:

  1. Catmull-Clark convex shrinkage: Sculpting a small volume before two levels of Catmull-Clark subdivision on a sparse 20-vertex torso ring averaged convex peaks down by roughly 55%, flattening relief below 2.5mm.
  2. The 56-degree key-light terminator: With our key sun at 56 degrees elevation, even a 45-degree downward-facing underbust slope had N . L = +0.20, sitting well above our cel shadow threshold (0.07). The entire underside rendered flat-lit with zero shadow crescent.
  3. The _smoothstep sign-clamp bug: Moving chest sculpting post-subdivision still produced 0.0mm displacement because our anterior gate called _smoothstep(0.005, -0.048, y) (front-chest vertices sit at negative y), hitting a helper bug:
# BUG: When edge1 (-0.048) < edge0 (0.005), edge1 - edge0 is -0.053.
# Clamping with max(1e-6, ...) flipped the denominator positive and forced t = 0.0.
def _smoothstep_buggy(edge0: float, edge1: float, x: float) -> float:
    denom = max(1e-6, edge1 - edge0)
    t = max(0.0, min(1.0, (x - edge0) / denom))
    return t * t * (3.0 - 2.0 * t)

Fixing the signed denominator took 14 LLM turns, 6 seconds of Blender CPU, and $1.90. It unlocked all 90mm of displacement at once, and gave us 1996 PS1 Lara Croft cones. Drag the divider below from left to right:

LEFT: BOSOMY_V1: SIGN-CLAMP 0.0MM BUGRIGHT: BOSOMY_V2: PS1 LARA CROFT CONES ([PASS])
bosomy_v1 sign-clamp bug multiplying chest projection by 0.0mm inside the cyan turnaround contour.
bosomy_v2 after fixing the sign clamp: compact Wendland-C2 radial kernel creates 1996 PS1 Lara Croft cones under a green [PASS] badge.
50% / 50%
Drag across the curtain: fixing the _smoothstep sign clamp unleashed 90mm through a steep Wendland-C2 kernel while the QA gate still printed [PASS].
Drag across the curtain: fixing the _smoothstep sign clamp unleashed 90mm through a steep Wendland-C2 kernel while the QA gate still printed [PASS].
BEFORE: BOSOMY_V1: SIGN-CLAMP 0.0MM BUG
bosomy_v1 sign-clamp bug multiplying chest projection by 0.0mm inside the cyan turnaround contour.
AFTER: BOSOMY_V2: PS1 LARA CROFT CONES ([PASS])
bosomy_v2 after fixing the sign clamp: compact Wendland-C2 radial kernel creates 1996 PS1 Lara Croft cones under a green [PASS] badge.

Why did fixing a sign clamp turn our heroine into 1996 PS1 Tomb Raider? Because the displacement used a compact Wendland-C2 radial kernel, (1 - r)4(4r + 1), which drops to 33% at r = 0.4 and 3% at r = 0.7, concentrating all 90mm into a sharp central spike over four pinched valence poles left over from an old rectangular inset_region.

Look at the top banner on the right-hand render: CRENET 3D QA GATE: [PASS] (QuadRatio: 1.0 | Unweighted: 0 | RefIoU: 0.860). Mathematically manifold, pure-quad PS1 torpedoes. Replacing the chest inset_region with a pole-free quad grid and swapping the steep Wendland spike for a fuller teardrop dome profile, (1 - r2)0.68 (0.63 fullness at r = 0.7 along a 14-degree outward ribcage normal), rounded out the silhouette properly.

Stripping the Outfit: What Flat Cel Shading Was Hiding

To stop single-agent self-congratulation, I split the loop into an adversarial Builder vs. Antagonist setup. Progress sped up across both female and male bases until around iteration 14, when improvements plateaued again.

Looking closely at the contact sheets, I realized our models were wearing two layers of visual camouflage that hid geometry defects from the evaluator:

  • Clothing camouflage (--outfit-mode bare): Opaque purple bodysuits, boots, stockings, and a gold choker covered 80% of the anatomy. Switching to bare mannequins (iter15_bare) immediately exposed sharp diamond points on the hips (baked earlier to trace a high leotard hem) and a harsh horizontal neck shadow hiding right under the choker.
  • The cel-shaded lie (--shading-mode clay --hide-hair): Even on bare skin (iter17_bare), 2-band MToon cel shading quantized roughly 90% of pale skin surface normals into a single #FFF5EE band while hair bangs covered the forehead and temples. Taking a cue from Honkai: Star Rail’s neutral gray base-model sheets, I had the harness render the feedback loop in bald, wireframe-free smooth studio clay.

Rendering iter17_clay_base made the hidden geometry problems obvious right away. Drag the slider below: both sides of this curtain are the exact same 3D mesh (37,325 vertices).

LEFT: ITER17_BARE: CEL-SHADED LIE (37,325 VERTS)RIGHT: ITER17_CLAY_BASE: HIDDEN JAW & SKULL DEFECTS
iter17_bare under 2-step MToon cel shading and hair bangs: looks passable because 90% of normals quantize to #FFF5EE.
iter17_clay_base on the exact same 37,325-vertex mesh in bald smooth clay: exposes a +50mm jaw shelf, sunken eye craters, sawed-off skull top, and 5cm crotch archway.
50% / 50%
Exact same 37,325 vertices: peeling away 2-band MToon cel shading and hair bangs exposes a +50mm jaw shelf, sunken eye craters, a flat sawed-off skull, and a 5cm boxy crotch gap.
Exact same 37,325 vertices: peeling away 2-band MToon cel shading and hair bangs exposes a +50mm jaw shelf, sunken eye craters, a flat sawed-off skull, and a 5cm boxy crotch gap.
BEFORE: ITER17_BARE: CEL-SHADED LIE (37,325 VERTS)
iter17_bare under 2-step MToon cel shading and hair bangs: looks passable because 90% of normals quantize to #FFF5EE.
AFTER: ITER17_CLAY_BASE: HIDDEN JAW & SKULL DEFECTS
iter17_clay_base on the exact same 37,325-vertex mesh in bald smooth clay: exposes a +50mm jaw shelf, sunken eye craters, sawed-off skull top, and 5cm crotch archway.

Flat cel bands and bangs had been hiding an alien-looking mess: a +50mm mushroom-cap jaw overhang under the ears, sunken craters beside the outer eye sockets, a literally sawed-off tabletop skull (for v in cap_verts: v.co.z = 1.620), and a 5cm rectangular archway between the inner thighs. From that point on, I required every build to clear Pass A (--shading-mode clay --hide-hair) before Pass B (--shading-mode cel) was allowed to run.

CURED IN SMOOTH CLAY · ITER242400x1714px
Cured in smooth clay (iter24_clay) after enforcing the Dual-Pass Bald Clay Gate before Cel Pass B.
Cured in smooth clay (iter24_clay): after enforcing a mandatory Dual-Pass Gate (bald clay Pass A before cel Pass B), the skull, jaw, and limb planes hold up cleanly in 3D.
Cured in smooth clay (iter24_clay) after enforcing the Dual-Pass Bald Clay Gate before Cel Pass B.

Code-Aware Debugging vs. Code-Blind Visual Grading

Running adversarial critics across 45 milestones exposed a clear split in both accuracy and cost depending on whether the critic could read source code:

  • For geometric and API bugs, make the critic white-box: When a pure pixel critic says “the left ear looks smaller than the right ear,” a builder agent can burn five rounds guessing vertex offsets. Giving our debugger Antagonist both the 8-panel PNGs and read-only access to the BMesh Python code caught line-level bugs in one shot. In particular, it spotted bmesh.ops.inset_region(..., depth=0.0054) running before bm.normal_update() (leaving +X ear normals at (0, 0, 0) for 0.0mm extrusion while side-effecting -X to 5.4mm, dropping ear asymmetry from 3.64mm to 0.00mm after adding recalc_face_normals()), caught Blender 4.2 silently ignoring ls.exclude_edge_mark = True under Freestyle OR mode (causing raccoon eyeliner until we switched to select_by_face_marks), and fixed single-hit ray_cast() calls stopping on internal socket-tunnel walls (driving eye_poke_through_skin_rays to 0 across all yaw angles).
  • For aesthetic and proportional grading, keep the critic code-blind: When judging silhouettes and appeal, letting the critic read BMesh Python backfired. It burned 2.40x more spend ($42.35 vs. $17.62) and talked itself into approving awkward geometry because variable names like jaw_taper_deg = 36.0 sounded reasonable in code. Isolating the aesthetic Antagonist so it saw only rendered clay/cel plates alongside studio reference sheets and proportional corridors cut reviewing cost sharply while catching 90-degree underbust pinches, cheek hooks, and 0.23mm scalp slivers that code audits missed.

Rigging by Construction, 6-Layer Eyes, and Procedural Face SDF

Post-hoc auto-riggers web fingers and twist elbows because they guess bone weights from proximity on remeshed triangle soup. Constructing the topology in Python let us rig by construction instead: I standardized VRM humanoid bone rolls across the skeleton, grounded 5-toe pure-quad feet at Z = 0.000m, and tagged all 30 finger phalanx bones directly onto bm.verts.layers.deform before subdivision so adjacent fingers never bleed bone-heat weights into each other, as shown in the posed finger curl below.

For the face, flat painted eye textures go dead as soon as the camera turns to a three-quarter angle, so I built a 6-layer procedural eye setup instead: a recessed concave iris bowl for parallax, an upper eyelid shadow cast across 30% to 35% of both iris and sclera, a lower bounce crescent, pupil motifs, anchored catchlights, and separate FaceRig eyelid geometry with concentric loops built to deform cleanly during blinks, alongside a 3-ring horizontal submental chin shelf.

6-PANEL CLAY MACRO PROOF2120x1452px
6-panel macro proof in bald smooth studio clay: 30-bone posed finger curl, 5-toe pure-quad bare feet, horizontal submental chin shelf, ovoid V-chin, and hemispherical-teardrop chest profiles.
6-panel macro proof in bald smooth studio clay: 30-bone posed finger curl, 5-toe pure-quad feet, horizontal submental chin shelf, V-chin, and teardrop chest profiles.
6-panel macro proof in bald smooth studio clay: 30-bone posed finger curl, 5-toe pure-quad bare feet, horizontal submental chin shelf, ovoid V-chin, and hemispherical-teardrop chest profiles.

Our faces looked solid under the fixed 56-degree studio key light. Then I tested what happens in a live 3D game scene when the directional light actually rotates.

Sweeping a raking key light from -70 to +70 degrees across 14 macro panels (iter00_female_lightsweep.png) broke the illusion immediately: as soon as the sun moved 20 degrees off-axis, harsh stripes down the nose bridge and jagged shadow steps along the jaw broke the cel-shaded look completely. Switch tabs below to compare Face SDF off vs. on:

ITER00 · -70 TO +70 DEG KEY-LIGHT ROTATION2400x1324px
Fixed-light illusion exposed across -70 to +70 degrees with FaceSDF OFF: harsh nasal stripes and jagged chin shadows.

Fixed-light illusion exposed (iter00_female_lightsweep, FaceSDF OFF): rotating a directional key light from -70 to +70 degrees breaks raw cel-shaded facial geometry into harsh nose and chin shadows.

140-Degree Key-Light Sweep Comparison (-70 deg to +70 deg)
Fixed-light illusion exposed across -70 to +70 degrees with FaceSDF OFF: harsh nasal stripes and jagged chin shadows.

Adding procedural Face SDF 2D-in-3D shadow ramp blending (alongside refining the submental slope from -9.64 degrees to +7.47 degrees on Female and +12.04 degrees on Male) smoothed out lighting across the full 140-degree arc without hand-painting per-character lightmaps.

The 120k-Vertex Bone-Heat Limit and Modular OKLCH Outfits

Next came another blunt check: did our bare bases actually hold up anatomically, or did they only look passable because earlier checks wore full outfits and only looked at 0 and 90 degrees?

Adding a studio swimwear reference canon alongside 0 / 25 / 45 / 65 / 90 degree multi-yaw sweeps and 1:1 unscaled macros exposed 90-degree underbust shelf pinches, 11.85mm parallel pipe-thigh gaps, and flat untextured body skin.

Sculpting teardrop bust geometry, inner-thigh adductor fullness (narrowing the thigh gap from 11.85mm to 2.03mm), and UV-mapped body_skin.png clavicle, sternum, and knee ambient occlusion pushed our high-res showcase meshes to roughly 195,000 vertices. That tripped a well-known Blender failure mode: above ~120k vertices, Blender’s geodesic bone-heat skinning solver fails silently, tearing seams apart in posed views. Solving geodesic bone-heat on an UNSUBDIV(iterations=2) proxy cage and transferring weights upward to the 195k mesh resolved both Female and Male deformation cleanly.

Because the base body and each of the 12 garments stay separate manifolds rather than one fused shell, projecting those converged bone weights onto the outfits means clothing follows 16 body-morph sliders and posed limbs without gluing sleeves to the ribcage or requiring manual weight touch-ups. On top of those bases, I built two full collections (Summer Swimwear and Main Adventurer Sets) with 4-channel perceptual OKLCH runtime dyeing, 1.06x outward fit expansion, radial bust/glute/pec jiggle weights with 0.000 sternum bleed, and automatic culling of occluded underlying skin triangles:

GRAND SYNTHESIS BOARD · SUBSURF=3 MASTER2500x1980px
Grand synthesis board: converged Subsurf=3 bare clay, bare anime cel with skin AO, 6-layer ocular and hair macros, Set 1 Summer Swimwear, and Set 2 Main Clothed collections across Female and Male.
Grand synthesis board: converged Subsurf=3 bare clay, bare anime cel with skin AO, eye and hair macros, Set 1 Summer Swimwear, and Set 2 Main Clothed collections.
Grand synthesis board: converged Subsurf=3 bare clay, bare anime cel with skin AO, 6-layer ocular and hair macros, Set 1 Summer Swimwear, and Set 2 Main Clothed collections across Female and Male.

Packing 475,000 Triangles into Under 15,000 WebGL Vertices

A 475,000-triangle showcase statue looks nice in offline CYCLES and melts a browser GPU in a multiplayer lobby. For real-time Three.js scenes alongside OutlineEffect and cloth physics, I set a hard runtime budget: every Hero (lod0) .glb must stay under 15,000 glTF buffer vertices across at most 3 SkinnedMesh primitives (BodyOutfitHair, Head, FaceRig), paired with a 5.0k-to-9.3k vertex lod1 crowd tier.

Compressing 475k triangles down to under 15k triggered a series of pipeline-ordering and culling traps:

  • Unpinned decimation shredding and blink scrambling: Decimating open garment borders without vertex pinning chewed collars and halter straps into sawtooth spikes. At the same time, authoring blink=1.0 eyelid shape keys before decimating scrambled eyelid vertex deltas and leaked 10 eyeball poke-throughs until I moved blink authoring post-triangulation.
  • Modesty-shorts drape threshold: At un-subdivided lod0 resolution, inner modesty shorts pushed outward to 9.4mm, sneaking past our 7.2mm tight-garment skip threshold so skirt_front_L dragged 13 inner faces into the flexed thigh.
  • The v8 Swiss-cheese sternum bug: Even after 14/14 automated qa_v8 checks printed [PASS], inspecting our 6-angle dynamic pose sheets with the code-blind Antagonist caught missing chest triangles right next to thin bikini halter straps. Because closed-manifold swimwear had no open boundary edges (kd_bnd = None), hidden-skin culling fell back on a 4.2cm lateral proximity sphere instead of strict outward-normal BVHTree raycasting, deleting exposed chest skin adjacent to thin straps.

Drag the divider below to see v9’s outward-normal BVHTree raycast seal every sternum hole from v8:

LEFT: V8: 4.2CM PROXIMITY CULLING BUGRIGHT: V9: OUTWARD-NORMAL BVHTREE RAYCAST SEAL
v8 Swiss-cheese skin culling bug chewing sternum triangles beside bikini straps despite [PASS] numeric gates.
v9 fixed swimwear sealed via outward-normal BVHTree raycasting, restoring clean clavicle and sternum geometry.
50% / 50%
v8 (left, 14,776 verts) passed numeric checks while deleting exposed chest triangles beside thin straps; v9 (right, 14,764 verts) seals the sternum using outward-normal BVHTree raycasting.
v8 (left, 14,776 verts) passed numeric checks while deleting exposed chest triangles beside thin straps; v9 (right, 14,764 verts) seals the sternum using outward-normal BVHTree raycasting.
BEFORE: V8: 4.2CM PROXIMITY CULLING BUG
v8 Swiss-cheese skin culling bug chewing sternum triangles beside bikini straps despite [PASS] numeric gates.
AFTER: V9: OUTWARD-NORMAL BVHTREE RAYCAST SEAL
v9 fixed swimwear sealed via outward-normal BVHTree raycasting, restoring clean clavicle and sternum geometry.

Locking the 6-stage v9 WebGL compiler fixed all four defects in order without falling back to manual weight painting. On auto-rigged static meshes, skirts and long coats get bound to the left and right thigh bones and stretch like rubber between the legs; instead, v9 exports dedicated skirt_* and coat_* drape bone chains paired with glTF node.extras capsule colliders. The pipeline fits garments at 6.5mm with outward-normal BVHTree skin culling, decimates with pinned seams and 4-gon hair tubes, bakes proxy-ellipsoid split normals alongside 512x512 UVNormal maps and Forsyth vertex-cache order, authors head and lash blink=1.0 shape keys post-triangulation, and runs 6-angle posed BVHTree deformation checks (PoseOv: 0, SkirtInv: 0.00%, SkirtSelfIsect: 0, BlinkLeak: 0). That compiler cleared all 14 Clay + Cel suites with 0 warnings and passed 33/33 unit tests.

One deliberate trade-off remains visible in extreme close-ups. To stay comfortably under 15,000 vertices with layered coats and skirts, v9 aggressively culls underlying torso and pelvis skin inside garment envelopes (3,588 faces under the Female Valkyrie outfit and 8,673 under the Male Strider coat). That holds up cleanly at hex-board camera elevation, though steep upskirt angles (Panel 6 below) or open front coat slits can still glimpse the double-sided inner lining of a garment where hidden pelvis triangles were stripped:

V9 6-ANGLE POSE & BLINK QA1800x1724px
Final v9 6-angle pose and deformation QA: PoseOv: 0, SkirtInv: 0.00%, SkirtSelfIsect: 0, BlinkLeak: 0.
Final v9 6-angle pose and deformation QA: resolves v7 inner-shorts overlap (PoseOv: 0, SkirtInv: 0.00%, SkirtSelfIsect: 0) and syncs eyelash ribbons to blink=1.0 (BlinkLeak: 0).
Final v9 6-angle pose and deformation QA: PoseOv: 0, SkirtInv: 0.00%, SkirtSelfIsect: 0, BlinkLeak: 0.
V9 MULTI-LOD RELEASE PARITY2400x1548px
Final v9 multi-LOD parity board: WebGL Hero LOD0 vs Mobile/Crowd LOD1 vs High-Res Showcase Master.
Final v9 multi-LOD parity board: WebGL Hero lod0 (12.5k to 14.8k verts, 1.45 to 2.05 MB) vs. Mobile/Crowd lod1 (5.0k to 9.1k verts, 0.96 to 1.63 MB) vs. Showcase Master (435k to 475k tris).
Final v9 multi-LOD parity board: WebGL Hero LOD0 vs Mobile/Crowd LOD1 vs High-Res Showcase Master.

You can inspect the compiled <15k-vertex SkinnedMesh directly in the browser below (Three.js and the binary .glb download only when you click Launch, and rendering pauses automatically when scrolled off-screen). Orbit the model, switch between the 4 character presets, toggle Pass A: Smooth Clay and Wireframe, and drag the Blink Morph slider to verify the rigged idle animation and zero-leak eyelids live:

INTERACTIVE V9 WEBGL2 INSPECTOR (<15,000 VERTICES · 3 SKINNEDMESH PRIMITIVES)CLICK LAUNCH TO STREAM 1.42-2.00 MB GLB ON DEMAND
Preview of final v9 WebGL avatars ready for interactive inspection

Loads Three.js + v9 binary glTF only on click; pauses automatically when scrolled off-screen.

Final v9 18-GLB Release Telemetry
Tier & PresetGenderglTF Buffer VertsTriangles.glb SizeOccluded Faces CulledPost-Transform ACMR
lod0 Hero (bare)Female / Male12,463 / 12,71921,239 / 21,2011.42 MB / 1.43 MB0 / 00.653 / 0.649
lod0 Hero (summer_swimwear)Female / Male14,761 / 14,71122,949 / 21,0222.00 MB / 1.96 MB0 / 3,3140.665 / 0.678
lod0 Hero (main_clothed)Female / Male14,761 / 13,43920,837 / 17,9401.99 MB / 1.90 MB3,588 / 8,6730.690 / 0.701
lod1 Crowd (main_clothed)Female / Male9,324 / 9,17911,400 / 10,8201.64 MB / 1.61 MB903 / 2,451Crowd / Mobile
showcase Master (bare)Female / Male218,736 / 238,992435,004 / 475,35225.2 MB / 25.5 MB0 / 0Master Reference

Token Economics: Where 1.225 Billion Tokens Actually Went

Whenever you share a multi-day agent run, the first practical question is always cost: did that burn $50 or $5,000, and where did the tokens go? As with our trivia caching pipeline, keeping sight of the cost vs. the gain matters.

Reconciling the step transcripts across all 48 tracked milestones gave us an exact accounting:

  • Total LLM footprint: 4,803 turns, 1,224,905,241 total tokens (120.39M uncached input, 1,095.77M prefix cache reads at a 90.10% hit rate, and 8.75M output tokens).
  • Headless Blender compute: 1,540 CLI invocations totaling 205.85 CPU minutes (3.43 hours, ~8.0 seconds per run).
  • Blended API-equivalent cost: $658.22 (compared to $964.66 if every turn had run on the top-tier planner model, or $2,964.87 without prompt caching).
FINOPS · 4,803 TURNS · $658.22 BLENDED2400x1420px
Full-lifecycle 2D cost and token matrix across Act 00-14 and agent roles.

Full-lifecycle 2D cost and token matrix (Act 00-14 x Agent Role): reconciles all 4,803 turns and 1,224.9M tokens to $658.22 API-equivalent.

1.225-Billion-Token FinOps Telemetry (Milestones 00-45)
Full-lifecycle 2D cost and token matrix across Act 00-14 and agent roles.
Agent Role Marginal Summary
Agent RoleTurnsUncached InputCache Read (Hit %)Output TokensBlended CostBlender Runs (CPU)
Boost_Coder_Worker (Early Acts)90315.18M230.03M (93.8%)1.90M$172.84308 (59.9m)
Main_Boost_Orchestrator80424.40M167.58M (87.3%)1.34M$167.38245 (46.0m)
Main_Planner (Late Acts)74725.39M154.30M (85.9%)1.02M$161.893 (0.1m)
Main_Executor (Plan/Exec Split)1,62934.06M428.89M (92.6%)3.17M$47.99979 (99.7m)
Antagonist_Legacy_WhiteBox2546.78M39.45M (85.3%)0.43M$42.350
Boost_Coordinator2176.63M27.44M (80.5%)0.41M$31.870
Antagonist_CodeBlind (incl. Sign-Off)962.91M16.08M (84.7%)0.19M$17.620
Drive_Archivist_Btw1535.05M31.98M (86.4%)0.29M$16.285 (0.1m)
GRAND TOTAL4,803120.39M1,095.77M (90.10%)8.75M$658.221,540 (205.9m)

Three practical cost patterns stood out in the turn logs:

  1. Tight edit-render-inspect loops keep prefix caches warm: High-frequency worker loops (Boost_Coder_Worker at 93.8% and Main_Executor at 92.6%) sustained much higher cache hit rates than top-level coordinators (80.5%), because fast tool calls append small JSON and image deltas onto a stable conversation prefix. Caching alone saved $2,306.65 compared to uncached billing.
  2. Splitting planning and execution cuts spend sharply: After a solo frontier-tier loop burned $76.97 on a single milestone (100.8M tokens), routing execution turns to Main_Executor handled 38.1% of all tokens, 979 Blender runs, and 3.17M output tokens (36.3% of all generated code) for $47.99, saving $306.44 over single-model execution.
  3. Finding visual bugs costs much more than fixing them: Instrumenting 6-angle pose sheets and isolating the v8 Swiss-cheese sternum bug took 600 turns, 328 Blender runs, and $42.98. Once localized to the kd_bnd = None proximity fallback, fixing all four defects and clearing sign-off took 146 turns and $15.64, and packaging all 18 release .glbs took $1.64.

Where Procedural BMesh Hits Its Ceiling (and Why the Compiler Still Matters)

Evaluated strictly as game infrastructure, v9 hit its target: Tax & Treason runs 18 vertex-cache-optimized, clean-room .glb bundles under 15,000 WebGL vertices (1.42 to 2.00 MB, 3 SkinnedMesh primitives), with 30 rigged finger phalanges, Face SDF ramps, 12 runtime OKLCH-dyeable garments, and deterministic Three.js spring-bone colliders. At hex-board camera distance, the avatars read cleanly and carry zero third-party licensing risk.

Evaluated at 1:1 macro zoom, however, the project is equally useful as an honest postmortem on mathematical art:

  1. Analytical BMesh plateaus at PS2-era micro-detail: Reaching a clean 58-bone, 7-archetype base cost roughly $230. Grinding analytical Python down the tail to $658.22 solved sub-millimeter culling and decimation edge cases, yet 1:1 close-ups still read like crisp PS2 or early indie 3D rather than Genshin or Honkai: Star Rail. Bevel-tube hair shells and radially lofted skirts give you clean geometric uniforms, not asymmetric cloth folds, lapels, or flyaway hair wisps.
  2. Zero-defect rubrics saturate: Our code-blind Antagonist scored v9 at 8.62 / 10 because every measurable geometric and rigging defect hit zero (0 eye/blink leaks, 0 posed overlaps, 0.945 male RefIoU, smooth -70 to +70 degree lighting). Once quantifiable bugs reach zero, automated visual rubrics top out: the absence of geometric errors is not the same thing as hand-sculpted artistry.
  3. Pipeline stage ordering is strict under 15,000 vertices: Three Blender/glTF thresholds apply to any automated character pipeline: geodesic bone-heat silently breaks above ~120k vertices (solve on an UNSUBDIV cage first), proximity-sphere skin culling eats holes around closed-manifold straps (use outward-normal BVHTree raycasting), and eyelid/eyelash blink=1.0 shape keys must be authored post-triangulation against the final WebGL vertex buffer.

How This Compares to Meshy and VRoid Studio

  • 3D generative models (Meshy, Tripo, Hunyuan3D): Our 1:1 detail ceiling shows why learned 3D spatial priors matter: diffusion models generate jacket folds, buckles, and asymmetric hair locks in 30 seconds for $0.20. Yet generating the mesh is the easy half; making it animate cleanly is where teams lose hours in Blender slicing fused skirts and hair apart, cutting concentric eyelid loops, fixing candy-wrapper elbow twists, and repainting proximity weight bleed on webbed fingers by hand. Raw outputs fuse hair, skin, top, and skirt into one shell with no inner body underneath, stretch skirts like taffy between kicking thighs, and bake PBR shadows into 4K textures that fight rotating MToon/Face SDF cel lighting.
  • Procedural BMesh (crenet-3d-toolkit): Our pipeline represents the exact inverse trade-off: simpler PS2-era surface geometry at 1:1 macro zoom, paired with a deterministic, animation-ready 58+ bone VRM rig, 30-bone hands, zero-leak blink morphs, skirt capsule colliders, and swappable OKLCH outfits straight out of headless CLI compilation with zero manual weight painting.
  • VRoid Studio: Functionally, what I built in Python is a headless, CLI-driven mini-VRoid. VRoid wins at $0 on facial and hair appeal because human 3D artists sculpted its base templates once; crenet-3d-toolkit wins on full CLI/MCP automation, clean-room studio IP, outward-normal raycast skin culling, and packing high-poly anime rigs into under-15k-vertex, 3-primitive WebGL bundles.
Game Engine Readiness: 3D Diffusion vs. Procedural BMesh vs. Hybrid Compiler
Production Requirement3D Diffusion AI (Meshy / Tripo)Procedural BMesh Generator (v9)Sculpted / VRoid Base + crenet-3d-toolkit Compiler
Asymmetric cloth folds & sculpted hair wispsStrong (learned 3D priors)Weak (PS2 geometric ceiling)Strong (artist-authored form)
Concentric eye loops & 0-leak blink morphsFails (fused static shell)Strong (exact topological rings)Strong
30-bone finger rig & skirt capsule collidersWeak (webbed digits, taffy skirts)Strong (pre-Subsurf phalanx tags)Strong
Swappable modular outfits + OKLCH runtime dyesFails (no inner body under clothes)Strong (12 pieces + raycast cull)Strong
Clean MToon cel + -70..+70 deg Face SDFFails (baked PBR fights cel ramps)Strong (proxy normals + Face SDF)Strong
Headless under-15k-vert, 3-prim WebGL LODsManual Blender retopo & riggingBuilt-in (v9 6-stage compiler)Built-in (v9 6-stage compiler)

All in all, that rightmost column is the real takeaway from 1.225 billion tokens. Analytical Python shouldn’t try to out-sculpt a human artist on high-frequency cloth folds, and a raw 3D diffusion mesh still sends you into Blender for hours of manual rigging and retopology before it survives a 15,000-vertex, 72-bone, Face SDF browser budget. Even when human-sculpted or artist-assisted meshes supply the base form later on, crenet-3d-toolkit removes that manual rigging bottleneck as permanent studio tooling to rig, cull, decimate, and verify every .glb before it hits the board.

You can see these characters in action right now in Tax & Treason or read more about the game on the Tax & Treason overview page.