mapspinner 0.1.71 → 0.1.72
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 +11 -4
package/package.json
CHANGED
package/src/shaders/terrain.glsl
CHANGED
|
@@ -1780,6 +1780,7 @@ void main() {
|
|
|
1780
1780
|
// vH > -2 gate cut the photo textures at the waterline, leaving the seabed flat-colored.
|
|
1781
1781
|
float texFarFade = 1.0 - smoothstep(8000.0, 10000.0, pxWorld);
|
|
1782
1782
|
if (uHasSurfTex > 0.5 && uTexMix > 0.001 && texFarFade > 0.001) {
|
|
1783
|
+
vec3 biomeC = albedo; // SUBTLE landscape color variation (user 2026-06-14 're-introduce ... use existing data, make it subtle'): the macro biome/climate color is ALREADY computed; save it now and mix a touch back after the material override (no new computation).
|
|
1783
1784
|
// material weights from the existing gates (climate = vClimate: z=temp, w=humid)
|
|
1784
1785
|
// SAND GATE = THE MACRO DESERT GATE (user 2026-06-11 'all the grassy areas need to have the
|
|
1785
1786
|
// grass texture'): the old humid<0.42 band splatted SAND across savanna/steppe/meadow-edge
|
|
@@ -1908,7 +1909,10 @@ void main() {
|
|
|
1908
1909
|
highp vec3 wt4 = wt * 4.0;
|
|
1909
1910
|
vec4 albA = surfTriTap(uSurfAlb, wt4, tw, lA);
|
|
1910
1911
|
vec3 cA = vec3(dot(albA.rgb, LUMA));
|
|
1911
|
-
|
|
1912
|
+
// 3 normal octaves (user 2026-06-14 'add an even lower freq octave, displacement/normals only,
|
|
1913
|
+
// 4x less frequent'): wt4 high (detail) + wt low (2.4km) + wt*0.25 VERY-low (9.6km) -- the very-
|
|
1914
|
+
// low one breaks the far repetition even more. Normals/displacement only (no albedo).
|
|
1915
|
+
vec3 nA = surfTriNrm(uSurfNrm, wt4, tw, lA, n) * 1.4 + surfTriNrm(uSurfNrm, wt, tw, lA, n) * 0.8 + surfTriNrm(uSurfNrm, wt * 0.25, tw, lA, n) * 0.55;
|
|
1912
1916
|
float dispA = albA.a;
|
|
1913
1917
|
// NO BIOME COLOR INHERITANCE (user 2026-06-14 'take away all biome color inheritance, it will
|
|
1914
1918
|
// speed it up' -- and fixes 'sand near grass tinted green'): each layer wears its OWN material
|
|
@@ -1920,7 +1924,7 @@ void main() {
|
|
|
1920
1924
|
if (wB > 0.02) { // second layer only where a real transition exists
|
|
1921
1925
|
vec4 albB = surfTriTap(uSurfAlb, wt4, tw, lB);
|
|
1922
1926
|
vec3 cB = vec3(dot(albB.rgb, LUMA));
|
|
1923
|
-
vec3 nB = surfTriNrm(uSurfNrm, wt4, tw, lB, n) * 1.4 + surfTriNrm(uSurfNrm, wt, tw, lB, n) * 0.8; //
|
|
1927
|
+
vec3 nB = surfTriNrm(uSurfNrm, wt4, tw, lB, n) * 1.4 + surfTriNrm(uSurfNrm, wt, tw, lB, n) * 0.8 + surfTriNrm(uSurfNrm, wt * 0.25, tw, lB, n) * 0.55; // + very-low octave
|
|
1924
1928
|
float dispB = albB.a;
|
|
1925
1929
|
// HEIGHT-BLEND POKE-THROUGH (user 'each texture's higher areas should poke through the other,
|
|
1926
1930
|
// offset by the ramp'): height = displacement + a weight-ramp offset (gate positions the
|
|
@@ -1953,8 +1957,10 @@ void main() {
|
|
|
1953
1957
|
// grass/sand interlocks (fingers) at ALL distances -- still the texture DISPLACEMENT, not noise.
|
|
1954
1958
|
float dispA_lo = surfTriTap(uSurfAlb, wt, tw, lA).a;
|
|
1955
1959
|
float dispB_lo = surfTriTap(uSurfAlb, wt, tw, lB).a;
|
|
1956
|
-
float
|
|
1957
|
-
float
|
|
1960
|
+
float dispA_vlo = surfTriTap(uSurfAlb, wt * 0.25, tw, lA).a; // very-low (9.6km) displacement -> even-larger-scale boundary undulation (less repetitive far)
|
|
1961
|
+
float dispB_vlo = surfTriTap(uSurfAlb, wt * 0.25, tw, lB).a;
|
|
1962
|
+
float hA = (dispA - 0.5) * 1.5 + (dispA_lo - 0.5) * 2.2 + (dispA_vlo - 0.5) * 2.2 + wRamp + ordA * 0.45;
|
|
1963
|
+
float hB = (dispB - 0.5) * 1.5 + (dispB_lo - 0.5) * 2.2 + (dispB_vlo - 0.5) * 2.2 - wRamp + ordB * 0.45;
|
|
1958
1964
|
float mh = max(hA, hB) - bw;
|
|
1959
1965
|
float waH = max(hA - mh, 0.0), wbH = max(hB - mh, 0.0);
|
|
1960
1966
|
float bSharp = waH / max(waH + wbH, 1e-4);
|
|
@@ -2006,6 +2012,7 @@ void main() {
|
|
|
2006
2012
|
// base = flat MATERIAL color (far/low-k); near = structured detail. The macro biome albedo is no
|
|
2007
2013
|
// longer the base, so NO biome color bleeds into the ground (user 'take away all biome inheritance').
|
|
2008
2014
|
albedo = clamp(mix(texMatColor, detail, k), 0.0, 1.0);
|
|
2015
|
+
albedo = mix(albedo, biomeC, 0.16); // subtle climate/biome tint back on top of the material color (deserts tanner, forests greener) -- at all distances for landscape variety
|
|
2009
2016
|
// FAKE MIDDAY AO from the displacement (user 2026-06-14 'darken the deepest parts of the
|
|
2010
2017
|
// displacement textures a little'): the texture's LOWEST displacement = crevices/pits; darken
|
|
2011
2018
|
// them ~18% so the surface reads as sunlit-from-above with soft self-occlusion in the lows.
|