3D engine that AI agents drive
Size the bush's far crown clumps to its level-0 crown (part of #394)
Nguyen Xuan An1b96f0c02328
diff --git a/changes/394-bush.md b/changes/394-bush.mdnew file mode 100644index 00000000..144690d4--- /dev/null+++ b/changes/394-bush.md@@ -0,0 +1 @@+- 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.35`, which keeps the clumps within the level-0 crown; level 2 reads 0.81 of level 0 under sky light, 0.86 with the sun behind and 1.35 with the sun in front, level 3 0.63, 0.70 and 1.17. The other species and the reference frames (`foliage`, `mountain-valley`, `mountain-valley-dawn`: FLIP 0.0, no changed pixel) do not move.diff --git a/src/vegetation-species.js b/src/vegetation-species.jsindex 1fce9f80..978e4e76 100644--- a/src/vegetation-species.js+++ b/src/vegetation-species.js@@ -118,7 +118,7 @@ export const SPECIES = {texture: 'sprig', color: [54, 104, 40], foliageColor: [0.06, 0.2, 0.045], tint: [1, 1, 0.9],sitesPerMeter: 9, start: 0.1, upBias: 0.3,meshLength: 0.22, meshWidth: 0.14, meshPerSite: 3, meshSpread: 0.9, profile: OVATE_LEAF, droop: 0.25, fold: 0.12,- cardSize: [0.4, 0.42], cardsPerSite: 2,+ cardSize: [0.4, 0.42], cardsPerSite: 2, clumpScale: 0.35,},},};diff --git a/src/vegetation.js b/src/vegetation.jsindex 17db3b53..9e278951 100644--- a/src/vegetation.js+++ b/src/vegetation.js@@ -327,7 +327,7 @@ function addCrownClumps(builder, skeleton, spec, mode, random, widthScale = 1) {for (const sites of cells.values()) {const center = scaleVector(sites.reduce((sum, site) => addVectors(sum, site.position), [0, 0, 0]), 1 / sites.length);const shading = crownShading(skeleton, center);- const radius = cellSize * (0.55 + 0.1 * Math.min(sites.length, 5)) * widthScale;+ const radius = cellSize * (0.55 + 0.1 * Math.min(sites.length, 5)) * widthScale * (spec.clumpScale ?? 1);if (mode === 'mesh') {addBlob(builder, center, radius, shading);continue;