@forgeax/engine-runtime 0.1.20 → 0.1.21
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/README.md +102 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/__tests__/create-renderer-gpu-pass-timing.unit.test.d.ts +2 -0
- package/dist/__tests__/create-renderer-gpu-pass-timing.unit.test.d.ts.map +1 -0
- package/dist/__tests__/lights-preservation.fixup.test.d.ts +2 -0
- package/dist/__tests__/lights-preservation.fixup.test.d.ts.map +1 -0
- package/dist/__tests__/render-error-exhaustive.test-d.d.ts.map +1 -1
- package/dist/createRenderer.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +2 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +30 -30
- package/src/__tests__/active-camera.unit.test.ts +6 -8
- package/src/__tests__/asset-registry.recursive.spec.ts +1 -1
- package/src/__tests__/clamp-to-last.e2e.browser.test.ts +2 -2
- package/src/__tests__/components.test-d.ts +10 -3
- package/src/__tests__/components.unit.test.ts +13 -7
- package/src/__tests__/create-renderer-assembly.integration.test.ts +24 -0
- package/src/__tests__/create-renderer-gpu-pass-timing.unit.test.ts +32 -0
- package/src/__tests__/createRenderer.browser-no-webgpu.test.ts +66 -0
- package/src/__tests__/dawn/hello-sprite-nineslice-section.dawn.test.ts +9 -1
- package/src/__tests__/dawn/instances-shadow.dawn.test.ts +15 -2
- package/src/__tests__/errors.unit.test.ts +51 -20
- package/src/__tests__/extract-frames-merge.test.ts +48 -40
- package/src/__tests__/extract-skin-mismatch.unit.test.ts +6 -2
- package/src/__tests__/frame-targets-shadow-regression.unit.test.ts +13 -0
- package/src/__tests__/geometry.unit.test.ts +7 -10
- package/src/__tests__/light-gpu-byte-neutral.unit.test.ts +2 -1
- package/src/__tests__/light-snapshot.test-d.ts +8 -0
- package/src/__tests__/lights-preservation.fixup.test.ts +127 -0
- package/src/__tests__/lights.unit.test.ts +75 -2235
- package/src/__tests__/pbr-pipeline.unit.test.ts +6 -1
- package/src/__tests__/pipeline.unit.test.ts +48 -202
- package/src/__tests__/point-light-shadow.browser.test.ts +208 -83
- package/src/__tests__/point-light-shadow.unit.test.ts +61 -4
- package/src/__tests__/render-error-exhaustive.test-d.ts +63 -9
- package/src/__tests__/render-system-mega.test.ts +30 -41
- package/src/__tests__/render-system-record-multi-material-textureview.test.ts +4 -1
- package/src/__tests__/render-system-record-per-submesh-transparency.test.ts +4 -1
- package/src/__tests__/render-system-skin-bg.unit.test.ts +14 -9
- package/src/__tests__/renderer-recover.unit.test.ts +8 -0
- package/src/__tests__/renderer-surface.unit.test.ts +229 -3
- package/src/__tests__/shadow-csm-atlas.test.ts +41 -0
- package/src/__tests__/shadow-csm-component.test.ts +31 -24
- package/src/__tests__/shadow-csm-extract.test.ts +156 -47
- package/src/__tests__/shadow-csm-runtime-vary.dawn.test.ts +72 -0
- package/src/__tests__/shadow-csm-shader.dawn.test.ts +19 -0
- package/src/__tests__/shadow-csm-ubo.test.ts +41 -45
- package/src/__tests__/shadow-csm-viewport.browser.test.ts +29 -0
- package/src/__tests__/shadow-fields-observable.dawn.test.ts +85 -20
- package/src/__tests__/skinned-shadow-mixed.dawn.test.ts +3 -1
- package/src/__tests__/skylight-lazy-projection.test.ts +8 -5
- package/src/__tests__/ssao-bgl.test.ts +10 -16
- package/src/__tests__/ssao-passes.test.ts +19 -2
- package/src/__tests__/systems.unit.test.ts +44 -31
- package/src/__tests__/view-ubo-layout.browser.test.ts +20 -10
- package/src/createRenderer.ts +1 -0
- package/src/index.ts +1 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// view-ubo-layout.browser.test.ts - feat-20260518-pbr-direct-lighting-mvp
|
|
2
|
-
// feat-
|
|
3
|
-
//
|
|
2
|
+
// feat-20260827-directional-csm-pcss-quality M1: VIEW_UBO_BYTES remains 960
|
|
3
|
+
// while the View slot remains 1024 B. The prefix layout is unchanged and the
|
|
4
|
+
// directional shadow carrier reuses the existing tail pad.
|
|
4
5
|
// 16 B + cameraPos 16 B + lightSpaceMatrix 64 B + inverseViewProj 64 B;
|
|
5
6
|
// std140 vec3 padded to 16-byte boundaries).
|
|
6
7
|
//
|
|
@@ -44,14 +45,16 @@ const VIEW_UBO_OFFSETS = {
|
|
|
44
45
|
lightSpaceMatrix: 112,
|
|
45
46
|
inverseViewProj: 176,
|
|
46
47
|
} as const;
|
|
47
|
-
const VIEW_UBO_BYTES =
|
|
48
|
+
const VIEW_UBO_BYTES = 960;
|
|
49
|
+
const DIRECTIONAL_FILTER_OFFSET = 512;
|
|
50
|
+
const SPOT_LIGHT_VIEW_PROJ_OFFSET = 528;
|
|
48
51
|
|
|
49
52
|
describe('w4 view UBO 240 B std140 layout (AC-06, browser)', () => {
|
|
50
|
-
it.skipIf(!browserReady)('host write payload is exactly
|
|
51
|
-
// The host (
|
|
53
|
+
it.skipIf(!browserReady)('host write payload is exactly 960 bytes (240 floats)', () => {
|
|
54
|
+
// The host (view-ubo.ts) builds a Float32Array(240) and
|
|
52
55
|
// emits a single queue.writeBuffer. Asserting the size lock here keeps
|
|
53
56
|
// the host shape and shader ABI in agreement before the GPU sees it.
|
|
54
|
-
const payload = new Float32Array(
|
|
57
|
+
const payload = new Float32Array(240);
|
|
55
58
|
expect(payload.byteLength).toBe(VIEW_UBO_BYTES);
|
|
56
59
|
});
|
|
57
60
|
|
|
@@ -63,17 +66,17 @@ describe('w4 view UBO 240 B std140 layout (AC-06, browser)', () => {
|
|
|
63
66
|
expect(VIEW_UBO_OFFSETS.lightSpaceMatrix).toBe(112);
|
|
64
67
|
expect(VIEW_UBO_OFFSETS.inverseViewProj).toBe(176);
|
|
65
68
|
// Buffer total = inverseViewProj offset + mat4 (64 B) = 240.
|
|
66
|
-
expect(VIEW_UBO_OFFSETS.inverseViewProj + 64).toBe(
|
|
69
|
+
expect(VIEW_UBO_OFFSETS.inverseViewProj + 64).toBe(240);
|
|
67
70
|
});
|
|
68
71
|
|
|
69
72
|
it.skipIf(!browserReady)(
|
|
70
73
|
'host packs lightDir / lightColor / cameraPos at canonical std140 slots',
|
|
71
74
|
() => {
|
|
72
75
|
// Canonical packing order documented in plan-strategy D-4: the host
|
|
73
|
-
// builds a
|
|
76
|
+
// builds a 240-float buffer mirroring the shader-side `View` struct
|
|
74
77
|
// field order. AC-06: existing field offsets unchanged -- tail append
|
|
75
78
|
// only.
|
|
76
|
-
const payload = new Float32Array(
|
|
79
|
+
const payload = new Float32Array(240);
|
|
77
80
|
// worldViewProj = identity for this assertion (mat4 in [0..16))
|
|
78
81
|
payload[0] = 1; // m00
|
|
79
82
|
payload[5] = 1; // m11
|
|
@@ -133,7 +136,7 @@ describe('w4 view UBO 240 B std140 layout (AC-06, browser)', () => {
|
|
|
133
136
|
// calculation.
|
|
134
137
|
const inverseProjF32Index = VIEW_UBO_OFFSETS.inverseViewProj / 4;
|
|
135
138
|
expect(inverseProjF32Index).toBe(44);
|
|
136
|
-
const payload = new Float32Array(
|
|
139
|
+
const payload = new Float32Array(240);
|
|
137
140
|
// Place an identity mat4 at inverseViewProj slot [44..59]
|
|
138
141
|
payload[44] = 1;
|
|
139
142
|
payload[49] = 1;
|
|
@@ -145,6 +148,13 @@ describe('w4 view UBO 240 B std140 layout (AC-06, browser)', () => {
|
|
|
145
148
|
expect(payload[59]).toBe(1);
|
|
146
149
|
});
|
|
147
150
|
|
|
151
|
+
it.skipIf(!browserReady)('shadow tail keeps the directional carrier before spot matrices', () => {
|
|
152
|
+
expect(DIRECTIONAL_FILTER_OFFSET).toBe(126 * 4 + 8);
|
|
153
|
+
expect(SPOT_LIGHT_VIEW_PROJ_OFFSET).toBe(132 * 4);
|
|
154
|
+
expect(SPOT_LIGHT_VIEW_PROJ_OFFSET - DIRECTIONAL_FILTER_OFFSET).toBe(16);
|
|
155
|
+
expect(SPOT_LIGHT_VIEW_PROJ_OFFSET + 4 * 4 * 16).toBe(VIEW_UBO_BYTES - 176);
|
|
156
|
+
});
|
|
157
|
+
|
|
148
158
|
it.skipIf(!browserReady)(
|
|
149
159
|
'existing field offsets unchanged by tail append (AC-06 rear-append guarantee)',
|
|
150
160
|
() => {
|
package/src/createRenderer.ts
CHANGED
|
@@ -39,6 +39,7 @@ export async function createRenderer(
|
|
|
39
39
|
...(options.standardProfile === undefined
|
|
40
40
|
? {}
|
|
41
41
|
: { standardProfile: options.standardProfile }),
|
|
42
|
+
...(options.gpuPassTiming === undefined ? {} : { gpuPassTiming: options.gpuPassTiming }),
|
|
42
43
|
};
|
|
43
44
|
try {
|
|
44
45
|
const constructed = await constructRuntimeRendererHost(canvas, rendererOptions, bundler);
|
package/src/index.ts
CHANGED
|
@@ -340,8 +340,7 @@ export {
|
|
|
340
340
|
// never rendered). One barrel entry => one module copy => one registry shared by
|
|
341
341
|
// createDebugDrawOnReady (the writer) and attachDebugOverlayPass (the reader).
|
|
342
342
|
// feat-20260704-runtime-tier1-decomposition M2 / w10 (D-3): the third error
|
|
343
|
-
// re-export block (
|
|
344
|
-
// HdrpLightBudgetExceededError) is folded into the render-cluster class
|
|
343
|
+
// re-export block (Standard Cluster error classes) is folded into the render-cluster class
|
|
345
344
|
// re-export block above -- they are render-cluster members sourced from
|
|
346
345
|
// ./errors/render.
|
|
347
346
|
// feat-20260608-cluster-lighting M2 / w10 + verify F-1/F-2: HDRP cluster-forward
|