mapspinner 0.1.73 → 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 +5 -19
package/package.json
CHANGED
package/src/shaders/terrain.glsl
CHANGED
|
@@ -1921,7 +1921,7 @@ void main() {
|
|
|
1921
1921
|
// 3 normal octaves (user 2026-06-14 'add an even lower freq octave, displacement/normals only,
|
|
1922
1922
|
// 4x less frequent'): wt4 high (detail) + wt low (2.4km) + wt*0.25 VERY-low (9.6km) -- the very-
|
|
1923
1923
|
// low one breaks the far repetition even more. Normals/displacement only (no albedo).
|
|
1924
|
-
vec3 nA = surfTriNrm(uSurfNrm, wt4, tw, lA, n) *
|
|
1924
|
+
vec3 nA = surfTriNrm(uSurfNrm, wt4, tw, lA, n) * 2.0 + surfTriNrm(uSurfNrm, wt, tw, lA, n) * 0.9 + surfTriNrm(uSurfNrm, wt * 0.25, tw, lA, n) * 1.1; // REBALANCED (user 2026-06-14 'higher octaves appear gone'): very-low 2.4 swamped the detail -> high (wt4) UP to 2.0 (dominant detail), very-low DOWN to 1.1 (still visible broad) (user 2026-06-14 'dont really see the lower freq octave yet'): at a 9.6km period its slope is gentle, so it needs more weight to read as broad undulation
|
|
1925
1925
|
float dispA = albA.a;
|
|
1926
1926
|
// NO BIOME COLOR INHERITANCE (user 2026-06-14 'take away all biome color inheritance, it will
|
|
1927
1927
|
// speed it up' -- and fixes 'sand near grass tinted green'): each layer wears its OWN material
|
|
@@ -1933,7 +1933,7 @@ void main() {
|
|
|
1933
1933
|
if (wB > 0.02) { // second layer only where a real transition exists
|
|
1934
1934
|
vec4 albB = surfTriTap(uSurfAlb, wt4, tw, lB);
|
|
1935
1935
|
vec3 cB = vec3(dot(albB.rgb, LUMA));
|
|
1936
|
-
vec3 nB = surfTriNrm(uSurfNrm, wt4, tw, lB, n) *
|
|
1936
|
+
vec3 nB = surfTriNrm(uSurfNrm, wt4, tw, lB, n) * 2.0 + surfTriNrm(uSurfNrm, wt, tw, lB, n) * 0.9 + surfTriNrm(uSurfNrm, wt * 0.25, tw, lB, n) * 1.1; // REBALANCED (match nA)
|
|
1937
1937
|
float dispB = albB.a;
|
|
1938
1938
|
// HEIGHT-BLEND POKE-THROUGH (user 'each texture's higher areas should poke through the other,
|
|
1939
1939
|
// offset by the ramp'): height = displacement + a weight-ramp offset (gate positions the
|
|
@@ -2022,23 +2022,9 @@ void main() {
|
|
|
2022
2022
|
// longer the base, so NO biome color bleeds into the ground (user 'take away all biome inheritance').
|
|
2023
2023
|
albedo = clamp(mix(texMatColor, detail, k), 0.0, 1.0);
|
|
2024
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')
|
|
2025
|
-
//
|
|
2026
|
-
//
|
|
2027
|
-
//
|
|
2028
|
-
// Faded by k so the far field (where the texture mips out) is untouched.
|
|
2029
|
-
// STRONGER fake-midday AO (user 2026-06-14 'should be more intense, we dont really see it'):
|
|
2030
|
-
// darken the recesses harder (0.82->0.5 = up to 50%) over a wider low-displacement range so the
|
|
2031
|
-
// crevices/pits read clearly. Still faded by k so the mipped far field is untouched.
|
|
2032
|
-
float texAO = mix(1.0, mix(0.5, 1.0, smoothstep(0.05, 0.6, texAlb.a)), k);
|
|
2033
|
-
albedo *= texAO;
|
|
2034
|
-
// ELEVATION AO (user 2026-06-14 'similar AO on elevation'): the macro analog of the displacement
|
|
2035
|
-
// AO -- darken CONCAVE relief (valley floors, gorges, recesses) using the screen-space CURVATURE
|
|
2036
|
-
// of the lit normal. curv = d(normal).d(position) / |d(position)|^2 -> +ve where the surface
|
|
2037
|
-
// curves into a pit (concave), -ve on ridges. Cheap (fwidth of the already-computed vNrm/vWorld).
|
|
2038
|
-
highp vec3 ddxP = dFdx(vWorld), ddyP = dFdy(vWorld);
|
|
2039
|
-
float curv = (dot(dFdx(vNrm), ddxP) + dot(dFdy(vNrm), ddyP)) / max(dot(ddxP, ddxP) + dot(ddyP, ddyP), 0.01);
|
|
2040
|
-
float elevAO = 1.0 - clamp(curv * 420.0, 0.0, 0.65); // concave -> darken up to 65% (user 2026-06-14 x2 'elevation based ao not visible yet': macro relief curvature is small-magnitude, needs big gain 45->420)
|
|
2041
|
-
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.)
|
|
2042
2028
|
// displacement-normal relief: WORLD-SPACE UDN perturbation from surfTriNrm (each projection
|
|
2043
2029
|
// plane's tangent axes, not the radial frame). Amplitude capped low (scramble lesson d262b5e);
|
|
2044
2030
|
// applied AFTER the uReliefShade exaggeration below so the exaggeration never amplifies it.
|