Explorer’s Lab › Sniff Trail › Build log
Build log
The 3D vertical slice (Blender + WebGPU)
Froze the 2D prototype as Gen 0, then built a 3D slice. Claude scripted Blender to make the clearing and a rigged wolf, then wrote a WebGPU runtime where one wind field moves grass, trees and scent.
Goal
Prove the new pipeline end to end: AI-scripted Blender → glTF → three.js WebGPU, with the signature system (one shared wind field) and sniff vision working in a small playable space.
Human decisions
Derek rejected top-down 2D as too basic, asked to push the frontier with any tools available, and dropped the zero-assets idea. Asset provenance replaces it.
What was done
- Froze Gen 0. The 2D prototype is preserved, playable at
/worlds/sniff-trail/gen0/. The freeze tool gained--id/--labeloptions for this. - Blender, headless, by script (
art/blender/build_slice.py, about 600 lines):- The clearing: noise-shaped terrain with a winding path and a hollow, about 46 trees (broadleaf blobs and stacked pines), rocks with moss tops, flowering bushes, a stump with mushrooms, and the Golden Sock.
- The wolf: a skin-modifier body from a joint skeleton, subdivided and coloured with fur, saddle, muzzle and tail tip, plus googly eyes (one bigger) and a tongue. Bound to a 23-bone armature with automatic weights.
- Exports:
clearing.glb,wolf.glb, andterrain.json(height grid and obstacles).
- Review loop. Rendered EEVEE previews, inspected them, and fixed blocky slope shading, stray cream patches on the legs, legs that were too thin and fur that was too pale. Then rebuilt.
- Runtime (
src/):WebGPURenderer+ TSL.- GPU grass with gust waves and parting around the wolf.
- Tree sway by height above the ground.
- A scent cloud advected by the same wind formula, pooling in the hollow.
- A procedural wolf rig: trot, slope pitch, sniff pose, spring tail and ears.
- A sniff camera and colour grade, synth wind ambience and the X-Ray (wind vectors and skeleton).
- Asset provenance.
externalAssetswas replaced byassets(file, source, madeBy, licence), validated bynpm run checkand shown in this dossier.
What broke / dead ends
- Blank colours: Blender’s glTF exporter wrote a blank
COLOR_0and put the painted colours inCOLOR_1. three.js looks forcolor1, but GLTFLoader names itcolor_1. Fixed by promoting the painted layer at load time. - Grass hid the wolf: the first grass was taller than the wolf. Shortened it.
- NaN freeze: the animation loop’s first timestamp could be earlier than the start time. The negative
dtmadesqrtreturn NaN and froze every scent particle. Fixed by clampingdtand usingperformance.now(). - Sniff vision whited out the screen when the camera sat inside the plume. Added a near-camera fade and toned down the glow.
Verification
npm run typecheckis clean.npm run buildandnpm run checkpass: 17 site URLs, plus smoke tests for bothplay/(3D) and the frozengen0/.- In the browser: WebGPU backend at about 120 fps, 71k grass blades, around 700 scent particles. Movement, sniff vision, camera drag and the X-Ray were checked by screenshots.
- Not verified: phones (touch quality tier), Safari/Firefox, and playing to the end by hand (the find was checked by distance in code only).
Next steps
Foot IK, a second scent and the sneeze, glTF compression, a painterly post-process trial, phone testing, and the lost-and-found story with an owner creature.