Calcy on graph paper 2D → .ic Pipeline
InstaCalc (the game) · Asset Pipeline Spec · November 2026

From a single drawing to a 3D math fighter

Instead of shipping 75 MB textured .glb downloads for every boss, we pair ComfyUI (for true 3D volume) with exploded turnaround schematics (for articulated joints) and compress every boss into a 924 B – 3.9 KB pure-math .ic / .ic.md file compiled on the fly by our 54 KB WebGL2 engine.

90.6% Live WebGL2 silhouette IoU 71.8 / 100 Texture & Lighting parity (+29.3 pts) 924–1,014 B csg_dct (82.9–91.2% 3D IoU) 2.6–3.9 KB dct2 compressed (80–88% cut) 58.0 / 100 Ortho 3-view check (flags pose/back drift) 13–19 auto-rigged ASCII + CSG parts
STEP 1 · CLEAN STILL

Reference + Mask

Take the trailer frame (435×576) and cut the character out cleanly with BiRefNet (L1=0.0211).

STEP 2A · VOLUME

ComfyUI → 3D-DCT

TRELLIS.2 builds 3D silhouette proportions, compressed into 2.6–3.9 KB dct2 or < 1 KB csg_dct.

STEP 2B · JOINTS

Prompts A–E Kits

AI turnaround & exploded component sheets carve isolated limbs + bone pivots automatically.

STEP 3 · STRATEGY 5

Hybrid .ic + Rig

Fuse the smooth R16F torso with crisp CSG plinths/decals (eˣ) & Voronoi lava shaders.

1. Result First · V10 & V12 Visual Proof Measured on local WebGL2 + wipe_score.py

Does a < 1–3 KB math file actually match concept art?

Judge it side-by-side — cards 3, 4, and Hero #2 below are compiled and rendered live right on your GPU from our actual .ic files (no pre-baked PNGs). Heavy organic curves come from a quantized R16F 3D-DCT table; razor-sharp pieces (the numbered plinth, shoulder pipes, hollow collar, and eˣ plate) stay pure CSG geometry.

Trailer Concept Still
1. Trailer Concept Still Uncropped 435×576 target frame with numbered plinth.
BiRefNet Surgical Mask
2. BiRefNet Cutout Mask Registered to concept (L1=0.0211); strips floor text.
3. V10 Live .ic (950 B!) Decoded live from euler-titan-1kb.ic (csg_dct) — zero PNG.
Trailer Concept Still
CONCEPTLIVE .IC
4. Live 50/50 Concept ↔ .ic Drag anywhere on image to scrub concept vs live WebGL2 shader.
4x5 Parity Grid
4×5 Parity Grid: 90.6% Global IoU Cells: C4=100%, D4=99%, D5=94%, B2=94%, D3=93%.
5-Strategy Quantitative Bakeoff
5-Strategy Bake-Off S1 (55–61%) → S2 Backsolve (70%) → S3 CSG (74%) → S5 .ic (94.4%).
Brass Mech Concept
CONCEPTLIVE S5
Hero #2: Brass Inf Mech Strategy 5 (70.6% IoU) Live WebGL2 crisp RBox + 2×2 rocket pods (924 B csg_dct · drag to scrub).
Measured Signal (tools/wipe_score.py)Before Shader TuningAfter Closed-Loop TuningConcept Target (00_ref_euler.jpg)
Texture & Lighting Parity 42.5 / 100 71.8 / 100 (+29.3 pts) Wrap studio key + sky fill + palm radial halo
Basalt Rock Albedo & Texture Std lum=0.126 (too dark/cold) lum=0.212 (std=0.077) lum=0.206 (std=0.072, charcoal slate)
Magma Seam & Volumetric Palm Halo 16.2% thin flat stripes 40.5% warm bevel + view halo 33.6% glowing fissures + soft palm plasma
Foreground Pixel L1 Error 0.1663 0.1320 (-20.6% error) Lower is closer inside Titan silhouette
Plinth Stone L1 & Brightness L1=0.0821 (speckled bevel) L1=0.0594 (lum=0.355) lum=0.340 smooth warm clay drum
Two-Band dct2 Spectral Codec · 80–88% Size Cut

Boss Compression: 25.7 KB → 3.2 KB (90.0% IoU Held)

Keeping low frequencies exact in int16 (lo=5–6) while pruning 70–80% of high-frequency 3D-DCT modes and sqrt-companding into int8 shrinks every boss by 80–88% and speeds up JS IDCT decode by ~4.6×. Pairing CSG base primitives with sparse residuals cuts further toward < 1.5 KB (~94%).

Hero AssetDense dct1dct2 (3 KB)csg_dct (<1 KB)
euler-titan25,713 B3,229 B (90.0%)950 B (-96.3% · 83.3%)
brass-inf-mech23,697 B3,102 B924 B (-96.1% · 82.9%)
calcy-hero15,530 B2,663 B1,014 B (-93.5% · 91.2%)
mandelbrot-lord19,368 B3,949 B-79.6% dct2
Verified AAA Gate · tools/ortho_score.py

Ortho 3-View Lock Catches Hidden 3D Bugs

A single 3/4 wipe can hit 90.6% while hiding back-side hallucinations. Scoring Front | Side | Back orthos (ortho=1) caught mirrored back-decal projection (fixed in GLSL via world n.z) and proved single-view extraction scores only 58.0 / 100 against a canonical A-pose ortho sheet (Front 53.5% · Side 57.8% · Back 54.4%). True AAA needs Ortho First → Rigged Pose → PBR Gate → < 4 KB Budget.

Canonical 3-View Ortho Turnaround
Concept Ortho SheetFront · Side · Back on height rulers
Live Ortho 3-View Alignment Diagnostic
Ortho Diff (58.0 / 100)Exposes pose & pipe drift across views

Try the interactive wipes yourself: drag the live split slider between concept art and real-time WebGL2 shaders, or inspect every rigged strategy side by side.

Open Concept↔Live Wipe ↗ Open 3D Skeleton Schematic ↗ Compare 950 B (-96%) ↗ Brass Mech Primitive Wipe ↗ Open 5-Strategy & Rig Lab ↗
Developer + Agent Automation CLI · Fast Deterministic Workflow
# 1. Any video (.mp4/.mov) or image -> rigged <4 KB dct2 + <1 KB csg_dct + ASCII .ic.md
python3 tools/video2ic.py input.mp4 --name boss-slug --comfy --sub1kb

# 2. Quantized Oriented-CSG + Residual <1 KB Compressor + 7-bit ASCII rig
python3 tools/assets/dsl_invert.py arcade/public/game/assets/ic/brass-inf-mech.ic arcade/public/game/assets/ic/brass-inf-mech-1kb.ic

# 3. Objective Wipe Parity + 3-View Ortho Gate + Full Tool Suite Smoke Audit
python3 tools/wipe_score.py ref.png live_clean.png live_mask.png ref_mask.png --json
python3 tools/ortho_score.py tools/ortho_3view_suite.json
python3 tools/suite_audit.py --live http://127.0.0.1:8199
2. Turning Stills Into Articulated Rigs

Exploded Schematics (Prompts A–E) build bendable skeletons automatically

A single beauty shot hides the back, inner armpits, and joint pivots. Instead of asking an artist to model from scratch, we generate an equal-height turnaround + separated exploded component kit. Python extracts each island, computes bone anchors, and compiles a bendable .ic rig in under a second.

Prompt D Turnaround and 13 Kit Parts
Prompt D · Kit Sheet Equal-height Front/Side/Back + 13 clean isolated parts.
Compiled 13-Part 3D Explodable Kit
Compiled 13-Part Kit titan-exploded-kit.ic with live explode & bend sliders.
Prompt E YAML Parametric Sheet
Prompt E · Parametric Maps Sphere / Capsule / Box parts onto skeletal bones.
Compiled 18-Primitive Skeleton
18-Part CSG Rig (2.4 KB) titan-parametric.ic compiled cleanly by schematic_to_ic.py.
Prompt B 9-Color Part-ID Sheet
Prompt B · 15-Joint RGB ID Flat RGB palette auto-carves 15 limb meshes (titan-partid.ic).
Prompt A Clean CAD 3-View Ortho
Prompt A · Clean 3-View Ortho Front × Side visual hull carved in 0.28s (2,505 verts, 5,032 tris).
Prompt C 8-Way Isometric Sprite Strip
Prompt C · 8-Way Isometric Strip (2048×256) 8 chroma-keyed 30° isometric views + 19,182-voxel visual hull.
3. Engineering Reality Check

Can we hit 100/100 fidelity — and get great natural rigging & motion?

Short answer: on static silhouette and staging we already hit 90–95% parity (88–92/100 independent critic release score). For animation and boss motion, separating clean parts (Prompt D) + bone anchors (Prompt E / rules/rigs.ic) + video keypoint retargeting gives natural motion without hand-keyframing every boss from zero.

CapabilityWhere We Are NowWhat Gives Us Natural, 100/100 Motion & Look
Exact Silhouette & Shader Parity
sdf-studio.html?wipe=1
90.3% IoU Live
(94.4% MPS, 89–91/100 Critic)
Already meets studio release bar. Last ~8% is collar furnace HDR bloom (#ffb31a) and soft Voronoi lava groove falloff.
Joint Discovery & Boss Parts
rules/rigs.ic + Prompt D/E
13–18 auto-carved parts
9 characters rigged via rig_pivots_tbl
Prompt D isolates every boss part on flat gray; Prompt E + rig_pivots_tbl bind shoulder/elbow/hip/knee pivots automatically without floating limbs.
Natural Combat Motion Sources
tools/assets/motion.py + calcy_anim_dsl.py
Procedural + Video Extractor
Optical pose tracking + Guitar-Tab @TIMELINE
Retarget AI video / Mixamo humanoid BVH cycles onto our shared humanoid pivot hierarchy (pelvis → chest → shoulder → elbow → fist), plus spring follow-through on pods & cables.
Compounding Roster Scaling
flywheel_priors.json
5.7× Speedup Verified
(302 → 53 camera evals in 0.9s)
Every solved hero teaches camera pitch & proportion priors to the next boss; ComfyUI multi-view + baked palette generalizes across the whole roster.
4. Try It Live On This Page Runs locally on 54 KB /vendor/ic-3d/ic-3d.js

Live .ic.md & .ic Compiler Workbench

Default loads the V10 Strategy 5 Euler Titan (90.3% IoU) from its readable .ic.md ASCII blueprint + .ic parts & 3D-DCT spectral field. Edit any CSG part, color, or timeline below and click Compile & Rebuild.

Initializing ic-3d compiler...
Drag: Orbit · Scroll: Zoom · Voronoi PBR + LatheGeometry
Live ASCII Readback:

      
04_euler_titan.ic.md (V10 Live Source)
5. Under the Hood · ComfyUI + Blender

From raw trailer frame to fitted math geometry

We never ship raw ComfyUI meshes (a single TRELLIS.2 export is 31–365 MB with faint voxel stair-stepping). Instead, ComfyUI acts as our 3D geometric oracle: BiRefNet cuts the subject out cleanly, TRELLIS.2 recovers 360° volume, Blender inspects the clay pass, and our backsolver fits crisp 1.5 KB .ic primitives to it.

Trailer Frame Input
1. Trailer Source FrameMulti-object desk scene with HUD banners.
Tight Hero Crop
2. Tight Subject CropIsolates hero before segmentation.
BiRefNet Cutout
3. BiRefNet Cutout1024×1024 clean silhouette mask.
ComfyUI Front Render
4. TRELLIS.2 3D MeshCanonical front pose reconstructed in 3D.
Blender Front
Front (0°)Studio light rig
Blender 3/4
3/4 View (38°)Core bevel check
Blender Side
Side (90°)Limb depth check
Blender Back
Back (180°)Rear armor check
Blender Clay Pass
Clay PassPure geometry only
ArtifactDisk SizeRole in Pipeline
golem_trellis2.glb365 MBRaw O-Voxel reference mesh (6.35M verts)
golem_trellis2.sdf.json2.0 MBNormalized 80³ signed-distance training grid
assets/golem.ic1.5 KBShipped math recipe compiled in RAM
assets/calcy.ic2.9 KBHero parametric SDF + materials
assets/arrow-mech.ic526 BUltra-compact mech recipe
In-Game Three.js Golem
Shipped Runtime Look (Procedural .ic) Crisp analytic bevels and procedural emissive veins — 240,000× smaller than the raw GLB.
4-Boss Audit Sheet & Exact M5 Max Commands
4x4 Trailer Recreation Sheet
4×4 Multi-Boss AuditInfinity Golem, Unit Circle Mech, Polynomial Hydra & Trailer Calcy.
SubjectGLB → SDFSilhouette / 360° / SurfaceRecommended .ic Strategy
Infinity Golem365 MB → 2.0 MB8.5 / 7.5 / 5.0Voxel/chiseled CSG + crisp procedural magma & math plaque.
Unit Circle Mech31.1 MB → 2.36 MB7.0 / 7.0 / 4.5Smooth parametric CSG arcs, protractor ticks & lens glow.
Polynomial Hydra68.1 MB → 2.47 MB6.0 / 6.0 / 4.0Mask plinth pre-3D; rebuild multi-heads with axis-aligned cubes.
Trailer Calcy47.9 MB → 1.99 MB8.0 / 6.5 / 4.0Smooth beveled box + procedural LCD face & keypad array.
# 1. Launch ComfyUI on Apple Silicon (MPS diffusion + --cpu-vae to avoid Conv3D hang)
/Users/kazad/ComfyUI-Installs/ComfyUI/ComfyUI/.venv/bin/python3 \
  /Users/kazad/ComfyUI-Installs/ComfyUI/ComfyUI/main.py \
  --listen 127.0.0.1 --port 8188 --cpu-vae --disable-auto-launch

# 2. Run 2D -> 3D directly on cropped hero image
python3 scratch/comfy_img2ic.py hero_crop.png --prefix asset_name --upsample none --sdf-res 80

# 3. Render multi-angle lit + clay check in Blender 5.2.2 LTS
blender --background --python scratch/blender_turntable.py -- ./out/asset.glb ./out asset_name

# 4. Fit tiny procedural .ic asset against normalized SDF
node tools/assets/mesh2ic.mjs program.ic ./out/asset.sdf.json views.json view_id out.ic --evals 1500
6. Math-Native Primitives & Cozy Roster

Compact equations beat triangle soup every time

Every silhouette on the graph paper reduces to four clean mathematical building blocks—revolutions, swept Bézier curves, Fourier ridges, and damped envelopes—keeping the entire hero lineup tiny, razor-sharp, and warm.

Lathe Profile r(y)

r(y) = Bezier 24 segs, ~45 B Armor / Horns

Swept Bézier C(t)

12 floats = limb

Fourier Ridge Folds

|sin(k·p)| fissures Zero textures, infinite LOD

Laplace Envelope

exp(-σr) · f(r) Smooth bevels, crisp rims
Core Thesis — Finding the Right Proc-Gen Parameters, Not Hand-Modeling: TRELLIS.2 + Ortho sheets act as a geometric oracle; dsl_invert.py + our 7-DOF Flywheel invert that oracle into the smallest expressive proc-gen program (549 B – 1,014 B csg_dct). Every card below is rendered live on your GPU directly from those compact math files — zero PNGs.
02. Calcy Hero509 B calcy-real.ic live
04. Euler Titan950 B csg_dct + CSG plinth
08. Brass Inf MechCrisp RBox + pods (3.6 KB .ic.md)
03. Poly Hydra3-neck non-biped (3.5 KB dct2)
06. Unit Circle MechProtractor shields (3.5 KB dct2)
100 Procedural Geometry, Shader & Look-Dev Checklist (42 Shipped / 19 Partial / 34 Queued)

Compression Funnel (Euler & Brass Mech)

  • PNG 374 KB static 2D concept still
  • GLB 1.7 MB raw unrigged TRELLIS.2 triangle soup
  • .ic (dct2) 3.1–3.2 KB (-87.4%) two-band spectral SDF
  • csg_dct 924–1,014 B (-96.3%) 19 oriented primitives + int8 residual

Compact DSL Words (351–918 B Bosses)

  • radial(n, r, tilt, part) — rings, spines & halos in 1 line
  • tube(pts, r1, r2) — swept flexible limbs, tails & coils
  • gear, rev, stack — clockwork, bells & golems

Spectral, SDF & Node Tricks (1–40)

  • YES 1D Fourier lathe profiles for boots & pedestals
  • YES Band-limited Worley lava fissures & cracks
  • YES LimbChain, MirrorX, SocketSnap, RivetArray
  • YES Tapered trapezoidal plates & recessed panel seams
  • PART Superquadric gloves, radial Fourier shields & tread splines
  • QUEUE 3D spherical harmonics & silhouette IoU optimizer

4-Map PBR, Lighting, Rigging & Compiler (41–100)

  • YES Triplanar 3D Voronoi + curvature edge wear + crevice AO
  • YES Strict 8:1:3 warm key / cool sky fill / rim + contact shadow
  • YES Asymmetric hero stance + instanced sub-assemblies
  • PART 2-bone IK limbs, GLSL math symbol SDFs, joint validators
  • QUEUE Secondary spring bounce, GTAO pass & auto-IK retargeting
7. Literate Source Format

Every model is a readable Markdown file (*.ic.md)

Splitting topology (@SKELETON in 7-bit ASCII), profile curves (<svg>), PBR surface bands (@MATERIAL_TAB), and keyframe timing (@TIMELINE) lets humans and AI inspect or edit a 3D boss directly in Git diffs or any browser.

60 FPS Live @TIMELINE Animation Smooth cubic bone interpolation compiled from 04_euler_titan.ic.md (4,416 B) — replaces choppy GIF.
Guitar-Tab Timeline Strip
Guitar-Tab Keyframes /windup → *SLAM* + *FLARE* → \recoil across 60 fps bones.
Inspect Full Literate 04_euler_titan.ic.md Source
# 04. Euler Exp Titan (`04_euler_titan.ic.md`)

```ic-skeleton
@SKELETON euler_exp_titan (unit: 0.1m)
          [HEAD]          -> lathe(#helmet_crest) + extrude(#t_visor)
            |
    (o)---[TORSO]---(o)   -> lathe(#chest_plate) + decal(#ex_badge)
    /        |        \
  [PAUL]    (o)     [PAUL] -> lathe(#pauldron)
   |       /   \       |
  [ARM] [THIGH][THIGH][ARM] -> lathe(#bicep_armor)
   |       |     |     |
 [FIST] [GREAV][GREAV][FIST] -> extrude(#molten_fist)
           |     |
        [PEDESTAL]         -> lathe(#stepped_pedestal) + decal(#plaque_2)
```

```ic-shader
obsidian_lava : objectSpaceVoronoi(warp=7.5, core=#ff5c08, crust=#252221)
pedestal_stone: cozyClay(base=#6c6862, seams=true)
```