mapspinner 0.1.57 → 0.1.59

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.57",
3
+ "version": "0.1.59",
4
4
  "description": "WebGL2 Earth-scale terrain rendering SDK for interactive globe applications",
5
5
  "main": "src/index.js",
6
6
  "exports": {
@@ -1790,14 +1790,13 @@ void main() {
1790
1790
  // BEACH sand gate tied to uBeachTopM (so the sand TEXTURE scales with the wide beach, not a
1791
1791
  // hardcoded 80m strip) + the shared warp on its LAND edge so the beach->grass line is irregular.
1792
1792
  // FINE BREAK on the grass->sand line (user 2026-06-14 'still a hard straight grass-sand line up
1793
- // close ... it must gain detail'): warpN breaks it at the km scale; add a high-freq (~80-200m)
1794
- // octave so the line stays irregular/fingered when you walk right up to it instead of going
1795
- // straight. Faded in WITH the close-up detail (detailFade-like, via pxWorld) so it never speckles
1796
- // at distance where the macro band is smooth.
1797
- float closeBreak = (1.0 - smoothstep(2.0, 40.0, pxWorld));
1798
- float beachFine = (snoise3(bwDir * 42000.0) + 0.5 * snoise3(bwDir * 95000.0)) * uBeachTopM * 0.45 * closeBreak;
1799
- float beachW = warpN * uBeachTopM * 0.30 + beachFine; // warp amplitude scales with the beach band height
1800
- float beach = (1.0 - smoothstep(uBeachTopM * 0.12 + beachW, uBeachTopM + beachW, vH))
1793
+ // close ... it must gain detail'): warpN positions the band irregularly at the km scale; the
1794
+ // FINE break of the grass->sand line is now the texture DISPLACEMENT height-blend (bSharp below),
1795
+ // NOT a fractal (user 2026-06-14: 'looking like a fractal, use the materials displacement'). Widen
1796
+ // the gate transition band so sand+grass overlap over a broad elevation span -> bSharp picks the
1797
+ // local winner by texture relief -> fingered shoreline that follows the actual texture bumps.
1798
+ float beachW = warpN * uBeachTopM * 0.30; // warp amplitude scales with the beach band height
1799
+ float beach = (1.0 - smoothstep(uBeachTopM * 0.10 + beachW, uBeachTopM * 1.15 + beachW, vH))
1801
1800
  * (1.0 - smoothstep(0.15, 0.42, slope));
1802
1801
  // SAND BLEED (2026-06-13): patchy sand spills above the main beach line, modulated by VS
1803
1802
  // warp noise so the edge reads as wind-blown pockets, not a strict elevation cut. At peak it
@@ -1892,7 +1891,21 @@ void main() {
1892
1891
  // SOFTENED (2026-06-13): transition sharpening reduced 3->1 so grass/rock/sand/snow
1893
1892
  // boundaries hold a natural blend band instead of a hard die-cut line. The 1.0 slope
1894
1893
  // still prefers the dominant layer but leaves a visible transition zone.
1895
- float bSharp = clamp((bAB * 2.0 - 1.0) * 1.0 + (albA.a - albB.a) * 0.3 + 0.5, 0.0, 1.0);
1894
+ // DISPLACEMENT-DRIVEN GRADIENT for ALL material pairs (user 2026-06-14 'all textures use the
1895
+ // displacement to mix the gradient'): height-blend the top-2 layers by their displacement so
1896
+ // every boundary (grass/rock, grass/sand, rock/snow...) follows the texture RELIEF = irregular,
1897
+ // not a straight gate line. The displacement weight ramps UP close (0.3 -> 1.3 by the deck)
1898
+ // where the hard lines show, and stays low far off so the 2.4km photo's bowl features never
1899
+ // flip whole patches to rock (the documented bowl-blob lesson -- that was a DISTANT artifact).
1900
+ // UNIVERSAL displacement-driven blend (user 2026-06-14 'this must be ALL texture blends -- the
1901
+ // rock slope and the biome divisions for height and area, wherever we blend textures'): this
1902
+ // bSharp is the ONE blend between the top-2 splat layers, so it already covers every material
1903
+ // pair. WEAKEN the weight term (1.0->0.45) and STRENGTHEN the displacement (-> up to 1.6 close)
1904
+ // so the texture RELIEF -- not the gate weight -- decides the local winner over a WIDE weight
1905
+ // band: every boundary (slope-rock, height-snow, climate/area-biome, beach) fingers along the
1906
+ // texture bumps. Displacement ramps DOWN far off so the 2.4km bowls never flip distant patches.
1907
+ float dispW = mix(0.45, 1.6, 1.0 - smoothstep(3.0, 80.0, pxWorld));
1908
+ float bSharp = clamp((bAB * 2.0 - 1.0) * 0.45 + (albA.a - albB.a) * dispW + 0.5, 0.0, 1.0);
1896
1909
  texAlb = mix(albB, albA, bSharp);
1897
1910
  texNrm = mix(nrmB, nrmA, bSharp);
1898
1911
  }