ugly-game 0.14.21 → 0.14.22
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 +10 -1
- package/package.json +1 -1
package/dist/assets/gpuCrowd.js
CHANGED
|
@@ -1103,7 +1103,16 @@ fn cylindrical(layer: i32, p: vec3f, dx: vec3f, dy: vec3f) -> vec3f {
|
|
|
1103
1103
|
// clip-space heading; the y is negated because clip space runs +y UP and a texture's v runs
|
|
1104
1104
|
// DOWN. Getting that flip wrong bends the background the wrong way, which reads as glass with
|
|
1105
1105
|
// an odd tilt rather than as anything obviously broken.
|
|
1106
|
-
|
|
1106
|
+
// ⚠️ NORMALIZED, and it was not at first. viewProj applied to a DIRECTION (w = 0) has no
|
|
1107
|
+
// meaningful magnitude - it carries the projection's scale terms and the rebased world's units,
|
|
1108
|
+
// so it came out in the tens. Times a 0.045 screen offset that is a displacement of whole
|
|
1109
|
+
// screens, which clamp() then pinned to a CORNER of the copy: every glass fragment sampled the
|
|
1110
|
+
// same corner texel, and face-on - where the rim term is near zero and the background is
|
|
1111
|
+
// essentially all you see - the body rendered as a flat dark shape. Only the direction is wanted
|
|
1112
|
+
// here; c.y alone sets how far.
|
|
1113
|
+
let ndRaw = (u.viewProj * vec4f(n, 0.0)).xy;
|
|
1114
|
+
let ndLen = length(ndRaw);
|
|
1115
|
+
let nd = select(vec2f(0.0), ndRaw / ndLen, ndLen > 1e-6);
|
|
1107
1116
|
let off = vec2f(nd.x, -nd.y) * c.y;
|
|
1108
1117
|
// Clamped so a grazing fragment cannot reach outside the copy and smear its edge texel across
|
|
1109
1118
|
// the body.
|