mapspinner 0.1.2 → 0.1.4
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 +1 -1
- package/planet.html +3 -7
- package/src/gl-render.js +4 -4
- package/src/planet-orchestrator.js +3 -3
package/package.json
CHANGED
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('
|
|
381
|
-
.then(m => m.
|
|
380
|
+
import('./src/planet-orchestrator.js')
|
|
381
|
+
.then(m => m.initMapspinnerPlanet(glw, { radius: WEBGL2_TERRAIN_R_M, frustumCull: false }))
|
|
382
382
|
.then(orch => { window.__planetOrch = orch; window.__planetOrchGL = glw; window.__planetOrchStatus='ready';
|
|
383
|
-
|
|
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('
|
|
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('
|
|
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('
|
|
202
|
-
const na = await (await fetch('
|
|
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 '
|
|
14
|
-
import { initMapspinnerRender } from '
|
|
15
|
-
import { createAnchorField } from '
|
|
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
|