Skip to content

armgit / 67.js

Public Imported from GitHub
0

3D engine that AI agents drive

Turn occlusion off by default, add reference --ambient-occlusion, fix the Blender character crash

Nguyen Xuan Anc7aaaf2ffba0
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9de0dec2..547f7090 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,7 +2,7 @@
## Unreleased
-- Make the default look good without tuning. Recipes get an image-based environment: `environment.setup` (`daylight` by default, `overcast`, `sunset`, `studio`) selects a small procedural sky map generated in code, plus its key light, with `environmentIntensity` and `environmentRotation`; no URLs or files from tool input. `effects.ambientOcclusion` (default `0.8`, `0` turns it off) and `ambientOcclusionRadius` add screen-space ambient occlusion from the depth texture; it compiles and allocates on first use and costs about 16 ms on a 190 ms SwiftShader frame (8 percent). `scene_capabilities` lists `lightingSetups`, `defaultLightingSetup` and `ambientOcclusion`. **This changes the look of every existing recipe that sets no lighting**: it now has an environment map, a key color of `[3, 2.8, 2.5]` instead of `[5.2, 4.7, 4.1]`, a fill intensity of `0` instead of `1`, and occlusion. The engine default is unchanged (occlusion off, no map) so code scenes keep their pixels. Reference scores against Cycles move by +0.0013 to -0.0019 in 8 of 9 scenes and by +0.0047 in `lit-interior`. Screen-space reflections are not part of this. Size budgets rise: `entry:core` +3,000, `entry:gltf` +500, `entry:agent-scene` +1,400, `entry:agent-asset` +1,300, `scene:lit-box` +3,500, `scene:gltf-box` +3,100, `scene:agent-scene` +3,100 (bytes gzip, about half of it spot and area light code from the lights branch)
+- Make the default look good without tuning. Recipes get an image-based environment: `environment.setup` (`daylight` by default, `overcast`, `sunset`, `studio`) selects a small procedural sky map generated in code, plus its key light, with `environmentIntensity` and `environmentRotation`; no URLs or files from tool input. `effects.ambientOcclusion` (0 to 1) and `ambientOcclusionRadius` add screen-space ambient occlusion from the depth texture. It is off by default: measured with `npm run reference -- --ambient-occlusion`, it improved no score by more than 0.002 (strength 0.8: -0.0019 in foliage, +0.0047 in lit-interior; strength 0.4, radius 0.3: within +0.0013 everywhere). When used it compiles and allocates on first use and costs about 16 ms on a 190 ms SwiftShader frame (8 percent). `scene_capabilities` lists `lightingSetups`, `defaultLightingSetup` and `ambientOcclusion`. **This changes the look of every existing recipe that sets no lighting**: it now has an environment map, a key color of `[3, 2.8, 2.5]` instead of `[5.2, 4.7, 4.1]`, and a fill intensity of `0` instead of `1`. The engine default is unchanged (occlusion off, no map) so code scenes keep their pixels. Screen-space reflections are not part of this. The `scene:lit-box` size budget rises by 100 bytes gzip for the environment and occlusion code. The reference suite gets `--ambient-occlusion`, and its Blender renderer drops triangles that repeat a vertex, which crashed Blender on the skinned character
- Reach Rapier from recipes: a `physics` section (and a `set-physics` operation) puts rigid bodies on node IDs with box, ball, capsule, convex or trimesh colliders fitted to their geometry, joints, gravity and a duration of up to 10 seconds. It is recorded once at 60 steps a second and seeks like `motion`, so a seek back repeats the same frame (checked as identical PNG bytes on SwiftShader through MCP). `scene_inspect` reports per-body final positions and resting times, contacts and sensor enter and leave events. Rapier stays an optional peer, served to the preview from `node_modules` like Manifold, so the MCP server bundle does not grow.
- Add trimesh and convex-hull colliders (bounded triangle and point counts, checked before allocation), sensors with enter and leave events, and 16-bit collision groups and masks to `addons/physics`, plus `contactEvents`, `restFrames`, `bakePhysicsScene`, `loadPhysicsEngine` and `setPhysicsModuleLoader`. A collider with `sensor` now bakes instead of throwing.
- Add the `tray-drop` task to the agent modeling suite: balls dropped into a pocket cut in an authored mesh, graded on a fixed trimesh body, balls resting on the pocket floor and a repeatable seek. Raise four size budgets for the physics code (`entry:physics` to 17,900, `entry:agent-scene` to 121,100, `entry:agent-asset` to 128,500, `scene:agent-scene` to 147,300 bytes gzip).
diff --git a/bench/reference/README.md b/bench/reference/README.md
index d5ba2a85..8bbdfecb 100644
--- a/bench/reference/README.md
+++ b/bench/reference/README.md
@@ -46,8 +46,7 @@ EEVEE against Cycles is a yardstick: it shows what a good rasterizer scores. In
## Limits
- Scores come from one camera for each scene and one machine. They do not measure motion or speed.
-- This suite sets an HDRI from code and turns occlusion on at the recipe default. A recipe reaches only the named procedural setups, so these scores still describe a better environment than an agent gets (issue #53).
-- `character` has no new EEVEE render: Blender 5.2.2 crashed on that scene in `mesh_set_custom_normals` in every retry (a pre-existing crash that this change does not touch), so its EEVEE columns keep the earlier numbers.
+- This suite sets an HDRI from code and leaves occlusion off; `--ambient-occlusion <strength> [--ambient-occlusion-radius <units>]` turns it on. A recipe reaches only the named procedural setups, so these scores still describe a better environment than an agent gets (issue #53).
- The Blender leaf material has no translucency, and the 67.js foliage shader adds it by a trick. `foliage` is therefore partly a difference in materials.
- `render-blender.py` does not read normal maps. No scene uses one yet, so a new scene with a normal map must add that first.
- `glass` and `car-paint` use the real 67.js `transmission` and `clearcoat` layers, and the Blender side sets the same values on the Principled BSDF. 67.js refracts through the front surface only, so the sphere does not show the inverted sky that Cycles traces through the back face.
diff --git a/bench/reference/baseline.json b/bench/reference/baseline.json
index a31bdab8..772a3bf0 100644
--- a/bench/reference/baseline.json
+++ b/bench/reference/baseline.json
@@ -1,128 +1,132 @@
{
- "metric": "FLIP (LDR), mean error, lower is better",
- "blenderVersion": "5.2.2 LTS",
- "seconds": {
- "character": {
- "cycles": 4.5,
- "eevee": 1.1
- },
- "fog": {
- "cycles": 16.6,
- "eevee": 1.1
- },
- "foliage": {
- "cycles": 5.8,
- "eevee": 1
- },
- "glass": {
- "cycles": 5.8,
- "eevee": 0.4
- },
- "lit-interior": {
- "cycles": 10,
- "eevee": 0.6
- },
- "material-spheres": {
- "cycles": 6.7,
- "eevee": 0.4
- },
- "metal": {
- "cycles": 5,
- "eevee": 0.3
- },
- "outdoor-hdri": {
- "cycles": 4.1,
- "eevee": 0.4
- },
- "spot-area": {
- "cycles": 20.3,
- "eevee": 13.2
- }
- },
- "graphics": {
- "gpu": "ANGLE (NVIDIA, NVIDIA GeForce RTX 3060 (0x00002487) Direct3D11 vs_5_0 ps_5_0, D3D11)",
- "cpu": "ANGLE (Google, Vulkan 1.3.0 (SwiftShader Device (Subzero) (0x0000C0DE)), SwiftShader driver)"
- },
- "scores": {
- "car-paint": {
- "gpu-vs-cycles": 0.1521,
- "gpu-vs-eevee": 0.1323,
- "cpu-vs-cycles": 0.152,
- "cpu-vs-eevee": 0.1323,
- "eevee-vs-cycles": 0.0819,
- "gpu-vs-cpu": 0.0055
- },
- "character": {
- "gpu-vs-cycles": 0.0995,
- "gpu-vs-eevee": 0.0833,
- "cpu-vs-cycles": 0.099,
- "cpu-vs-eevee": 0.0826,
- "eevee-vs-cycles": 0.074,
- "gpu-vs-cpu": 0.0068
- },
- "fog": {
- "gpu-vs-cycles": 0.2612,
- "gpu-vs-eevee": 0.0542,
- "cpu-vs-cycles": 0.2608,
- "cpu-vs-eevee": 0.0542,
- "eevee-vs-cycles": 0.2662,
- "gpu-vs-cpu": 0.0085
- },
- "foliage": {
- "gpu-vs-cycles": 0.1594,
- "gpu-vs-eevee": 0.1386,
- "cpu-vs-cycles": 0.159,
- "cpu-vs-eevee": 0.1384,
- "eevee-vs-cycles": 0.0783,
- "gpu-vs-cpu": 0.0096
- },
- "glass": {
- "gpu-vs-cycles": 0.145,
- "gpu-vs-eevee": 0.1469,
- "cpu-vs-cycles": 0.1447,
- "cpu-vs-eevee": 0.1471,
- "eevee-vs-cycles": 0.115,
- "gpu-vs-cpu": 0.0074
- },
- "lit-interior": {
- "gpu-vs-cycles": 0.4997,
- "gpu-vs-eevee": 0.1204,
- "cpu-vs-cycles": 0.4993,
- "cpu-vs-eevee": 0.1209,
- "eevee-vs-cycles": 0.5159,
- "gpu-vs-cpu": 0.006
- },
- "material-spheres": {
- "gpu-vs-cycles": 0.1598,
- "gpu-vs-eevee": 0.1196,
- "cpu-vs-cycles": 0.1595,
- "cpu-vs-eevee": 0.1194,
- "eevee-vs-cycles": 0.1006,
- "gpu-vs-cpu": 0.0069
- },
- "metal": {
- "gpu-vs-cycles": 0.1868,
- "gpu-vs-eevee": 0.1565,
- "cpu-vs-cycles": 0.1867,
- "cpu-vs-eevee": 0.1565,
- "eevee-vs-cycles": 0.0934,
- "gpu-vs-cpu": 0.0063
- },
- "outdoor-hdri": {
- "gpu-vs-cycles": 0.0676,
- "gpu-vs-eevee": 0.052,
- "cpu-vs-cycles": 0.0672,
- "cpu-vs-eevee": 0.0515,
- "eevee-vs-cycles": 0.0383,
- "gpu-vs-cpu": 0.0058
- },
- "spot-area": {
- "gpu-vs-cycles": 0.1242,
- "gpu-vs-eevee": 0.1707,
- "cpu-vs-cycles": 0.1242,
- "cpu-vs-eevee": 0.1709,
- "eevee-vs-cycles": 0.1935,
- "gpu-vs-cpu": 0.0032
- }
+ "metric": "FLIP (LDR), mean error, lower is better",
+ "blenderVersion": "5.2.2 LTS",
+ "seconds": {
+ "car-paint": {
+ "cycles": 35.4,
+ "eevee": 82.5
+ },
+ "character": {
+ "cycles": 19.2,
+ "eevee": 4.5
+ },
+ "fog": {
+ "cycles": 63.5,
+ "eevee": 36.3
+ },
+ "foliage": {
+ "cycles": 39.5,
+ "eevee": 27.4
+ },
+ "glass": {
+ "cycles": 29.5,
+ "eevee": 13.7
+ },
+ "lit-interior": {
+ "cycles": 77.4,
+ "eevee": 2.6
+ },
+ "material-spheres": {
+ "cycles": 25.0,
+ "eevee": 60.5
+ },
+ "metal": {
+ "cycles": 42.2,
+ "eevee": 30.4
+ },
+ "outdoor-hdri": {
+ "cycles": 42.9,
+ "eevee": 12.9
+ },
+ "spot-area": {
+ "cycles": 28.5,
+ "eevee": 10.1
+ }
+ },
+ "graphics": {
+ "gpu": "ANGLE (NVIDIA, NVIDIA GeForce RTX 3060 (0x00002487) Direct3D11 vs_5_0 ps_5_0, D3D11)",
+ "cpu": "ANGLE (Google, Vulkan 1.3.0 (SwiftShader Device (Subzero) (0x0000C0DE)), SwiftShader driver)"
+ },
+ "scores": {
+ "car-paint": {
+ "gpu-vs-cycles": 0.1521,
+ "gpu-vs-eevee": 0.1323,
+ "cpu-vs-cycles": 0.152,
+ "cpu-vs-eevee": 0.1323,
+ "eevee-vs-cycles": 0.0819,
+ "gpu-vs-cpu": 0.0055
+ },
+ "character": {
+ "gpu-vs-cycles": 0.0995,
+ "gpu-vs-eevee": 0.0833,
+ "cpu-vs-cycles": 0.099,
+ "cpu-vs-eevee": 0.0826,
+ "eevee-vs-cycles": 0.074,
+ "gpu-vs-cpu": 0.0068
+ },
+ "fog": {
+ "gpu-vs-cycles": 0.2612,
+ "gpu-vs-eevee": 0.0542,
+ "cpu-vs-cycles": 0.2608,
+ "cpu-vs-eevee": 0.0542,
+ "eevee-vs-cycles": 0.2662,
+ "gpu-vs-cpu": 0.0085
+ },
+ "foliage": {
+ "gpu-vs-cycles": 0.1594,
+ "gpu-vs-eevee": 0.1386,
+ "cpu-vs-cycles": 0.159,
+ "cpu-vs-eevee": 0.1384,
+ "eevee-vs-cycles": 0.0783,
+ "gpu-vs-cpu": 0.0096
+ },
+ "glass": {
+ "gpu-vs-cycles": 0.1326,
+ "gpu-vs-eevee": 0.1471,
+ "cpu-vs-cycles": 0.1323,
+ "cpu-vs-eevee": 0.1474,
+ "eevee-vs-cycles": 0.115,
+ "gpu-vs-cpu": 0.0075
+ },
+ "lit-interior": {
+ "gpu-vs-cycles": 0.5055,
+ "gpu-vs-eevee": 0.0923,
+ "cpu-vs-cycles": 0.5051,
+ "cpu-vs-eevee": 0.0928,
+ "eevee-vs-cycles": 0.5159,
+ "gpu-vs-cpu": 0.0062
+ },
+ "material-spheres": {
+ "gpu-vs-cycles": 0.1598,
+ "gpu-vs-eevee": 0.1196,
+ "cpu-vs-cycles": 0.1595,
+ "cpu-vs-eevee": 0.1194,
+ "eevee-vs-cycles": 0.1006,
+ "gpu-vs-cpu": 0.0069
+ },
+ "metal": {
+ "gpu-vs-cycles": 0.1868,
+ "gpu-vs-eevee": 0.1565,
+ "cpu-vs-cycles": 0.1867,
+ "cpu-vs-eevee": 0.1565,
+ "eevee-vs-cycles": 0.0934,
+ "gpu-vs-cpu": 0.0063
+ },
+ "outdoor-hdri": {
+ "gpu-vs-cycles": 0.0676,
+ "gpu-vs-eevee": 0.052,
+ "cpu-vs-cycles": 0.0672,
+ "cpu-vs-eevee": 0.0515,
+ "eevee-vs-cycles": 0.0384,
+ "gpu-vs-cpu": 0.0058
+ },
+ "spot-area": {
+ "gpu-vs-cycles": 0.1242,
+ "gpu-vs-eevee": 0.1707,
+ "cpu-vs-cycles": 0.1242,
+ "cpu-vs-eevee": 0.1709,
+ "eevee-vs-cycles": 0.1935,
+ "gpu-vs-cpu": 0.0032
}
+ }
}
diff --git a/bench/reference/harness.js b/bench/reference/harness.js
index 4b3aa08c..61b9a5d4 100644
--- a/bench/reference/harness.js
+++ b/bench/reference/harness.js
@@ -1,7 +1,6 @@
// Runs in the page: draws one reference scene, and describes it as plain data for Blender.
import { Renderer67 } from '/src/renderer.js';
import { REFERENCE_SCENES } from './scenes.js';
-import { DEFAULT_AMBIENT_OCCLUSION } from '/src/agent-scene-capabilities.js';
function encodeBytes(typedArray) {
const bytes = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength);
@@ -71,7 +70,7 @@ function describeScene(id, scene) {
};
}
-async function renderReferenceScene(id, { describe }) {
+async function renderReferenceScene(id, { describe, ambientOcclusion = 0, ambientOcclusionRadius = 0.5 }) {
const scene = await REFERENCE_SCENES[id]();
const canvas = document.querySelector('canvas');
const renderer = new Renderer67(canvas, scene.parts, {
@@ -79,7 +78,7 @@ async function renderReferenceScene(id, { describe }) {
environment: scene.environment, shadowBounds: scene.shadow,
});
renderer.resize();
- const frame = { ...scene.camera, environment: scene.environment, time: 0, exposure: 1, effects: { ambientOcclusion: DEFAULT_AMBIENT_OCCLUSION } };
+ const frame = { ...scene.camera, environment: scene.environment, time: 0, exposure: 1, effects: { ambientOcclusion, ambientOcclusionRadius } };
renderer.render(frame);
renderer.render(frame);
const debug = renderer.context.getExtension('WEBGL_debug_renderer_info');
diff --git a/bench/reference/images/car-paint.jpg b/bench/reference/images/car-paint.jpg
index d68b1f63..170f69fe 100644
Binary files a/bench/reference/images/car-paint.jpg and b/bench/reference/images/car-paint.jpg differ
diff --git a/bench/reference/images/character.jpg b/bench/reference/images/character.jpg
index f690e048..2896ca0c 100644
Binary files a/bench/reference/images/character.jpg and b/bench/reference/images/character.jpg differ
diff --git a/bench/reference/images/fog.jpg b/bench/reference/images/fog.jpg
index 71b45d6e..a2b75d7c 100644
Binary files a/bench/reference/images/fog.jpg and b/bench/reference/images/fog.jpg differ
diff --git a/bench/reference/images/foliage.jpg b/bench/reference/images/foliage.jpg
index ef2fd8bb..9204b46e 100644
Binary files a/bench/reference/images/foliage.jpg and b/bench/reference/images/foliage.jpg differ
diff --git a/bench/reference/images/glass.jpg b/bench/reference/images/glass.jpg
index 22669d84..08e3693c 100644
Binary files a/bench/reference/images/glass.jpg and b/bench/reference/images/glass.jpg differ
diff --git a/bench/reference/images/lit-interior.jpg b/bench/reference/images/lit-interior.jpg
index 03ed2cd5..9e26d6ea 100644
Binary files a/bench/reference/images/lit-interior.jpg and b/bench/reference/images/lit-interior.jpg differ
diff --git a/bench/reference/images/material-spheres.jpg b/bench/reference/images/material-spheres.jpg
index 90af23af..ebb0cc54 100644
Binary files a/bench/reference/images/material-spheres.jpg and b/bench/reference/images/material-spheres.jpg differ
diff --git a/bench/reference/images/metal.jpg b/bench/reference/images/metal.jpg
index 5c218308..e6b8c80c 100644
Binary files a/bench/reference/images/metal.jpg and b/bench/reference/images/metal.jpg differ
diff --git a/bench/reference/images/outdoor-hdri.jpg b/bench/reference/images/outdoor-hdri.jpg
index 69a50327..34544ba1 100644
Binary files a/bench/reference/images/outdoor-hdri.jpg and b/bench/reference/images/outdoor-hdri.jpg differ
diff --git a/bench/reference/images/spot-area.jpg b/bench/reference/images/spot-area.jpg
index cbfd13e2..345b4e44 100644
Binary files a/bench/reference/images/spot-area.jpg and b/bench/reference/images/spot-area.jpg differ
diff --git a/bench/reference/render-blender.py b/bench/reference/render-blender.py
index ddb86a0e..3c2573d4 100644
--- a/bench/reference/render-blender.py
+++ b/bench/reference/render-blender.py
@@ -51,6 +51,10 @@ def build_mesh(name, geometry):
positions = decode(geometry["positions"]).reshape(-1, 3)
normals = decode(geometry["normals"]).reshape(-1, 3)
triangles = decode(geometry["indices"]).reshape(-1, 3)
+ # A triangle that repeats a vertex has no area and is invisible, but Blender builds an invalid face from it
+ # and crashes in mesh_set_custom_normals (the skinned character has three).
+ repeats_vertex = (triangles[:, 0] == triangles[:, 1]) | (triangles[:, 1] == triangles[:, 2]) | (triangles[:, 0] == triangles[:, 2])
+ triangles = triangles[~repeats_vertex]
mesh = bpy.data.meshes.new(name)
mesh.from_pydata(positions.tolist(), [], triangles.tolist())
mesh.normals_split_custom_set_from_vertices(normals.tolist())
diff --git a/bench/reference/run.mjs b/bench/reference/run.mjs
index 0ae5e7a0..360dbe60 100644
--- a/bench/reference/run.mjs
+++ b/bench/reference/run.mjs
@@ -1,4 +1,5 @@
// Renders the reference scenes in 67.js and Blender, then scores them: npm run reference
+// --ambient-occlusion <strength> [--ambient-occlusion-radius <units>] turns occlusion on (off by default).
// Use --score-only to score existing renders, --skip-blender to keep them, and --scene <id> for one scene.
import { spawnSync } from 'node:child_process';
import { mkdir, writeFile } from 'node:fs/promises';
@@ -22,6 +23,10 @@ const argumentsGiven = process.argv.slice(2);
const scoreOnly = argumentsGiven.includes('--score-only');
const skipBlender = argumentsGiven.includes('--skip-blender');
const sceneFlag = argumentsGiven.indexOf('--scene');
+const occlusionFlag = argumentsGiven.indexOf('--ambient-occlusion');
+const ambientOcclusion = occlusionFlag >= 0 ? Number(argumentsGiven[occlusionFlag + 1]) : 0;
+const radiusFlag = argumentsGiven.indexOf('--ambient-occlusion-radius');
+const ambientOcclusionRadius = radiusFlag >= 0 ? Number(argumentsGiven[radiusFlag + 1]) : 0.5;
const onlyScene = sceneFlag >= 0 ? argumentsGiven[sceneFlag + 1] : null;
async function renderBackend(backend, serverUrl, graphics) {
@@ -37,7 +42,7 @@ async function renderBackend(backend, serverUrl, graphics) {
if (onlyScene && id !== onlyScene) continue;
const started = performance.now();
const describe = backend === 'gpu';
- const result = await page.evaluate(([sceneId, shouldDescribe]) => window.renderReferenceScene(sceneId, { describe: shouldDescribe }), [id, describe]);
+ const result = await page.evaluate(([sceneId, shouldDescribe, ambientOcclusion, ambientOcclusionRadius]) => window.renderReferenceScene(sceneId, { describe: shouldDescribe, ambientOcclusion, ambientOcclusionRadius }), [id, describe, ambientOcclusion, ambientOcclusionRadius]);
if (result.glError !== 0) throw new Error(`${id} on ${backend} gave WebGL error ${result.glError}.`);
graphics[backend] = result.graphics;
await writeFile(`${WORK_DIRECTORY}/${id}-${backend}.png`, Buffer.from(result.image, 'base64'));
diff --git a/bench/size/budgets.json b/bench/size/budgets.json
index 52cf5d30..3df7a9d1 100644
--- a/bench/size/budgets.json
+++ b/bench/size/budgets.json
@@ -31,8 +31,8 @@
"entry:agent-scene": 129200,
"entry:agent-asset": 136600,
"entry:hdri": 3300,
- "scene:lit-box": 56000,
+ "scene:lit-box": 56100,
"scene:gltf-box": 75300,
"scene:agent-scene": 155700
}
-}
+}
\ No newline at end of file
diff --git a/docs/agent-look.md b/docs/agent-look.md
index 9a34eed9..5eee8abc 100644
--- a/docs/agent-look.md
+++ b/docs/agent-look.md
@@ -130,7 +130,7 @@ High radiance can clip at the renderer's half-float HDR target limit of `65504`
## Lighting setups
-A recipe with no lighting settings uses `daylight`: a small procedural sky map (128 by 64, generated in code, no files or URLs) lights every surface and shows in metal and glossy reflections, with a warm key light for shadows.
+A recipe with no lighting settings uses `daylight` (and no occlusion): a small procedural sky map (128 by 64, generated in code, no files or URLs) lights every surface and shows in metal and glossy reflections, with a warm key light for shadows.
The four setups are `daylight`, `overcast` (even grey light, weak key), `sunset` (low warm sun, dark blue zenith) and `studio` (neutral room with three soft boxes).
Setting `setup` through `set-environment` resets `lightDirection`, `keyColor`, `keyIntensity`, `fillIntensity`, `ambientIntensity`, `skyTop` and `skyBottom` to that setup; fields in the same call still win, and fields set earlier are replaced.
Remote URLs and HDRI files are not accepted from tool input.
@@ -187,7 +187,7 @@ See [volume fog](volumetric.md) for renderer requirements and frame-time limits.
The controls reuse `resolveEffects` with a preview bloom strength of `0.12`.
Exposure remains independent and maps to `frame.exposure`.
Bloom strength zero disables bloom.
-Ambient occlusion reads the depth texture, so it needs the HDR depth target that previews use. The program compiles and its half-resolution target allocates on first use. On SwiftShader at 960 by 540 it adds about 16 ms to a 190 ms frame (measured, 8 percent). The engine itself leaves it off unless a frame asks; only recipes default to `0.8`. Pixels that direct light already brightens keep less of it, because occlusion belongs to indirect light.
+Ambient occlusion reads the depth texture, so it needs the HDR depth target that previews use. The program compiles and its half-resolution target allocates on first use. On SwiftShader at 960 by 540 it adds about 16 ms to a 190 ms frame (measured, 8 percent). It is off by default: against Cycles on 10 reference scenes it improved no score by more than 0.002 and made most slightly worse, because the largest gaps are cast shadow shape and reflections, not contact darkening. Pixels that direct light already brightens keep less of it, because occlusion belongs to indirect light.
| Field | Default | Range |
| --- | --- | --- |
@@ -197,7 +197,7 @@ Ambient occlusion reads the depth texture, so it needs the HDR depth target that
| `temperature` | `0` | `-1` to `1` |
| `vignette` | `0` | `0` to `1` |
| `grain` | `0` | `0` to `0.1` |
-| `ambientOcclusion` | `0.8` | `0` to `1`. Screen-space contact darkening; `0` skips the pass and its program |
+| `ambientOcclusion` | `0` | `0` to `1`. Screen-space contact darkening, off by default; any value above `0` runs the pass |
| `ambientOcclusionRadius` | `0.5` | `0.01` to `100` world units |
| `bloom.strength` | `0.12` | `0` to `2` |
| `bloom.threshold` | `1` | `0` to `10` |
diff --git a/docs/parity.md b/docs/parity.md
index 81bb7dc6..5b0165c8 100644
--- a/docs/parity.md
+++ b/docs/parity.md
@@ -190,7 +190,7 @@ To move to a new Blender release, run `node scripts/parity-manual-snapshot.mjs`.
| Rendering > Cameras | partial | Perspective, orthographic views, focal length and animated paths. There is no depth of field. | [camera-path](../tests/camera-path.test.js), [camera](../tests/camera.test.js) | #54 |
| Rendering > Lights > Light Objects | partial | One directional light with a shadow, 8 point lights, 8 spot lights and 4 rectangular area lights. Point and spot lights can cast shadows from one 24-tile atlas (a point light takes 6 tiles, a spot light 1). Area lights use a representative point and cast no shadow. The directional shadow is a single map, not cascaded. | [lighting](../tests/lighting.test.js), `npm run reference` scene `spot-area` | #52 |
| Rendering > Lights > Light Linking | missing | No light linking. | | #52 |
-| Rendering > Lights > World Environment | partial | Recipes pick a named setup (`daylight`, `overcast`, `sunset`, `studio`) that carries a procedural environment map, and get screen-space ambient occlusion. Code can load any HDRI; recipes reach only the named maps, with no URLs or files. No reflections between objects yet. | [environment](../tests/environment.test.js), [default look](../tests/default-look.test.js) | #53 |
+| Rendering > Lights > World Environment | partial | Recipes pick a named setup (`daylight`, `overcast`, `sunset`, `studio`) that carries a procedural environment map, with opt-in screen-space ambient occlusion. Code can load any HDRI; recipes reach only the named maps, with no URLs or files. No reflections between objects yet. | [environment](../tests/environment.test.js), [default look](../tests/default-look.test.js) | #53 |
| Rendering > Materials > Components | partial | Surfaces with PBR factors and five maps, a clear coat, transmission with thickness, attenuation and IOR, sheen, and specular weight and tint. There is no anisotropy, iridescence, subsurface scattering, volume material or displacement. | [texture-set](../tests/texture-set.test.js) | #50, #51 |
| Rendering > Materials > Assignment | done | A node names one material. | [agent-scene](../tests/agent-scene.test.js) | |
| Rendering > Materials > Preview | out of scope | Interface for a person. Agents use `scene_look`. | | |
diff --git a/skills/build-67js-scene/SKILL.md b/skills/build-67js-scene/SKILL.md
index 015e0236..a4628f43 100644
--- a/skills/build-67js-scene/SKILL.md
+++ b/skills/build-67js-scene/SKILL.md
@@ -63,7 +63,7 @@ Read [scene-contract.md](references/scene-contract.md) before creating parts or
7. Validate geometry, bounds and scene budgets with the existing Node tests.
8. Capture actual rendered wide and narrow views. Inspect edges, highlights, overlap and the focal point.
9. Exercise orbit, zoom, camera selection and the requested interaction through project dev tooling.
-10. In a recipe, start from the default look: `environment.setup` is `daylight` and `effects.ambientOcclusion` is `0.8`. Pick `studio` for products, `overcast` for soft even light, `sunset` for warm low light; set `ambientOcclusion: 0` only to turn contact darkening off. Do not hand-tune key, fill and ambient first.
+10. In a recipe, start from the default look: `environment.setup` is `daylight` and `effects.ambientOcclusion` is `0` (off; set 0.4 to 0.8 to add contact darkening). Pick `studio` for products, `overcast` for soft even light, `sunset` for warm low light; Do not hand-tune key, fill and ambient first.
Do not treat an `antialias: true` context as proof that the final image looks smooth.
Report measured geometry, draw counts and render size separately from visual judgments.
diff --git a/src/agent-scene-capabilities.js b/src/agent-scene-capabilities.js
index 0611656b..cb9a235c 100644
--- a/src/agent-scene-capabilities.js
+++ b/src/agent-scene-capabilities.js
@@ -21,7 +21,7 @@ export const RECIPE_ALPHA_MODES = Object.freeze(['opaque', 'blend']);
// Named lighting setups (see lighting-setups.js) and the occlusion strength that recipes get when they set none.
export const LIGHTING_SETUP_NAMES = Object.freeze(['daylight', 'overcast', 'sunset', 'studio']);
export const DEFAULT_LIGHTING_SETUP = 'daylight';
-export const DEFAULT_AMBIENT_OCCLUSION = 0.8;
+export const DEFAULT_AMBIENT_OCCLUSION = 0;
export const AGENT_SCENE_CAPABILITIES = Object.freeze({
format: '67js.scene', schemaVersion: 1,
diff --git a/tests/agent-look.test.js b/tests/agent-look.test.js
index de582bdc..bf0d5a60 100644
--- a/tests/agent-look.test.js
+++ b/tests/agent-look.test.js
@@ -27,7 +27,7 @@ test('default look is complete, detached JSON and idempotent', () => {
});
assert.deepEqual(look.effects, {
saturation: 1, contrast: 1, temperature: 0, vignette: 0, grain: 0,
- ambientOcclusion: 0.8, ambientOcclusionRadius: 0.5,
+ ambientOcclusion: 0, ambientOcclusionRadius: 0.5,
bloom: { strength: 0.12, threshold: 1, radius: 1 }, exposure: 1,
});
assert.deepEqual(look.shadow, { target: [0, 1, 0], extent: 3.5, distance: 8, near: 0.1, far: 15 });