ugly-game 0.14.15 → 0.14.16
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/gpuShadow.d.ts +13 -0
- package/dist/gpuShadow.js +15 -2
- package/package.json +1 -1
package/dist/gpuShadow.d.ts
CHANGED
|
@@ -65,6 +65,19 @@ export declare class GpuShadowRenderer {
|
|
|
65
65
|
private giProbeBuf;
|
|
66
66
|
private count;
|
|
67
67
|
private cam;
|
|
68
|
+
/**
|
|
69
|
+
* Scratch for the per-cascade copy of `cam`, with that cascade's matrix parked at `lightVP[0]`.
|
|
70
|
+
*
|
|
71
|
+
* ⚠️ SIZED FROM `cam`, never from a second copy of the same arithmetic. It held a literal
|
|
72
|
+
* `6 * 4` while `cam` grew to `7 * 4` for the `eye` vec4 that relief/parallax needs, and
|
|
73
|
+
* `frame`'s `shadowCam.set(this.cam)` then overflowed by four floats on the FIRST FRAME of every
|
|
74
|
+
* scene — `RangeError: offset is out of bounds`, no shadow pass, no draw, fps 0, on every page of
|
|
75
|
+
* every consumer. Two hand-maintained expressions for one layout is the whole defect; this makes
|
|
76
|
+
* the second one impossible to get wrong.
|
|
77
|
+
*
|
|
78
|
+
* ⚠️ Declaration order is load-bearing: class fields initialise top-down, so `cam` must stay
|
|
79
|
+
* above this line.
|
|
80
|
+
*/
|
|
68
81
|
private shadowCam;
|
|
69
82
|
private cascades;
|
|
70
83
|
/** Width of the blend into the next cascade, in uv (0 = hard switch). Small: it costs a 2nd PCF. */
|
package/dist/gpuShadow.js
CHANGED
|
@@ -565,9 +565,22 @@ export class GpuShadowRenderer {
|
|
|
565
565
|
giGridBuf;
|
|
566
566
|
giProbeBuf;
|
|
567
567
|
count = 0;
|
|
568
|
-
// camVP(16) + lightVP[MAX_CASCADES](16 each) + sun + sunCol + tint + atlas + up + csm
|
|
568
|
+
// camVP(16) + lightVP[MAX_CASCADES](16 each) + sun + sunCol + tint + atlas + up + csm + eye
|
|
569
569
|
cam = new Float32Array(16 + MAX_CASCADES * 16 + 7 * 4);
|
|
570
|
-
|
|
570
|
+
/**
|
|
571
|
+
* Scratch for the per-cascade copy of `cam`, with that cascade's matrix parked at `lightVP[0]`.
|
|
572
|
+
*
|
|
573
|
+
* ⚠️ SIZED FROM `cam`, never from a second copy of the same arithmetic. It held a literal
|
|
574
|
+
* `6 * 4` while `cam` grew to `7 * 4` for the `eye` vec4 that relief/parallax needs, and
|
|
575
|
+
* `frame`'s `shadowCam.set(this.cam)` then overflowed by four floats on the FIRST FRAME of every
|
|
576
|
+
* scene — `RangeError: offset is out of bounds`, no shadow pass, no draw, fps 0, on every page of
|
|
577
|
+
* every consumer. Two hand-maintained expressions for one layout is the whole defect; this makes
|
|
578
|
+
* the second one impossible to get wrong.
|
|
579
|
+
*
|
|
580
|
+
* ⚠️ Declaration order is load-bearing: class fields initialise top-down, so `cam` must stay
|
|
581
|
+
* above this line.
|
|
582
|
+
*/
|
|
583
|
+
shadowCam = new Float32Array(this.cam.length);
|
|
571
584
|
cascades = 0; // layers currently allocated; 0 until the first frame sizes it
|
|
572
585
|
/** Width of the blend into the next cascade, in uv (0 = hard switch). Small: it costs a 2nd PCF. */
|
|
573
586
|
cascadeBand = 0.12;
|