ugly-game 0.14.28 → 0.14.30
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/dist/assets/gpuCrowd.js +17 -1
- package/package.json +1 -1
package/dist/assets/gpuCrowd.js
CHANGED
|
@@ -918,6 +918,9 @@ const DETAIL_STRENGTH: f32 = 0.35;
|
|
|
918
918
|
// How much brighter the faked sky is than the fog colour it is built from. A metal reflects nearly all
|
|
919
919
|
// of what hits it, so its environment has to be able to read brighter than the ambient floor.
|
|
920
920
|
const ENV_SKY: f32 = 1.7;
|
|
921
|
+
// And how much DARKER the faked ground is. Both ends are forced apart on purpose — see the note in fs
|
|
922
|
+
// about an overcast scene where the ambient and the fog tint are the same colour.
|
|
923
|
+
const ENV_GROUND: f32 = 0.3;
|
|
921
924
|
// ⚠️ 1/MEAN (0.4615), NOT 1/p99, and getting that wrong is what made every desaturating material
|
|
922
925
|
// look bad for three rounds. This gain feeds a MULTIPLICATIVE detail map, so what matters is that it
|
|
923
926
|
// averages 1.0 - leaving the material's own colour and contrast alone while still modulating it.
|
|
@@ -1116,7 +1119,12 @@ fn cylindrical(layer: i32, p: vec3f, dx: vec3f, dy: vec3f) -> vec3f {
|
|
|
1116
1119
|
// way a real reflection does.
|
|
1117
1120
|
let rdir = reflect(-v, n);
|
|
1118
1121
|
let sky = clamp(rdir.y * 0.5 + 0.5, 0.0, 1.0);
|
|
1119
|
-
|
|
1122
|
+
// ⚠️ The ground half is DARKENED, not taken as-is, and without that metal still read flat. In an
|
|
1123
|
+
// overcast scene the ambient and the fog tint are nearly the SAME pale grey, so mixing between them
|
|
1124
|
+
// gave a gradient with no range in it — exactly the lighting a white studio backdrop produces, and
|
|
1125
|
+
// the one the lab opens in. Forcing the down-facing end dark guarantees the tonal sweep that makes
|
|
1126
|
+
// a surface read as reflective whatever the scene is doing.
|
|
1127
|
+
let envCol = mix(u.amb.xyz * ENV_GROUND, u.fog.xyz * ENV_SKY, sky);
|
|
1120
1128
|
// Fresnel brightens a grazing reflection, which is the other half of the metal read.
|
|
1121
1129
|
let env = base * a.w * envCol * (0.55 + 1.15 * clamp(fres, 0.0, 1.0));
|
|
1122
1130
|
let lit = base * (1.0 - a.w) * (u.amb.xyz + d * u.sunCol.xyz * sh) + env + spec;
|
|
@@ -1364,6 +1372,14 @@ export class GpuCrowdRenderer {
|
|
|
1364
1372
|
mipmapFilter: 'linear',
|
|
1365
1373
|
addressModeU: 'repeat',
|
|
1366
1374
|
addressModeV: 'repeat',
|
|
1375
|
+
// ⚠️ ANISOTROPIC, because a human atlas is not isotropic and the legs prove it. Measured on
|
|
1376
|
+
// all-mine-sky's UV chart, a texture-space SQUARE renders with median aspect 1.57 on the
|
|
1377
|
+
// chest, 2.46 on the shin and 5.11 on the thigh — the leg islands carry about three times
|
|
1378
|
+
// fewer texels per centimetre along the limb than around it. Trilinear picks its mip from the
|
|
1379
|
+
// WORST axis, so it blurs the well-sampled direction to hide the stretched one, and the result
|
|
1380
|
+
// reads as vertical streaking down the legs. Anisotropic sampling is exactly the case this
|
|
1381
|
+
// hardware feature exists for, and it costs nothing on surfaces that are already isotropic.
|
|
1382
|
+
maxAnisotropy: 16,
|
|
1367
1383
|
});
|
|
1368
1384
|
}
|
|
1369
1385
|
/** The rung geometry and pool sizes, once the assets are in. Null before `setAssets`. */
|