Clearer objects in scope
This commit is contained in:
fraxle
2026-06-07 10:32:38 +01:00
parent b3c9ed2068
commit 1a69994833
+8 -6
View File
@@ -60,7 +60,7 @@ const GROUND_SPEC = {
open: { night: '#0e160b', grad: [[0, '#6f9e3e'], [1, '#3f6a24']], open: { night: '#0e160b', grad: [[0, '#6f9e3e'], [1, '#3f6a24']],
obj: { types: ['hedge', 'bush', 'oak'], base: 18, n: 7, sizeMul: 1.15, seed: 1011, bands: [[0.14, 0.92]] } }, obj: { types: ['hedge', 'bush', 'oak'], base: 18, n: 7, sizeMul: 1.15, seed: 1011, bands: [[0.14, 0.92]] } },
forest: { night: '#0d120a', grad: [[0, '#3f5a2e'], [0.5, '#4a4628'], [1, '#3a2c19']], forest: { night: '#0d120a', grad: [[0, '#3f5a2e'], [0.5, '#4a4628'], [1, '#3a2c19']],
obj: { types: ['oak'], base: 22, n: 11, sizeMul: 1.7, seed: 3031, bands: [[0.1, 0.94]] } }, obj: { types: ['oak'], base: 30, n: 14, sizeMul: 1.7, seed: 3031, bands: [[0.04, 0.94]], randomX: true } },
alpine: { night: '#11141b', snowGround: true, grad: [[0, '#787c82'], [1, '#494c52']], alpine: { night: '#11141b', snowGround: true, grad: [[0, '#787c82'], [1, '#494c52']],
obj: { types: ['pine'], base: 20, n: 7, sizeMul: 1.4, seed: 7073, bands: [[0.12, 0.92]], mountains: true } }, obj: { types: ['pine'], base: 20, n: 7, sizeMul: 1.4, seed: 7073, bands: [[0.12, 0.92]], mountains: true } },
urban: { night: '#13151b', grad: [[0, '#9a9da2'], [1, '#595c61']], urban: { night: '#13151b', grad: [[0, '#9a9da2'], [1, '#595c61']],
@@ -71,16 +71,16 @@ const GROUND_SPEC = {
obj: { types: ['boat'], base: 22, n: 5, sizeMul: 1.2, seed: 6061, bands: [[0.15, 0.9]] } }, obj: { types: ['boat'], base: 22, n: 5, sizeMul: 1.2, seed: 6061, bands: [[0.15, 0.9]] } },
desert: { night: '#19140f', grad: [[0, '#d9bd85'], [1, '#b6945c']], desert: { night: '#19140f', grad: [[0, '#d9bd85'], [1, '#b6945c']],
obj: { types: ['cactus'], base: 24, n: 6, sizeMul: 1.3, seed: 8083, bands: [[0.12, 0.9]] } }, obj: { types: ['cactus'], base: 24, n: 6, sizeMul: 1.3, seed: 8083, bands: [[0.12, 0.9]] } },
river: { night: '#0d130a', grad: [[0, '#4d6c30'], [0.26, '#3f5a28'], [0.32, '#42738b'], [0.58, '#356074'], [0.64, '#4d6c30'], [1, '#345020']], river: { night: '#0d130a', grad: [[0, '#4d6c30'], [0.10, '#3f5a28'], [0.15, '#42738b'], [0.44, '#356074'], [0.50, '#4d6c30'], [1, '#345020']],
obj: { types: ['reed', 'oak'], base: 17, n: 8, sizeMul: 1.3, seed: 5053, bands: [[0.1, 0.24], [0.68, 0.92]] } }, obj: { types: ['reed', 'oak'], base: 17, n: 8, sizeMul: 1.3, seed: 5053, bands: [[0.03, 0.09], [0.58, 0.92]] } },
}; };
// Daytime "material" colour per scattered object type — trees green, cacti // Daytime "material" colour per scattered object type — trees green, cacti
// desert-green, parasol warm, boat sail-coloured, etc. Run through the cycle // desert-green, parasol warm, boat sail-coloured, etc. Run through the cycle
// (objTone) at render time so they darken at night, warm at sunset, etc. // (objTone) at render time so they darken at night, warm at sunset, etc.
const MATERIAL = { const MATERIAL = {
oak: '#4f7d39', pine: '#356040', bush: '#2e5218', hedge: '#4c7a3e', oak: '#0e2208', pine: '#091410', bush: '#1e380e', hedge: '#122808',
cactus: '#5f8a4a', palm: '#4a7d3e', parasol: '#bb5a46', reed: '#74803c', cactus: '#1e4016', palm: '#102a10', parasol: '#bb5a46', reed: '#161e04',
boat: '#ccc4ad', boat: '#ccc4ad',
}; };
@@ -778,11 +778,13 @@ export function ScopeReticle({ value, cat, loading, elev = 0, dt = new Date(), g
const band = bands[k % bands.length]; const band = bands[k % bands.length];
// Stratify horizontally so objects spread evenly across the width // Stratify horizontally so objects spread evenly across the width
// (with jitter) instead of clustering; deeper objects sit lower. // (with jitter) instead of clustering; deeper objects sit lower.
// randomX bypasses stratification for fully organic placement (e.g. forest).
const slot = (k + 0.5) / cfg.n; // 0..1 even const slot = (k + 0.5) / cfg.n; // 0..1 even
const jitter = (rnd() - 0.5) * (1.4 / cfg.n); const jitter = (rnd() - 0.5) * (1.4 / cfg.n);
const xf = cfg.randomX ? (rnd() * 2 - 1) : Math.max(-1, Math.min(1, (slot * 2 - 1) + jitter));
objs.push({ objs.push({
d: band[0] + rnd() * (band[1] - band[0]), d: band[0] + rnd() * (band[1] - band[0]),
xf: Math.max(-1, Math.min(1, (slot * 2 - 1) + jitter)), xf,
type: cfg.types[Math.floor(rnd() * cfg.types.length)], type: cfg.types[Math.floor(rnd() * cfg.types.length)],
wf: 0.4 + rnd() * 0.5, wf: 0.4 + rnd() * 0.5,
}); });