mapspinner 0.1.1 → 0.1.3

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/index.html ADDED
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>mapspinner — WebGL2 Terrain SDK</title>
6
+ <meta http-equiv="refresh" content="0;url=planet.html">
7
+ </head>
8
+ <body>
9
+ <p><a href="planet.html">Launch mapspinner demo</a></p>
10
+ </body>
11
+ </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mapspinner",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "WebGL2 Earth-scale terrain rendering SDK for interactive globe applications",
5
5
  "main": "src/index.js",
6
6
  "exports": {
package/planet.html CHANGED
@@ -377,14 +377,10 @@ function frameLoop(){
377
377
  // The orchestrator works in METERS (its producer generates meter-scale elevation).
378
378
  // We drive it in meter-space and scale the km-unit camera into meters via
379
379
  // WEBGL2_M_PER_UNIT below.
380
- import('/src/planet-orchestrator.js')
380
+ import('./src/planet-orchestrator.js')
381
381
  .then(m => m.initProlandPlanet(glw, { radius: WEBGL2_TERRAIN_R_M, frustumCull: false }))
382
382
  .then(orch => { window.__planetOrch = orch; window.__planetOrchGL = glw; window.__planetOrchStatus='ready';
383
- // install the unified live generation-control surface (window.__gen) AND apply its
384
- // CLI-validated DEFAULTS to the wasm at startup (the baked wasm cascade is the old
385
- // table; __gen.apply() pushes the Earth-scale C4 cascade + seaBias so the rendered
386
- // planet matches the CLI-validated generation without a wasm rebuild).
387
- import('/src/terrain-gen-controls.js').then(()=>{ try{ window.__gen && window.__gen.apply(); }catch(_){} }).catch(e=>console.warn('gen-controls',e)); })
383
+ import('./src/terrain-gen-controls.js').then(()=>{ try{ window.__gen && window.__gen.apply(); }catch(_){} }).catch(e=>console.warn('gen-controls',e)); })
388
384
  .catch(e => { window.__planetOrchStatus='error:'+(e.message||e); console.error('orch init',e); });
389
385
  }
390
386
  }
package/src/gl-render.js CHANGED
@@ -63,9 +63,9 @@ export async function initMapspinnerRender(gl, opts = {}) {
63
63
  let _hpfTex = null, _hpfTex2 = null, _hpfRes = 0; // _hpfTex RG16F(seaBias,elevAmp), _hpfTex2 RG8(temp,humid) -- W12 pack
64
64
 
65
65
  // ---- compile terrain.glsl ----
66
- let src = await (await fetch('/src/shaders/terrain.glsl')).text();
66
+ let src = await (await fetch('./src/shaders/terrain.glsl')).text();
67
67
  // Analytic Bruneton-style atmosphere helpers, shared by terrain FS + sky pass.
68
- let atmoSrc = await (await fetch('/src/shaders/atmosphere.glsl')).text();
68
+ let atmoSrc = await (await fetch('./src/shaders/atmosphere.glsl')).text();
69
69
 
70
70
  // NON-BLOCKING COMPILE (user 2026-06-02: 'startup takes really long'). The terrain shader's
71
71
  // first (cold-cache) compile can take tens of seconds; querying COMPILE_STATUS/LINK_STATUS
@@ -198,8 +198,8 @@ export async function initMapspinnerRender(gl, opts = {}) {
198
198
  // renderer in a broken state (a failed build throws before `prog` is reassigned).
199
199
  async function recompile(){
200
200
  try {
201
- const ns = await (await fetch('/src/shaders/terrain.glsl?t='+(performance.now()|0))).text();
202
- const na = await (await fetch('/src/shaders/atmosphere.glsl?t='+(performance.now()|0))).text();
201
+ const ns = await (await fetch('./src/shaders/terrain.glsl?t='+(performance.now()|0))).text();
202
+ const na = await (await fetch('./src/shaders/atmosphere.glsl?t='+(performance.now()|0))).text();
203
203
  const nb = buildTerrainProgram(ns, na);
204
204
  await awaitProgramLink(nb.p, nb.vs, nb.fs, 'terrain'); // throws on compile/link error
205
205
  const newProg = nb.p;
@@ -10,9 +10,9 @@
10
10
  // - FACE_FRAME below is the SINGLE source of truth for the cube-face local frame (col0=U,
11
11
  // col1=V, col2=center); worldToFaceLocal inverts it to put the world camera into face coords.
12
12
 
13
- import { Quadtree } from '/src/quadtree.js';
14
- import { initMapspinnerRender } from '/src/gl-render.js';
15
- import { createAnchorField } from '/src/anchor-field.js';
13
+ import { Quadtree } from './quadtree.js';
14
+ import { initMapspinnerRender } from './gl-render.js';
15
+ import { createAnchorField } from './anchor-field.js';
16
16
 
17
17
  // MUST match the render's localToWorld3 transformation exactly (col0=U, col1=V,
18
18
  // col2=center). This is the face's local orthonormal frame: a face-local point