ugly-game 0.14.25 → 0.14.26
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 +13 -2
- package/package.json +1 -1
package/dist/assets/gpuCrowd.js
CHANGED
|
@@ -911,7 +911,18 @@ fn shadowFactor(world: vec3f, ndl: f32) -> f32 {
|
|
|
911
911
|
// should not set the gain for twelve whole bodies.
|
|
912
912
|
//
|
|
913
913
|
// ⚠️ Reachable only when desat > 0, so material 0 is unaffected by its value.
|
|
914
|
-
const LUMA_GAIN: f32 =
|
|
914
|
+
const LUMA_GAIN: f32 = 2.1670;
|
|
915
|
+
// ⚠️ 1/MEAN (0.4615), NOT 1/p99, and getting that wrong is what made every desaturating material
|
|
916
|
+
// look bad for three rounds. This gain feeds a MULTIPLICATIVE detail map, so what matters is that it
|
|
917
|
+
// averages 1.0 - leaving the material's own colour and contrast alone while still modulating it.
|
|
918
|
+
// Normalising by p99 keeps every value under 1, which sounds like the safe choice and is not: the
|
|
919
|
+
// mean then lands near 0.5, so wood, metal and glass all drew at HALF brightness with half the
|
|
920
|
+
// contrast of whatever they multiplied. Wood arrived as flat dark brown with its grain invisible, and
|
|
921
|
+
// three separate rewrites of the TEXTURE chased a defect that was never in the texture.
|
|
922
|
+
//
|
|
923
|
+
// ⚠️ The clamp band is [0.35, 1.6], not [0, 1]. At this gain a mid skin texel already reaches 1.0, so
|
|
924
|
+
// clamping at 1 would flatten the entire bright half of the map back into a constant - reintroducing
|
|
925
|
+
// the same loss from the other direction. A detail map has to be allowed above 1 to modulate upward.
|
|
915
926
|
// ONE ROW PER MATERIAL, two vec4s each: (spec, exponent, fresnel, metal) then
|
|
916
927
|
// (desat, texture layer, tile scale, pad).
|
|
917
928
|
//
|
|
@@ -1017,7 +1028,7 @@ fn cylindrical(layer: i32, p: vec3f, dx: vec3f, dy: vec3f) -> vec3f {
|
|
|
1017
1028
|
// desat 1 is pores, creases and anatomical shading - which is what makes a bronze figure read as
|
|
1018
1029
|
// a figure rather than as a smooth mannequin.
|
|
1019
1030
|
let skinS = textureSample(skinTex, skinSamp, i.uv, i.layer).rgb;
|
|
1020
|
-
let detail = mix(skinS, vec3f(clamp(luma(skinS) * LUMA_GAIN, 0.
|
|
1031
|
+
let detail = mix(skinS, vec3f(clamp(luma(skinS) * LUMA_GAIN, 0.35, 1.6)), b.x);
|
|
1021
1032
|
// ⚠️ The blend normal comes from the DERIVATIVES of the interpolated rest position, not from any
|
|
1022
1033
|
// normal in a buffer. There is no bind-pose normal to bind - normals are recomputed after the
|
|
1023
1034
|
// morph from the adjacency arrays - and the post-morph normal ROTATES WITH THE LIMB, so using it
|