Skip to content

armgit / 67.js

Public Imported from GitHub
0

3D engine that AI agents drive

Accept the path tracer growth and update the parity ledger (part of #283)

Nguyen Xuan Ancfcbe17e7e6c
diff --git a/changes/283-path-tracer.size.md b/changes/283-path-tracer.size.md
new file mode 100644
index 00000000..98b9b942
--- /dev/null
+++ b/changes/283-path-tracer.size.md
@@ -0,0 +1,2 @@
+- entry:path-tracer: grows by about 1,040 bytes gzip for the subsurface random walk (path-tracer-subsurface.js) and the shading split, which the tracer carries for every scene because the walk runs inside its path loop.
+- entry:path-tracer+lazy: the same 1,040 bytes.
diff --git a/changes/283.size.md b/changes/283.size.md
index bb698ece..1d4e3349 100644
--- a/changes/283.size.md
+++ b/changes/283.size.md
@@ -7,6 +7,4 @@
- tool:scene_create: the material subsurface block, about 825 bytes.
- tool:scene_apply: the material subsurface block, twice (add-material and set-material), about 1,650 bytes.
- tool:scene_create_asset: the material subsurface block, about 825 bytes.
-- result:scene_capabilities: one line naming the subsurface block, with the ranges kept in the tool schema.
-- entry:path-tracer: grows by about 1,040 bytes gzip for the subsurface random walk (path-tracer-subsurface.js) and the shading split, which the tracer carries for every scene because the walk runs inside its path loop.
-- entry:path-tracer+lazy: the same 1,040 bytes.
+- result:scene_capabilities: one line naming the subsurface block, with the ranges kept in the tool schema.
\ No newline at end of file
diff --git a/docs/parity.md b/docs/parity.md
index aee12acc..7c02b2b6 100644
--- a/docs/parity.md
+++ b/docs/parity.md
@@ -187,13 +187,13 @@ To move to a new Blender release, run `node scripts/parity-manual-snapshot.mjs`.
| Physics > Baking Physics Simulations | partial | Physics records to a timeline in code or when a recipe scene is created, on the main thread. | [film-physics](../tests/film-physics.test.js) | #61 |
| Physics > Simulation Nodes | missing | No node graph. | | #43 |
| Rendering > Render Engines > EEVEE | partial | A WebGL2 rasterizer with PBR, one directional shadow, 16 point lights, fog and bloom. Reflection probes exist behind `bake.probes` (on by default with a bake; specular only, no parallax; [light-bake](light-bake.md)); no irradiance or box probes. | [renderer](../tests/renderer.test.js), [scores against EEVEE](../bench/reference/baseline.json) | #52, #53, #55, #56 |
-| Rendering > Render Engines > Cycles | partial | A CPU path tracer (`addons/path-tracer`, or `settings.renderer` on an image render job; [path-tracer](path-tracer.md)) draws diffuse, GGX metal, clear coat, glass, maps, cutouts, the sun, point, spot and area lights with soft shadows and the environment map, with a denoiser. At 32 samples its FLIP score against Cycles is better than the rasterizer's on 7 of the 11 reference scenes and worse on `outdoor-hdri`, `character`, `fog` (no volume fog) and `foliage` (equal to 0.0003); since issue #284 it traces emissive maps and homogeneous volume fog, and at 64 samples `fog` scores 0.0312 against the rasterizer's 0.2021 and the new `emissive-sign` scene 0.0800 against 0.2372; the mean is 0.171 against 0.189 (`npm run reference -- --path-tracer`, [bench/reference/path-tracer.json](../bench/reference/path-tracer.json)). It draws normal and metallic-roughness maps (issue #129) and runs about 2.8 times faster per thread, and 3.5 to 3.9 times with the shadow-ray change (inferred from 8,360 to about 30,000 paths per second on the demo room), than at that table, whose scores and seconds predate both (the second table in the reference README has the current ones); it draws them on box-projected materials too, can stop converged pixels on request (`noiseThreshold`, off by default because it costs `spot-area` score, see the reference README), and finishes a 1920 by 1080 still of a 181,708 triangle room at 64 samples in 246 s on 8 threads with `noiseThreshold` 0.03 (about 8 to 9 minutes with every sample, inferred) under a job limit now 600 s; it does not trace translucent leaves, occlusion maps, anisotropy, iridescence or sheen (the job result names them in `metrics.pathTracer.ignored`), and it is not Cycles parity. The darker floor was the diffuse layer losing light at grazing angles, fixed in issue #215, which also added light linking: at 64 samples against Cycles `outdoor-hdri` is 0.0226, `character` 0.0287 and `light-linking` 0.0213, and the current scores of every scene are in `bench/reference/path-tracer.json`. `addons/light-bake` bakes bounced light from point, spot and area lights and the sun into a lightmap for each part, on the CPU with ray tracing; recipes reach it through the `bake` section and `set-bake` (draft and standard presets, with fine the same as standard, shrunk deterministically to a path step budget of 5 million, then by bounces, so a preset bakes even a large hall; scene_inspect reports what it used, whether it reduced, bake seconds and skipped parts, which include hair, particle and cloth nodes), patterned, textured and emissive parts bake through a second UV set and a `lightMap` slot, GLB export writes the map approximately as `TEXCOORD_1` emissive, but there are no reflection probes and no baked AO. On `lit-interior` it brings the score against Cycles from 0.5055 to 0.1444 (`npm run reference -- --bake lit-interior`). | [light-bake](../tests/light-bake.test.js), [path-tracer](../tests/path-tracer.test.js), [recipe bake](../tests/agent-bake.test.js), [frame time](../bench/reference/frame-time.mjs), [lit-interior scene](../bench/reference/scenes.js) | #55, #57, #128 |
+| Rendering > Render Engines > Cycles | partial | A CPU path tracer (`addons/path-tracer`, or `settings.renderer` on an image render job; [path-tracer](path-tracer.md)) draws diffuse, GGX metal, clear coat, glass, maps, cutouts, the sun, point, spot and area lights with soft shadows and the environment map, with a denoiser. At 32 samples its FLIP score against Cycles is better than the rasterizer's on 7 of the 11 reference scenes and worse on `outdoor-hdri`, `character`, `fog` (no volume fog) and `foliage` (equal to 0.0003); since issue #284 it traces emissive maps and homogeneous volume fog, and at 64 samples `fog` scores 0.0312 against the rasterizer's 0.2021 and the new `emissive-sign` scene 0.0800 against 0.2372; the mean is 0.171 against 0.189 (`npm run reference -- --path-tracer`, [bench/reference/path-tracer.json](../bench/reference/path-tracer.json)). It draws normal and metallic-roughness maps (issue #129) and runs about 2.8 times faster per thread, and 3.5 to 3.9 times with the shadow-ray change (inferred from 8,360 to about 30,000 paths per second on the demo room), than at that table, whose scores and seconds predate both (the second table in the reference README has the current ones); it draws them on box-projected materials too, can stop converged pixels on request (`noiseThreshold`, off by default because it costs `spot-area` score, see the reference README), and finishes a 1920 by 1080 still of a 181,708 triangle room at 64 samples in 246 s on 8 threads with `noiseThreshold` 0.03 (about 8 to 9 minutes with every sample, inferred) under a job limit now 600 s; it does not trace translucent leaves without a `subsurface` block, occlusion maps, anisotropy, iridescence or sheen (the job result names them in `metrics.pathTracer.ignored`), and it is not Cycles parity. The darker floor was the diffuse layer losing light at grazing angles, fixed in issue #215, which also added light linking: at 64 samples against Cycles `outdoor-hdri` is 0.0226, `character` 0.0287 and `light-linking` 0.0213, and the current scores of every scene are in `bench/reference/path-tracer.json`. `addons/light-bake` bakes bounced light from point, spot and area lights and the sun into a lightmap for each part, on the CPU with ray tracing; recipes reach it through the `bake` section and `set-bake` (draft and standard presets, with fine the same as standard, shrunk deterministically to a path step budget of 5 million, then by bounces, so a preset bakes even a large hall; scene_inspect reports what it used, whether it reduced, bake seconds and skipped parts, which include hair, particle and cloth nodes), patterned, textured and emissive parts bake through a second UV set and a `lightMap` slot, GLB export writes the map approximately as `TEXCOORD_1` emissive, but there are no reflection probes and no baked AO. On `lit-interior` it brings the score against Cycles from 0.5055 to 0.1444 (`npm run reference -- --bake lit-interior`). | [light-bake](../tests/light-bake.test.js), [path-tracer](../tests/path-tracer.test.js), [recipe bake](../tests/agent-bake.test.js), [frame time](../bench/reference/frame-time.mjs), [lit-interior scene](../bench/reference/scenes.js) | #55, #57, #128 |
| Rendering > Render Engines > Workbench | out of scope | A viewport engine for working by hand. | | |
| Rendering > Cameras | partial | Perspective, orthographic views, focal length, animated paths, depth of field from depth and camera motion blur, both repeatable per frame. Object motion blur and bokeh shapes are missing. | [camera-path](../tests/camera-path.test.js), [camera](../tests/camera.test.js), [render-passes](../tests/render-passes.test.js) | #54 |
| Rendering > Lights > Light Objects | partial | One directional light with a shadow, 16 point lights, 8 spot lights and 7 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, or up to four cascades through `addons/cascaded-shadows` (`shadowCascades` on the renderer and `environment.shadowCascades` in recipes, three by themselves when `shadow.extent` is above 40): scene `long-street` scores 0.1555 against Cycles with one map and 0.1398 with three cascades, for about 0.2 ms more a frame on an RTX 3060 when the camera moves. | [lighting](../tests/lighting.test.js), [cascades](../tests/cascaded-shadows.test.js), `npm run reference` scenes `spot-area` and `long-street` | #52 |
| Rendering > Lights > Light Linking | partial | `addons/light-linking`: a light's `affects` list (and `environment.keyAffects` for the sun) limits it to the named parts through `applyLightLinks`, as a Blender receiver collection does; the shader skips a light whose bit in the part's mask is clear. Linking changes what a light adds, not what it shadows. The path tracer (issue #215) and the light bake honour it, and recipes reach it through `affects` and `environment.keyAffects` (`lightLinking` in `scene_capabilities`). There is no blocker list. Scene `light-linking` scores 0.0998 against Cycles. | [light-linking](../tests/light-linking.test.js), `npm run reference` scene `light-linking` | #52 |
| 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. The MCP preview adds an automatic floor with a contact shadow (`environment.ground: false` removes it). Cold-run reference-free score for sitting on a surface, summed over six tasks and 0 to 3 each: 0 before, 6 with the floor and 7 after a lone flat object (a gear) stopped being read as a floor; the front and side cameras see it edge-on, so only the three-quarter view shows it. A blind pairwise Sonnet judge (`default-judge.mjs`, six cold recipes, two cameras, 18 calls) prefers the floor to none 18 of 18 (p 0.0000076) and the darker floor now used (0.22) to the first one (0.6) 18 of 18; its control, one image against itself, picks the first 17 of 18. | [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. Anisotropic highlights and a thin-film iridescence layer, as in the glTF extensions, are compiled in only when a part uses them. Subsurface scattering (the `subsurface` block: weight, radius, scale, color; sun light only, rasterizer only, compiled in only when a part uses it) approximates skin, wax and leaves; the path tracer ignores it. There is no volume material or displacement. | [texture-set](../tests/texture-set.test.js), [material-layers](../tests/material-layers.test.js) | #50, #51 |
+| 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. Anisotropic highlights and a thin-film iridescence layer, as in the glTF extensions, are compiled in only when a part uses them. Subsurface scattering (the `subsurface` block: weight, radius, scale, color; sun light only in the rasterizer, compiled in only when a part uses it) approximates skin, wax and leaves; the CPU path tracer traces it as a bounded Random Walk (at most 32 scattering events, thin cards as translucency) and the GPU tracer still ignores it. In the `subsurface` reference scene, scored against the Cycles render with subsurface on, the path tracer gets 0.0795 with weight 1 and 0.0875 with weight 0 (64 samples, 28.8 s against 20.7 s), the rasterizer 0.1180 and 0.1229. There is no volume material or displacement. | [texture-set](../tests/texture-set.test.js), [material-layers](../tests/material-layers.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`. | | |
| Rendering > Materials > Settings | partial | Opaque and blend in recipes, and mask on imported assets, with double-sided support. | [gltf-extensions](../tests/gltf-extensions.test.js) | #51 |
@@ -201,7 +201,7 @@ To move to a new Blender release, run `node scripts/parity-manual-snapshot.mjs`.
| Rendering > Materials > Legacy Textures | out of scope | Blender keeps these for old files. | | |
| Rendering > Shader Nodes > Input | partial | `uv` coordinates only. There is no object, geometry, camera or light-path input. | [material-graph](../tests/material-graph.test.js) | #50 |
| Rendering > Shader Nodes > Output | partial | A graph makes base colour, roughness, metallic, emission and height. It is baked to textures on the CPU, so it can not react to light, view or position. The `brick-graph` reference scene scores 0.2269 against Cycles; its `brick-flat` control (the graph's average colour, no maps) is the baseline it is compared with, and a bump of 0 would score 0.2065, so the bump is stronger than Blender's, not weaker. | [material-graph](../tests/material-graph.test.js), [brick-graph scene](../bench/reference/scenes.js) | #50 |
-| Rendering > Shader Nodes > Shader | partial | A metallic-roughness surface with clear coat, transmission, sheen and specular layers, and unlit, liquid and foam tags. Anisotropy (key, fill and local lights, and a bent environment lookup) and thin-film iridescence follow the glTF extensions rather than Blender's tangent and thin-film inputs, scored in the `brushed-film` reference scene. Khronos sample assets (`npm run reference -- --khronos`, files downloaded by hand) score 0.23 to 0.48 against Cycles on the pixels the asset covers (0.13 to 0.38 for EEVEE): the glTF clear coat (strength, roughness, normal), anisotropy and sheen textures are read (`layerMaps`, shader code in `material-layer-shaders`), which took the barn lamp from 0.4758 to 0.3584 and the anisotropy disc from 0.3481 to 0.2808; the transmission, iridescence and specular textures are not read, and `SheenChair` imports since a normal map may carry its own scale and offset. Subsurface maps Principled BSDF Subsurface Weight, Radius and Scale (Random Walk in Cycles) to a wrapped sun diffuse plus shadow-map thickness; it is scored in the `subsurface` reference scene. | [material-layers](../tests/material-layers.test.js) | #51 |
+| Rendering > Shader Nodes > Shader | partial | A metallic-roughness surface with clear coat, transmission, sheen and specular layers, and unlit, liquid and foam tags. Anisotropy (key, fill and local lights, and a bent environment lookup) and thin-film iridescence follow the glTF extensions rather than Blender's tangent and thin-film inputs, scored in the `brushed-film` reference scene. Khronos sample assets (`npm run reference -- --khronos`, files downloaded by hand) score 0.23 to 0.48 against Cycles on the pixels the asset covers (0.13 to 0.38 for EEVEE): the glTF clear coat (strength, roughness, normal), anisotropy and sheen textures are read (`layerMaps`, shader code in `material-layer-shaders`), which took the barn lamp from 0.4758 to 0.3584 and the anisotropy disc from 0.3481 to 0.2808; the transmission, iridescence and specular textures are not read, and `SheenChair` imports since a normal map may carry its own scale and offset. Subsurface maps Principled BSDF Subsurface Weight, Radius and Scale (Random Walk in Cycles) to a wrapped sun diffuse plus shadow-map thickness; the path tracer follows it with a random walk, and both are scored in the `subsurface` reference scene. | [material-layers](../tests/material-layers.test.js) | #51 |
| Rendering > Shader Nodes > Displacement | partial | Bump: a graph's height becomes a normal map. There is no displacement of the surface. | [material-graph](../tests/material-graph.test.js) | #50 |
| Rendering > Shader Nodes > Texture | partial | Image maps, 11 pattern presets, and graph nodes for noise, voronoi, wave, checker and gradient. Noise is not Blender's noise function, and there is no brick, musgrave, magic or environment node. Patterns follow UVs or box projection. | [material-patterns](../tests/material-patterns.test.js), [material-graph](../tests/material-graph.test.js), [brick-graph scene](../bench/reference/scenes.js) | #50 |
| Rendering > Shader Nodes > Color | partial | Color ramp, mix and invert. There is no hue, curves, gamma or blend modes. | [material-graph](../tests/material-graph.test.js) | #50 |