Texel A field guide to 3D techniques

TexelBench

Reproducible 3D scene generation benchmark for AI coding agents and real-time pipelines. Ten multi-genre challenges scored on zero WebGL/shader errors, hardware Metal/WebGL2 frame timing, material/lighting look-dev gates, token cost, and 3-angle rendered pixels.

Three.js r187 Playbook Writing A/B/C Study

Three independent blind subagents on the same model and identical prompt, each given only its assigned Three.js playbook variant. All scenes compiled and captured in headless Chromium on Apple M1 Metal WebGL2 across 3 identical camera presets (hero, closeup, grazing) with zero external CDN assets.

threejs r187 Apple M1 (ANGLE Metal WebGL2, 1280×720) 2026-12-01
Visual Quality
9.2 / 10 +3.4 vs Variant 1
Variant 1: 5.8/10 → Variant 2: 9.2/10
WebGL Shader Errors
0 errors −2 errors
Variant 1 hit 2 r187 GLSL compile errors
Output Tokens
80,009 −9.3%
Variant 1: 88,218 incl. thinking
Wall-Clock Duration
14m 12s −57s faster
Variant 1: 15m 09s · 28 vs 15 turns
Variant 2 (Look-Dev Contract + Polish Pass) — Hero Alley render Variant 1 (Baseline Prose Guide) — Hero Alley render Variant 1 · Baseline Prose Guide (5.8/10) Variant 2 · Look-Dev Contract + Polish Pass (9.2/10)

Scorecard & Token Telemetry

Variant Visual Errors Output tok Fresh input Cache read Turns / Time Metal ms Key outcome
Variant 1
Baseline Prose Guide
5.8 / 10 2 88,218 132,558 1,140,419 15 · 15m 09s 74.4 ms Two MeshPhysicalMaterial onBeforeCompile shaders failed to compile in Three.js r187 ('vNormal' undeclared, 'perturbNormal2Arb' overload mismatch), leaving the wet road a flat pink slab and brick walls untextured.
Variant B
Code-First Snippets
7.1 / 10 0 61,106 107,757 1,002,753 17 · 9m 19s 104.6 ms Fastest and cheapest run (−31% output tokens, −39% wall time) with sharp neon puddle reflections and crisp brick normals — but unexcluded transparent steam quads rendered as solid black occlusion blocks inside GTAOPass.
Variant 2
Look-Dev Contract + Polish Pass
9.2 / 10 0 80,009 214,496 2,151,430 28 · 14m 12s 81.4 ms Clear winner (+3.4 visual pts, 0 errors, −9.3% fewer output tokens, −57s faster than Variant 1). Phase-2 Polish Pass added raking bulkhead sconce, pipe manifold + shutoff valve, wooden floor andon, parked bicycle, recessed upper windows, and puddle meniscus sheen.

4 Empirically Proven Findings Folded into Live Playbooks

01

Avoid brittle onBeforeCompile chunk patching in Three.js r187

Internal MeshPhysicalMaterial GLSL chunks (vNormal, perturbNormal2Arb) changed signatures in r187, causing Variant 1's wet-asphalt and POM brick shaders to fail compilation. Paired procedural PBR canvas maps, standalone ShaderMaterial/Reflector, or WebGPU TSL compiled with 0 errors.

02

Hide transparent & particle meshes during GTAOPass

GTAOPass renders its depth/normal prepass with an override material that ignores transparent: true, turning steam billboards and glass into solid black boxes (Variant B). Wrapping gtao.render to hide userData.skipGTAO and transparent meshes eliminates the bug completely.

03

Three.js r187 API removals caught by Metal WebGL

THREE.PCFSoftShadowMap was removed in r187 (use THREE.PCFShadowMap + shadow.radius) and THREE.Clock is deprecated (use THREE.Timer).

04

Quantitative gates + Phase-2 Polish Pass cut output tokens while jumping +3.4 visual pts

Variant 2 used 9.3% fewer output tokens and finished 57s faster than Variant 1 while adding layered silhouette craft, raking close-up light, and Fresnel puddle meniscus realism. Both Code-First snippets (B) and Numeric Gates + Polish Pass (C) are now merged into live /guides/threejs.md.

10 Canonical TexelBench Challenges

Run the local Playwright Metal/WebGL2 harness against any static Three.js scene with: node scripts/texelbench.mjs --challenge=<id> --entry=path/to/index.html

#01 · Sci-Fi / Night / Urban Verified run

Rain-Slicked Cyberpunk Ramen Alley

Build an interactive 3D rain-slicked Tokyo/cyberpunk alleyway ramen shop & vending machine corner at twilight-into-night — featuring wet asphalt puddles, glowing paper lanterns & neon signs, weathered brick & corrugated metal shutters, a warm wooden counter interior visible through glass, rising steam/haze, and crisp shadows & reflections.

Machine-readable benchmark schema & verified runs: /api/v1/bench.json · Read the upgraded Three.js playbook born from this study: /guides/threejs.md · GPU shader timing table: Hardware GPU Benchmarks.