not baad
This commit is contained in:
parent
4a8aff90b2
commit
6cef9a3abe
11 changed files with 1184 additions and 235 deletions
17
renderer.js
17
renderer.js
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue