3D engine that AI agents drive
Shorten the 0.16.0 changelog and group entries by heading
Nguyen Xuan An207bd1a6c942
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex bbea460d..2d4fb41e 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -2,208 +2,64 @@## 0.16.0-- Draw the `foliage`, `mountain-valley` and grand valley reference frames without wind (issue #191). The reference harness left the renderer's default `wind: 0.3` on, which moved leaf cards by up to about four pixels at the reference camera while Blender drew them still. `foliage` falls from 0.0979 to 0.0838 against Cycles (EEVEE 0.0924), `mountain-valley` from 0.1769 to 0.1691, the three grand valleys by 0.0018 to 0.0077; no other scene moves. The README has the card-by-card comparison with Blender.-- Turn the floor sky trace (issue #197) on by default in the recipe path for a closed room a sun lights, at strength 0.2: `createAgentScene` calls `applyDefaultFloorSky(parts, environment)` from a lazily loaded module, loaded when the recipe names its sun (`keyColor` or `keyIntensity`). Open scenes and rooms lit by lamps alone are left as they are, because the trace made those worse against Cycles. `environment.floorSkyTrace: false` opts out, any other value leaves it on (documented in `docs/agent-look.md`). `applyFloorSkyVisibility` gains `onlyClosedRooms`, a lower default strength with it, and `report.meanVisibility`. FLIP against Cycles: `temple-hall` -0.0023, the three grand temple options -0.0051 to -0.0096, `dark-shaft` +0.0017, no other scene past 0.002. The README has the numbers.-- Add `applyFloorSkyVisibility` (`67js/addons/floor-sky-visibility`, issue #197), an opt-in trace of the sky each floor texel sees: 64 cosine-weighted rays per texel against the other parts, written into the floor's `skyVisibility`, which the shader already multiplies into the world and sky light. It adds nothing to the core entry, is off unless called, and leaves closed rooms alone unless `includeClosedRooms` is set. On the reference suite it improves 5 scenes by 0.004 to 0.010 FLIP (`car-paint`, `material-spheres`, `brushed-film`, `brick-flat`, `brick-graph`) and the three grand temple options by 0.011 to 0.021, but `long-street` gets worse by 0.0135 and three more scenes pass 0.002, so it is not on by default. The trace takes 0.5 to 1.7 s and the cut floor adds 0.1 to 0.3 ms per frame. The README has the numbers.-- Regenerate every cell of `baseline.json` and `grand.json` with the 8-bit EEVEE scorer (closes #258). Only the EEVEE columns and `cpu-vs-cycles` of `long-street` and `megacity-dusk` moved in `baseline.json`; the grand 67js columns moved a lot because the old file predated work on main. See `bench/reference/README.md`.-- Scale large glTF texture sets down at load instead of throwing (closes #260). When the images together pass `maxTexturePixels`, the largest are halved together until they fit, so 40 maps of 1024 px load with default options as 512 px. `asset.scaledTextures` lists each scaled image as `{ name, from, to }` and `asset.warnings` summarises it. The new `maxTextureImagePixels` option (default 16,777,216) is the hard ceiling for one image, which is still rejected before decoding. KTX2 images are never scaled.-- Raise the light limits to 16 point lights, 8 spot lights and 7 area lights (issue #261), from 8, 8 and 4. A server hall lit by 12 point and 7 area lights renders with every light visible. On an RTX 3060 at 960x540 each point light adds about 0.04 to 0.05 ms and each area light about 0.04 ms (16 point and 7 area lights: 1.92 ms, none: 1.07 ms; `bench/lighting/frame-time.mjs`). The light bake takes the same limits, the area limit is 7 so that the sun and all lights fit the 32 bit light-linking mask, and `material.lightMask` now defaults to `-1` (every bit) instead of `0x1fffff`.-- Document light intensity units and the three.js conversion (issue #262). `docs/agent-look.md` states the unit of the key, point, spot and area light intensities with a conversion table from three.js r155 and later, and `tests/light-units.test.js` ports one light of each kind with the table and checks the irradiance within 2 percent.-- Fit the default fog to the scene size (issue #263). A scene that sets no `fogDensity` now gets 0.006, or 1.2 divided by the scene diagonal when that is smaller, so a 900 m scene keeps 30 percent of its contrast at the far side instead of 0.4 percent. Scenes up to about 200 m are unchanged. `normalizeAgentLook` now returns `fogDensity: null` for "fit to the scene"; set a number, or 0 for none, to override.-- Warn when the shadow view and the light direction disagree (issue #264). A renderer whose `shadowBounds.eye` points 10 degrees or more away from `environment.lightDirection` now lists a `shadow-light-direction-mismatch` warning in `renderer.diagnostics`. `docs/agent-look.md` says the eye wins.-- Report a skipped ambient occlusion pass (issue #266). A frame with `effects.ambientOcclusion` above 0 on a renderer built without `depth: true` now sets a named `ambient-occlusion-without-depth` warning in `renderer.diagnostics`, which the preview's render info includes, instead of skipping the pass silently.-- Load glTF textures that use `EXT_texture_webp` (closes #274). The WebP source decodes like PNG and JPEG, counts toward the texture budgets from its header size, and falls back to the PNG or JPEG `source` when the browser cannot decode WebP.-- Load glTF files whose `COLOR_0` is RGBA with alpha below one (closes #278). The RGB colours are kept, the alpha is dropped, and `warnings` names the meshes where that happened.-- Load glTF files that use optional extensions and line primitives instead of refusing them (closes #280). An optional extension 67js does not read, such as `EXT_texture_avif`, is ignored and named in `warnings`; one in `extensionsRequired` is still refused. POINTS, LINES, LINE_LOOP and LINE_STRIP primitives are skipped with a warning that names the mesh. `KHR_materials_unlit` loads as the `unlit` material tag, and `KHR_lights_punctual` comes back as `asset.lights`: point and spot lights and the first directional light as `Renderer67` environment options. Not done: drawing the skipped primitives, and a reference-image check of a Khronos lights sample.-- Move the skin and morph shader code and the renderer's skin and morph validation, texture layout and packing out of the core renderer bundle (part of #281). `skinning.js` and `morph.js` register them on import, and every module that makes a pose (`createSkinPose`, `createMorphPose`, the glTF loader, rigs, retargeting, the crowd addon) imports them, so a lit box without a skin or morph target no longer carries them. Breaking: a renderer given a part with `skin` or `morph` that never imported those modules now throws and names the module to import. The post pass explosion step (the film's ignition scene) moved to `explosion-shader.js`, which the film player imports; a frame with `volumeExplosion` needs it. `scene:lit-box` is now 49,934 bytes gzip, under the goal of 50,000.-- Move the water, foliage, grass, terrain, moss, fire and smoke shading out of the core renderer bundle into `addons/world-material-shader` (part of #281). Breaking: a renderer that draws a part with one of those tags needs `import '@codepawlhq/67js/addons/world-material-shader'`; the terrain, vegetation, grass, clutter, film and agent terrain modules import it themselves, and a recipe loads it with `loadAgentSceneModules`. The environment map shading text now sits with the map builder, and GLSL line comments are stripped from the published bundles. The shader registry lives in the small `shader-registry.js`, so an addon that registers code no longer pulls in the renderer's shader text (`entry:spume` 25,410 to 12,411 gzip).-- Move the liquid and foam pass and the splat ground material out of the core renderer bundle (part of #281). Breaking: a renderer that draws a transmissive, `liquid` or `foam` part needs `import '@codepawlhq/67js/addons/liquid-shader'`, and one that draws `material.layers` needs `import '@codepawlhq/67js/addons/splat-shader'`; recipes and glTF files with transmission load the liquid code on their own, and the Spume player imports it. The environment map builder loads with `createEnvironmentMap`, so a renderer without an environment map no longer carries it. Measured by `npm run size`, gzip: `scene:lit-box` 66,497 to 56,343, `scene:gltf-box` 90,790 to 80,866, `scene:agent-scene` 110,277 to 103,794. The liquid program also compiles on the first liquid part instead of at start. `npm run size` now prints each goal scene against its goal.-- Match Blender 5.2's AgX in `environment.viewTransform: 'agx'` (issue #282). Grey 0.18 now maps to 0.460 sRGB against Blender's 0.461 (it was 0.501), and the colour ramp is within 0.0247 at most, 0.0026 on average (it was 0.0885 and 0.0252). The curve is a fit of Blender's AgX LUT: a per-channel sigmoid and two matrices. FLIP against Cycles AgX, `outdoor-hdri` 0.0997 to 0.0425, `material-spheres` 0.1467 to 0.0903, `character` 0.1238 to 0.0581.-- Score the view transforms against Blender 5.2.2 (issue #282): `npm run reference -- --view-transform agx --scene <id>,<id>` draws 67js with `viewTransform` and Cycles with Blender's AgX, and scores them into `bench/reference/view-transform.json`. The colour ramp shows `neutral` within 0.0079 of Blender (mean 0.0013) and `agx` within 0.0885 (mean 0.0252); the README has the table and the scene scores.-Add `environment.viewTransform` (`aces`, `agx`, `neutral`) and `.cube` or named looks in the renderer, the recipe and the path tracer, checked against Blender 5.2 on a colour ramp (closes #282, except the two scored reference scenes).-- The GPU path tracer traces the material `subsurface` block (issue #283 follow-up, part of #302): the same bounded random walk as the CPU tracer, compiled into the kernel only for a scene with a part whose weight is above 0, with the block in its own two-texel-per-material table. A scene without one compiles and renders the kernel it always did. Scored against the Cycles render of `subsurface`, see `docs/path-tracer.md`.-- Add a material `subsurface` block for skin, wax and leaves (part of #283): `weight` (0 to 1), `radius` (red, green, blue mean free path in units of `scale`, default `[1, 0.2, 0.1]`), `scale` (metres, default 0.05) and an optional `color`, named as Blender's Principled BSDF Subsurface Weight, Radius and Scale. Recipes and the MCP `scene_create` schema accept it with bounded numbers. The rasterizer widens the sun's diffuse past the shadow edge per channel and lets light through thin parts by the thickness the sun shadow map gives; the code is a lazily loaded addon (`@codepawlhq/67js/addons/subsurface-shader`, loaded by a recipe on its own) that compiles in only when a part has a weight above 0, so a scene without it draws the same picture and pays nothing. The path tracer does not read the block yet. `bench/reference/render-blender.py` exports it as Random Walk subsurface, and the reference scenes `subsurface` and `subsurface-off` score it against Cycles.-- Raise the subsurface addon back-face translucency from 0.5 to 1.0 (part of #283) so thin parts such as leaves pass more light, measured on the `subsurface` reference scene against Cycles; scenes without a subsurface weight draw the same picture.-- The path tracer traces the `subsurface` block (part of #283): a bounded Random Walk for parts with a weight above 0 (mean free path radius times scale, colour mapped to a single scattering albedo, at most 32 scattering events, exit back to the surface) and thin translucency for a card with nothing behind it. A weight of 0 draws exactly the pictures it drew before. Against the Cycles render with subsurface on, the `subsurface` scene scores 0.0795 with weight 1 and 0.0875 with weight 0 at 64 samples; the GPU tracer still ignores the block.-- Trace emissive maps and homogeneous volume fog in the path tracer, and name what it still skips (issue #284). An `emissiveMap` is read at each hit and scaled by `emission` and `emissiveColor`; `environment.volumeFog` is a uniform medium with exact free-flight sampling, lit by every light and the sky with shadow rays. `metrics.pathTracer.ignored` in an image job result now also lists anisotropy, iridescence, sheen, moss, splat layers and baked light maps. The new `emissive-sign` reference scene scores 0.0800 (the rasterizer scores 0.2372) against Cycles with the path tracer, and `fog` goes from 0.5333 to 0.0312 (the rasterizer scores 0.2021).-- Compare outlines with Blender and check their width across sizes (part of #285). `npm run reference:line-art` draws a reference scene of unbevelled boxes, a stepped block, a sphere and two touching parts with `environment.lines`, draws the same scene in Blender 5.2 with Freestyle, and prints the edge mask overlap and the line width at preview size and at 4K. Details in `docs/line-art.md`.-- Add outlines, toon light and polylines (part of #285). `environment.lines: {}` draws outlines of fixed pixel width at silhouettes, part boundaries, creases and depth jumps from the object ID, normal and depth guides. `lines.polylines` draws screen-width lines in the world, and `toon` on a material (or `lines.toon`) bands the light. A recipe turns it on with one `set-environment` edit through MCP, and `scene_capabilities` reports `lineArt`. The code is the new addon `@codepawlhq/67js/addons/line-art`, loaded only by recipes that use it, and a scene without `lines` draws as before. Guide: `docs/line-art.md`.-- Add the `overshoot-lift-plain` task and a `--backend cpu|gpu` option to the agent modeling suite (issue #286). Three live Sonnet runs of each overshoot task passed with 2 tool calls each, because the agent never chose a named easing.-- Add named easing curves and `cubic-bezier` to keyframes (closes #286). A `LINEAR` or `SMOOTH` keyframe takes `easing` (`linear`, `cubic-bezier(x1, y1, x2, y2)` or `ease<In|Out|InOut>` + Sine, Quad, Cubic, Quart, Quint, Expo, Circ, Back, Bounce or Elastic) for the segment after it, with arguments for Back and Elastic, such as `easeOutBack(3)` and `easeOutElastic(1.5, 0.4)`. Recipe motion tracks, camera paths and material tracks take it, an unknown name throws an error that lists the valid forms, GLB export bakes eased tracks to linear samples, and every curve matches Blender 5.2 within 1e-4 (`tests/easing.test.js`). New suite task `overshoot-lift`; the Keyframes row of the parity ledger is updated.-- Keep the single 2048 x 2048 sun shadow map at one texel when cascades are on and nothing else reads it (issue #287). With `shadowCascades`, the main shader and the underwater lookup read the cascade array, so the single map was drawn and held for nothing: 16 MB of depth and one more shadow pass per caster change. It is still allocated and drawn when volume fog is on or a material has `subsurface`, the two places that read it. A cascaded scene at 960 by 540 allocates 77.66 MB of render targets instead of 93.66 MB (20 of 26 reference scenes drop 16 MB; the 6 with volume fog or subsurface keep the map), and 52 reference draws (26 scenes with and without 3 cascades) are byte-identical PNGs to `main`. The map also follows the casters now: a renderer that starts with nothing to cast and gets casters from `replaceParts` allocates the full map instead of keeping one texel.-- Add the opt-in addon `useCompactColor(renderer)` (`@codepawlhq/67js/addons/compact-color`, issue #287). It stores the frame and its multisample colour in 4 bytes a pixel (R11F_G11F_B10F) instead of 8: at 1920 x 1080 with 4 samples the render targets go from 110.92 to 71.37 MB. It has no alpha, so it needs `hdr: true` and an opaque canvas and throws otherwise, and it throws when the device lacks the renderer's sample count in that format. Mean FLIP against the default over the 26 reference scenes is 0.002 to 0.030 (median 0.021). Without the call the core keeps RGBA16F and draws byte-identical pictures.-- Draw the multisampled depth with 16 bits when the renderer has no depth texture (issue #287). A plain lit scene at 960 by 540 with 4 samples allocates 41.36 MB of render targets instead of 45.31 MB (`instanced-objects`), and the 25 reference scenes draw the same pictures (worst FLIP against the previous 67js picture 0.0000). A renderer with `depth: true` keeps 24 bits, because its resolve needs the same format. Two other steps failed the 0.002 FLIP limit and are not in: a 16-bit sun shadow map (brick scenes 0.0023 and 0.0031) and an R11G11B10F colour target (0.002 to 0.034 over the 25 scenes, about 0.02 on most). A 1024 shadow map changed `subsurface` by 0.006.-- Draw 3D Gaussian splats as an optional addon, `67js/addons/gaussian-splats` (issue #288). It reads a standard 3DGS PLY with a byte and splat count limit (512 MiB and 2,000,000 by default, 4,000,000 at most), and draws the splats after the opaque parts with the depth test against them, no depth write and a CPU counting sort, back to front, through a wrap of `drawBlendBatches` that needs no renderer change. The core bundle is unchanged. `docs/gaussian-splats.md` has the guide and `bench/gaussian-splats/README.md` the frame time and memory at 100,000 and 1,000,000 splats and the comparison with the three.js `GaussianSplat`. Recipes, the MCP server and the asset catalog (GLB only) do not reach it yet.-- Update the three.js comparison dependency to 0.187.0 and three-mesh-bvh to 0.9.17 (PR #292), with the size baseline, runtime report and three.js splat numbers measured again on 0.187.0.-- Water reflection skips the mirror draw for render pass frames (`albedo`, `normal`, `emission`, `depth`, `objectId`), which never show the reflection. A pass no longer pays for a second scene draw (closes #297).-- Speed up `renderer.updateParts` for matrix and colour updates (closes #299). A part whose material still holds the values that passed the checks skips them, and the morph pass runs only when a morph or skin is in the update. 25,000 matrix-only parts take about 5 to 8 ms of JavaScript, from 33 to 55 ms (`npm run benchmark:update-parts`).-- Encode video frames in the page with WebCodecs (issue #301). `scripts/render-media.mjs` and the MCP video job draw a frame, hand the canvas to the browser's hardware H.264 `VideoEncoder` in the same task, and send only the encoded chunks (5 to 60 kB a frame) to Node over one binary WebSocket, where `ffmpeg -c copy` muxes them with the audio. The full 4,488 frame film at 1280 by 720 on the RTX 3060 took 20.6 s in all, 2.2 ms a frame of capture and 2.0 ms of draw, against 139.6 s for screenshots (25.1 ms a frame of capture) and 405.1 s for reading raw pixels over a WebSocket (84.8 ms a frame, 94 ms in a 10 s clip). Profiling showed ffmpeg was not the cost (3.7 ms a frame) and `readPixels` was 6.6 ms, but Chrome moved the 3.7 MB frame to Node at only 100 to 140 MB a second. The output matches the previous NVENC path at 44.8 dB PSNR and is tagged BT.709 limited range. `--capture auto` is the default for video and falls back to screenshots when the browser cannot hardware encode, or for `--encoder cpu` and `--backend cpu`. `--capture webcodecs` fails instead of falling back, `--capture raw` keeps the `readPixels` path as opt in, and PNG stills are unchanged. `npm run smoke:capture-parity` checks a decoded raw frame against its PNG seek. `ws` is a new dev dependency, bundled into the MCP server.-- The light bake can trace on the GPU (issue #302): `bakeLightmapsAsync(parts, lighting, { backend: 'gpu' })` starts a cosine weighted path at every covered texel in the GPU path tracer's kernel (a texel mode of the same shader, so lights, materials, maps and the bounce rules are the tracer's) and resolves with the same `{ parts, report }`; `report.backend`, `report.gpu` and `report.gpuCompileSeconds` say what ran. `backend` is `cpu` (the default and the reference) or `gpu`, as for the path tracer; the synchronous `bakeLightmaps` refuses `gpu` and names the addon. It lives in its own addon, `67js/addons/light-bake-gpu`, so the CPU bake and the core bundle do not carry it. It needs WebGL2 with float targets, does not take light linking (`affects`) or a sky-only bake, and `bench/reference/bake-compare.mjs` measures it against the CPU bake.-- Add a GPU backend to the path tracer, `backend: 'gpu'` (issue #302): the same algorithm and random numbers in a WebGL2 fragment shader, with the BVH, materials, maps, lights and sky in float textures, inside the path-tracer addon only. The 1920 by 1080 demo room at 64 samples took 58.2 s against 585.9 s on the CPU tracer, and GPU against CPU FLIP was 0.0001 to 0.0018 on the 16 reference scenes. `docs/webgpu-decision.md` records WebGL2 over WebGPU for this offline work.-- The GPU path tracer remeasured on the 1920 by 1080 demo room at 64 samples (issue #302): 38.7 s for a first compile of an unseen kernel text and 41.0 s again, 7 s of each compiling, so the under-60-s box holds with a cold shader cache. The light bake box stays open.-- Add `settings.renderer.denoise: "oidn"` for path traced render jobs (issue #303): Intel Open Image Denoise from the optional package `@codepawlhq/67js-denoise-oidn`, outside the core archive. `denoise` also takes `"wavelet"` (the old `true`) and `"none"`; `oidn` defaults to 16 samples, and a job without the package or its binary falls back to the wavelet filter and says so in `metrics.pathTracer.denoiserNote`. At 1920 by 1080 the denoise step took 1.6 s against about 9 s for the wavelet filter (measured). `bench/reference/denoise-*.mjs` compare the denoisers.-- Keep KTX2 textures GPU-compressed (closes #304). A KTX2 loader that transcodes to BC7, BC1, BC3, ASTC 4x4 or ETC2 is now accepted, and the renderer uploads each mip with `compressedTexSubImage2D`, so a 2K map takes about a quarter of the memory of RGBA8. The new `ktx2WorkerConfigFor(context)` export gives the loader the formats a context takes, and it falls back to RGBA8 where there are none. `asset.textureFormats` lists the format, size and bytes of each texture, and compressed KTX2 images count a quarter of their pixels toward `maxTexturePixels`.-- Compare agent friendliness of 67js MCP against three.js written as code on six suite tasks with the same model and the same checks and look score (issue #31, three.js half; the Blender MCP half still needs a VM): `bench/agent-modeling/threejs.mjs` runs the three.js side and `results/2026-11-07-threejs-vs-67js.json` holds both.-- Add the Blender MCP half of issue #31: `bench/agent-modeling/blender.mjs` runs Sonnet against the official Blender MCP server inside a disposable container (`blender-container/`) on the same six tasks and the same grading; 6 of 6 pass, 3.8 tool calls, look 0.926 (`results/2026-11-07-blender-mcp.json`), so the issue now has a row for 67js, three.js and Blender.-- Make reversed-Z depth camera-relative (issue #310). `installReversedDepth` now compiles the main vertex shader with the eye subtracted from the world position before the view-projection multiply, so large world coordinates no longer meet the view translation in float32; the renderer core is unchanged and a scene without the addon draws byte for byte as before. On the depth-precision bench (GPU) the 500 m, 0.1 mm gap pair falls from 0.134 to 0.069 wrong pixels and the 500 m, 1 mm pair from 0.015 to 0.014; the rest of the 0.069 is the float32 step of the model's own vertices at that distance, which no vertex transform removes.-- Document the float32 depth limit of reversed-Z (closes #310): `docs/guide.md` gives the measured failure rates far from the camera (0.1 mm gap at 500 m: 6.9% of pixels; 1 mm at 500 m: 1.4%) and the workaround, a gap of at least 1 mm or `decal: true`. A split-float vertex path that would remove the limit is tracked separately.-- Stop z-fighting on flush surfaces (part of #310): `renderer.diagnostics` and `scene_inspect` warn `coplanar-overlap` with both part names, the shared area and a fix, and a node's `decal: true` or `depthLayer` (0 to 4), or `environment.resolveCoplanar: 'offset'`, draws the smaller part with a scoped polygon offset in the colour pass and render passes without moving geometry.-- Add reversed-Z depth as an addon (part of #310): `installReversedDepth(renderer, mode)` in `src/reversed-depth.js` draws the colour pass with depth 1 at the near plane, a 32-bit float depth buffer and `GREATER` where `EXT_clip_control` exists, and leaves the shadow maps, backgrounds and post passes on the standard range. `mode` is `true`, `false` or `'auto'`, which switches it on when a frame's far / near passes 10,000 or the coplanar check (`installDepthPrecision`, which also installs the warning) finds a flush pair more than 40 units from the eye. The renderer core is unchanged, so a scene that does not install it pays no bytes (lit-box +0). On the RTX 3060 the share of pixels where the far plane of a pair wins falls from 0.15 to 0.009 (50 m, 0.1 mm gap), 0.079 to 0 (50 m, 1 mm) and 0.188 to 0.015 (500 m, 1 mm); 500 m with 0.1 mm stays at 0.13 (`bench/reference/README.md`).-- A terrain that does not set `mirrorLevels` now builds its coarse water-mirror meshes (up to two halvings the resolution allows) when `applyWaterReflection` finds a water surface in the scene, so an agent needs no flag (part of #316). The levels are built from the heights the terrain already keeps. A terrain in a scene without water builds none of them, and an explicit `mirrorLevels`, 0 included, is kept as given. On the 900 m benchmark terrain the one-time build takes about 130 ms inside `applyWaterReflection`, adds 22 MB of mesh data, and leaves terrain without water at its old memory and build time. With no `mirrorLevels` in the benchmark call the mirror frame costs +25% over reflection off (8.08 against 6.45 ms, 240 samples per variant, RTX 3060), and the picture is pixel for pixel the one made with `mirrorLevels: 2`. The first frame after attaching takes 5.7 ms of GPU time, a normal frame.-- `scripts/benchmark-water-reflection.mjs` leaves `mirrorLevels` unset unless `--mirror-levels N` is given, and reports the `applyWaterReflection` time, the mirror mesh size and the first frame after attach (part of #316).-- The water mirror draw now skips a part whose bounding sphere covers under 5 pixels of radius on screen (it was 1.5), since the ripples and blur hide it (part of #316). On the 960 by 540 water benchmark (20k pebbles, dense terrain with `mirrorLevels: 2`) the mirror pass draws 97 instances and 184 K triangles where it drew 1,241 and 527 K; against the uncut mirror the lit frame differs by at most 3 of 255 per channel (mean 0.0017).-- `scripts/benchmark-water-reflection.mjs` builds its terrain with `mirrorLevels: 2` by default (`--mirror-levels 0` gives the old numbers) and runs its variants in turn for several rounds (`--rounds`, default 3) and pools the timings, so a machine under load drifts the same way for every variant (part of #316).-- Median GPU ms per frame on the RTX 3060 through the GPU lock, 960 by 540, 240 samples per variant: reflection off 6.08, old unculled mirror 10.79 (+77%), new mirror 7.60 (+25%), `updateEvery: 2` 6.54 (+7%), still camera 6.08 (0 mirror draws). With `mirrorLevels` left at 0 the new mirror costs about +70% in the same scene, because the mirror then draws every terrain triangle: a terrain used with water should set `mirrorLevels: 2`. With the mirror draw stripped to two instances the pass costs 0.1 ms, so the rest is the geometry it draws, not fill: a mirror at scale 0.5 is no faster than at 0.75.-- `createTerrain({ mirrorLevels })` (default 0) builds up to that many extra coarser meshes for each chunk, used only by the water mirror draw (part of #316). Their chunk edges keep every finest-grid vertex, so they meet a neighbour's finest edge or another mirror mesh with no crack (a plain coarse mesh left gaps of up to 3 m on a hilly test terrain). `attachWaterReflection` hides these levels from every other draw and lets the mirror pick them by its own screen error, so a terrain that sets `mirrorLevels` must be used with it. No renderer code changed.-- Make the water reflection cheaper (part of #316): the mirror draw skips parts under the plane and sub-pixel parts, takes coarser levels, drops local lights and the cascade redraw, keeps its picture while the frame and parts are unchanged, and `attachWaterReflection` takes `updateEvery` for films.-- Add `--counts-only` (draw counts on SwiftShader, no GPU lock) and an old-mirror variant to `scripts/benchmark-water-reflection.mjs` (part of #316). On a 960 by 540 canvas the mirror draws 1,241 instances and 1.67 M triangles where the uncut mirror drew 7,321 and 3.50 M; the picture differs by at most 1 of 255 per channel.-- Place catalog GLB assets inside recipe scenes with a node `asset` field (issue #320): terrain, lights, procedural meshes and many imported models share one scene. Copies of an asset share geometry and materials and draw as one batch, materials override by source name, a placed clip plays from its own start time and seeks to the same frame, and `scene_inspect` reports each placement's id, bounds and clips. Render jobs draw placed assets too; `docs/mcp.md` gives the command that bundles a Poly Haven glTF folder into a GLB.-- Add the `vegetation` recipe node (issue #321): one tree, or a seeded scatter over a terrain node with density, slope limit and exclusions, with levels chosen from the recipe camera, `season` (summer, autumn, bare), `foliage` and `grass` recipe material tags, `environment.wind` strength and direction, a `tag` override for placed asset materials so imported trees sway, and `scene_inspect` `vegetation` counts per species and level. The scatter gives the same instances as `scatterVegetation` for the same options.-- Drive cars through MCP (issue #322): `motion.drive` on an imported asset recipe and `drive` on a placed asset run the vehicle kit from a path or legs, with Ackermann steering, reverse legs, wheels found with `wheels: 'auto'`, headlight poses and tail lights that follow the brake. `scene_inspect` reports `motionDrive` with the wheels found, the names rejected and the light signals, and `scene_capabilities` documents the entry. Spin times radius matches the distance driven within 2 percent through a curve and a stop.-- Add Ackermann steering, reverse legs and lights to `addons/vehicle` (issue #322). Each steerable wheel now turns about the shared turning centre from the measured wheelbase and track (`steering: 'shared'` keeps the old single angle), `driveAlongLegs` drives forward and reverse legs that stop at each end with the heading kept, and `pose.lights` carries headlight positions and directions that follow the body plus brake and reverse signals, with `applyVehicleLightsToParts` writing them to tail-light emission. The MCP `motion.drive` field is still open.-- Add `67js/addons/crowd-skinning` (issue #323): `createCrowdRig`, `bakeCrowdPalette` and `createCrowdParts` bake a character's clip into a joint-matrix texture once and draw every instance of it as one instanced batch per material, each instance sampling its own clip time, so draw calls stop growing with the number of people. Instances are culled by a bound that covers the whole clip, and `createCrowdLods` gives coarser levels skinned with the same joints. The renderer gains small hooks for it (a `crowd` part field, a `crowdPacked` geometry attribute, a `crowdEnabled` shader uniform); skinned parts without `crowd` behave as before.-- Add recipe crowds, a lower pose rate for far instances, and maps and morph targets on crowd parts (part of #323). An asset placement with `crowd: { clip, count, seed, layout, spacing, ... }` fills a group node with up to 1000 walking copies of one catalog character in one batch per material, and `scene_inspect` lists it under `assets` with `kind: "crowd"`. `farDistance` and `farRate` (recipe) or `farPose` and `setTimes(times, eye)` (addon) make far instances hold each pose for `1 / rate` seconds without breaking seek equals play. `createCrowdRig` keeps UVs so materials with maps draw on a crowd, and `{ morphs: true }` keeps morph targets on their own part. The crowd shader now reads its joints and weights packed in the colour attribute, which frees the UV attribute and makes the core bundle slightly smaller. `docs/retarget.md` has the measured RTX 3060 numbers: 500 `RobotExpressive` instances at a median 5.75 ms (8.27 ms in a later run on a shared card) with 7 draw calls.-- Measure the impostor forest on terrain and bake it faster (part of #324). `scripts/measure-vegetation-forest.mjs` now draws the 5,000-tree forest on rolling `createTerrain` ground and prints triangles and draw calls counted at the WebGL calls, GPU frame time per interleaved run and the bake time per repeat (`--gpu`, `--runs N`). Impostors bake from level 3, the mesh the card replaces, which cut the FLIP of the card render against the full-level render on the RTX 3060 from 0.0080 to 0.0039. The bake loop steps its barycentric weights along a row and reuses its bleed buffers, so baking 15 tree variants took 1.53 to 1.55 s on the RTX 3060 machine in headless Chrome. Impostors stay opt-in: no default look changes. See https://67js.codepawl.com/vegetation.md.-- Add baked impostor levels and dithered cross-fades to the vegetation addon (issue #324). `selectLevels(instances, eye, { impostors: { from: 3 }, fade: 0.06 })` draws far trees as one camera-facing card from a 64-view hemi-octahedral colour and normal atlas baked on the CPU (0.6 to 0.7 s for five species in Node), lit by the scene and casting a shadow from the light's side, and cross-fades neighbouring levels with a dither coverage, chosen from the distance alone. A 5,223-tree forest drops from 2.68M to 0.52M triangles with cards from level 3 and 0.36M from level 2 (measured in Node). Both are opt-in, so existing scenes draw as before.-- Impostor cards blend the four baked views around the viewing direction (a stochastic per-pixel pick, so a circling camera no longer steps between 64 views), and `selectLevels` takes `pixelError: { pixels, height, fov }` to set the switch distances from a screen error (part of #324). A frame-difference test checks that a dolly across the card boundary shows no pop.-- Retarget a clip from another catalog asset through MCP with `motion.layers[].from`, plant the feet with `motion.footLock` (two-bone IK on contact phases found from foot height and speed, soles turned to an optional ground normal), and key morph weights by target name with `{ kind: "morph" }` tracks (issue #325). `scene_inspect` hierarchy reports `retargets` (mapped, unmapped and missing bones), `footLock` phases and `morphTargetNames`; measured foot drift in planted phases under 2 cm on the test pair.-- `npm run smoke:agent-retarget` proves the whole path through MCP with two humanoid GLBs in the asset catalog: feet within 2 cm in planted phases (4.6 cm without the lock), the sole within 5 degrees of a slope, and keyed blink and jaw weights that seek back to identical bytes (issue #325).-- Cloth follows moving characters (issue #326). Colliders can be a ball or capsule attached to any node or bone, or one capsule per bone of an armature fitted as the ragdoll does; a sheet's `pinTo` makes its pinned edges ride a node with a pin weight. Both are sampled at every 60 Hz solver step, so a seek equals playing to that time. A cape pinned to the reference walker stays outside every limb capsule through a 5 s walk, and the same cape without colliders sinks 20 mm or more into them. Up to 64 moving colliders; a 5 s walk bakes in about 2.5 s.-- Rough water keeps its reflection (issue #331). A surface up to roughness 0.5 now gets the mirror pass; above 0.1 the mirror picture is sampled from a coarser mip level, rising linearly to level 5 at 0.5, and from 0.35 it fades out to the environment reflection, so a sea at 0.13 blurs slightly instead of losing every reflection.-- Stop size budget conflicts between pull requests (issue #337). `npm run size` now compares each bundle with the base branch and fails when core or a scene grows by more than 64 bytes gzip, or another entry by more than 2%, unless the pull request adds a `changes/<issue>.size.md` note that names the bundle and the reason. Pull requests no longer edit `bench/size/budgets.json` or `baseline.json`, and `npm run size:release` resets them at release. The base is measured beside the pull request and cached by base commit, and the measurement itself runs four builds at once.-- Add `map: { sequence: { frames, fps, loop } }` to recipe materials: a colour map that plays catalog PNG, JPEG or WebP images, with the frame `floor(motionTime * fps)` shared by `scene_look`, `scene_review` and render jobs, `updateTexture` only on a frame change, and `textureSequences` in `scene_inspect` (closes #339). The asset catalog now lists images with `kind` and `mimeType`.-- Add `renderer.updateTexture(descriptor, { image?, region? })` in the `texture-update` addon (issue #339). It pushes new pixels into an uploaded texture, such as a live canvas, a video frame or a simulation tile, with `texSubImage2D`. It keeps the sRGB or linear storage and `flipY` of the first upload, regenerates mipmaps and throws clear errors for a wrong size, a region outside the texture, a compressed texture or a descriptor that was never uploaded. The core entry grows by 50 bytes gzip. Recipes and MCP tools have no pixel input yet, so they are unchanged.-- Measure tool schema and result bytes against the base branch with `npm run tool-cost` (issue #345). A pull request that grows a tool by more than 64 bytes, a result by more than 128 or the total by more than 128 accepts it in its own `changes/<issue>.size.md`, so `bench/tool-cost-budgets.json` no longer conflicts. The `measured` history string is gone and the absolute budgets are release ceilings, refreshed by `npm run tool-cost:release`. The npm archive is measured the same way (issue #337): it may grow by 2% of the base branch archive, and an `archive` line in a size note accepts more, so one stale ceiling no longer fails every later pull request.-- A Blender Cycles reference of the water shadow pool (volume absorption and scatter) and its FLIP score against 67js sit in `bench/reference/README.md` and `scripts/score-water-shadows.mjs` (issue #349). No engine code changed.-- Water shadows follow the water (issue #349). A sun shadow on a `water` surface is faint and never darkens the reflection, and everything below the water level fades by `exp(-absorption * depth)` per colour, with shadows lifted and softened by depth times `turbidity`. Recipes take the `water` material tag with `waterPreset` (`lake`, `sea`, `river`), `absorption` (RGB per metre) and `turbidity` (0 to 1), listed in `scene_capabilities` under `water`. Blended water (opacity below one) refracts what lies below it (n = 1.33, bent by the waves) and blurs it with depth times turbidity (only over what lies below the water, so the edge of a bed stays sharp instead of fading into a haze), and submerged objects fade into the water colour. The code sits in the world material addon, so a renderer without water does not carry it, and the MCP tool count is unchanged.-- Add a bounced-light estimate for a closed room lit by point, spot or area lights without a bake (issue #351). `groundBounceEnvironment` gives the environment map a `bounce` colour, flux * rho / (pi * area * (1 - rho)) per colour channel, which the renderer adds to the diffuse light at no cost per frame; `environment.roomBounce: false` turns it off. A room with a sun is left alone. `scene_inspect` says so when a closed room is lit by lamps only and names the bake preset.-- Under a low sun (sun elevation near the horizon) the environment map also gets a `bounce` colour from the sunlit slopes and walls around a shadow: `0.4 * albedo * sun / pi * (wall - ground)^2`, free per frame. `mountain-valley` and `megacity-dusk` shadow p20 against Cycles go from 0.60 and 0.59 to 0.79 and 0.85 with a better FLIP; scenes with a high sun, `temple-hall` and `dark-shaft` do not change. `environment.outdoorFill: false` turns it off. `bench/reference/render-gpu.mjs` takes `--cpu` for SwiftShader.-- `scene_render_submit` renders scenes that place catalog assets as a still, stills or MP4 (issue #373): the job page loads the bytes of every placed asset by content ID the way `scene_look` does, and `settings.motion.start` plays placed clips on scene time without authored motion.-- Load glTF files that used to throw (closes #378). `KHR_materials_pbrSpecularGlossiness` converts to metallic-roughness (diffuse as base color, metallic 0, roughness 1 - glossiness; the specular color and `specularGlossinessTexture` are not read). A normal map or other texture on a primitive without `TEXCOORD_0` is dropped from that primitive. Both are named in `warnings`. `KHR_materials_unlit` already loaded with the unlit tag; an unlit texture on a primitive without UVs now loads too. The code is in `src/gltf-fallbacks.js`, which only a file that needs it loads.-- Draw the plain lit frame faster (issue #388): the fragment shader now reads the three box-mapping varyings (`boxPosition`, `boxNormal`, `boxNormalMatrix`) only when a material sets `boxMapScale`, so a scene without box mapping no longer makes every vertex compute and pass 15 floats it never uses. On the GPU the main pass of the plain Lakeside, Old church and Warehouse worlds at 1920x1080 drops by 0.2 to 0.5 ms per frame, and the 16 bit target, the MSAA resolve and the post pass turn out to cost 0.3 ms of the 3.3 ms. Output is byte identical on the reference scenes. `entry:core` and both goal scenes get 18 to 20 bytes smaller.-- Draw a world with water faster when the sky is a large environment map (issue #388): the check that decides whether the water mirror picture can be reused no longer walks the sky's pixels one by one every frame, so a still frame of the container port no longer spends about 170 ms of CPU on it. A typed array of more than 65,536 values in a frame (a sky or texture payload) is now compared by identity; smaller ones, such as the eye position, still compare by value.-- Draw the plain lit frame faster (issue #388): the vertex shader now writes the three box-mapping varyings (`boxPosition`, `boxNormal`, `boxNormalMatrix`) only when a material sets `boxMapScale`, and the per-instance emission colour and object ordinal travel in one flat `vec4` instead of two outputs. A scene without box mapping no longer computes the box position (a transform of every vertex by three matrix column lengths) or passes 15 floats it never reads, and each vertex carries one register fewer. Output is byte identical on the reference scenes. `entry:core` and both goal scenes get 0 to 3 bytes smaller.-- Draw meshes faster when they carry no vertex colours or draw one instance per batch (issue #388): the shaders no longer pass the vertex tint and sky visibility between stages, and a renderer whose batches each hold a single instance reads that instance's colour, surface, emission and box matrix from uniforms instead of varyings. The large-mesh sphere draw of about 1.05 million sub-pixel triangles drops from 1.64-1.66 ms to about 0.38 ms at 1080p on an RTX 3060.-- Fixed the 5 ms audio dropout at every join of a film rendered as several video jobs. A video job takes `audio.track: 'pcm'`, which writes lossless audio without AAC priming and padding, and `docs/agent-render-jobs.md` has the join recipe: copy the video parts, lay the audio once as AAC (#389).-- Fix the outdoor shadow fill never being drawn (issue #392, part of #351): `groundBounceEnvironment` set the fill as the map's `bounce` colour but not the `irradianceWithBounce` method the renderer calls to add it, so the colour was ignored. A map with a fill now carries the method, as the room bounce does. In `megacity-dusk` (SwiftShader against a fresh Cycles render) the facade slices of the picture go from 0.75-0.77 to 0.95-1.05 of Cycles' luminance and FLIP from 0.1580 to 0.1340; `mountain-valley`, `fog-valley`, `subsurface` and `subsurface-off` get a lighter shadow too, and the other 16 reference scenes checked draw the same pixels.-- Draw the opaque texels of a `blend` material first, with depth writes, then blend only the translucent ones (issue #393). A glTF exported with every material as BLEND (common for Sketchfab converters) no longer lets one mesh paint over another in file order: on the Sea House island a palm in front of the roof was drawn behind it.-- Shrink the bush's far crown clumps (issue #394). A bush's crown is wide and its twigs are short, so the clumps that stand in for its leaves at levels 2 and 3 were sized from the widest leaf and reached 1.7 times further out than level 0 (leaf radius median 3.4 m against 2.0 m, from 0.2 m below the ground to 8.5 m on a 6 m bush). They covered 4.5 times the pixels of level 0 (96,000 against 21,000) and sat in each other's shade, so the pure-leaf luminance fell to 0.47 of level 0 under sky light and with the sun behind. The bush species now sets `clumpScale: 0.5`, which keeps the clumps within the level-0 crown; level 2 reads 0.65 of level 0 under sky light, 0.73 with the sun behind and 1.19 with the sun in front, level 3 0.54, 0.55 and 1.04 (0.35 gave 0.81, 0.86, 1.35 and 0.63, 0.70, 1.17; the higher value trades a darker far crown in shade for a less over-bright one in sun). The other species and the reference frames (`foliage`, `mountain-valley`, `mountain-valley-dawn`: FLIP 0.0, no changed pixel) do not move.-- Tree levels 1 to 3 now read the sky visibility field measured on level 0 and keep its mean, so every level sees about as much sky as level 0 (it was 0.04 to 0.06 against 0.08 to 0.12). Part of #394.-- Leaves and grass blades now let sun through to the face you see. Before, a tree's flat lower-level cards seen from below took transmitted light from the wrong side and lost the rest to their own shadow, so under the sun they read at about 0.3 to 0.6 of level 0's brightness on the leaf pixels, now about 0.5 to 0.9. Part of #394.-- The dawn forest of the `mountain-valley-dawn` reference scene was black because its mist was lit by almost nothing: the scene copied `ambient: 0.02` from the sunlit scenes, but here the sun is behind the massif and Cycles lights the mist from the sky. The mist now has the sky's mean radiance (0.5), and the forest pixels read 0.030 to 0.037 luminance against 0.014 to 0.021 before and 0.020 to 0.033 in Cycles (FLIP against Cycles 0.200 to 0.167). Before the change the near trees (70 to 150 m) already read 0.021 against 0.020 in Cycles, so no shader term changed. Part of #394.-- `volumeFog` takes `heightFalloff` (metres): density thins as exp(-height above the volume floor / heightFalloff), so a mist can be thick on the valley floor and fade with height without a hard top. 0 keeps the flat volume. Part of #394.-- The dawn valley mist in `mountain-valley-dawn` is dense at the floor and thins with height (`heightFalloff` 35 m), with coarse noise patches and a sky-lit pale ambient, so the forest reads through layered mist instead of a uniform grey box. Part of #394.-- Add the material fragment hook (part 2 of issue #405). A recipe material gets an optional `snippet`: `{ fragment, uniforms, mask }`, where `fragment` defines `void materialHook(inout vec3 color, inout float alpha, vec2 uv, vec3 worldPosition)` and may change the colour and alpha or `discard`. It works from `scene_create` and `set-material` (`snippet: null` clears it); no new MCP tool and no host code. The hook runs in the colour pass, in the shadow pass (a discarded fragment casts no shadow) and in the ID pass. `mask: "map"` lets the snippet sample `snippetMask`, the material's own map or pattern. The snippet passes the same validator as a post pass (4 KB, no `#` lines, no `while` or `do`, counted `for` loops, no `gl_` or `u67_` names, at most 16 finite uniforms), every refusal names the line, the column and a fix, and a compile failure returns `renderError` with the log mapped to snippet lines before the running renderer is touched. `scene_capabilities` lists the limits under `materialSnippet`, and `docs/user-passes.md` has a dissolve example. The code lives in the lazy `src/material-snippet.js`, loaded when a recipe contains a `"snippet":{`. Closes #405.-- Add user post-process passes (part 1 of issue #405). A scene can run its own full-screen GLSL ES 3.00 passes on the finished frame, through the `67js/addons/user-pass` addon (`installUserPasses`, `renderer.userPasses.set`), the `postPasses` recipe section and the `set-post-passes` operation. A pass reads `sceneColor`, `sceneDepth`, `resolution`, `time` and `worldNormalAt`, takes named float, vec2 to vec4 and int uniforms, and can render at a `scale` below 1 and enlarge with nearest filtering for a pixel-art look. MCP accepts no host code; a snippet passes `src/shader-snippet-validator.js` first (at most 4 passes of 4 KB, no `#` lines, no `while` or `do`, only counted `for` loops over integer literals up to 64 iterations, no `gl_` names but `gl_FragCoord`, no `u67_` names, at most 16 numeric uniforms) and every refusal carries the line, the column and a fix. A compile failure comes back as `renderError` with the driver log mapped to snippet lines, and the session stays usable. `scene_capabilities` lists the limits under `postPasses`, `scene_inspect` lists the passes, and `docs/user-passes.md` has the API and a dither plus pixel downscale example. The validator is a separate module so the material fragment hook (part 2) can reuse it.-- `worldBounds` (used by `applyWaterReflection`, `findWaterSurface` and the probe code) keeps its minimum and maximum in scalars instead of arrays indexed by axis (issue #406). On the AIS port film, `applyWaterReflection` falls from about 160 ms to 80 ms; the bounds are bit-equal and the frame is pixel-identical.-- The renderer starts every program, then uploads textures and buffers, then reads the link results, so the driver links while the upload runs (issue #406). On the AIS port film this hides about 0.25 s; with `ImageBitmap` images (64 ms to upload a 24-megapixel texture against 300 ms from an `Image`) the page loads in 2.8 to 3.4 s instead of 3.6 to 3.7 s. Pixels are unchanged. `docs/terrain.md` has the bitmap loading line and a migration snippet for per-vertex mask samplers.-- Add `67js/addons/heightfield` (`sampleRasterGrid`, `createHeightfieldGeometry`): a terrain mesh from height, mask and photo rasters in typed-array passes instead of per-vertex closures and allocations (issue #406). On the AIS port film the terrain code falls from about 3.4 s to 0.6 s and the page loads in 3.6 to 3.7 s instead of 5.5 to 6.7 s (three.js: 1.0 to 1.4 s); the rendered frame is pixel-identical.-- Add `67js/addons/replace-textured-parts` (issue #423): after `import '@codepawlhq/67js/addons/replace-textured-parts'`, `renderer.replaceParts` adds and removes textured parts, deletes a texture once no part uses it and drops it from the texture ledger. Without the import, a textured add or remove throws and names the import. Skinned and morphed parts still need a new renderer.-- Cloth steps live: `createCloth(positions, triangles, options)` returns a stepper with `step(dt)`, runtime `pin`/`unpin` with moving targets, `pinForce`, per-particle extra mass and tearing (`tearStretch`, `tearForce`, a readable `broken` list). `bakeCloth` is now a loop over it and records the same frames as before (closes #430).-- New addon `@codepawlhq/67js/addons/update-part-vertices` exports `updatePartVertices(renderer, part, positions, normals)`, which rewrites a rigid part's vertex buffers with `bufferSubData` instead of `replaceParts`. The core bundle does not change.-- A cloth seek in the MCP preview rewrites one geometry per sheet in place and uploads its positions and normals with `updatePartVertices`, instead of replacing the part (part of #430). One 33 x 33 seek and draw measured 1.53 ms with `replaceParts` and 1.07 ms in place.-- Far tree levels look as bright from every side. Every standing clump card of a crown used to face one world direction, so level 2 of a conifer drew at 0.80 of level 0 from one side and 0.27 from the other two. Each clump now rolls its standing card by the golden angle from the last (issue #432).-- Far tree levels no longer pop darker than level 0 when a tree switches level (issue #432). Three changes, on top of the rolled clump cards of #477:- - The clump cards of levels 2 and 3 take their own normals again instead of blending 70% toward the crown's (`clumpCanopyBlend`, 0 by default, 0.3 for the bush). With the crown normal, a sun behind a tree left its far levels near black while level 0 still glowed through its leaves.- - The level match in `src/tree-sky.js` takes the mean sky visibility over the leaf each vertex stands for (`vertexCoverage`, a third of the area of its triangles) instead of over the vertices, because a clump has few vertices for a lot of leaf.- - Each species carries a colour gain and a sky gain for levels 2 and 3 in `src/tree-level-gains.js`. `node scripts/measure-tree-level-luminance.mjs --fit` solves them: it draws each level against level 0 from three sides under sky light, a sun behind and a sun in front, and brings the ratios close to 1. The file holds the geometric mean of the fits on seeds 1 to 6, recentred a little below 1. Trees of one species still differ, so each tree's colour gain also follows how much clump area its far level carries against level 0 (`area`, `areaExponent`). Over seeds 1 to 8, each species' mean ratio of levels 2 and 3 to level 0 lies within 0.90 to 1.07 under every light (0.15 to 0.66 for the four trees before #477 and this change), and 226 of the 240 seed ratios (5 species, 2 levels, 3 lights, 8 seeds) land within 0.85 to 1.15.- - The probe (`scripts/measure-tree-level-luminance.mjs`) also prints the ratio from each side (`sides`), which is how the one-way cards showed up: pooled over three sides, they averaged out.-- `tests/tree-sky-levels.test.js` pins the coverage-weighted mean and the range of the gains. This changes how far trees look.-- Meshopt-compress the airport and datacenter showcase GLBs like the port (part of #435): airport 21.6 MB to 13.4 MB, datacenter 14.9 MB to 12.0 MB, vertex data and textures unchanged and the 1280x720 same-camera stills pixel-identical (mean and max difference 0). On a 7.4 Mbps link the airport is ready in 20.5 s instead of 29.9 s and the datacenter in 17.1 s instead of 20.6 s; on localhost both stay within 1 to 2 s of before, the decode costing about 1 s. The airport sky HDR is already RLE-coded, and re-encoding it losslessly saves 1.8%, so it is unchanged.-- Load the container port showcase faster (closes #435): its `scene.glb` is now meshopt-compressed, 24.3 MB to 11.9 MB with identical vertex data, textures and pixels, and the showcase page passes the meshopt decoder to the glTF loader. On a 7.4 Mbps link (the speed the live site delivered, throttled in headless Chrome) the scene is ready in 16.9 s instead of 29.5 s; the decode costs about 0.8 s on a fast link (1.6 s to 2.5 s with the file on localhost). Before this change the live site served the GLB uncompressed (`model/gltf-binary` is not compressed in transit): 22.6 s to ready, 25.5 MB over 23 requests, 92% of it waiting on the network and about 1.7 s on glTF decode and scene build.-- Water shadows on the bed follow the sun's refracted path (issue #438). The sun leg to a submerged surface is absorbed over `depth / cos(theta_t)` with Snell n = 1.33, so the clear lake at 4 m keeps 0.06 of its shadow contrast in red, as in Cycles, not 0.23. In murky water the lift that pulled the shadow toward the lit side is replaced by a positive in-scatter term, so a shadow never inverts and a river at 4 m keeps about a quarter of its contrast. Contrast for the lake and river at 0.2, 1 and 4 m is within 0.05 of the Cycles reference.-- Make the MCP `environment` schema and the backend agree (closes #440). The schema now accepts `viewTransform`, `resolveCoplanar`, `objectReflections` and `look`, and `set-environment` accepts `ground`, which the schema already listed and docs/agent-look.md documents (`ground: false` removes the automatic floor). `tests/mcp-environment-schema.test.js` derives the backend list from `src/agent-look.js` and checks the schema and the documented fields against it.-- Rebuild the preview renderer when an edit regroups parts of a scene with any texture map, not only pattern textures. `resolveCoplanar: 'offset'` on a scene with a placed textured GLB used to commit and then fail the next `scene_look` with "replaceParts can add or change only rigid, untextured parts."-- Draw the showcase worlds from a small first part and stream the rest in (closes #445). Each of `public/showcase/port`, `airport` and `datacenter` is now `scene.glb` (the ground and the hero the opening camera frames) plus `scene.rest.glb`, with a 128x64 `sky.preview.hdr` for the first frame. `scripts/split-showcase-glb.mjs` regenerates the split from the one-piece GLB: every compressed vertex stream, texture and material is copied byte for byte, node transforms are kept, and only the shared meshopt index stream is decoded and encoded again (lossless). The page draws the first part, starts the rest the moment it is in, adds it with `replaceParts`, swaps in the full sky and puts the parts back in the one-piece order. The loading chip shows real megabytes from the first request to the last (for example `3.2 of 13.4 MB`, sizes from `Content-Length`). Core size is unchanged (entry:core +0 B); the logic is in `src/showcase.js` and `src/showcase-download.js`.-- Measured in headless Chrome on a local `vite preview` build, cache off, link throttled to 5 Mbps with no added latency, two runs each (`scripts/measure-showcase-load.mjs`). First frame, before to after: port 22.0-22.1 s to 3.9-4.4 s, airport 27.3-27.5 s to 4.2-4.7 s, datacenter 22.8-23.0 s to 4.0-4.1 s. The first frame needs 2.5-2.7 MB: about 0.4 MB of page code and 1.8-2.2 MB of first part. Final frame: port 22.0-22.1 s to 22.1-22.6 s, airport 27.3-27.5 s to 28.7-29.4 s, datacenter 22.8-23.0 s to 22.9-23.1 s. Bytes for the whole world: port 13.39 to 13.43 MB, airport 18.10 to 18.87 MB (its first part shares textures with the ramp equipment, so they travel twice), datacenter 14.04 to 14.09 MB.-- On an unthrottled link the first frame comes at 0.4-0.9 s instead of 1.3-1.9 s, and the final frame at 1.3-3.6 s instead of 1.3-2.0 s (one airport run took 5.0 s on a busy machine), because the rest decodes and joins after the first frame.-- The final frame matches the one-piece render pixel for pixel in all three worlds at the same camera: mean difference 0 and maximum difference 0 (1280x720 for airport and datacenter; the port draws 632x355 there, which its 512 MiB memory budget allows, before and after).-- Texture memory once loaded: airport 161 to 196 MiB, because a texture that both parts use is decoded once per file; the port (447 MiB) and the datacenter (196 MiB) hold the same as before.-- MCP: `scene_apply` (`set-environment`) and `scene_create_asset` no longer repeat the whole environment schema; they name `recipe.environment` in `scene_create` and the server still checks every field. The tool schemas are about 15 KB smaller, and the environment field descriptions shortened in #444 are back.-- The nature world draws again: `src/nature.js` loads the world material shader that water, foliage and terrain need (#449).-- A texture that both parts of a split showcase world use is now stored, downloaded and decoded once (part of #455). `scripts/split-showcase-glb.mjs` keeps such a texture in the first part only; the rest holds a 1x1 stand-in image and the same key in the texture's `extras.sharedTexture`. `loadGltf` and `parseGltf` take `options.sharedTextures` (made by the new `createSharedTextures()`): a texture with a key already decoded by an earlier file is reused, so the parts of all files bind the same texture descriptors and the renderer uploads and counts each once. The split script also warns when an image still sits in both parts, and writes the draw-order ranks as runs (`partRankRuns`, about 9 KB less JSON in the airport rest).-- Measured in headless Chrome on a local `vite preview` build, cache off, 5 Mbps (`scripts/measure-showcase-load.mjs`). Airport: 18.87 to 18.15 MB for the whole world (one-piece GLB: 18.10 MB), texture memory 196 to 161 MiB (one-piece: 161 MiB), first frame 4.2-4.5 s (was 4.5 s), final frame 27.4-28.2 s (was 29.4 s). Port (13.43 MB, 447 MiB) and datacenter (14.08 MB, 196 MiB) share no texture between parts and hold the same. The final frame of all three worlds is byte-identical to main at the same camera (maximum difference 0).-- The 0.05 MB the airport still sends over the one-piece GLB is the split's own cost: the 33 KB first-frame sky preview and 8 KB of JSON that both parts carry. No texture travels twice.-- `loadGltf` and `parseGltf` now open a glTF whose material has maps with different `KHR_texture_transform` (issue #457), for example a tiled base color map beside an emissive map with no transform, instead of throwing. The loader keeps the transform that is cheapest to tile to and resamples the other maps into that UV space at load, with a `warnings` entry naming the material and map. A resampled map grows to at most 4 times its source pixels and never past `maxTextureImagePixels`. Maps that cannot be resampled (a ratio that is not a whole number, a clamped or mirrored sampler, a compressed texture) still fail, now with the material named. Scenes that load files without mixed transforms draw the same pixels.-- **Breaking:** glTF limit errors are now one `RangeError` that names every limit the file goes over, the measured value and the value that fits, for example `glTF over its limits: vertices 9120000, over maxVertices 8000000. Fix: pass { maxVertices: 9120000 }.` (issue #458). Code that matched the old messages (`glTF exceeds maxBytes.`, `Texture image exceeds maxTextureImagePixels before decoding.`) has to match the option name instead.-- Raise the `loadGltf` and `parseGltf` defaults so one large exported scene loads without options: `maxBytes` 256 MiB (was 32 MiB), `maxVertices` 8,000,000 (was 2,000,000), `maxParts` and `maxInstances` 65,536 (were 20,000 and 4,096), `maxResources` 256 (was 64), `maxTextureImagePixels` 8192 x 8192 (was 4096 x 4096). `maxTexturePixels` and `maxJoints` keep their values. `GLTF_CAPABILITIES.limits` lists the defaults. The port showcase, whose 6144 x 3072 texture went over the old image ceiling, now opens through MCP `scene_create_asset`.-- Decode EXT_meshopt_compression inside `loadGltf` and `parseGltf` (closes #461). Attribute, triangle and index modes with the NONE, OCTAHEDRAL, QUATERNION and EXPONENTIAL filters decode with no `options.decoders.meshopt`, so gltfpack and Sketchfab files, `public/wall-e.glb` and the three showcase worlds (both parts each) open, and so do they in the MCP asset catalog and `scene_create_asset`. The decoder is meshoptimizer's WebAssembly build that three.js already ships, in a chunk (`src/gltf-meshopt.js`) that only a file with a compressed buffer view loads: entry:core, lit-box, gltf-box and agent-scene do not grow (gltf-box -31 B gzip). The fallback buffer is never read and does not count against `maxBytes`, so it may be absent or an unreachable `uri`. A view that fails to decode throws `EXT_meshopt_compression could not decode a buffer view` with its mode and filter. `options.decoders.meshopt` still replaces the built-in decoder. The showcase page no longer imports a decoder itself.-- Light the surroundings of the sunlit patches in a sun-lit closed room (issue #462). A lazily loaded module (`withSunBounce`, loaded with the floor sky trace) finds the patches when the scene is prepared and adds up to 6 unshadowed point lights above them, with flux = sun irradiance x lit area x albedo per channel, so the floor, walls and pillars near a patch get more light than the far end. `environment.sunBounce` is a number of 0 or more (0 off, byte for byte the look before; 1 default; above 1 stronger) in recipes, `set-environment`, the MCP schema and `docs/agent-look.md`; anything else throws a TypeError. Open scenes, rooms with no sun and baked scenes do not change. Ring luminance around the patch moves toward Cycles (`dark-shaft` mean 0.77 to 0.97, `temple-hall` 0.67 to 0.72), FLIP moves by -0.0044 to +0.0022; see `docs/lighting.md`.-- Give the job store lock back when the MCP server shuts down (issue #462). The server now closes the render job store before the browser, so `store.lock` is removed first when a client closes the connection and kills the process a couple of seconds later, and the job controller also removes its own lock when the process exits without a clean close. The next run no longer stops with "Stale job store lock requires explicit repair".-- Allow `bake.bounces` up to 8 (was 3) for the lightmap bake and the irradiance grid (issue #462). Cycles gathers 8 bounces and the grid stopped at 3, which left sunlit rooms cooler and darker: on a synthetic room with an orange floor and a warm sun, 8 bounces read 28% warmer (R/B) and 30% brighter than 3, and the grid matched its own 3-bounce gather within 2%. On the agent-built reading-corner room with the grid, 8 bounces move R/B from 1.22 to 1.27 (Cycles 1.44) and FLIP against Cycles from 0.4035 to 0.3817. The default stays 3, so no scene changes unless a recipe asks for more. The reference harness gets `--bake-bounces <n>`.-- Fix `environment.sunBounce` doing nothing in a sunlit room with a window opening and a garden outside it (issue #462). The room test started its rays from the middle of the scene's bounds, which a lawn and a hedge beside the window moved out of the room (share 0.50 against the 0.90 needed), so no patch lights were found and `sunBounce` 1 and 2 drew the same picture. `fittedClosedRoomShare` (`src/fitted-closed-room.js`, lazy) starts again from the middle of the parts near the rest and leaves out the heaviest parts when the scene is over 150,000 triangles, so scanned props no longer switch the test off; the core `closedRoomShare` and the inspect diagnostic are unchanged, and open scenes still do not count as rooms. The patch search now samples only the triangles a coarse first pass found sunlit and inside the room (a lawn took nearly all 20,000 samples before, leaving 149 in the room), and a patch's light stands at most half the free distance in front of it, so it cannot end up behind a wall. On the five reference halls `sunBounce` 1 moves the FLIP score against Cycles by -0.0027 to +0.0018 compared with no bounce (the first version: -0.0043 to +0.0022) and the picture around the lit patch toward Cycles; `sunBounce: 0` draws the same pixels as before the bounce existed and open scenes do not change. A patch with less than 3 percent of the scene size of free space in front of it is left out, so no light stands close enough to a surface to draw a hard speck. Numbers in `docs/lighting.md`.-- The default studio floor no longer buries small objects. It stays at y 0.019, but when that would hide more than a tenth of the scene's height (a pencil, scissors, a robot hand hanging below y 0), it sits 2% up from the scene's lowest point instead. Four files that drew an empty frame now draw: the Menagerie Tetheria hand and the SimReady forceps, pencil and scissors (issue #468).-- `Renderer67` sizes its memory budget to the scene when `memoryBudgetMiB` is not passed: room for the geometry, textures and one full frame, at least 256 MiB, at most 1024 MiB on a device that reports 8 GiB of memory or more (512 MiB otherwise). Large exports such as a 234 MB warehouse and a 244 MB paint studio now draw with no options (issue #470). Pass `memoryBudgetMiB` to keep a fixed budget.-- Memory budget errors name the geometry, texture and frame bytes they counted and the `memoryBudgetMiB` that fits, ending in `Fix: pass { memoryBudgetMiB: 365 }`, like the glTF limit errors.-- When `maxTexturePixels` scales textures down, base color and emission maps keep twice the size of the normal, roughness and occlusion maps, for the same memory. The warning names three scaled images and a count; `asset.scaledTextures` still lists every one.-- Names and kinds the caller picks now reach only their own table entry, never one inherited from `Object.prototype`. A mesh attribute named `__proto__`, `constructor` or `prototype` throws a TypeError. A cloth collider of an unknown kind throws a TypeError that lists ball, capsule and box, and a pinned particle that does not exist throws a RangeError. Baking a pattern of an unknown type throws the same RangeError that normalizing it does (issue #475).-- Add mesh blend (`67js/addons/mesh-blend`, issue #478), a screen-space pass that softens the seam where one mesh cuts into another (a rock sunk into terrain, a trunk into the ground). A part opts in with `blend: { radius }` in metres, as a part option in code or a `blend` field on a recipe node (MCP `set-node` takes it too). The pass finds seams from the part ID (a change of part), the frame depth (a depth match, so silhouettes against the sky are skipped) and a normal discontinuity rebuilt from the depth, then mixes the other part's colour over the radius. It adds nothing to the core entry and is off unless a part has `blend`: frames of scenes without it are pixel-identical to main (max difference 0 on a lit box and on a nature terrain). The lit pass writes the part IDs into a second colour attachment (a shader feature that exists only while a part has `blend`), so there is no second draw; `docs/mesh-blend.md` has the numbers and limits, and `bench/reference/mesh-blend.mjs` renders the before and after still.-- `loadGltf` and `parseGltf` load a glTF with a skin or animation clips but no mesh (issue #480), such as the skeleton-only 100STYLE clips. The result has `parts: []`, `nodes` with the skin's joints marked `joint: true`, and the clips in `animations`, so `clipFromGltfAnimation` and `createAssetPose` work on it. A file with no mesh, no skin and no animation still throws, now with "no supported triangle meshes and no skin or animation".-- `loadGltf` and `parseGltf` skip a degenerate triangle primitive instead of throwing for the whole file (issue #481). A missing or short POSITION accessor, a bad index count, an index out of range and a primitive of only zero-area triangles each give one entry in `asset.warnings` that names the mesh, the primitive index and the reason. The file throws only when no primitive survives, and the error lists the skipped ones. A vertex with no generated normal because no triangle with area uses it no longer stops the primitive.-- Show the changelog page title once (issue #482): the small "Changelog" link above the Versions picker is gone, and the page keeps its heading. Below 480 px the site header's GitHub button shows only its mark, with an `aria-label`, so the header stays on one row on a phone on every page that shares it.-- Show unreleased changes on the site (issue #482). The site build now writes `/changelog.json` (`{ version, released, unreleased }`, each entry with its issue number and a `breaking` flag) and puts an "Unreleased" section above the released ones in `/changelog.md`, both read from `changes/*.md` and `CHANGELOG.md`. A new `changelog.html` page shows them with a link to each issue and an icon on breaking entries, and `docs/mcp.md`, `docs/agent-scene.md` and the `build-67js-scene` skill point agents at the JSON. `.github/workflows/publish.yml` also creates the `v<version>` tag and a GitHub Release from that version's `CHANGELOG.md` section after `publish:ci`, and skips a release that already exists.-- Make the mesh blend pass cheaper (issue #489). The shader reads its 24 taps from a constant table instead of computing a square root, sine and cosine per tap, the ID attachment is cleared each frame so an ID lookup needs no depth fetch, and a batch whose parts share one radius and one level keeps its frustum culling. On the nature scene at 1080p on an RTX 3060 the pass costs 0.26 to 0.30 ms of GPU time per round over 12 rounds (median 0.27 ms), down from about 0.55 ms; scenes without `blend` draw the same pixels.-- Make the unreleased features reachable by agents (closes #490). The MCP recipe schema now accepts the node fields `blend` (mesh blend), `decal` and `depthLayer`, which `add-node`, `set-node` and `scene_create` rejected before. `scene_create_asset` on a file with no mesh says that a skeleton-only file is a clip source for `motion.layers[].from`. `docs/agent-scene.md` (seam fields, the refracted water-bed shadow), `docs/agent-motion.md`, `docs/gltf.md` (MCP catalog limits), `docs/guide.md` (the `world-material-shader` and `liquid-shader` imports), `public/llms.txt` (GLB support, the changelog pointer) and the build-67js-scene skill (moving cloth colliders, seams, sun bounce, skeleton-only clips) cover them.-- The MCP asset catalog takes GLB files up to 64 MiB and 1,000,000 vertices (was 16 MiB and 250,000), and all its limits come from one module, `src/agent-asset-limits.js`, which the catalog, the runtime, the preview page and the render jobs share. A file over a limit fails with an error that names the limit and the value it hit. The limits stay below the `loadGltf` defaults because the file crosses one browser call as base64, which crashed the page from 80 MiB in a local Chrome test (#492).-- `Renderer67.render` now applies `near` and `far` given without `fov` or `projection`, so a model hundreds of units wide frames and draws (issue #495); before, those two values were ignored and the fixed 0.1 to 100 range clipped everything.-- `loadGltf` and `parseGltf` keep a node that a clip scales to zero (issue #496): it draws a speck while its scale is zero and a node that starts at zero scale shows again when a clip scales it up, instead of throwing at that pose.-- Light morphs that have no authored base NORMAL (#496): the loader now computes the base normals from the triangles and per-target normal deltas from the morphed positions, so lighting follows the morph instead of dropping the deltas. A NaN or Infinity in a vertex POSITION or a morph POSITION delta becomes 0, and a non-finite inverse bind matrix becomes the identity, each with a load warning, so bounds, culling and skinning stay finite instead of refusing the file.-- `loadGltf` and `parseGltf` load morph targets with normalized int8 or int16 POSITION deltas (KHR_mesh_quantization) and keep a skin whose joint has zero scale, collapsing its vertices to a point with a warning (issue #496).-- `loadGltf` and `parseGltf` no longer refuse a file over three more Sketchfab-style defects (issue #496): authored vertex normals of zero length are rebuilt from the triangles, a mesh whose node has a zero or non-finite world transform is skipped, and morph targets without a base `NORMAL` load with generated normals and no morph normal deltas. Each repair adds an entry to `asset.warnings` that names the mesh, primitive or node.-- Cap the combined asset bytes one MCP call sends to the preview page at 64 MiB (issue #498). Several assets that were each under the per-file cap could together crash the preview page; the call now fails with an error that names `maxCombinedBytes` and the total.-- Object, nature, film and motion pages share one nav with an icon on every link; footer GitHub and npm links show their logos; nature slider labels share a baseline with their value (#499).-- The modeling, 2D and asset viewer pages use the same scene nav as the other scene pages, the film transport row and scrubber use one even gap, and the icon in the Save PNG, Export GLB and docs Next buttons sits on the text centre (#499).-- Graph normal maps bake at the colour resolution again. The twice-resolution bake from #401 brought `brick-graph` from 0.0734 to 0.0714 against Cycles, but it cost 4 times the texels (5.6 MB against 1.4 MB with mips for a 512 pattern), which is not worth the gain as a default. The measurement stays in `bench/reference/README.md`.-- Record the next levers for the tilted-normal dark side of `brick-graph` (issue #50). The cube, a half-step exponent, a sun clip with the geometric normal and the fill and environment terms were each scored on the GPU and none beat the squared horizon share, so `src/shaders.js` is unchanged; the README has the table.-- Darken the sky light of a surface lit through a normal map faster as the normal tilts away from the geometric one (issue #50): the share of the sky lobe above the surface is now squared. The `brick-graph` wall scores 0.0866 against Cycles, was 0.0930 (SwiftShader, 960 x 540), and its darkest pixel moves from 0.289 to 0.210 (Cycles 0.218). Scenes without a normal map are unchanged.-- Make the graph `noise` node Blender's Noise Texture node, value for value (issue #50). It was a periodic gradient noise with its own hash; it is now Blender's 2D Perlin (Jenkins hash, 8 gradients, quintic fade) summed as fractal Brownian motion with detail `octaves - 1`, roughness 0.5, lacunarity 2 and Normalize on, and matches a Cycles bake of the node to 5e-5 at every pixel. The seed shifts the lattice by whole cells, and `"tile": false` keeps Blender's endless lattice (exact match, does not repeat); by default the lattice wraps so the texture tiles.-- A material graph's height now becomes a normal map by reading the height half a texel either side of each texel centre instead of differencing two baked texels, so a joint edge is no wider than a texel, as in Blender's Bump node. Same slope per UV unit. `brick-graph` against Cycles 0.0967 to 0.0933; its excess over the flat wall 0.0420 to 0.0386 (EEVEE 0.0120). Part of #50. See `bench/reference/README.md`.-- Hold the farthest sun cascade while the camera orbits (issue #504): a wide cascade map was redrawn almost every frame because its depth range had no margin on the light side, so any drift toward the sun left it. The wide map now reaches the same 10 percent further toward the light, and an orbiting camera on the container port redraws the farthest cascade 1 time in 40 frames instead of 25. A still camera and the nearest cascade fit exactly as before, so a still frame draws the same pixels.-- The showcase water mirror redraws every second frame while the camera moves, about 1.3 ms off an orbiting frame of the container port; a still camera looks the same.-- Redraw the far sun cascades less often while the camera orbits (issue #504): a cascade past the nearest one keeps its depth map while the camera moves inside it, and is redrawn 10 percent wider than needed when it leaves, so it stays valid for many frames; the nearest cascade and a camera that stopped fit exactly as before, and only the cascades whose map changed are drawn. Measured on an RTX 3060 at 1080p with an orbiting camera, the container port goes from 5.5-5.7 ms to 4.3-4.4 ms and the airport ramp from 15.6-17.0 ms to 13.3-13.8 ms. A still camera draws the same pixels as before; while orbiting, about 10 percent of pixels move by a few levels at shadow edges (0.2 percent by more than 8 of 255).-- Irradiance grid (issue #506): `irradianceGrid: true` now picks up to 48 nodes along the longest side within 8,192 nodes, instead of 24, so a long hall gets a cell about half the size. A first try with a 32,768 node budget made a closed 68 m hall take 40 s, past the 20 s bake limit, and the scene was drawn with no grid at all; the budget keeps every reference hall inside the limit. In a grid scene the fog's bounce is now the grid's mean light and the fog's ambient counts the sky only. FLIP against Cycles: `temple-hall-a` 0.1454 to 0.1323, `temple-hall-b` 0.1211 to 0.1085, `temple-hall-c` 0.1078 to 0.0874, `temple-hall` 0.0576 to 0.0513, `dark-shaft` 0.0569 to 0.0732.-- Fix the opt-in `bake.irradianceGrid` lifting closed rooms (issue #506). Against Cycles on the five reference halls the grid scored 0.15 to 0.19 FLIP and was 1.6 to 1.8 times too bright; it now scores 0.0576, 0.0569, 0.1455, 0.1211 and 0.1077 (temple-hall, dark-shaft, temple-hall-a, -b, -c), better than the lightmap bake on temple-hall-a and -b and within 0.003 on temple-hall and dark-shaft, in about a second where the bake takes 14 to 57. Three causes: the world's light reached the grid's surfaces unoccluded (each node now stores the share of sky it sees and the shader scales the environment light by it, as the lightmap path does with its sky visibility map); nodes inside a wall were filled with the mean of both sides, which carried the sunlit outside into the room (they now copy the darkest neighbour); and the smoothing blurred across walls (a neighbour counts only when a ray between the two nodes is free). A grid scene also no longer gets the sun-bounce point lights or the ground bounce, which doubled the light the grid already holds. `bake.irradianceGrid` stays opt-in. The reference harness takes `--bake-grid [nodes]`.-- Add `bake.irradianceGrid` (issue #506): an opt-in baked grid of first order spherical harmonics that gives a sunlit closed room the warm multi-bounce light Cycles has. It is traced on the CPU with the bake's ray tracer, stored in one RGBA16F 3D texture and read with one lookup per pixel, so a frame costs no extra ray. It replaces lightmaps for the scene and is off by default. The code is a lazy module (`src/irradiance-grid.js`); the core entry gains one shader slot and one material field.-- `scripts/render-media.mjs` now launches Google Chrome with `--use-angle=metal` on macOS when `--backend gpu` is selected, avoiding a SwiftShader fallback (issue #507).-- Docs: add an API reference and a Resources page (part of #508). `scripts/api-reference.mjs` reads the exports of `67js` and every addon, with signatures, the comment above each declaration and a source link. `npm run build` writes it to `/api-reference.json`, so the page always matches the code. Resources links the demos, the agent guides, every contract, the changelog and npm.-- Docs: rewrite six guide sections as teaching pages with live examples (part of #508). The pages cover cameras, materials, lighting, model import and export, troubleshooting, and AI agents. The examples include mouse orbit, a material chart, a canvas texture, a moving sun and a lamp with bloom. They also include a GLB viewer and PNG and GLB download buttons. The pages correct stale text. Without `world: true`, the default field of view is about 32.7 degrees. The glTF importer has its own parser and reads alpha and double-sided materials.-- Docs: add a Start here path (part of #508). Introduction, Install and Your first scene take a reader from an empty folder to an animated scene in six steps. Each step shows the expected result. Code blocks marked `live` run in the page on the site's own engine build. A reader can edit, run, reset and copy them. The pictures come from those examples through `npm run docs:media`. The docs page gains headings, lists, figures, callouts and cards. It also gains package manager tabs and an outline of the page. Every guide section now shows in the navigation. `/guide.md` is built from the start pages and the guide in navigation order. Old `#overview` and `#getting-started` links still open the new pages.-- The nature demo softens the seam where rocks and tree trunks meet the ground (mesh blend) and flies a small cloth flag on the footbridge, which follows the Wind slider. `?softening=0` draws the valley without both, to compare.-- `Renderer67.resize` no longer shifts the studio projection right on canvases wider than 700 px (issue #517); `render({ eye, target })` now keeps `target` centred at any canvas width, and the studio demo sets its own sidebar offset.-- `loadGltf` and `parseGltf` now fall back to a touching face normal or `[0, 1, 0]` with a warning when a generated vertex normal cancels out or a vertex touches only zero-area triangles (issue #521).-- Fixed: disposing a renderer right after its WebGL context was lost (for example stopping a docs live example before its shaders finish) no longer throws `Shader compilation failed: null`. `finishProgram` deletes the program and returns quietly when the context is lost (#541).-- Keep the silhouette score when the look images fail (issue #548): `scoreLook` now records `imagesError` instead of dropping the whole look record.-- Add `addons/scene-query` and the `scene_walkmap` MCP tool (issue #553). `createSceneQuery(parts)` raycasts a whole loaded scene with each part's world matrix (nearest hit with point, distance, normal, part ID and material), builds the per-part BVH lazily and keeps it, and `walkMap` samples ground height and headroom on a grid. On the Bistro scene a 1 m grid of 12,630 cells matches a Blender sample within 5 cm on 12,619 of 12,629 cells. The MCP server now lists 23 tools. `mesh-query` keeps the last validated matrix per index, so repeated rays against one part skip the matrix checks.-- Render a `scene.json` world along a camera track with `render-media` (issue #554). `--scene file --config scene.json` loads the same GLB, sky, renderer options, exposure and frame effects the showcase page reads, headless, and `--camera keys.json` (`{ "fps": 24, "frames": [[eye, target], ...] }`, or `createCameraPath` keys) drives the camera one frame per output frame through the existing bounded frame queue and encoder. Asset paths such as `/showcase/bistro/scene.glb` resolve under `--root`, then next to the config. The config's `renderer.memoryBudgetMiB` is the default budget (up to 8192 MiB with `--memory`). On an RTX 3060 the Bistro walk renders 120 frames at 960x540 in 13 s including load, 9.2 fps, against about 0.7 fps for the hidden-pane showcase capture.-- Add `sunFromEnvironmentMap(map)` and `keyLightFromHdri(map, bounds)` to the `@codepawlhq/67js/addons/hdri` addon (issue #555). They find the sun in an HDR map as a luminance-weighted centre, honour `rotation`, and return `lightDirection`, `keyColor`, `keyIntensity` and a `shadowBounds` view aimed along the sun over the scene bounds, or `null` for an overcast map. On Poly Haven san_giuseppe_bridge_4k with rotation pi the direction is within 0.05 degrees of the hand-tuned one. Core size does not change.-- `scene_walkmap` and `walkMap` mark obstacles and keep clear of them (issue #559). `keepOut` (metres) with an optional `streetY` casts a down ray from 2.6 m above the street, marks a cell as an obstacle when its first hit is over 0.3 m above the lowest surface under it (kerbs stay walkable), closes one-cell seams, cuts the obstacles back out and clears every cell closer than `keepOut`; in code `walkMap({ obstacles })` and the new `walkableMask` do the same. `scene_walkmap` also works on recipe scenes, and `assetId` queries a catalog GLB above the 1,000,000 vertex render cap without rendering it (parsed in the server, textures dropped, up to 6,000,000 triangles). On the Bistro sample a 0.25 m grid with `keepOut` 1.0 takes 38 s and agrees with a Blender walk map on 99.95 percent of cells; see `docs/scene-query.md`.-- Split the `Test` workflow into parallel jobs (audit, size and tool cost, six unit shards balanced by the measured time of each test file (`test-timings.json`), coverage, package smokes) behind one final `test` job that branch protection keeps requiring, with a shared `.github/actions/setup`. Unit tests now run with Node's built-in coverage; `scripts/coverage-gate.mjs` merges the shard lcov files, writes the job summary and fails when line, branch or function coverage drops more than 0.5 points below `coverage-baseline.json`. `npm run test:isolated` left CI because `node --test` already runs each file in its own process. `publish.yml` calls `test.yml` before publishing and checks `npm view` afterwards. See `docs/ci.md` (issue #560).-Run the unit tests in eight shards so a CI run stays under 2.5 minutes (#563).--The coverage gate now allows a 1.5 point drop on branches (lines and functions stay at 0.5), because branch totals move by up to about 0.8 points between runs of the same commit; `tests/coverage-gate.test.js` covers both allowances.-- Load and animate glTF files with duplicate or missing node names (issues #565 and #551). The decoder made names unique with a `_N` suffix but could still hand a later node the name it had just generated, so two channels collided and createAnimationClip threw "Each target property can have only one track"; it now skips taken suffixes. Unnamed nodes were named by a random uuid in clip tracks and by an empty string in the asset's node metadata, so a skinned file such as Khronos BrainStem threw "no clip track names a joint of this rig"; both now use the source id (`node-4`). Scale keys of exactly 0 are accepted (zero hides a node; negative still throws), and a skin whose joint has zero scale loads with that joint collapsed (and the existing warning) instead of throwing a singular joint transform error. `createRigFromSkin` no longer crashes on a singular inverse bind matrix.-- Add `npm run smoke:mcp-clients` (issue #69). It drives the CPU MCP server through the pinned MCP Inspector CLI 2.13.0 and the official Python SDK 2.3.0. Both list 22 tools and create a scene, and the Python client gets a PNG back from `scene_look`. The Inspector CLI cannot, because it starts a new server per command, and `docs/mcp.md` records that.-- Record how other clients and Claude models use the docs and the MCP server (issue #69). A 5-task sample ran on haiku and sonnet through Claude Code, a no-MCP task gives an agent only `llms.txt` and the installed package (`bench/agent-modeling/llms-only.mjs`), and the results are in `bench/agent-modeling/results/2026-11-04-clients-models.json`. The guide and `llms.txt` now say that the render script assumes the `67js` alias install and what to change after a plain `npm install @codepawlhq/67js`; both sonnet runs first tried `node_modules/67js` and failed.-- Run the no-MCP task through the Antigravity CLI with a session-only command allow rule (`llms-only.mjs --agent agy`): Gemini 4 Argon and Gemini 3.8 Flash passed 2 of 2, GPT-OSS 120B 0 of 2 (issue #69).-- The homepage hero is a live 3D airport ramp you can orbit or switch between four shots, on wide screens after the page has loaded; phones and data-saver visitors keep the still image. The real-time renderer is also exported as `Glaze` and the path tracer as `Cook` (`Renderer67` and `renderPathTracedImage` keep working).-- The site header shows a history icon beside Changelog, as it does beside Docs. Footer links stay plain text. The navigation smoke checks now expect both links.-- Keep the package version in `src/version.js` instead of importing `package.json`, so the core bundle no longer carries the whole manifest. `entry:core` drops from 87,557 to 85,749 bytes gzip.-- Add three learn pages for AI agents and tighten `models-and-ai-agents`. `connect-mcp` gives the launch command and the config file for nine harnesses (Claude Code, Claude Desktop, Cursor, VS Code, Codex CLI, Gemini CLI, Antigravity, Cline, Zed), a check and troubleshooting. `agent-workflows` shows the real result of each tool, the render loop, skills and the no-MCP path. `optimize-for-agents` has measured tool, result and image costs and the agent-modeling results.-- Docs: the 22 guide sections that now have their own interactive learn pages are removed from docs/guide.md, so each fact lives in one place; the fog and shrinkwrap posters are re-rendered from their final examples.-- Rewrite nine documentation pages as interactive learn pages (part of #508): parts and geometry, procedural modeling, sculpt brushes, contact detection, shrinkwrap and surface patches, retained surface attachments, local lights and volume fog, HDR environment lighting, and the renderer reference. Each page has live examples with a drag or slider control, logged output (counts, timings, query results), an options table taken from the code, and a list of common mistakes. Every fact of the old guide sections moved into the page with the same id.-- Rewrite 13 later documentation pages as interactive learn pages (terrain and ground textures, trees and grass, grass fields, wheeled vehicles, baked liquid, deterministic animation, animation curves and mixing, skeletal and morph animation, humanoid retargeting and crowds, recorded physics, assemblies and interaction, images and films, performance and memory). Each has live examples with sliders, play and pause or time scrubbing, a console that prints what calls return, an options table and common mistakes, and replaces the guide section with the same id. Performance and memory is now an optimisation guide with numbers from `bench/runtime` and dated measurements.-- Docs live examples can import every addon the package exports (`67js/addons/<name>`), loaded only when an example imports it, and `new Float32Array(...)` in example code passes the engine's typed array checks without borrowing the page's constructors.-- Docs live examples: the status label no longer takes the article's paragraph style (it was 14 px with a 23 px bottom margin, so it sat high and large), each example shows what its `console.log`, `info`, `warn` and `error` print in a small output panel under the picture, and the introduction cube can be dragged to orbit.-- The live examples on the terrain, trees and grass, grass fields, wheeled vehicles, baked liquid, humanoid crowds and recorded physics learn pages now call the real addons (`createTerrain`, `scatterVegetation` with `selectLevels`, `createGrass`, `createVehicleRig` with `driveAlongPath`, `loadSpumeCache` with `createSpumePlayer`, `createCrowd` with `mapHumanoidBones`, `createPhysicsScene`) instead of core-only stand-ins, and print real counts, heights and timings to the console panel. Only the calls that need CC0 texture files or a rigged character stay as plain code blocks. The `window.parent` typed array line is gone from every live example, since the frame supplies those constructors.-- Take 269 bytes gzip out of a plain lit box (`scene:lit-box` 50,127 to 49,858) with no change to a picture. A room's bounced light is now added by a method that `groundBounceEnvironment` puts on the map (`irradianceWithBounce`), so the renderer holds no bounce code; the liquid optics check moved from `src/renderer.js` to `src/liquid-optics.js`, and the liquid pass reads it itself. Breaking for deep imports only: `resolveLiquidOptics` is no longer exported by `src/renderer.js`; import it from `src/liquid-optics.js`.-- Link [viz3d](https://github.com/codepawl/viz3d) from the README, a skill that renders its films and stills in 67js.-- Point the package, site and docs at the new `codepawl/67.js` repository, rewrite the README around the showcase worlds and drop the preview images that only the old README used.-- Turn the three showcase scenes into worlds you can explore: the container port with a fully stacked ship, yard, quay and gate, the airport with piers, runway and tower, and the data center campus with halls, cooling, substation, gate and parking. Each scene sets camera bounds for the free camera.-- Restyle the site, showcase and docs with the CodePawl Afterimage theme (always dark, glass header, scene-coloured glow, grain, pointer light), show a loading chip with real download progress when a showcase scene opens, and add pan, pinch, keyboard movement and Reset view to the showcase.-- Colour the code on the site: the home page example, the MCP command and the install command now use the same syntax colours as the docs, and shell commands colour the program, subcommand, flags, numbers and package specifiers.-- A goal scene that is already over its goal on the base branch now fails `npm run size` when a pull request grows it by more than 8 bytes of build noise; only a `- goal:<scene>:` line approved by An accepts it.-- `npm run size` fails a pull request that takes `scene:lit-box`, `scene:gltf-box` or `scene:agent-scene` over its goal when the base branch met it. Only a `- goal:<scene>:` line, approved by An, accepts that.-- The build-67js-scene skill tells agents to file a 67js bug at once on codepawl/67.js, with the steps, the scene and a still.+### Highlights++- GPU path tracer: `backend: 'gpu'` renders the 1080p demo room in about 40 s, against 586 s on the CPU. The light bake can use it too (#302)+- Outlines and toon shading with `environment.lines` (#285)+- Subsurface scattering for skin, wax and leaves with the material `subsurface` block (#283)+- 3D Gaussian splats from a standard PLY file, as an addon (#288)+- `environment.viewTransform` picks ACES, AgX or neutral, and AgX now matches Blender 5.2 (#282)+- Easing curves and `cubic-bezier` on keyframes, within 1e-4 of Blender (#286)++### Agents and MCP++- Recipes place catalog GLB assets next to terrain and procedural meshes, and render jobs draw them (#320)+- A `vegetation` node plants one tree or a seeded forest over terrain, with seasons and wind (#321)+- `motion.drive` drives a car model along a path with real steering, reverse and brake lights (#322)+- Crowds of up to 1,000 walkers draw in one batch per material (#323)+- Clips retarget between characters, feet stay planted, and morph targets key by name (#325)+- Materials can play an image sequence as their colour map (#339)+- The new `scene_walkmap` tool finds where a character can walk (#553)+- The MCP schema now accepts every environment and node field the engine reads (#490)++### Rendering++- Up to 16 point, 8 spot and 7 area lights, from 8, 8 and 4 (#261)+- Water got depth fade, soft shadows on the bed, refraction, and a reflection that survives rough water and costs less (#349)+- Default fog fits the scene size, so the far side of a big world no longer fades out (#263)+- `volumeFog` takes `heightFalloff` for valley mist that thins with height+- Sunlit rooms get softer bounced light by default, and `bake.irradianceGrid` adds Cycles-like multi-bounce light (#506)+- Far trees no longer pop darker when they switch level, and big forests can use impostor cards (#432)+- Reversed-Z depth and a z-fighting warning that names both parts and the fix (#310)+- Mesh blend softens the seam where a rock or a trunk meets the ground (#478)+- Your own post passes and a GLSL hook on materials (#405)+- Plain scenes draw faster, and far shadow cascades redraw less often (#388)++### glTF++- Many more real-world files load: meshopt, WebP, spec-gloss, optional extensions, skeleton-only clips and common Sketchfab defects (#496)+- KTX2 textures stay GPU-compressed, about a quarter of the memory (#304)+- Large texture sets scale down instead of throwing, and the default limits are higher (#260)++### Animation and physics++- Cloth follows moving characters, and steps live with pins and tearing (#326)+- `renderer.updateParts` is about 6 times faster for matrix and colour updates (#299)++### Tools, docs and site++- Video export encodes in the browser: a 4,488-frame film took 21 s instead of 140 s (#301)+- Path traced jobs can use Intel Open Image Denoise (#303)+- The docs are now interactive learn pages with live examples, plus an API reference (#508)+- The showcase worlds show their first frame sooner and stream the rest in (#445)+- Agent benchmarks against three.js code and the Blender MCP on the same tasks (#31)++### Breaking changes++- Skin, morph, water, foliage, terrain, liquid and splat shaders moved into addons. A renderer that draws those parts without the import throws and names it. Recipes and loaders import them on their own (#281)+- glTF limit errors are one `RangeError` that names every limit the file goes over. Match on the option name, not the old message (#458)+- `material.lightMask` defaults to `-1`, every light (#261)+- `normalizeAgentLook` returns `fogDensity: null` for fog that fits the scene (#263)## 0.15.0diff --git a/changes/README.md b/changes/README.mdindex d8f930f4..638d245d 100644--- a/changes/README.md+++ b/changes/README.md@@ -3,11 +3,13 @@Each pull request adds one file here, such as `changes/issue-199.md`, with its changelog bullet exactly as it should read in `CHANGELOG.md`:```md-- Add the `foo` option to `bar` (issue #123). It does this, measured as that.+- `bar` takes a `foo` option for X (#123)```+Keep the bullet to one line a user can read in a few seconds: what they can do now, or what got better, and the issue number. Put the measurements, the method and the edge cases in the pull request and the docs, not here. Start a breaking change with `Breaking:`.+Do not edit `CHANGELOG.md` in a pull request. Two pull requests then never touch the same file, so GitHub has nothing to conflict on.-`npm run changes` prints the pending notes. At release time `npm run changes:fold` writes them into `CHANGELOG.md` as the section for the version in `package.json` and deletes the files.+`npm run changes` prints the pending notes. At release time `npm run changes:fold` writes them into `CHANGELOG.md` as the section for the version in `package.json` and deletes the files. Then edit that section by hand before the release: merge bullets about the same feature, drop internal ones (benchmark scripts, CI, refactors with no visible effect), and sort the rest under `### Highlights`, `### Agents and MCP`, `### Rendering`, `### glTF`, `### Animation and physics`, `### Tools, docs and site` and `### Breaking changes`. The site shows each `###` heading, and every entry under `Breaking changes` gets the breaking mark.A size note, `changes/<issue>.size.md`, is not a changelog bullet. It accepts a bundle size increase, and `bench/size/README.md` says how. `changes:fold` leaves it out of the changelog and deletes it. The same note accepts a tool cost increase, with lines such as `- tool:scene_create: <reason>`, and `bench/tool-cost/README.md` says how.diff --git a/changes/short-changelog.md b/changes/short-changelog.mdnew file mode 100644index 00000000..443e509e--- /dev/null+++ b/changes/short-changelog.md@@ -0,0 +1 @@+- The changelog groups its entries under headings, and 0.16.0 is rewritten as a short summarydiff --git a/scripts/changelog-fragments.mjs b/scripts/changelog-fragments.mjsindex 2fc962d6..f0fdd405 100644--- a/scripts/changelog-fragments.mjs+++ b/scripts/changelog-fragments.mjs@@ -37,13 +37,29 @@ function issueNumberOf(text, fallbackName) {return inName ? Number(inName[1]) : null;}+// A "### Group" heading names the group of the entries below it. Every entry under a group called+// "Breaking changes" is breaking.+const groupHeading = /^###\s+(.+?)\s*$/;+export function parseEntries(markdown, fallbackName) {const entries = [];+ let group = null;for (const line of markdown.replace(/\r\n/g, '\n').split('\n')) {- if (line.startsWith('- ')) entries.push(line.slice(2).trim());- else if (line.trim() && entries.length > 0) entries[entries.length - 1] += ` ${line.trim()}`;+ const heading = line.match(groupHeading);+ if (heading) {+ group = heading[1];+ } else if (line.startsWith('- ')) {+ entries.push({ text: line.slice(2).trim(), group });+ } else if (line.trim() && entries.length > 0) {+ entries[entries.length - 1].text += ` ${line.trim()}`;+ }}- return entries.map((text) => ({ issue: issueNumberOf(text, fallbackName), text, breaking: breakingPattern.test(text) }));+ return entries.map(({ text, group: entryGroup }) => {+ const breaking = breakingPattern.test(text) || breakingPattern.test(entryGroup ?? '');+ const entry = { issue: issueNumberOf(text, fallbackName), text, breaking };+ if (entryGroup) entry.group = entryGroup;+ return entry;+ });}// Splits CHANGELOG.md into its "## <version>" sections, newest first as written.diff --git a/src/changelog.js b/src/changelog.jsindex 7951b441..b8c42222 100644--- a/src/changelog.js+++ b/src/changelog.js@@ -56,7 +56,9 @@ function entryRow(entry) {label.append(breakingIcon(), 'Breaking');text.append(label);}- appendText(text, entry.text);+ // The issue column already links the number, so a trailing "(#N)" for the same issue is dropped.+ const trailingIssue = entry.issue === null ? null : new RegExp(`\\s*\\(#${entry.issue}\\)$`);+ appendText(text, trailingIssue ? entry.text.replace(trailingIssue, '') : entry.text);row.append(issue, text);return row;}@@ -66,10 +68,25 @@ function versionSection(id, title, entries) {section.id = id;const heading = document.createElement('h2');heading.textContent = title;- const list = document.createElement('ul');- list.className = 'change-list';- list.append(...entries.map(entryRow));- section.append(heading, list);+ section.append(heading);+ // Entries come in runs that share a group. Each run gets its own heading and list.+ let list = null;+ let currentGroup;+ for (const entry of entries) {+ const group = entry.group ?? null;+ if (!list || group !== currentGroup) {+ if (group) {+ const groupHeading = document.createElement('h3');+ groupHeading.textContent = group;+ section.append(groupHeading);+ }+ list = document.createElement('ul');+ list.className = 'change-list';+ section.append(list);+ currentGroup = group;+ }+ list.append(entryRow(entry));+ }return section;}diff --git a/tests/changelog-data.test.js b/tests/changelog-data.test.jsindex 323fff23..4168971e 100644--- a/tests/changelog-data.test.js+++ b/tests/changelog-data.test.js@@ -75,6 +75,28 @@ test('release notes are one version section with its breaking marker and the insassert.equal(extractVersionSection(changelog, '0.14.0'), '- Fix a seek that works without breaking playback (part of #9).');});+test('a ### heading groups the entries below it, and the Breaking changes group marks them breaking', async () => {+ const grouped = [+ '## 0.16.0',+ '',+ '### Highlights',+ '',+ '- A GPU path tracer (#302)',+ '',+ '### Breaking changes',+ '',+ '- Shaders moved into addons (#281)',+ '',+ ].join('\n');+ await withFragments({}, async (folder) => {+ const data = await readChangelogData({ changelogText: grouped, version: '0.16.0', folder });+ assert.deepEqual(data.released[0].entries, [+ { issue: 302, text: 'A GPU path tracer (#302)', breaking: false, group: 'Highlights' },+ { issue: 281, text: 'Shaders moved into addons (#281)', breaking: true, group: 'Breaking changes' },+ ]);+ });+});+test('release notes fail clearly when the version is not in the changelog', () => {assert.throws(() => releaseNotes(changelog, '9.9.9', '@codepawlhq/67js'), /CHANGELOG\.md has no section for 9\.9\.9\./);});