mapspinner 0.1.44 → 0.1.45

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.44",
3
+ "version": "0.1.45",
4
4
  "description": "WebGL2 Earth-scale terrain rendering SDK for interactive globe applications",
5
5
  "main": "src/index.js",
6
6
  "exports": {
package/src/gl-render.js CHANGED
@@ -421,7 +421,7 @@ export async function initMapspinnerRender(gl, opts = {}) {
421
421
  gl.uniform1f(loc('vtxDetail'), g('vtxDetail', 1.0)); // DECISIVE: vtxDisplace strength (early-return on 0)
422
422
  gl.uniform1f(loc('canyonDepthMul'), g('canyonDepth', 1.0));
423
423
  gl.uniform1f(loc('uVsCheap'), (typeof window!=='undefined' && window.__vsCheap) ? 1.0 : 0.0); // VS carve-cost profiling A/B
424
- gl.uniform1f(loc('uBeachShelfM'), g('beachShelf', 2400.0)); // land coastal shelf (geometry); probe MUST match render
424
+ gl.uniform1f(loc('uBeachShelfM'), g('beachShelf', 12000.0)); // land coastal shelf (geometry); probe MUST match render
425
425
  gl.uniform1f(loc('cliffAmt'), g('cliffAmt', 1.0));
426
426
  gl.uniform1i(loc('uFloatLinearOK'), _halfFloatLinearOK ? 1 : 0);
427
427
  // FXC unroll-defeat (2026-06-12 AMD d3d11 fix): runtime octave bound for broadShapeM; the shader
@@ -960,7 +960,7 @@ export async function initMapspinnerRender(gl, opts = {}) {
960
960
  const _g = (n,d)=> (typeof window!=='undefined' && window['__'+n]!=null) ? +window['__'+n] : d;
961
961
  gl.uniform1f(U('canyonDepthMul'), _g('canyonDepth', 1.0));
962
962
  gl.uniform1f(U('uVsCheap'), (typeof window!=='undefined' && window.__vsCheap) ? 1.0 : 0.0); // VS carve-cost profiling A/B
963
- gl.uniform1f(U('uBeachShelfM'), _g('beachShelf', 2400.0)); // land coastal shelf (geometry): h<S eased h*h/S = wide beach
963
+ gl.uniform1f(U('uBeachShelfM'), _g('beachShelf', 12000.0)); // land coastal shelf (geometry): h<S eased h*h/S = wide beach
964
964
  gl.uniform1f(U('uHiFreqCut'), _g('hiFreqCut', 0.25)); // 0.5->0.25 (2026-06-10 'blotchy' -- see setComposeHeightUniforms)
965
965
  gl.uniform1f(U('uVertexAO'), _g('vertexAO', 1.0)); // per-vertex shading/AO strength (DEFECT 2, 2026-06-06)
966
966
  gl.uniform1f(U('cliffAmt'), _g('cliffAmt', 1.0));
@@ -1039,7 +1039,7 @@ export async function initMapspinnerRender(gl, opts = {}) {
1039
1039
  gl.uniform1f(U('oceanAmp'), (oc.oceanAmplitude != null) ? oc.oceanAmplitude : 1.0);
1040
1040
  gl.uniform1f(U('oceanChoppy'), (oc.oceanChoppiness != null) ? oc.oceanChoppiness : 0.5);
1041
1041
  gl.uniform1f(U('oceanFoam'), (oc.oceanFoam != null) ? oc.oceanFoam : 0.5);
1042
- gl.uniform1f(U('uBeachTopM'), _g('beachTop', 140.0)); // beach ceiling: grass stops, sand to the waterline + under it. 30->90 (user 2026-06-14: 3x beach width)
1042
+ gl.uniform1f(U('uBeachTopM'), _g('beachTop', 420.0)); // beach ceiling: grass stops, sand to the waterline + under it. 30->90 (user 2026-06-14: 3x beach width)
1043
1043
 
1044
1044
  // SINGLE INSTANCED DRAW: the deform params that were per-quad uniforms (ox,oy,l,level + face)
1045
1045
  // are now PER-INSTANCE attributes. Build one interleaved instance buffer [ox,oy,l,level,face]
@@ -623,7 +623,14 @@ highp float composeHeight(vec3 dir0, highp vec2 faceLocal, float tileM){ // W7
623
623
  // SLOPE down to the abyssal plain (which keeps its raw depth). Monotone remap of h, pure fn of
624
624
  // the field -> seam-safe, LOD-invariant, and the collision probe shares it by construction.
625
625
  if (h < 0.0) {
626
- highp float d = -h;
626
+ // C1 WATERLINE (user 2026-06-14 'geometry crease + shading/rock hard line where land meets beach'):
627
+ // the land shelf is FLAT at the waterline (slope 0) but the seabed used slope 0.24 from h=0 -> a
628
+ // slope discontinuity = a crease (+ the shading brightness line + rock where steep) right at the
629
+ // shore. Ease the shallow seabed with the SAME flat-at-waterline shelf curve (mirror of the land
630
+ // side) before the 0.24/1.19 bathymetry, so BOTH sides meet the waterline with slope 0 = no crease.
631
+ highp float bShelfS = uBeachShelfM > 1.0 ? uBeachShelfM : 600.0;
632
+ highp float d0 = -h;
633
+ highp float d = (d0 < bShelfS) ? (d0 * d0 / bShelfS) * (2.0 - d0 / bShelfS) : d0;
627
634
  h = -(min(d, 500.0) * 0.24 + max(d - 500.0, 0.0) * 1.19);
628
635
  h = max(h, -11000.0); // cap depth at Mariana Trench (~11km)
629
636
  } else {
@@ -852,7 +859,9 @@ void main() {
852
859
  // shelf/slope bathymetry remap + underwater displacement -- MUST mirror composeHeight exactly
853
860
  // (this is the FS-material running value; composeHeight is the geometry/probe height).
854
861
  if (vH < 0.0) {
855
- highp float dSea = -vH;
862
+ highp float bShelfS = uBeachShelfM > 1.0 ? uBeachShelfM : 600.0; // C1 waterline -- mirror composeHeight exactly
863
+ highp float dSea0 = -vH;
864
+ highp float dSea = (dSea0 < bShelfS) ? (dSea0 * dSea0 / bShelfS) * (2.0 - dSea0 / bShelfS) : dSea0;
856
865
  vH = -(min(dSea, 500.0) * 0.24 + max(dSea - 500.0, 0.0) * 1.19);
857
866
  vH = max(vH, -11000.0); // cap depth at Mariana Trench (~11km)
858
867
  } else {