mapspinner 0.1.63 → 0.1.64

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.63",
3
+ "version": "0.1.64",
4
4
  "description": "WebGL2 Earth-scale terrain rendering SDK for interactive globe applications",
5
5
  "main": "src/index.js",
6
6
  "exports": {
@@ -1410,7 +1410,13 @@ vec3 terrainAlbedoClimate(float h, float slope, float rockSlope, float temp, flo
1410
1410
  // vegetation dropped out a beat BEFORE the rock arrived -> a light bare-grass ring. Key veg off the
1411
1411
  // SAME rockSlope so vegetation fades EXACTLY as rock fades in -> grass stays dark right up to the
1412
1412
  // rock with no light gap, and veg is 0 wherever rock is full (no biome-green bleeding onto rock).
1413
- float veg = (1.0 - smoothstep(bandEdgesHi.x, bandEdgesHi.y, h)) * (1.0 - smoothstep(slopeRock.x, slopeRock.y, rockSlope));
1413
+ // BREAK THE VEG RING (user 2026-06-14 'hard separation between dark and light grass, a hard circle
1414
+ // around mountains'): veg dropped at a clean elevation+slope threshold -> a dark->light grass ring
1415
+ // circling every peak. Warp BOTH thresholds with ONE cheap noise (~2-3km) so the dark/light grass
1416
+ // boundary fingers irregularly instead of a contour ring. (Reuses the hoisted nwp; one snoise3.)
1417
+ float vegN = snoise3(nwp * 2400.0);
1418
+ float veg = (1.0 - smoothstep(bandEdgesHi.x + vegN * 850.0, bandEdgesHi.y + vegN * 850.0, h))
1419
+ * (1.0 - smoothstep(slopeRock.x, slopeRock.y + vegN * 0.13, rockSlope));
1414
1420
  // ELEVATION + LATITUDE BIOME BIAS (user 2026-06-02: 'the hypsometric ramp should influence biome
1415
1421
  // distribution, pulling biomes out of their anchor areas a bit for better distribution'). On top
1416
1422
  // of the anchor climate temp/humid, bias the EFFECTIVE temperature DOWN with elevation (lapse rate
@@ -1886,14 +1892,22 @@ void main() {
1886
1892
  // off (= the old low-freq look) -- no second octave, no detailFade. Albedo = luma STRUCTURE (macro
1887
1893
  // color carries chroma); normal strong (x1.4); displacement drives the height-blend (mips soften
1888
1894
  // the displacement, and thus the blend, at distance automatically).
1895
+ // LOW-OCTAVE NORMAL BLEND (user 2026-06-14 'blend the higher octave with the lower octave's
1896
+ // NORMALS for a less repetitive faraway look -- dont fade it, draw both'): the high octave (wt4)
1897
+ // tiles tightly so it repeats visibly far off; ADD the low octave (wt, 2.4km, less repetitive)
1898
+ // NORMAL on top -- ALWAYS, no fade -- to break that repetition. Albedo stays high-octave only.
1889
1899
  highp vec3 wt4 = wt * 4.0;
1890
1900
  vec4 albA = surfTriTap(uSurfAlb, wt4, tw, lA);
1891
- vec3 cA = vec3(dot(albA.rgb, LUMA)); vec3 nA = surfTriNrm(uSurfNrm, wt4, tw, lA, n) * 1.4; float dispA = albA.a;
1901
+ vec3 cA = vec3(dot(albA.rgb, LUMA));
1902
+ vec3 nA = surfTriNrm(uSurfNrm, wt4, tw, lA, n) * 1.4 + surfTriNrm(uSurfNrm, wt, tw, lA, n) * 0.8; // high + low-octave normal
1903
+ float dispA = albA.a;
1892
1904
  vec4 texAlb = vec4(cA, dispA); vec3 texNrm = nA;
1893
1905
  float splatRock = (abs(lA - 1.0) < 0.5) ? 1.0 : 0.0; // height-blend rock fraction (layer 1 = rock)
1894
1906
  if (wB > 0.02) { // second layer only where a real transition exists
1895
1907
  vec4 albB = surfTriTap(uSurfAlb, wt4, tw, lB);
1896
- vec3 cB = vec3(dot(albB.rgb, LUMA)); vec3 nB = surfTriNrm(uSurfNrm, wt4, tw, lB, n) * 1.4; float dispB = albB.a;
1908
+ vec3 cB = vec3(dot(albB.rgb, LUMA));
1909
+ vec3 nB = surfTriNrm(uSurfNrm, wt4, tw, lB, n) * 1.4 + surfTriNrm(uSurfNrm, wt, tw, lB, n) * 0.8; // high + low-octave normal
1910
+ float dispB = albB.a;
1897
1911
  // HEIGHT-BLEND POKE-THROUGH (user 'each texture's higher areas should poke through the other,
1898
1912
  // offset by the ramp'): height = displacement + a weight-ramp offset (gate positions the
1899
1913
  // boundary); higher wins over a soft width so the loser's high bumps poke through = fingers,