3D engine that AI agents drive
Merge remote-tracking branch 'origin/main' into feat/grand-scene-options
Nguyen Xuan An1cb13fd02f99
diff --cc CHANGELOG.mdindex 37783c0f,60754840..5b454099--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -2,8 -2,8 +2,10 @@@## Unreleased+- Add three options for each grand reference scene, to pick from (part of issue #168, which stays open until An picks). `bench/reference/grand-scenes.js` holds `mountain-valley`, `temple-hall` and `megacity-dusk` as `-a`, `-b` and `-c`, each with its own composition, light and time of day, drawn by `npm run reference -- --grand` into `grand.json` and `images/grand-<id>.jpg` (`baseline.json` and the existing images are unchanged). The Blender side gained a `gradient` world, written as the same equirectangular image 67js draws. `bench/reference/grand-sheets.py` makes one comparison sheet per scene.++ - Hide sky light where the scene blocks it: inside tree crowns and on a valley floor (issue #191, part of it). `createTree` bakes a sky visibility into each foliage vertex from the leaf density above it, and `createTerrain` bakes one into each terrain vertex from the horizon in 16 directions. The shader multiplies it into the environment light only, and meshes without it read 1. On `bench/reference`, the `foliage` crown went from 0.298 to 0.200 (Cycles 0.175) and the score from 0.1173 to 0.1023 (EEVEE 0.0888); `mountain-valley` went from 0.3483 to 0.2623 (EEVEE 0.1879), and its floor from 0.417 to 0.360 (Cycles 0.272). No other scene changed to four digits. The agent scene geometry bound allows 4 more bytes for each terrain vertex.+ - Compare trees like with like (issue #166, part of it). The Blender side of `bench/reference` now rebuilds the 67js leaf model for `foliage` materials (back-face normal, colour and normal variation, sky reflection 0.3, and light from behind as a Translucent BSDF with weight `0.3 * pi / (3.7, 3.4, 2.9)`), and the 67js back light is now shadowed by the sun shadow. `foliage` goes from 0.1290 to 0.1173 against Cycles (EEVEE 0.0864 to 0.0888) and `mountain-valley` from 0.3473 to 0.3483 (EEVEE 0.1828 to 0.1879); no other scene moved. The remaining gap is canopy and valley sky occlusion, recorded in `bench/reference/README.md`.- Make the recipe bake presets bake large rooms (issue #189). A preset that does not fit the 5 million path step budget at 16 samples and 1 texel per unit now gives up bounces one at a time instead of refusing, and `bake.reduction` tells the agent what it asked for, what ran and that explicit samples, bounces and texelsPerUnit (up to 24 million path steps, 20 s inline) buy more. `temple-hall` at `standard` now bakes (16 samples, 1 bounce, 1.37 texels per unit, 0.0705 against 0.1504 unbaked with a probe). `fine` is now the same as `standard`: five samples and density mixes within the 20 s limit scored no better on the room scenes. Table in `bench/reference/README.md`.- Score the recipe bake presets against Cycles (part of issue #170, open for the frame costs). `standard` scores 0.127 to 0.159 on the three rooms (no bake 0.51), `fine` is no better, and `standard` and `fine` refuse `temple-hall`. Table in `bench/reference/README.md`.- No test asserts real elapsed time any more (issue #179): work counts and a fake clock replace stopwatches. `smoke:agent-review-close` and `smoke:film-physics` are wired; the second starts its own server.diff --cc bench/reference/scenes.jsindex f3b7bc05,51623842..6643ac1a--- a/bench/reference/scenes.js+++ b/bench/reference/scenes.js@@@ -169,8 -169,8 +169,8 @@@ export const KHRONOS_SCENES = Object.fr// Grand scenes: the scale people actually want to draw, built from the engine's terrain, vegetation and plain boxes.// Only what Blender can draw too is used: the terrain colours are vertex colours, the emissive windows are Emission, the- // fog is a volume box. The built-in leaf translucency of 67js has no Blender counterpart (see the README).+ // fog is a volume box. Blender rebuilds the 67js leaf model for foliage materials (see the README).-function seededRandom(seed) {+export function seededRandom(seed) {let state = seed >>> 0;return () => {state = (state + 0x6d2b79f5) >>> 0;