mapspinner 0.1.74 → 0.1.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/shaders/terrain.glsl +3 -40
package/package.json
CHANGED
package/src/shaders/terrain.glsl
CHANGED
|
@@ -760,7 +760,6 @@ out float vLakeWet; // lake open-water mask (carve basin)
|
|
|
760
760
|
out float vRiverWet; // river thalweg wet line
|
|
761
761
|
out float vWaterDepth; // metres the flat inland-water plane sits ABOVE the local terrain floor (>0 = submerged)
|
|
762
762
|
out float vCanyonDep; // canyon gorge depth [0,1]
|
|
763
|
-
out float vConcavity; // height-field Laplacian / step^2 (1/m, +ve = concave valley/pit) -- ELEVATION AO signal (free from the normal central-diff taps)
|
|
764
763
|
out float vCliffFace; // cliff/escarpment riser face [0,1] (1 = steep terrace face)
|
|
765
764
|
out float vDuneCrest; // dune crest [0,1]
|
|
766
765
|
out float vLevel; // quad LOD level (per-instance iOffset.w) for the patches debug view
|
|
@@ -1004,7 +1003,6 @@ void main() {
|
|
|
1004
1003
|
// sides of a seam share the same dir0/tangent frame -> consistent normals, no row artifact.
|
|
1005
1004
|
highp float hN0 = 0.0;
|
|
1006
1005
|
highp vec3 vN = dir0;
|
|
1007
|
-
highp float concavRaw = 0.0; // height Laplacian / step^2 (+ve = concave) -- set in the land branches, free from the normal taps
|
|
1008
1006
|
if (uIsWater < 0.5 && uThc > 0.5) {
|
|
1009
1007
|
// THC FAST PATH: height + symmetric central-diff normal from the baked pool. 5 bilinear texture
|
|
1010
1008
|
// taps replace 5 full composeHeight evals (the VS-bound cost). The 4 normal taps use the SAME
|
|
@@ -1060,23 +1058,6 @@ void main() {
|
|
|
1060
1058
|
vN = normalize(cross(wPU - wMU, wPV - wMV));
|
|
1061
1059
|
if (dot(vN, dir0) < 0.0) vN = -vN; // keep it outward (terrain has no overhangs)
|
|
1062
1060
|
}
|
|
1063
|
-
// ELEVATION-AO CONCAVITY at LARGE scale (user 2026-06-14 'AO is focused on features too small, must
|
|
1064
|
-
// AO the larger features'): the 300m normal-step Laplacian keyed on small/sharp relief (canyons). Take
|
|
1065
|
-
// the Laplacian of broadShapeLowM (the cheap 8-oct LARGE-SCALE shape, no small carves) over a WIDE ~2km
|
|
1066
|
-
// step instead, so the AO darkens broad valleys/basins. broadShapeLowM is the same field the mesa
|
|
1067
|
-
// slope gate uses at a 1.2km step -> a known-cheap large-feature probe. Land only (water needs none).
|
|
1068
|
-
if (uIsWater < 0.5) {
|
|
1069
|
-
const highp float ecM = 2000.0; // wide finite-diff step = large-feature scale
|
|
1070
|
-
highp vec3 ux = normalize(cross(abs(dir0.y) < 0.99 ? vec3(0.0,1.0,0.0) : vec3(1.0,0.0,0.0), dir0));
|
|
1071
|
-
highp vec3 uy = cross(dir0, ux);
|
|
1072
|
-
highp float h0c = broadShapeLowM(dir0);
|
|
1073
|
-
highp float hxp = broadShapeLowM(normalize(dir0 + ux * (ecM / defRadius)));
|
|
1074
|
-
highp float hxm = broadShapeLowM(normalize(dir0 - ux * (ecM / defRadius)));
|
|
1075
|
-
highp float hyp = broadShapeLowM(normalize(dir0 + uy * (ecM / defRadius)));
|
|
1076
|
-
highp float hym = broadShapeLowM(normalize(dir0 - uy * (ecM / defRadius)));
|
|
1077
|
-
concavRaw = (hxp + hxm + hyp + hym - 4.0 * h0c) / (ecM * ecM); // 1/m large-scale curvature, +ve = broad valley/basin
|
|
1078
|
-
}
|
|
1079
|
-
vConcavity = concavRaw;
|
|
1080
1061
|
highp float h = hN0;
|
|
1081
1062
|
// OCEAN TOP = A SEPARATE, ELEVATION-BASED SURFACE (user 2026-06-10: 'terrain should extend into
|
|
1082
1063
|
// the ocean, the ocean top separate and elevation based'). composeHeight keeps carrying the TRUE
|
|
@@ -1154,7 +1135,6 @@ in float vLakeWet; // carve masks computed in the VS, interpolated (no per-pi
|
|
|
1154
1135
|
in float vRiverWet;
|
|
1155
1136
|
in float vWaterDepth; // metres of submerged water (>0 = real open inland water at the flat plane)
|
|
1156
1137
|
in float vCanyonDep;
|
|
1157
|
-
in float vConcavity; // elevation-AO concavity (1/m, +ve = valley/pit)
|
|
1158
1138
|
in float vCliffFace;
|
|
1159
1139
|
in float vDuneCrest;
|
|
1160
1140
|
in float vLevel; // quad LOD level (patches view)
|
|
@@ -2042,26 +2022,9 @@ void main() {
|
|
|
2042
2022
|
// longer the base, so NO biome color bleeds into the ground (user 'take away all biome inheritance').
|
|
2043
2023
|
albedo = clamp(mix(texMatColor, detail, k), 0.0, 1.0);
|
|
2044
2024
|
albedo = mix(albedo, biomeC, 0.68); // climate/biome tint back on top of the material color (deserts tanner, forests greener) -- UP 0.16->0.68 (user 2026-06-14 x2 'tinting-according-to-landscape can be intensified, not really visible yet')
|
|
2045
|
-
//
|
|
2046
|
-
//
|
|
2047
|
-
//
|
|
2048
|
-
// Faded by k so the far field (where the texture mips out) is untouched.
|
|
2049
|
-
// STRONGER fake-midday AO (user 2026-06-14 'should be more intense, we dont really see it'):
|
|
2050
|
-
// darken the recesses harder (0.82->0.5 = up to 50%) over a wider low-displacement range so the
|
|
2051
|
-
// crevices/pits read clearly. Still faded by k so the mipped far field is untouched.
|
|
2052
|
-
float texAO = mix(1.0, mix(0.5, 1.0, smoothstep(0.05, 0.6, texAlb.a)), k);
|
|
2053
|
-
albedo *= texAO;
|
|
2054
|
-
// ELEVATION AO (user 2026-06-14 x3 'similar AO on elevation / still not visible'): the screen-space
|
|
2055
|
-
// curvature of vNrm was ~0 (vNrm is a per-vertex analytic normal, linearly interpolated -> its
|
|
2056
|
-
// fwidth is tiny on the coarse grid = invisible). Replaced with vConcavity = the height-field
|
|
2057
|
-
// LAPLACIAN computed FREE from the VS normal central-diff taps (1/m, +ve = concave valley/pit),
|
|
2058
|
-
// a real object-space relief signal that survives interpolation. Darken concavities up to 65%.
|
|
2059
|
-
// VERY GRADUAL response (user 2026-06-14 'ao works but not gradiated, must be very gradual'): the
|
|
2060
|
-
// hard clamp(.,0.6) flat-topped every valley past a threshold = a visible AO edge + no gradation
|
|
2061
|
-
// between medium and deep concavity. Exponential SOFT saturation instead -- monotonic, smooth
|
|
2062
|
-
// onset AND smooth approach to the 0.6 floor, so darkening grades continuously with depth, no edge.
|
|
2063
|
-
float elevAO = 1.0 - 0.6 * (1.0 - exp(-max(vConcavity, 0.0) * 2500.0)); // concavRaw ~=1/Rc of the LARGE shape (~3-7e-4 for km-scale basins): broad valley eases in, asymptotes to -60%
|
|
2064
|
-
albedo *= elevAO;
|
|
2025
|
+
// (AO REMOVED 2026-06-14 user 'fps dropped a lot, no visual improvement, get rid of all the ao
|
|
2026
|
+
// for texture and landscape': the displacement texAO + the broadShapeLowM-Laplacian elevation AO
|
|
2027
|
+
// are both gone; the latter's 5 wide VS taps were the FPS cost. vConcavity varying also removed.)
|
|
2065
2028
|
// displacement-normal relief: WORLD-SPACE UDN perturbation from surfTriNrm (each projection
|
|
2066
2029
|
// plane's tangent axes, not the radial frame). Amplitude capped low (scramble lesson d262b5e);
|
|
2067
2030
|
// applied AFTER the uReliefShade exaggeration below so the exaggeration never amplifies it.
|