This commit is contained in:
33333-33333 2026-05-29 22:00:42 +09:00
commit 6cef9a3abe
11 changed files with 1184 additions and 235 deletions

View file

@ -433,14 +433,25 @@ function terrainColorContinuous(map, fx, fy, mode) {
]);
}
const coastBlend = clamp((waterCoverage - 0.36) / 0.28);
color = coastBlend > 0 ? mixRgb(landColor, waterColor, coastBlend) : landColor;
const centerWater = Boolean(map.sea?.[i]);
if (centerWater) {
// Keep the visible coastline and the filled water side derived from the same
// sea mask. Only a very narrow anti-aliased edge borrows land color; broad
// land/sea averaging made coast strokes disagree with the underlying fill.
const edgeLand = clamp((0.58 - waterCoverage) / 0.26);
color = edgeLand > 0 ? mixRgb(waterColor, landColor, edgeLand * 0.42) : waterColor;
} else {
const shore = clamp((waterCoverage - 0.10) / 0.42);
const shoreColor = [224, 229, 213];
color = shore > 0 ? mixRgb(landColor, shoreColor, shore * 0.34) : landColor;
}
return blendOutside(color, isInside);
}
function terrainShadeContinuous(map, fx, fy) {
const i = sampleCellIndex(map, fx, fy);
const waterCoverage = seaCoverageSample(map, fx, fy);
if (waterCoverage >= 0.50) return waterVisualShade(map, fx, fy);
if (map.sea?.[i] || waterCoverage >= 0.82) return waterVisualShade(map, fx, fy);
const step = 0.50;
const eC = fieldSample(map, map.elevation, fx, fy);