ugly-game 0.14.18 → 0.14.19
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 +16 -2
- package/package.json +1 -1
package/dist/assets/gpuCrowd.js
CHANGED
|
@@ -906,8 +906,12 @@ const MATS = array<vec4f, 10>(
|
|
|
906
906
|
vec4f(0.35, 64.0, 0.50, 0.0), vec4f(0.60, -1.0, 1.000, 0.0),
|
|
907
907
|
vec4f(0.90, 128.0, 0.80, 1.0), vec4f(1.00, 0.0, 0.333, 0.0),
|
|
908
908
|
vec4f(0.90, 256.0, 1.00, 0.0), vec4f(1.00, -1.0, 1.000, 0.0),
|
|
909
|
-
vec4f(0.08, 16.0, 0.15, 0.0), vec4f(1.00, 1.0, 0.
|
|
909
|
+
vec4f(0.08, 16.0, 0.15, 0.0), vec4f(1.00, 1.0, 0.220, 0.0),
|
|
910
910
|
);
|
|
911
|
+
// ⚠️ Wood's tile scale is 0.22, not 0.5, and that was set by LOOKING. A shipped human stands ~16.6
|
|
912
|
+
// kit units, so 0.5 repeats the grain about eight times head to foot — fine enough that at any
|
|
913
|
+
// normal camera distance it averages into a flat tan and the character reads as bare skin. 0.22 is
|
|
914
|
+
// closer to four repeats, which is a plank rather than a veneer.
|
|
911
915
|
fn luma(c: vec3f) -> f32 { return dot(c, vec3f(0.2126, 0.7152, 0.0722)); }
|
|
912
916
|
// TRIPLANAR: three samples of the same tiling map, blended by the bind-space normal.
|
|
913
917
|
//
|
|
@@ -986,7 +990,17 @@ fn triplanar(layer: i32, p: vec3f, dx: vec3f, dy: vec3f, n: vec3f) -> vec3f {
|
|
|
986
990
|
// between gold and yellow plastic with a white highlight sitting on it.
|
|
987
991
|
let specCol = mix(vec3f(1.0), base, a.w);
|
|
988
992
|
let spec = (a.x + fres) * pow(max(ndh, 0.0), a.y) * specCol * u.sunCol.xyz * sh;
|
|
989
|
-
|
|
993
|
+
// ⚠️ A METAL STILL RECEIVES THE AMBIENT TERM, and the first cut of this did not. Driving diffuse
|
|
994
|
+
// to zero by metalness is right for the SUN — a metal has no diffuse lobe — but this renderer has
|
|
995
|
+
// no environment map, and u.amb is the only stand-in for one it has. Zeroing both left a metal
|
|
996
|
+
// character as a BLACK SILHOUETTE with a single hot spot where the sun happened to mirror, which
|
|
997
|
+
// is what a metal with nothing to reflect genuinely looks like and is useless as a material.
|
|
998
|
+
// Tinted by the base colour, because what a metal reflects takes its colour.
|
|
999
|
+
//
|
|
1000
|
+
// Found by LOOKING at it. Every assertion in the GPU harness passed on the black version: it was
|
|
1001
|
+
// view-dependent, it peaked on the mirror axis, it differed from every other row.
|
|
1002
|
+
let env = base * a.w * u.amb.xyz;
|
|
1003
|
+
let lit = base * (1.0 - a.w) * (u.amb.xyz + d * u.sunCol.xyz * sh) + env + spec;
|
|
990
1004
|
|
|
991
1005
|
let dist = length(i.world - u.cam.xyz);
|
|
992
1006
|
let f = clamp(1.0 - exp(-dist * u.fog.w), 0.0, 1.0);
|