mapspinner 0.1.13 → 0.1.15

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.13",
3
+ "version": "0.1.15",
4
4
  "description": "WebGL2 Earth-scale terrain rendering SDK for interactive globe applications",
5
5
  "main": "src/index.js",
6
6
  "exports": {
@@ -497,7 +497,7 @@ export async function initMapspinnerPlanet(gl, opts = {}) {
497
497
  // ONLY to splitDist (NOT distF below): distF = sf*8.0 is the altitude-weighting term, and scaling sf
498
498
  // into BOTH compounds into ~2 levels at altitude (witnessed: base sf*2 gave mx 5->7 at 8000km). Keep
499
499
  // distF on the original sf so the push is a clean ONE step. maxLevel (16) is untouched -- no new LOD.
500
- const LOD_STEP = 4.0; // push ALL LODs out ANOTHER step (user 2026-06-09 #2, after the 1.0->2.0 first step):
500
+ const LOD_STEP = 3.0; // push ALL LODs 0.75 step (reduced from 4.0 to target ~600 quads at all alts):
501
501
  qt.computeSplitDist(sf * LOD_STEP, gl.drawingBufferHeight || 480, fovy);
502
502
  // DETAIL-FARTHER (user 2026-06-01h: each LOD pop should happen ~3x farther out -- 6km detail at
503
503
  // 24km, etc.). A quad subdivides when camAlt < l * splitDist * distFactor, so tripling distFactor
package/src/quadtree.js CHANGED
@@ -91,7 +91,7 @@ export class Quadtree {
91
91
  // 20km). Shrinking the penalty-free near radius lets the far-LOD falloff coarsen MORE of the
92
92
  // off-screen / past-horizon field, cutting peak visible leaves toward ~600-900 (precondition
93
93
  // for the 512 layer cap). These are THE only values -- no device tier.
94
- const near = Math.max(this._camAlt * 4.0, horizon * 0.5, 20000.0);
94
+ const near = Math.max(this._camAlt * 2.0, horizon * 0.4, 20000.0);
95
95
  // floor 0.5 (was 0.18): past the horizon the split may HALVE, not crush to ~1/5 (which was
96
96
  // collapsing near-field detail on descent). Foreground (latC<near) stays fall=1 -> full LOD.
97
97
  const fall = 1.0 / (1.0 + Math.max(0.0, latC - near) / near);
@@ -102,10 +102,11 @@ export class Quadtree {
102
102
  // altitude climbs, so far and near refine at the same rate = the gradient FLATTENS the higher we get
103
103
  // (detail budget spreads from the near foreground out to the far field). Below fps height the gradient
104
104
  // stays sharp (floor 0.5) so the deck keeps its near-field detail. fpsAltM live via this.fpsAltM.
105
- const fpsAltM = this.fpsAltM || 5000.0;
106
- const aboveFps = Math.min(1.0, Math.max(0.0, (this._camAlt - fpsAltM) / (fpsAltM * 8.0))); // 0 at fps height -> 1 by ~45km
107
- const maxFloor = 0.7;
108
- const floor = 0.25 + (maxFloor - 0.25) * (aboveFps * aboveFps * (3 - 2 * aboveFps)); // 0.25 deck -> 0.7 high alt, always some far coarsening
105
+ // FLOOR: starts at 0.6 at deck (preserves near-field detail where the user sees it),
106
+ // drops logarithmically with altitude toward ~0.3 at orbital height, so far coarsening
107
+ // engages progressively at every altitude -- no more one-step jump at ~45km.
108
+ const altLog = Math.log2(Math.max(this._camAlt, 5000.0) / 5000.0);
109
+ const floor = Math.max(0.30, Math.min(0.60, 0.60 - altLog * 0.05));
109
110
  const effSplit = this.splitDist * Math.max(floor, fall);
110
111
  if (dist < l * effSplit && level < this.maxLevel) {
111
112
  const hl = l / 2.0;