mapspinner 0.1.69 → 0.1.70
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/shaders/terrain.glsl +20 -4
package/package.json
CHANGED
package/src/shaders/terrain.glsl
CHANGED
|
@@ -1798,7 +1798,12 @@ void main() {
|
|
|
1798
1798
|
highp vec3 bwDir = nWorld;
|
|
1799
1799
|
// 3-oct (added the ~1km octave, user 2026-06-14 'make biome bands more interesting') -> the
|
|
1800
1800
|
// texture-splat rock/snow/beach edges break into finer fingers as you approach, not a hard band.
|
|
1801
|
-
|
|
1801
|
+
// HIGHER-FREQ octaves added (user 2026-06-14 'sand-grass crossover too straight; snow warps ok
|
|
1802
|
+
// but sand-grass doesnt'): the snow line follows the mountains so it reads wavy, but the beach
|
|
1803
|
+
// sits on flat coastal land where the old 12/5/2.3km warp shifted the line UNIFORMLY = still a
|
|
1804
|
+
// straight horizontal line. Add ~900m + ~360m octaves so the beach/biome edges wiggle locally.
|
|
1805
|
+
float warpN = snoise3(bwDir * 3325.0) + 0.5 * snoise3(bwDir * 7750.0) + 0.4 * snoise3(bwDir * 17000.0)
|
|
1806
|
+
+ 0.45 * snoise3(bwDir * 45000.0) + 0.32 * snoise3(bwDir * 110000.0); // ~ +/-2.6
|
|
1802
1807
|
// BEACH sand gate tied to uBeachTopM (so the sand TEXTURE scales with the wide beach, not a
|
|
1803
1808
|
// hardcoded 80m strip) + the shared warp on its LAND edge so the beach->grass line is irregular.
|
|
1804
1809
|
// FINE BREAK on the grass->sand line (user 2026-06-14 'still a hard straight grass-sand line up
|
|
@@ -1937,15 +1942,26 @@ void main() {
|
|
|
1937
1942
|
// displacement crossover) and STRONG at the ends so the fingers taper to nothing before the
|
|
1938
1943
|
// gate cuts off -> the ramp completes smoothly, no end line.
|
|
1939
1944
|
float wRamp = (bAB - 0.5) * mix(1.4, 4.0, clamp(abs(bAB - 0.5) * 2.0, 0.0, 1.0)); // mid 0.6->1.4 (user 2026-06-14 'all crossover bands a bit wide, rock too'): stronger weight bias = NARROWER displacement crossover on every pair
|
|
1940
|
-
|
|
1941
|
-
|
|
1945
|
+
// OVERLAY ORDER (user 2026-06-14 'flip the order of the textures overlay on the ramps, grass
|
|
1946
|
+
// goes over sand etc'): bias the height by a per-material overlay priority so the COVERING
|
|
1947
|
+
// material wins the crossover -> grass overlays sand+rock, snow overlays all (sand<rock<grass<snow).
|
|
1948
|
+
float ordA = lA < 0.5 ? 0.6 : (lA < 1.5 ? 0.3 : (lA < 2.5 ? 0.0 : 1.0));
|
|
1949
|
+
float ordB = lB < 0.5 ? 0.6 : (lB < 1.5 ? 0.3 : (lB < 2.5 ? 0.0 : 1.0));
|
|
1950
|
+
// LOD-STABLE boundary (user 2026-06-14 'still see the hard color line' -- the high-octave
|
|
1951
|
+
// displacement mips FLAT at distance so the crossover collapsed to a smooth ramp = a line/band).
|
|
1952
|
+
// Add the LOW-octave (2.4km tile) displacement, which stays varied much farther out, so the
|
|
1953
|
+
// grass/sand interlocks (fingers) at ALL distances -- still the texture DISPLACEMENT, not noise.
|
|
1954
|
+
float dispA_lo = surfTriTap(uSurfAlb, wt, tw, lA).a;
|
|
1955
|
+
float dispB_lo = surfTriTap(uSurfAlb, wt, tw, lB).a;
|
|
1956
|
+
float hA = (dispA - 0.5) * 1.8 + (dispA_lo - 0.5) * 2.8 + wRamp + ordA * 0.45;
|
|
1957
|
+
float hB = (dispB - 0.5) * 1.8 + (dispB_lo - 0.5) * 2.8 - wRamp + ordB * 0.45;
|
|
1942
1958
|
float mh = max(hA, hB) - bw;
|
|
1943
1959
|
float waH = max(hA - mh, 0.0), wbH = max(hB - mh, 0.0);
|
|
1944
1960
|
float bSharp = waH / max(waH + wbH, 1e-4);
|
|
1945
1961
|
texAlb = vec4(mix(cB, cA, bSharp), mix(dispB, dispA, bSharp));
|
|
1946
1962
|
texNrm = mix(nB, nA, bSharp);
|
|
1947
1963
|
vec3 mcB = lB < 0.5 ? bcGrass : (lB < 1.5 ? bcRock : (lB < 2.5 ? bcShore : bcSnow));
|
|
1948
|
-
texMatColor = mix(mcB, mcA, bSharp); //
|
|
1964
|
+
texMatColor = mix(mcB, mcA, bSharp); // material color, broken up by the (noise-augmented) bSharp below
|
|
1949
1965
|
}
|
|
1950
1966
|
// MATCH COLOR TO NORMAL (user 2026-06-14 'green grassy patches with the rock normals -- should be
|
|
1951
1967
|
// rock colored or grass normals'): texNrm follows the displacement height-blend (rock on bumps in
|