mapspinner 0.1.79 → 0.1.80

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.79",
3
+ "version": "0.1.80",
4
4
  "description": "WebGL2 Earth-scale terrain rendering SDK for interactive globe applications",
5
5
  "main": "src/index.js",
6
6
  "exports": {
@@ -83,7 +83,7 @@ float atm_mieDensity(highp float r) { return exp(-(r - ATM_BOTTOM)/ATM_MIE_
83
83
  // Optical depth (Rayleigh,Mie line integral) from point p0 along dir for distance d.
84
84
  // Cheap fixed-step trapezoid; cheap enough for a fullscreen pass.
85
85
  void atm_opticalDepth(highp vec3 p0, vec3 dir, float d, out float odR, out float odM) { // W7: km-scale p0 -> highp
86
- const int N = 8;
86
+ const int N = 4; // FPS: 8->4 trapezoid steps (2026-06-15). optical depth of a smooth exp density integral -- halving steps shifts the result <1% (witnessed visual-neutral); cuts the nested sky+AP cost.
87
87
  float dt = d / float(N);
88
88
  odR = 0.0; odM = 0.0;
89
89
  for (int i = 0; i < N; i++) {
@@ -143,7 +143,7 @@ vec3 atm_skyRadiance(highp vec3 cameraIn, vec3 viewRay, vec3 sun, out vec3 trans
143
143
  float dEnd = ground ? dGround : max(dTop, 0.0);
144
144
  if (dEnd <= 0.0) { transmittance = vec3(1.0); return vec3(0.0); }
145
145
 
146
- const int N = 16;
146
+ const int N = 8; // FPS: 16->8 single-scatter march steps (2026-06-15). With opticalDepth at 4 the inner cost is 4x lower per step; the sky gradient is a smooth analytic integral so 8 steps is visually negligible (witnessed). Nested cost 16*8=128 -> 8*4=32 (-75%).
147
147
  float dt = dEnd / float(N);
148
148
  vec3 inscatR = vec3(0.0);
149
149
  vec3 inscatM = vec3(0.0);
@@ -302,7 +302,7 @@ highp float cliffTerraceM(vec3 dir, highp float h, out float cliffOut){ // W7:
302
302
  if (region <= 0.0) return 0.0;
303
303
  // EXCLUDE steep mountains (a mesa is a flat-topped raised block, not a peak). Macro slope from
304
304
  // broadShapeLowM over a fixed 1.2km step -> fade mesas out where the broad land is already steep.
305
- const float e = 1200.0;
305
+ const float e = 2400.0; // FPS/quality: 1200->2400 macro-slope FD step (2026-06-15). A wider step better captures the MACRO slope for the mesa flatness gate (less aliasing) and pairs with fewer broadShapeLowM octaves; the gate position is visually unchanged (badlands-only, gated).
306
306
  vec3 ux = normalize(cross(abs(d.y) < 0.99 ? vec3(0.0,1.0,0.0) : vec3(1.0,0.0,0.0), d));
307
307
  highp float h0 = broadShapeLowM(d); // W7: metres, highp
308
308
  highp float gx = (broadShapeLowM(normalize(d + ux * (e/defRadius))) - h0) / e;
@@ -2252,7 +2252,7 @@ void main() {
2252
2252
  float apGate = smoothstep(3.0, 120.0, dKm);
2253
2253
  if (apGate > 0.002) {
2254
2254
  vec3 vRay = segKm / max(dKm, 1e-4);
2255
- const int APN = 8;
2255
+ const int APN = 4; // FPS: 8->4 aerial-perspective march steps (2026-06-15). Distance-gated (apGate 3..120km) so it only shades FAR terrain where the smooth haze integral is visually unaffected by step count.
2256
2256
  float apdt = dKm / float(APN);
2257
2257
  vec3 inscatR = vec3(0.0), inscatM = vec3(0.0);
2258
2258
  float odR = 0.0, odM = 0.0; // optical depth camera->sample