mapspinner 0.1.49 → 0.1.51

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mapspinner",
3
- "version": "0.1.49",
3
+ "version": "0.1.51",
4
4
  "description": "WebGL2 Earth-scale terrain rendering SDK for interactive globe applications",
5
5
  "main": "src/index.js",
6
6
  "exports": {
@@ -631,10 +631,14 @@ highp float composeHeight(vec3 dir0, highp vec2 faceLocal, float tileM){ // W7
631
631
  // whole ocean into 'almost-land everywhere', user 2026-06-14) with the flat-at-waterline curve so
632
632
  // both sides meet the waterline at slope 0 (no crease); beyond SEABED_EASE the true bathymetry
633
633
  // resumes so the ocean goes DEEP.
634
- const highp float SEABED_EASE = 300.0; // metres of depth flattened at the shore (decoupled from the land beach)
634
+ const highp float SEABED_EASE = 120.0; // metres of depth flattened at the shore (decoupled from the land beach)
635
635
  highp float d0 = -h;
636
636
  highp float d = (d0 < SEABED_EASE) ? (d0 * d0 / SEABED_EASE) * (2.0 - d0 / SEABED_EASE) : d0;
637
- h = -(min(d, 500.0) * 0.24 + max(d - 500.0, 0.0) * 1.19);
637
+ // STEEPER DROP-OFF (user 2026-06-14 'seabed flat/close to waterline; steeper + more relief'):
638
+ // narrow shelf 500->150m raw, steeper shelf 0.24->0.6, steeper continental slope 1.19->1.5 so the
639
+ // seabed plunges to deep water just offshore (less flat shallow shelf) and the deep bathymetry
640
+ // carries 1.5x the bShape relief = more dramatic underwater terrain to explore.
641
+ h = -(min(d, 150.0) * 0.6 + max(d - 150.0, 0.0) * 1.5);
638
642
  h = max(h, -11000.0); // cap depth at Mariana Trench (~11km)
639
643
  } else {
640
644
  // LAND COASTAL SHELF (user 2026-06-14: 'beaches not wide enough'): the underwater shelf above
@@ -652,7 +656,10 @@ highp float composeHeight(vec3 dir0, highp vec2 faceLocal, float tileM){ // W7
652
656
  }
653
657
  // displacement now continues UNDERWATER (the old land-only gate served the flat-clamped ocean,
654
658
  // gone since 026d530): the seabed carries the same micro-relief as land = realistic continuation.
655
- h += vDisp;
659
+ // SEABED RELIEF BOOST (user 2026-06-14 'more relief' to explore): amplify the micro-relief with DEPTH
660
+ // (1x at the shore -> 2.2x by 600m down) so the deep seabed is rugged/interesting, while shallow water
661
+ // stays calm so the boost never lifts the bed toward sea level (no 'almost-land').
662
+ h += vDisp * mix(1.0, 2.2, clamp((h + 50.0) / -550.0, 0.0, 1.0));
656
663
  // PERLIN-EVERYWHERE ELEVATION (user 2026-06-10 'it must also affect elevation'): the same detailFbm
657
664
  // the FS albedo overlay shows, as real relief (~30m per lever unit -> ~180m at the user-tuned 6).
658
665
  // Shore-gated (fades in over the first 250m of land) so the coastline and the flat water planes are
@@ -862,17 +869,17 @@ void main() {
862
869
  // shelf/slope bathymetry remap + underwater displacement -- MUST mirror composeHeight exactly
863
870
  // (this is the FS-material running value; composeHeight is the geometry/probe height).
864
871
  if (vH < 0.0) {
865
- const highp float SEABED_EASE = 300.0; // mirror composeHeight: narrow waterline ease, deep ocean beyond
872
+ const highp float SEABED_EASE = 120.0; // mirror composeHeight: narrow waterline ease, deep ocean beyond
866
873
  highp float dSea0 = -vH;
867
874
  highp float dSea = (dSea0 < SEABED_EASE) ? (dSea0 * dSea0 / SEABED_EASE) * (2.0 - dSea0 / SEABED_EASE) : dSea0;
868
- vH = -(min(dSea, 500.0) * 0.24 + max(dSea - 500.0, 0.0) * 1.19);
875
+ vH = -(min(dSea, 150.0) * 0.6 + max(dSea - 150.0, 0.0) * 1.5); // steeper drop-off (mirror composeHeight)
869
876
  vH = max(vH, -11000.0); // cap depth at Mariana Trench (~11km)
870
877
  } else {
871
878
  highp float bShelf = uBeachShelfM > 1.0 ? uBeachShelfM : 600.0; // LAND COASTAL SHELF -- mirror composeHeight exactly (wide beach, user 2026-06-14); guard stale/unset uniform
872
879
  if (vH < bShelf) vH = (vH * vH / bShelf) * (2.0 - vH / bShelf); // C1-continuous (mirror composeHeight) -- removes the beach-top slope kink / hard shading line
873
880
 
874
881
  }
875
- vH += vDisp;
882
+ vH += vDisp * mix(1.0, 2.2, clamp((vH + 50.0) / -550.0, 0.0, 1.0)); // seabed relief boost (mirror composeHeight)
876
883
  vH += detailFbm(dir0) * uDetailOverlay * 30.0 * step(0.0, vH);
877
884
  // FLAT-AREA VALLEY NETWORKS + LAKES (user 2026-06-13): incised valley systems in low-relief
878
885
  // plains -- must mirror composeHeight for FS material consistency.
@@ -1384,7 +1391,13 @@ vec3 terrainAlbedoClimate(float h, float slope, float rockSlope, float temp, flo
1384
1391
  return mix(c, vec3(0.82, 0.88, 0.94), seaIce * 0.9);
1385
1392
  }
1386
1393
  // biome weight: full on gentle lowland, fading where rock/snow/steep takes over.
1387
- float veg = (1.0 - smoothstep(bandEdgesHi.x, bandEdgesHi.y, h)) * (1.0 - smoothstep(slopeRock.x, slopeRock.y, slope));
1394
+ // VEG SLOPE GATE (user 2026-06-14 'hard line of light grass around rocks'): the gate faded veg over
1395
+ // `slope` (the macro, gentler) while the ROCK blend keys off `rockSlope` (the raw geometric normal,
1396
+ // steeper). The two thresholds didn't coincide, so on the approach to a rock the dark biome-green
1397
+ // vegetation dropped out a beat BEFORE the rock arrived -> a light bare-grass ring. Key veg off the
1398
+ // SAME rockSlope so vegetation fades EXACTLY as rock fades in -> grass stays dark right up to the
1399
+ // rock with no light gap, and veg is 0 wherever rock is full (no biome-green bleeding onto rock).
1400
+ float veg = (1.0 - smoothstep(bandEdgesHi.x, bandEdgesHi.y, h)) * (1.0 - smoothstep(slopeRock.x, slopeRock.y, rockSlope));
1388
1401
  // ELEVATION + LATITUDE BIOME BIAS (user 2026-06-02: 'the hypsometric ramp should influence biome
1389
1402
  // distribution, pulling biomes out of their anchor areas a bit for better distribution'). On top
1390
1403
  // of the anchor climate temp/humid, bias the EFFECTIVE temperature DOWN with elevation (lapse rate