diff --git a/config.js b/config.js index 2098f1e..a39e9cb 100644 --- a/config.js +++ b/config.js @@ -417,8 +417,11 @@ window.CONFIG = { spreadKm: 45, // gaussian sigma around the motorway network spreadFloor: 0.30, // share that far side roads keep speed: 1.0, // flow speed multiplier - density: 0.5, // vehicle density multiplier + density: 0.25, // vehicle density multiplier brightness: 0.78, // vehicle light intensity (60 % of 1.3) + motorwayDensity: 0.95, // share of the density budget on motorways/trunk + sideDensity: 0.35, // share of the density budget on primary/secondary/tertiary + sideDashFactor: 3.2, // wider spacing on side roads: fewer local cars // Time-based traffic profile. Values are multipliers around the // configured density. Times are local scene-clock hours. timeProfile: { @@ -441,6 +444,7 @@ window.CONFIG = { // timeProfile: { morningGain: 0.8, eveningGain: 1.0, nightReduction: 0.85 } } // speed: 2.0, density: 0.6, brightness: 1.0 + // density: 0.25, motorwayDensity: 1.0, sideDensity: 0.25, sideDashFactor: 4.0 }, // ------------------------------------------------------------------ diff --git a/vendor/clouds3d.js b/vendor/clouds3d.js index 9863925..2053cde 100644 --- a/vendor/clouds3d.js +++ b/vendor/clouds3d.js @@ -3453,8 +3453,11 @@ var CAR_M_DASH = carMetres(CAR_TUN.dashM || 620); // drive slower -> 0.017 slots/s (~68 km/h at 1116 m spacing). Their peak // density sits below the motorway peak and the gaussian falloff shapes it // further by distance to the nearest motorway. -var CAR_M_SPEED = 0.055 * CAR_SPEED, CAR_M_DENS = 0.85 * CAR_DENS; -var CAR_B_DASH = CAR_M_DASH * 2.4, CAR_B_SPEED = 0.017 * CAR_SPEED, CAR_B_DENS = 0.85 * CAR_DENS; +var CAR_MOTORWAY_DENSITY = (typeof CAR_TUN.motorwayDensity === 'number') ? Math.max(0, Math.min(1.5, CAR_TUN.motorwayDensity)) : 0.95; +var CAR_SIDE_DENSITY = (typeof CAR_TUN.sideDensity === 'number') ? Math.max(0, Math.min(1.5, CAR_TUN.sideDensity)) : 0.35; +var CAR_SIDE_DASH_FACTOR = (typeof CAR_TUN.sideDashFactor === 'number') ? Math.max(1.0, Math.min(8.0, CAR_TUN.sideDashFactor)) : 3.2; +var CAR_M_SPEED = 0.055 * CAR_SPEED, CAR_M_DENS = CAR_MOTORWAY_DENSITY * CAR_DENS; +var CAR_B_DASH = CAR_M_DASH * CAR_SIDE_DASH_FACTOR, CAR_B_SPEED = 0.017 * CAR_SPEED, CAR_B_DENS = CAR_SIDE_DENSITY * CAR_DENS; var carGeo = null; // { motorway: packedChains, secondary: packedChains } var carVboM = null, carCountM = 0; var carVboB = null, carCountB = 0; @@ -4711,7 +4714,7 @@ function buildCarGeometry(chainsM, chainsB, ts, cfg, places) { var mw = cfg.CAR_FLOOR + (1 - cfg.CAR_FLOOR) * Math.exp(-t * t); // Side roads are sparse unless they are near the A-net or a town. // Motorways/settlements get the bulk; remote secondary roads stay faint. - return Math.min(1, 0.20 + 0.55 * mw + 0.60 * st); + return Math.min(1, 0.12 + 0.72 * mw + 0.38 * st); } function build(polys, withField, dash) { var li, i, segs = 0, totalLen = 0;