mapspinner 0.1.37 → 0.1.38

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.37",
3
+ "version": "0.1.38",
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
@@ -286,6 +286,7 @@ export async function initMapspinnerRender(gl, opts = {}) {
286
286
  gl.uniform1f(loc('uDetailOverlay'), g('detailOverlay', 6.0)); // perlin-everywhere ELEVATION term in composeHeight -- probe must match the VS or collision diverges
287
287
  gl.uniform1f(loc('vtxDetail'), g('vtxDetail', 1.0)); // DECISIVE: vtxDisplace strength (early-return on 0)
288
288
  gl.uniform1f(loc('canyonDepthMul'), g('canyonDepth', 1.0));
289
+ gl.uniform1f(loc('uVsCheap'), (typeof window!=='undefined' && window.__vsCheap) ? 1.0 : 0.0); // VS carve-cost profiling A/B
289
290
  gl.uniform1f(loc('uBeachShelfM'), g('beachShelf', 2400.0)); // land coastal shelf (geometry); probe MUST match render
290
291
  gl.uniform1f(loc('cliffAmt'), g('cliffAmt', 1.0));
291
292
  gl.uniform1i(loc('uFloatLinearOK'), _halfFloatLinearOK ? 1 : 0);
@@ -806,6 +807,7 @@ export async function initMapspinnerRender(gl, opts = {}) {
806
807
  // literals so the look is unchanged until the user dials a window global.
807
808
  const _g = (n,d)=> (typeof window!=='undefined' && window['__'+n]!=null) ? +window['__'+n] : d;
808
809
  gl.uniform1f(U('canyonDepthMul'), _g('canyonDepth', 1.0));
810
+ gl.uniform1f(U('uVsCheap'), (typeof window!=='undefined' && window.__vsCheap) ? 1.0 : 0.0); // VS carve-cost profiling A/B
809
811
  gl.uniform1f(U('uBeachShelfM'), _g('beachShelf', 2400.0)); // land coastal shelf (geometry): h<S eased h*h/S = wide beach
810
812
  gl.uniform1f(U('uHiFreqCut'), _g('hiFreqCut', 0.25)); // 0.5->0.25 (2026-06-10 'blotchy' -- see setComposeHeightUniforms)
811
813
  gl.uniform1f(U('uVertexAO'), _g('vertexAO', 1.0)); // per-vertex shading/AO strength (DEFECT 2, 2026-06-06)
@@ -198,6 +198,7 @@ float riverCarveM(vec3 dir, out float wet){
198
198
  float riverCarveM(vec3 dir){ float w; return riverCarveM(dir, w); }
199
199
  const float CANYON_INCISE_DEPTH = 1400.0; // metres at the gorge floor (user 2026-06-02: deepen+widen so canyons visibly sculpt the elevation; was 480m = invisible vs multi-km relief)
200
200
  uniform float canyonDepthMul; // LIVE canyon-depth lever (window.__canyonDepth; 1.0 default)
201
+ uniform float uVsCheap; // VS profiling: >0.5 skips all carves in composeHeight (window.__vsCheap; gpuTimer carve-cost A/B)
201
202
  // W5: uNrmGain deleted (only fed the removed VS slopeGain).
202
203
  uniform float uVertexAO; // per-vertex shading/AO strength lever (window.__vertexAO; 1.0 default)
203
204
  // SEPARATE WATER SURFACE (user 2026-06-11 'the ocean should be a separate surface'): the same
@@ -643,6 +644,10 @@ highp float composeHeight(vec3 dir0, highp vec2 faceLocal, float tileM){ // W7
643
644
  // Shore-gated (fades in over the first 250m of land) so the coastline and the flat water planes are
644
645
  // untouched and no noise islets pop offshore. The VS FD lit-normal picks it up automatically.
645
646
  h += detailFbm(dir0) * uDetailOverlay * 30.0 * step(0.0, h);
647
+ // VS-PROFILING GATE (2026-06-14): uVsCheap>0.5 returns BEFORE all the carves (valley/lake/river/
648
+ // canyon/cliff/dune) so gpuTimer can A/B the per-vertex CARVE cost (the doctrine's suspected
649
+ // dominant term). Transient profiling toggle (window.__vsCheap); 0 = full path (default).
650
+ if (uVsCheap > 0.5) return h;
646
651
  // FLAT-AREA VALLEY NETWORKS + LAKES (user 2026-06-13): incised valley systems in low-relief
647
652
  // plains. Replaces the old noise bumps with a ridge-field valley network for connected
648
653
  // linear depressions and lakes that fill the valley bottoms. Fades to zero by reliefMul ~0.5.