Skip to content

armgit / 67.js

Public Imported from GitHub
0

3D engine that AI agents drive

Drop the clump roll, now on main through #477, from the #432 notes

Nguyen Xuan And858a25132df
diff --git a/changes/432-tree-level-luminance.md b/changes/432-tree-level-luminance.md
index 9188764d..24545f6d 100644
--- a/changes/432-tree-level-luminance.md
+++ b/changes/432-tree-level-luminance.md
@@ -1,7 +1,6 @@
-- Far tree levels no longer pop darker than level 0 when a tree switches level (issue #432). Four changes:
- - The standing card of each clump on levels 2 and 3 is rolled by the golden angle from the last clump. All of them used to face one world direction, so a far tree drew about three times darker from some sides than from others (0.80 of level 0 from one side and 0.27 from the others, for a conifer under even sky light).
+- 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 on main for the four trees), and 226 of the 240 seed ratios (5 species, 2 levels, 3 lights, 8 seeds) land within 0.85 to 1.15.
+ - 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.
diff --git a/changes/432-tree-level-luminance.size.md b/changes/432-tree-level-luminance.size.md
index cf12fb5e..5292205f 100644
--- a/changes/432-tree-level-luminance.size.md
+++ b/changes/432-tree-level-luminance.size.md
@@ -1 +1 @@
-- scene:agent-scene+lazy: 364796 to 365358 bytes gzip (+562) for the per-level tree gains (`src/tree-level-gains.js`, 10 rows of three numbers and one exponent per species), the leaf-area correction of the colour gain, the leaf-area weighted sky match (`vertexCoverage`, `coverageMean`, `scaleVisibility`) and the rolled standing clump cards, which keep the far levels of a tree as bright as level 0 from every side so a tree no longer pops darker when it switches level (issue #432); no budget in `bench/size/budgets.json` changes
+- scene:agent-scene+lazy: 364964 to 365488 bytes gzip (+524) for the per-level tree gains (`src/tree-level-gains.js`, 10 rows of three numbers and one exponent per species), the leaf-area correction of the colour gain, the leaf-area weighted sky match (`vertexCoverage`, `coverageMean`, `scaleVisibility`), which keep the far levels of a tree as bright as level 0 so a tree no longer pops darker when it switches level (issue #432); no budget in `bench/size/budgets.json` changes