ugly-game 0.14.31 → 0.14.33

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.
@@ -920,7 +920,19 @@ const DETAIL_STRENGTH: f32 = 0.35;
920
920
  const ENV_SKY: f32 = 1.7;
921
921
  // And how much DARKER the faked ground is. Both ends are forced apart on purpose — see the note in fs
922
922
  // about an overcast scene where the ambient and the fog tint are the same colour.
923
- const ENV_GROUND: f32 = 0.3;
923
+ // ⚠️ 0.55, not 0.3. STAINLESS is not a dark metal — it sits around the middle of the range and gets
924
+ // its drama from what it reflects, not from going near-black where it faces away from the sky. At 0.3
925
+ // the shadowed sides crushed almost to black, which reads as gunmetal or cast iron.
926
+ const ENV_GROUND: f32 = 0.55;
927
+ // ⚠️ A DELIBERATE MIP BIAS on the material texture only, and it is what lets a dense pattern actually
928
+ // be seen. The gradient handed to textureSampleGrad is what picks the mip, so shrinking it selects a
929
+ // SHARPER level than the footprint strictly warrants. Without it the grain hit a hard ceiling: 32
930
+ // lines around the body read, 44 and 64 both averaged away to flat skin in the mip chain long before
931
+ // they reached the eye, so raising the density made the material LESS visible rather than more.
932
+ //
933
+ // The cost is some shimmer on a distant character. That is the right trade here — the crowd drops to
934
+ // coarser rungs with distance anyway, and an invisible material is a worse defect than a busy one.
935
+ const MIP_SHARPEN: f32 = 0.55;
924
936
  // ⚠️ 1/MEAN (0.4615), NOT 1/p99, and getting that wrong is what made every desaturating material
925
937
  // look bad for three rounds. This gain feeds a MULTIPLICATIVE detail map, so what matters is that it
926
938
  // averages 1.0 - leaving the material's own colour and contrast alone while still modulating it.
@@ -1074,9 +1086,9 @@ fn cylindrical(layer: i32, p: vec3f, dx: vec3f, dy: vec3f) -> vec3f {
1074
1086
  var matC = vec3f(1.0);
1075
1087
  if (i32(b.y) >= 0) {
1076
1088
  if (b.w > 0.5) {
1077
- matC = cylindrical(i32(b.y), i.rest * b.z, rdx * b.z, rdy * b.z);
1089
+ matC = cylindrical(i32(b.y), i.rest * b.z, rdx * b.z * MIP_SHARPEN, rdy * b.z * MIP_SHARPEN);
1078
1090
  } else {
1079
- matC = triplanar(i32(b.y), i.rest * b.z, rdx * b.z, rdy * b.z, bn);
1091
+ matC = triplanar(i32(b.y), i.rest * b.z, rdx * b.z * MIP_SHARPEN, rdy * b.z * MIP_SHARPEN, bn);
1080
1092
  }
1081
1093
  }
1082
1094
  let base = detail * matC * i.tint.rgb;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugly-game",
3
- "version": "0.14.31",
3
+ "version": "0.14.33",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {