mapspinner 0.1.45 → 0.1.47
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/src/gl-render.js +5 -3
- package/src/shaders/terrain.glsl +3 -2
package/package.json
CHANGED
package/src/gl-render.js
CHANGED
|
@@ -421,7 +421,8 @@ export async function initMapspinnerRender(gl, opts = {}) {
|
|
|
421
421
|
gl.uniform1f(loc('vtxDetail'), g('vtxDetail', 1.0)); // DECISIVE: vtxDisplace strength (early-return on 0)
|
|
422
422
|
gl.uniform1f(loc('canyonDepthMul'), g('canyonDepth', 1.0));
|
|
423
423
|
gl.uniform1f(loc('uVsCheap'), (typeof window!=='undefined' && window.__vsCheap) ? 1.0 : 0.0); // VS carve-cost profiling A/B
|
|
424
|
-
gl.uniform1f(loc('uBeachShelfM'), g('beachShelf',
|
|
424
|
+
gl.uniform1f(loc('uBeachShelfM'), g('beachShelf', 28000.0)); // land coastal shelf (geometry); probe MUST match render
|
|
425
|
+
gl.uniform1f(loc('uLandBias'), g('landBias', 680.0)); // +650m hypsometry bias = ~+30% land:sea (measured: landFrac 0.041 -> 0.054 over a 700-dir sphere grid, user 2026-06-14). window.__landBias dials it live.
|
|
425
426
|
gl.uniform1f(loc('cliffAmt'), g('cliffAmt', 1.0));
|
|
426
427
|
gl.uniform1i(loc('uFloatLinearOK'), _halfFloatLinearOK ? 1 : 0);
|
|
427
428
|
// FXC unroll-defeat (2026-06-12 AMD d3d11 fix): runtime octave bound for broadShapeM; the shader
|
|
@@ -960,7 +961,8 @@ export async function initMapspinnerRender(gl, opts = {}) {
|
|
|
960
961
|
const _g = (n,d)=> (typeof window!=='undefined' && window['__'+n]!=null) ? +window['__'+n] : d;
|
|
961
962
|
gl.uniform1f(U('canyonDepthMul'), _g('canyonDepth', 1.0));
|
|
962
963
|
gl.uniform1f(U('uVsCheap'), (typeof window!=='undefined' && window.__vsCheap) ? 1.0 : 0.0); // VS carve-cost profiling A/B
|
|
963
|
-
gl.uniform1f(U('uBeachShelfM'), _g('beachShelf',
|
|
964
|
+
gl.uniform1f(U('uBeachShelfM'), _g('beachShelf', 28000.0)); // land coastal shelf (geometry): h<S eased h*h/S = wide beach
|
|
965
|
+
gl.uniform1f(U('uLandBias'), _g('landBias', 680.0)); // +650m hypsometry bias = ~+30% land:sea (window.__landBias); MUST match the probe (setComposeHeightUniforms) for collision parity
|
|
964
966
|
gl.uniform1f(U('uHiFreqCut'), _g('hiFreqCut', 0.25)); // 0.5->0.25 (2026-06-10 'blotchy' -- see setComposeHeightUniforms)
|
|
965
967
|
gl.uniform1f(U('uVertexAO'), _g('vertexAO', 1.0)); // per-vertex shading/AO strength (DEFECT 2, 2026-06-06)
|
|
966
968
|
gl.uniform1f(U('cliffAmt'), _g('cliffAmt', 1.0));
|
|
@@ -1039,7 +1041,7 @@ export async function initMapspinnerRender(gl, opts = {}) {
|
|
|
1039
1041
|
gl.uniform1f(U('oceanAmp'), (oc.oceanAmplitude != null) ? oc.oceanAmplitude : 1.0);
|
|
1040
1042
|
gl.uniform1f(U('oceanChoppy'), (oc.oceanChoppiness != null) ? oc.oceanChoppiness : 0.5);
|
|
1041
1043
|
gl.uniform1f(U('oceanFoam'), (oc.oceanFoam != null) ? oc.oceanFoam : 0.5);
|
|
1042
|
-
gl.uniform1f(U('uBeachTopM'), _g('beachTop',
|
|
1044
|
+
gl.uniform1f(U('uBeachTopM'), _g('beachTop', 1000.0)); // beach ceiling: grass stops, sand to the waterline + under it. 30->90 (user 2026-06-14: 3x beach width)
|
|
1043
1045
|
|
|
1044
1046
|
// SINGLE INSTANCED DRAW: the deform params that were per-quad uniforms (ox,oy,l,level + face)
|
|
1045
1047
|
// are now PER-INSTANCE attributes. Build one interleaved instance buffer [ox,oy,l,level,face]
|
package/src/shaders/terrain.glsl
CHANGED
|
@@ -210,6 +210,7 @@ uniform float uIsWater; // 0 = terrain pass, 1 = water-surfac
|
|
|
210
210
|
uniform float uUnderwater; // 0 = camera above water, 1 = camera below sea level
|
|
211
211
|
uniform float uBeachTopM; // beach ceiling (m): below this, grass/snow yield to sand (window.__beachTop; 30 default)
|
|
212
212
|
uniform float uBeachShelfM; // land coastal-shelf top (m): h<this is eased (h*h/S) so the coast rises gently from the waterline = wide beach (window.__beachShelf; 300 default). GEOMETRY (composeHeight+vH).
|
|
213
|
+
uniform float uLandBias; // metres added to h (cbias+bShape) BEFORE the sea/land split -> raises the hypsometry = MORE LAND vs sea (window.__landBias). composeHeight + VS mirror + probe all add it (parity).
|
|
213
214
|
uniform float uHiFreqCut; // hi-freq elevation-noise attenuation, applied to ALL hi-freq sources:
|
|
214
215
|
// broadShapeM/MD fine octaves (o>=6) + vtxDisplace micro-relief
|
|
215
216
|
// (window.__hiFreqCut; default 0.25 = the user's 4x reduction, 2026-06-06)
|
|
@@ -615,7 +616,7 @@ highp float composeHeight(vec3 dir0, highp vec2 faceLocal, float tileM){ // W7
|
|
|
615
616
|
ridgeMul = mix(ridgeMul, max(ridgeMul, 0.9 * volcanic), isleZone);
|
|
616
617
|
}
|
|
617
618
|
highp float bShape = broadShapeM(dir0, reliefMul, ridgeMul); // W7: metres
|
|
618
|
-
highp float h = cbias + bShape;
|
|
619
|
+
highp float h = cbias + bShape + uLandBias; // W7: composite elevation metres (~13000); +uLandBias raises hypsometry = more land
|
|
619
620
|
// REALISTIC BATHYMETRY (user 2026-06-11 'the depth under the water doesnt seem right -- the
|
|
620
621
|
// landscape should continue underwater realistically'): raw cbias+bShape plunges at land-relief
|
|
621
622
|
// gradients, so the seabed hit kilometre depths within sight of the beach. Real margins have a
|
|
@@ -855,7 +856,7 @@ void main() {
|
|
|
855
856
|
// entire silhouette+hypsometry. The old wasm upsample-and-add cascade (zfc.x) was REMOVED -- it
|
|
856
857
|
// was a SECOND shape source that diverged per-LOD (the detail-inversion root). bShape amplitude
|
|
857
858
|
// was retuned (A0 6500, off -900) so this single field hits Earth hypso without the cascade.
|
|
858
|
-
vH = cbias + bShape;
|
|
859
|
+
vH = cbias + bShape + uLandBias; // +uLandBias (mirror composeHeight) -> more land vs sea
|
|
859
860
|
// shelf/slope bathymetry remap + underwater displacement -- MUST mirror composeHeight exactly
|
|
860
861
|
// (this is the FS-material running value; composeHeight is the geometry/probe height).
|
|
861
862
|
if (vH < 0.0) {
|