@forgeax/engine-render 0.1.23 → 0.1.24
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 +131 -9
- package/dist/assembly/bundler-contract.d.ts +9 -0
- package/dist/assembly/bundler-contract.d.ts.map +1 -0
- package/dist/assembly/device-feature-admission.d.ts +8 -0
- package/dist/assembly/device-feature-admission.d.ts.map +1 -1
- package/dist/assembly/extended-lighting-fallback.d.ts +13 -0
- package/dist/assembly/extended-lighting-fallback.d.ts.map +1 -0
- package/dist/assembly/factory.d.ts +7 -243
- package/dist/assembly/factory.d.ts.map +1 -1
- package/dist/assembly/material/assembly.d.ts +3 -2
- package/dist/assembly/material/assembly.d.ts.map +1 -1
- package/dist/assembly/material/standard-layer-projection.d.ts +10 -0
- package/dist/assembly/material/standard-layer-projection.d.ts.map +1 -0
- package/dist/assembly/material-shader-policy.d.ts +168 -0
- package/dist/assembly/material-shader-policy.d.ts.map +1 -0
- package/dist/assembly/material-shader-prewarm.d.ts +21 -0
- package/dist/assembly/material-shader-prewarm.d.ts.map +1 -0
- package/dist/assembly/mesh-ssbo-grow.d.ts +88 -0
- package/dist/assembly/mesh-ssbo-grow.d.ts.map +1 -0
- package/dist/assembly/recovery/device-loss-fanout.d.ts +14 -0
- package/dist/assembly/recovery/device-loss-fanout.d.ts.map +1 -0
- package/dist/assembly/recovery/generation.d.ts +46 -0
- package/dist/assembly/recovery/generation.d.ts.map +1 -0
- package/dist/assembly/recovery/recovery-attempt.d.ts +63 -0
- package/dist/assembly/recovery/recovery-attempt.d.ts.map +1 -0
- package/dist/assembly/recovery/renderer-recover.d.ts +115 -0
- package/dist/assembly/recovery/renderer-recover.d.ts.map +1 -0
- package/dist/assembly/renderer-facade.d.ts +10 -0
- package/dist/assembly/renderer-facade.d.ts.map +1 -0
- package/dist/assembly/renderer-frame-transaction.d.ts +17 -0
- package/dist/assembly/renderer-frame-transaction.d.ts.map +1 -1
- package/dist/assembly/renderer-helpers.d.ts +19 -0
- package/dist/assembly/renderer-helpers.d.ts.map +1 -0
- package/dist/assembly/renderer-lifecycle.d.ts +34 -0
- package/dist/assembly/renderer-lifecycle.d.ts.map +1 -1
- package/dist/assembly/shader-prewarm-policy.d.ts +15 -0
- package/dist/assembly/shader-prewarm-policy.d.ts.map +1 -0
- package/dist/assembly/webgpu-ready-contract.d.ts +9 -0
- package/dist/assembly/webgpu-ready-contract.d.ts.map +1 -0
- package/dist/assembly/webgpu-ready.d.ts +55 -0
- package/dist/assembly/webgpu-ready.d.ts.map +1 -0
- package/dist/assembly/webgpu-renderer.d.ts +152 -0
- package/dist/assembly/webgpu-renderer.d.ts.map +1 -0
- package/dist/authoring.mjs +1 -1
- package/dist/{chunk-4L3P6DT5.mjs → chunk-GE3SDD72.mjs} +37 -5
- package/dist/chunk-GE3SDD72.mjs.map +1 -0
- package/dist/{chunk-HZUPSYW7.mjs → chunk-KZFTK6DO.mjs} +102 -15
- package/dist/chunk-KZFTK6DO.mjs.map +1 -0
- package/dist/{chunk-FF7K3FSO.mjs → chunk-Q752SHI5.mjs} +89 -89
- package/dist/{chunk-FF7K3FSO.mjs.map → chunk-Q752SHI5.mjs.map} +1 -1
- package/dist/{chunk-QODA5UKU.mjs → chunk-RR5L4SRS.mjs} +2 -2
- package/dist/chunk-RR5L4SRS.mjs.map +1 -0
- package/dist/{chunk-YALPS44A.mjs → chunk-TFH5I7JJ.mjs} +47 -47
- package/dist/chunk-TFH5I7JJ.mjs.map +1 -0
- package/dist/{chunk-FBC4R44J.mjs → chunk-UQYS7FRM.mjs} +57 -57
- package/dist/chunk-UQYS7FRM.mjs.map +1 -0
- package/dist/{chunk-4NPUASZR.mjs → chunk-YKB5DQV7.mjs} +161 -19
- package/dist/chunk-YKB5DQV7.mjs.map +1 -0
- package/dist/{chunk-ZUWKAZ2I.mjs → chunk-YRUYGA4A.mjs} +615 -237
- package/dist/chunk-YRUYGA4A.mjs.map +1 -0
- package/dist/{chunk-DIYW3M5D.mjs → chunk-Z3YYH2MB.mjs} +2210 -2213
- package/dist/chunk-Z3YYH2MB.mjs.map +1 -0
- package/dist/construct-renderer.mjs +19841 -16190
- package/dist/construct-renderer.mjs.map +1 -1
- package/dist/device/device-scope.d.ts +2 -0
- package/dist/device/device-scope.d.ts.map +1 -1
- package/dist/device/gpu-residency.d.ts +24 -4
- package/dist/device/gpu-residency.d.ts.map +1 -1
- package/dist/environment/frame.d.ts +5 -0
- package/dist/environment/frame.d.ts.map +1 -1
- package/dist/environment/inspection.d.ts +7 -0
- package/dist/environment/inspection.d.ts.map +1 -1
- package/dist/environment/lifecycle.d.ts +20 -2
- package/dist/environment/lifecycle.d.ts.map +1 -1
- package/dist/errors/recover.d.ts +58 -2
- package/dist/errors/recover.d.ts.map +1 -1
- package/dist/errors/render.d.ts +13 -0
- package/dist/errors/render.d.ts.map +1 -1
- package/dist/extract/contracts.d.ts +899 -0
- package/dist/extract/contracts.d.ts.map +1 -0
- package/dist/features/host.d.ts +2 -0
- package/dist/features/host.d.ts.map +1 -1
- package/dist/features/prepared-gpu-work.d.ts +3 -0
- package/dist/features/prepared-gpu-work.d.ts.map +1 -1
- package/dist/features/prepared-graphics-store.d.ts +2 -0
- package/dist/features/prepared-graphics-store.d.ts.map +1 -1
- package/dist/gpu-driven/production-raster.d.ts +28 -0
- package/dist/gpu-driven/production-raster.d.ts.map +1 -1
- package/dist/gpu-scene.d.ts +1 -0
- package/dist/gpu-scene.d.ts.map +1 -1
- package/dist/ibl/IblPipelineCache.d.ts +7 -6
- package/dist/ibl/IblPipelineCache.d.ts.map +1 -1
- package/dist/ibl/skylight-bind-group.d.ts +7 -1
- package/dist/ibl/skylight-bind-group.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +6 -6
- package/dist/internal.mjs +6 -6
- package/dist/light-buffer-layout.d.ts +3 -0
- package/dist/light-buffer-layout.d.ts.map +1 -1
- package/dist/materials.d.ts +34 -10
- package/dist/materials.d.ts.map +1 -1
- package/dist/mesh-material-bindings.d.ts +56 -0
- package/dist/mesh-material-bindings.d.ts.map +1 -1
- package/dist/occlusion-proxy.d.ts +4 -0
- package/dist/occlusion-proxy.d.ts.map +1 -0
- package/dist/pbr-pipeline.d.ts +32 -9
- package/dist/pbr-pipeline.d.ts.map +1 -1
- package/dist/points-lines/prepare.d.ts +3 -0
- package/dist/points-lines/prepare.d.ts.map +1 -1
- package/dist/points-lines/standard-owner.d.ts +33 -0
- package/dist/points-lines/standard-owner.d.ts.map +1 -0
- package/dist/record/frame-snapshot.d.ts +5 -0
- package/dist/record/frame-snapshot.d.ts.map +1 -1
- package/dist/record/frame-targets.d.ts.map +1 -1
- package/dist/record/frame.d.ts +14 -2
- package/dist/record/frame.d.ts.map +1 -1
- package/dist/record/main-pass-geometry.d.ts +14 -1
- package/dist/record/main-pass-geometry.d.ts.map +1 -1
- package/dist/record/main-pass-material.d.ts +7 -17
- package/dist/record/main-pass-material.d.ts.map +1 -1
- package/dist/record/main-pass.d.ts.map +1 -1
- package/dist/record/mesh-ssbo.d.ts +11 -3
- package/dist/record/mesh-ssbo.d.ts.map +1 -1
- package/dist/record/recovery-pipeline.d.ts +30 -0
- package/dist/record/recovery-pipeline.d.ts.map +1 -0
- package/dist/record/render-context.d.ts +26 -4
- package/dist/record/render-context.d.ts.map +1 -1
- package/dist/record/typed-frame-graph.d.ts +1 -1
- package/dist/record/typed-frame-graph.d.ts.map +1 -1
- package/dist/recovery/render-system-candidate.d.ts +65 -0
- package/dist/recovery/render-system-candidate.d.ts.map +1 -0
- package/dist/render-contract.d.ts +64 -7
- package/dist/render-contract.d.ts.map +1 -1
- package/dist/render-system-extract-tail.d.ts +12 -0
- package/dist/render-system-extract-tail.d.ts.map +1 -0
- package/dist/render-system-extract.d.ts +156 -22
- package/dist/render-system-extract.d.ts.map +1 -1
- package/dist/render-system.d.ts +128 -4
- package/dist/render-system.d.ts.map +1 -1
- package/dist/scene/render-scene.d.ts +19 -0
- package/dist/scene/render-scene.d.ts.map +1 -1
- package/dist/temporal/frame-coordinator.d.ts.map +1 -1
- package/dist/temporal/index.mjs +6 -6
- package/dist/temporal/taa-history-store.d.ts +15 -1
- package/dist/temporal/taa-history-store.d.ts.map +1 -1
- package/dist/temporal/transaction.d.ts +5 -0
- package/dist/temporal/transaction.d.ts.map +1 -1
- package/package.json +20 -20
- package/src/__tests__/device-feature-admission.unit.test.ts +6 -0
- package/src/__tests__/device-loss-fanout.unit.test.ts +107 -0
- package/src/__tests__/device-scope-lifecycle.unit.test.ts +21 -0
- package/src/__tests__/environment-generation.integration.test.ts +23 -0
- package/src/__tests__/expose-renderer-errors.unit.test.ts +34 -0
- package/src/__tests__/factory-contract.integration.test.ts +122 -7
- package/src/__tests__/fallback-row-stride-surface.unit.test.ts +4 -1
- package/src/__tests__/ibl/face-uniforms.unit.test.ts +2 -0
- package/src/__tests__/ibl-residency-publication.unit.test.ts +113 -0
- package/src/__tests__/material-contract-inventory.unit.test.ts +24 -9
- package/src/__tests__/material-cooked-projection.unit.test.ts +19 -1
- package/src/__tests__/material-static-dynamic-route.unit.test.ts +29 -0
- package/src/__tests__/material-stride-surface.unit.test.ts +7 -3
- package/src/__tests__/materials-standard-contract.unit.test.ts +104 -0
- package/src/__tests__/mesh-buffer-usage-surface.unit.test.ts +1 -1
- package/src/__tests__/physical-clearcoat.integration.test.ts +89 -0
- package/src/__tests__/prepared-gpu-driven-pbr.integration.test.ts +1 -1
- package/src/__tests__/prepared-graphics-pipeline-warmup.unit.test.ts +1 -1
- package/src/__tests__/recover-error-policy-owner.unit.test.ts +6 -3
- package/src/__tests__/recovery-candidate-prepare.contract.test.ts +140 -0
- package/src/__tests__/renderer-factory-material-contract.unit.test.ts +85 -18
- package/src/__tests__/renderer-frame-generation-fence.integration.test.ts +47 -0
- package/src/__tests__/renderer-generation-assembly.unit.test.ts +77 -0
- package/src/__tests__/renderer-generation-failure.unit.test.ts +108 -0
- package/src/__tests__/renderer-producer-root-matrix.integration.test.ts +33 -0
- package/src/__tests__/renderer-recovery-capability-matrix.unit.test.ts +59 -0
- package/src/__tests__/renderer-recovery-contract.unit.test.ts +73 -0
- package/src/__tests__/renderer-recovery-lifecycle.unit.test.ts +216 -0
- package/src/__tests__/renderer-target-history-recovery.integration.test.ts +80 -0
- package/src/__tests__/shader-manifest-fixture.ts +13 -16
- package/src/__tests__/shader-stage-surface.unit.test.ts +1 -1
- package/src/__tests__/standard-layer-projection.unit.test.ts +23 -0
- package/src/__tests__/transmission-prewarm.unit.test.ts +95 -85
- package/src/__tests__/volumetric-fog-topology.unit.test.ts +3 -1
- package/src/assembly/bundler-contract.ts +9 -0
- package/src/assembly/device-feature-admission.ts +15 -5
- package/src/assembly/extended-lighting-fallback.ts +216 -0
- package/src/assembly/factory.ts +81 -10088
- package/src/assembly/material/assembly.ts +18 -2
- package/src/assembly/material/standard-layer-projection.ts +16 -0
- package/src/assembly/material-shader-policy.ts +854 -0
- package/src/assembly/material-shader-prewarm.ts +88 -0
- package/src/assembly/mesh-ssbo-grow.ts +270 -0
- package/src/assembly/recovery/device-loss-fanout.ts +89 -0
- package/src/assembly/recovery/generation.ts +141 -0
- package/src/assembly/recovery/recovery-attempt.ts +800 -0
- package/src/assembly/recovery/renderer-recover.ts +906 -0
- package/src/assembly/renderer-facade.ts +342 -0
- package/src/assembly/renderer-frame-transaction.ts +45 -0
- package/src/assembly/renderer-helpers.ts +99 -0
- package/src/assembly/renderer-lifecycle.ts +159 -0
- package/src/assembly/shader-prewarm-policy.ts +157 -0
- package/src/assembly/webgpu-ready-contract.ts +14 -0
- package/src/assembly/webgpu-ready.ts +4079 -0
- package/src/assembly/webgpu-renderer.ts +4095 -0
- package/src/components/camera.ts +1 -1
- package/src/debug-draw-glue.ts +1 -1
- package/src/device/device-scope.ts +35 -6
- package/src/device/gpu-residency.ts +194 -26
- package/src/environment/frame.ts +6 -0
- package/src/environment/inspection.ts +10 -0
- package/src/environment/lifecycle.ts +114 -8
- package/src/errors/recover.ts +76 -5
- package/src/errors/render.ts +17 -0
- package/src/extract/contracts.ts +974 -0
- package/src/features/host.ts +16 -0
- package/src/features/prepared-gpu-work.ts +20 -2
- package/src/features/prepared-graphics-store.ts +17 -0
- package/src/gpu-driven/production-raster.ts +97 -2
- package/src/gpu-scene.ts +3 -2
- package/src/ibl/IblPipelineCache.ts +134 -50
- package/src/ibl/skylight-bind-group.ts +26 -0
- package/src/index.ts +9 -1
- package/src/light-buffer-layout.ts +3 -0
- package/src/materials.ts +262 -45
- package/src/mesh-material-bindings.ts +59 -0
- package/src/occlusion-proxy.ts +64 -0
- package/src/pbr-pipeline.ts +139 -15
- package/src/points-lines/__tests__/cache-recovery.unit.test.ts +22 -0
- package/src/points-lines/prepare.ts +9 -0
- package/src/points-lines/standard-owner.ts +403 -0
- package/src/record/__tests__/frame-targets-recovery.unit.test.ts +60 -0
- package/src/record/__tests__/main-pass-geometry.unit.test.ts +26 -1
- package/src/record/__tests__/mesh-ssbo.unit.test.ts +38 -0
- package/src/record/__tests__/recovery-pipeline.unit.test.ts +124 -0
- package/src/record/__tests__/sprite-material-abi.unit.test.ts +28 -13
- package/src/record/__tests__/standard-pbr-ubo-layout.unit.test.ts +47 -4
- package/src/record/__tests__/temporal-payload.unit.test.ts +22 -43
- package/src/record/__tests__/typed-frame-graph-plan.unit.test.ts +1 -1
- package/src/record/frame-snapshot.ts +15 -0
- package/src/record/frame-targets.ts +11 -1
- package/src/record/frame.ts +6 -2
- package/src/record/helpers.ts +1 -1
- package/src/record/main-pass-geometry.ts +230 -5
- package/src/record/main-pass-material.ts +316 -209
- package/src/record/main-pass-sprite-draws.ts +6 -7
- package/src/record/main-pass.ts +94 -6
- package/src/record/mesh-ssbo.ts +32 -10
- package/src/record/recovery-pipeline.ts +695 -0
- package/src/record/render-context.ts +35 -4
- package/src/record/typed-frame-graph.ts +45 -1
- package/src/record/view-ubo.ts +3 -3
- package/src/recovery/render-system-candidate.ts +839 -0
- package/src/render-contract.ts +65 -7
- package/src/render-system-extract-tail.ts +2983 -0
- package/src/render-system-extract.ts +124 -2977
- package/src/render-system.ts +868 -659
- package/src/scene/render-scene.ts +124 -1
- package/src/temporal/frame-coordinator.ts +4 -1
- package/src/temporal/taa-history-store.ts +46 -2
- package/src/temporal/temporal-view.ts +1 -1
- package/src/temporal/transaction.ts +9 -0
- package/src/tilemap-chunk-extract-system.ts +1 -1
- package/src/transmission/__tests__/standard-transmission.dawn.test.ts +19 -12
- package/dist/chunk-4L3P6DT5.mjs.map +0 -1
- package/dist/chunk-4NPUASZR.mjs.map +0 -1
- package/dist/chunk-DIYW3M5D.mjs.map +0 -1
- package/dist/chunk-FBC4R44J.mjs.map +0 -1
- package/dist/chunk-HZUPSYW7.mjs.map +0 -1
- package/dist/chunk-QODA5UKU.mjs.map +0 -1
- package/dist/chunk-YALPS44A.mjs.map +0 -1
- package/dist/chunk-ZUWKAZ2I.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -42,12 +42,31 @@ capability facts, then `observe(receipt, request)` for receipt-bound evidence.
|
|
|
42
42
|
|
|
43
43
|
### AI cold-start route
|
|
44
44
|
|
|
45
|
-
An AI consumer can start with the public sequence `
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
An AI consumer can start with the public sequence `state -> inspect -> recover
|
|
46
|
+
-> FrameReceipt`. `Renderer.state()` is the closed lifecycle union: only
|
|
47
|
+
`alive` admits a frame; `device-lost` permits one explicit recovery flight;
|
|
48
|
+
`recovering` shares that flight; `faulted` requires a new Renderer; and
|
|
49
|
+
`disposed` is terminal. `inspect()` is detached POD evidence for the current
|
|
50
|
+
state and recovery attempt. After `recover()` succeeds, submit the unchanged
|
|
51
|
+
draw input and use the new `FrameReceipt` as the proof for that generation.
|
|
52
|
+
|
|
53
|
+
`inspect().recovery` is always present. Its `phase` is `null` outside an active
|
|
54
|
+
attempt and otherwise follows `quiesce`, `acquire-adapter`, `acquire-device`,
|
|
55
|
+
`rehydrate`, `compile-graph`, `publish`, and `cleanup`. The projection also
|
|
56
|
+
reports the `fromGeneration`/`candidateGeneration` fence, monotonic `attempt`,
|
|
57
|
+
`lastOutcome`, committed `rehydratedRoots`, and bounded `staleLossEvents`.
|
|
58
|
+
These are detached facts; they never expose devices, graphs, textures, or
|
|
59
|
+
mutable resource collections.
|
|
60
|
+
|
|
61
|
+
During `device-lost` or `recovering`, the App keeps its host heartbeat but does
|
|
62
|
+
not advance the World or submit a frame. A failed `Result` is repaired from
|
|
63
|
+
`error.code`, `expected`, `hint`, and typed `detail`: wait for the shared
|
|
64
|
+
recovery flight, explicitly retry, repair the named owner, or create a new
|
|
65
|
+
Renderer according to the closed error. Do not parse `message`. Target and
|
|
66
|
+
history tokens retain logical identity, but their new-generation contents are
|
|
67
|
+
uninitialized until a successful receipt; a neutral target or last-known-good
|
|
68
|
+
fallback is not proof of real recovery. Public consumers never receive graph
|
|
69
|
+
nodes, devices, history textures, or prepared handles.
|
|
51
70
|
|
|
52
71
|
The current-source manifest and schema identify `source`, `build`, `backend`,
|
|
53
72
|
`runner`, and `frameIdentity`. Structural graph receipts, Browser/Dawn
|
|
@@ -74,6 +93,26 @@ plan. Register it at construction with
|
|
|
74
93
|
`createRenderer(canvas, { features: [feature] })`. A feature never receives a
|
|
75
94
|
device, queue, encoder, staging builder, or submit callback.
|
|
76
95
|
|
|
96
|
+
## RenderFeature: the producer seam (first-read index)
|
|
97
|
+
|
|
98
|
+
The public route is one `RenderFeature<FrameData>` through the active RenderGraph
|
|
99
|
+
and `Standard Pipeline`. Here `type FrameData` is the
|
|
100
|
+
producer-owned extracted value; `plan(data, context)` declares named resources and passes.
|
|
101
|
+
Register it with
|
|
102
|
+
`createRenderer(canvas, { features: [feature] })`. The renderer derives graph
|
|
103
|
+
access, preparation, recording, and recovery; the feature never receives a
|
|
104
|
+
device, queue, encoder, or submit callback. Each declaration becomes a
|
|
105
|
+
`RenderGraph pass` inside the active frame submit boundary.
|
|
106
|
+
|
|
107
|
+
### Material contract projection
|
|
108
|
+
|
|
109
|
+
Render consumes only the Pack-owned material publication projection. Its
|
|
110
|
+
inputs are runtime bool/value data, composed module slots, and the closed
|
|
111
|
+
compiler context; render never authors, cooks, writes DDC, or selects a
|
|
112
|
+
fallback material. The projection preserves `layoutIdentity`,
|
|
113
|
+
`programIdentity`, `cookIdentity`, and `materialPublicationIdentity` so a
|
|
114
|
+
stale draw can be traced to the first producer divergence.
|
|
115
|
+
|
|
77
116
|
### Directional shadow quality: author → inspect → recover
|
|
78
117
|
|
|
79
118
|
`DirectionalLight` is the only authoring entry for directional shadow quality.
|
|
@@ -501,6 +540,70 @@ Render owns this consumption route:
|
|
|
501
540
|
| `cook` output | Record only validated shader artifacts. |
|
|
502
541
|
| `recovery` | Preserve the structured failure so the source contract or cooked module can be repaired. |
|
|
503
542
|
|
|
543
|
+
## Standard physical material authoring
|
|
544
|
+
|
|
545
|
+
`Materials.standard` is the public authoring entry point for the Standard
|
|
546
|
+
root. It emits one `MaterialAsset.parameters` contract; values and texture
|
|
547
|
+
coordinates are projections of that contract, not a second feature mask. A
|
|
548
|
+
base-only root keeps `forward + deferred + shadow`, while declaring any
|
|
549
|
+
second-stage layer or physical texture selects `forward + shadow`.
|
|
550
|
+
|
|
551
|
+
```ts
|
|
552
|
+
import { Materials } from '@forgeax/engine-render';
|
|
553
|
+
|
|
554
|
+
const material = Materials.standard({
|
|
555
|
+
baseColor: [0.72, 0.48, 0.22, 1],
|
|
556
|
+
metallic: 0,
|
|
557
|
+
roughness: 0.34,
|
|
558
|
+
clearcoat: 0.7,
|
|
559
|
+
clearcoatRoughness: 0.18,
|
|
560
|
+
anisotropyStrength: 0.35,
|
|
561
|
+
anisotropyRotation: Math.PI / 2,
|
|
562
|
+
sheenColor: [0.08, 0.03, 0.02],
|
|
563
|
+
sheenRoughness: 0.25,
|
|
564
|
+
iridescence: 0.5,
|
|
565
|
+
iridescenceIor: 1.4,
|
|
566
|
+
iridescenceThicknessMinimum: 120,
|
|
567
|
+
iridescenceThicknessMaximum: 380,
|
|
568
|
+
specular: 0.9,
|
|
569
|
+
specularColor: [1, 0.92, 0.8],
|
|
570
|
+
ior: 1.5,
|
|
571
|
+
});
|
|
572
|
+
```
|
|
573
|
+
|
|
574
|
+
The layer contract and texture semantics are fixed at the root:
|
|
575
|
+
|
|
576
|
+
| Layer / slot | Defaults | Texture facts | Pass / frame rule |
|
|
577
|
+
|:--|:--|:--|:--|
|
|
578
|
+
| `clearcoat`, `clearcoatRoughness` | `0`, `0` | `clearcoatTexture.R`, `clearcoatRoughnessTexture.G`, `clearcoatNormalTexture.RG` | coat normal needs `NORMAL + UV + tangent`; coat energy attenuates the base |
|
|
579
|
+
| `anisotropyStrength`, `anisotropyRotation` | `0`, `0` radians | `anisotropyTexture.RG` direction, `.B` strength | always needs a tangent frame; rotation changes the GGX highlight axis |
|
|
580
|
+
| `sheenColor`, `sheenRoughness` | `[0,0,0]`, `0` | color RGB is sRGB; roughness A is linear | Charlie lobe stays below clearcoat and uses existing IBL resources |
|
|
581
|
+
| `iridescence`, `iridescenceIor`, `iridescenceThickness*` | `0`, `1.3`, `100..400 nm` | strength R, thickness G; min may exceed max | bounded thin-film Fresnel modifies base reflection |
|
|
582
|
+
| `specular`, `specularColor`, `ior` | `1`, `[1,1,1]`, `1.5` | `specularTexture.A` and `specularColorTexture.RGB` (sRGB for color) | dielectric F0 uses valid IOR; metallic uses the base metal response |
|
|
583
|
+
|
|
584
|
+
> [!CAUTION]
|
|
585
|
+
> A missing or conflicting anisotropy tangent input returns the structured
|
|
586
|
+
> `material-tangent-required` error. Repair the mesh producer by supplying a
|
|
587
|
+
> finite `TANGENT : vec4` (including `.w` handedness), or by supplying
|
|
588
|
+
> `NORMAL`, the selected UV set, and triangle topology so the importer can
|
|
589
|
+
> generate and persist the frame. Do not substitute an identity or derivative
|
|
590
|
+
> fallback.
|
|
591
|
+
|
|
592
|
+
For a texture, pass a `MaterialTextureValue` when the slot needs a sampler or
|
|
593
|
+
non-default coordinates; `coordinates.set` and `coordinates.transform` stay
|
|
594
|
+
with that slot. glTF authors use the same fields through the importer, which
|
|
595
|
+
preserves the chain `parse → MaterialAsset → cook → Pack refs → load`.
|
|
596
|
+
|
|
597
|
+
The public recovery path is:
|
|
598
|
+
|
|
599
|
+
```mermaid
|
|
600
|
+
flowchart LR
|
|
601
|
+
A["inspect root and receipt"] --> B["branch on error.code"]
|
|
602
|
+
B --> C["repair source, mesh, or root"]
|
|
603
|
+
C --> D["re-import / re-cook"]
|
|
604
|
+
D --> E["load the new generation and draw"]
|
|
605
|
+
```
|
|
606
|
+
|
|
504
607
|
### Mesh material binding resolution
|
|
505
608
|
|
|
506
609
|
Render resolves one effective material table per logical mesh slot before
|
|
@@ -518,6 +621,25 @@ uses the neutral engine material.
|
|
|
518
621
|
|
|
519
622
|
The render path is `MaterialAsset` -> extract snapshot -> prepare resources -> record the per-slot `coordinates` and values. The effective `parent` is already resolved before extract. If a material contract or reflection binding fails, preserve the structured error and repair the source contract or cooked module before drawing again; that is the recovery route. The render package owns consumption, not material import or cook policy.
|
|
520
623
|
|
|
624
|
+
### Materials factory color inputs
|
|
625
|
+
|
|
626
|
+
The high-level `Materials.standard` and `Materials.unlit` factories normalize
|
|
627
|
+
authored colors at their boundary. Numeric RGB/RGBA tuples are linear-sRGB and
|
|
628
|
+
are copied unchanged; CSS/Hex strings and `0xRRGGBB` integers are sRGB inputs
|
|
629
|
+
and are decoded once. Use `Materials.srgb(tuple)` when a numeric tuple is known
|
|
630
|
+
to be sRGB. Generated assets carry `colorSpace: 'linear'`, so extraction does
|
|
631
|
+
not decode them a second time. The low-level `MaterialAsset` contract remains
|
|
632
|
+
authored-sRGB by default for serialized `type: 'color'` values; mark those
|
|
633
|
+
values `colorSpace: 'linear'` when they are already linear. Texture color space
|
|
634
|
+
continues to come from each texture asset and is not overridden by material
|
|
635
|
+
array metadata.
|
|
636
|
+
|
|
637
|
+
```ts
|
|
638
|
+
const linear = Materials.standard({ baseColor: [0.5, 0.5, 0.5, 1] });
|
|
639
|
+
const css = Materials.standard({ baseColor: '#808080' });
|
|
640
|
+
const explicitSrgb = Materials.unlit(Materials.srgb([0.5, 0.5, 0.5, 1]));
|
|
641
|
+
```
|
|
642
|
+
|
|
521
643
|
### Resident material observation
|
|
522
644
|
|
|
523
645
|
`renderer.inspect().meshMaterialBindings[]` is the detached observation of the
|
|
@@ -778,9 +900,9 @@ and emits indirect arguments with `firstInstance = 0`.
|
|
|
778
900
|
|
|
779
901
|
The Standard frame activates the production raster lane when compute, storage
|
|
780
902
|
buffers, and indirect drawing are available. The current lane accepts opaque,
|
|
781
|
-
rigid default-unlit passes with batch-stable render state,
|
|
782
|
-
indexed or non-indexed geometry, multiple submeshes and
|
|
783
|
-
canonical `12F` vertex layout. It also accepts persistent rigid multi-World
|
|
903
|
+
rigid default-unlit triangle-list passes with batch-stable render state,
|
|
904
|
+
ordinary instances, indexed or non-indexed geometry, multiple submeshes and
|
|
905
|
+
material slots, and the canonical `12F` vertex layout. It also accepts persistent rigid multi-World
|
|
784
906
|
composition. Candidates come from the complete persistent projection rather
|
|
785
907
|
than the CPU-visible snapshot. The same typed graph imports the scene and mesh
|
|
786
908
|
buffers, runs the three compute passes, and consumes generated arguments with
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ImportTransport } from '@forgeax/engine-types';
|
|
2
|
+
/** Build-tool inputs forwarded from the host into renderer assembly. */
|
|
3
|
+
export interface BundlerOptions {
|
|
4
|
+
readonly importTransport?: ImportTransport | undefined;
|
|
5
|
+
readonly shaderManifestUrl?: string | undefined;
|
|
6
|
+
/** Exact checkout revision emitted by the build-tool adapter. */
|
|
7
|
+
readonly build?: string | undefined;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=bundler-contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundler-contract.d.ts","sourceRoot":"","sources":["../../src/assembly/bundler-contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,wEAAwE;AACxE,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,eAAe,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC;IACvD,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChD,iEAAiE;IACjE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACrC"}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import type { RhiAdapter, RhiDevice } from '@forgeax/engine-rhi';
|
|
2
2
|
export declare const STANDARD_PBR_REQUIRED_SAMPLED_TEXTURES = 17;
|
|
3
|
+
/**
|
|
4
|
+
* The complete Standard physical root can declare all optional texture slots.
|
|
5
|
+
* Its material group therefore needs one more sampled-texture entry than the
|
|
6
|
+
* extended-lighting topology alone. Request this ceiling when the adapter can
|
|
7
|
+
* provide it; lower-capability devices remain fail-closed at material
|
|
8
|
+
* pipeline admission instead of receiving an invalid WebGPU layout.
|
|
9
|
+
*/
|
|
10
|
+
export declare const STANDARD_PHYSICAL_REQUIRED_SAMPLED_TEXTURES = 21;
|
|
3
11
|
export interface DeviceFeatureAdmissionOptions {
|
|
4
12
|
readonly gpuPassTiming?: object | undefined;
|
|
5
13
|
readonly captureGpuTimings?: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device-feature-admission.d.ts","sourceRoot":"","sources":["../../src/assembly/device-feature-admission.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAejE,eAAO,MAAM,sCAAsC,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"device-feature-admission.d.ts","sourceRoot":"","sources":["../../src/assembly/device-feature-admission.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAejE,eAAO,MAAM,sCAAsC,KAAK,CAAC;AACzD;;;;;;GAMG;AACH,eAAO,MAAM,2CAA2C,KAAK,CAAC;AAE9D,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5C,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAClD;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,gBAAgB,EAAE,cAAc,EAAE,CAAC;IAC5C,QAAQ,CAAC,cAAc,CAAC,EAAE;QACxB,QAAQ,CAAC,gCAAgC,EAAE,MAAM,CAAC;KACnD,CAAC;CACH;AAED,KAAK,mBAAmB,GAAG,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AAE9F,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,mBAAmB,EAC5B,OAAO,CAAC,EAAE,6BAA6B,GACtC,sBAAsB,CA0BxB;AAED,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,mBAAmB,EAC5B,OAAO,CAAC,EAAE,6BAA6B,GACtC,sBAAsB,GAAG,SAAS,CAKpC;AAED,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,4BAA4B,CAAC,GAC7E,OAAO,CAOT"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Buffer, RhiDevice, Texture, TextureView } from '@forgeax/engine-rhi';
|
|
2
|
+
export interface ExtendedLightingFallbackResources {
|
|
3
|
+
readonly iesProfileTexture: Texture;
|
|
4
|
+
readonly cookieTexture: Texture;
|
|
5
|
+
readonly cookieMatrixBuffer: Buffer;
|
|
6
|
+
readonly iesProfileTextureView: TextureView;
|
|
7
|
+
readonly cookieTextureView: TextureView;
|
|
8
|
+
readonly ltcLambertTextureView: TextureView;
|
|
9
|
+
readonly ltcGgxTextureView: TextureView;
|
|
10
|
+
}
|
|
11
|
+
/** Allocate the always-valid fallback resources for the extended-lighting BGL. */
|
|
12
|
+
export declare function createExtendedLightingFallbackResources(device: RhiDevice, enabled: boolean): ExtendedLightingFallbackResources | undefined;
|
|
13
|
+
//# sourceMappingURL=extended-lighting-fallback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extended-lighting-fallback.d.ts","sourceRoot":"","sources":["../../src/assembly/extended-lighting-fallback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EAEN,SAAS,EAET,OAAO,EACP,WAAW,EACZ,MAAM,qBAAqB,CAAC;AAgB7B,MAAM,WAAW,iCAAiC;IAChD,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;IACpC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,qBAAqB,EAAE,WAAW,CAAC;IAC5C,QAAQ,CAAC,iBAAiB,EAAE,WAAW,CAAC;IACxC,QAAQ,CAAC,qBAAqB,EAAE,WAAW,CAAC;IAC5C,QAAQ,CAAC,iBAAiB,EAAE,WAAW,CAAC;CACzC;AA0FD,kFAAkF;AAClF,wBAAgB,uCAAuC,CACrD,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,OAAO,GACf,iCAAiC,GAAG,SAAS,CA0F/C"}
|
|
@@ -1,246 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { Buffer, PipelineLayout, RhiDevice } from '@forgeax/engine-rhi';
|
|
3
|
-
import { type MaterialShaderManifestEntry } from '@forgeax/engine-shader';
|
|
4
|
-
import type { ImportTransport, ParamSchemaEntry } from '@forgeax/engine-types';
|
|
5
|
-
export type { MaterialShaderManifestEntry } from '@forgeax/engine-shader';
|
|
6
|
-
import type { RenderFeatureMaterialShaderBindingContract } from '../features/plan';
|
|
7
|
-
import type { Renderer, RendererOptions } from '../render-contract';
|
|
1
|
+
import type { RendererOptions } from '../render-contract';
|
|
8
2
|
import { type RhiBackendPack } from './backend-contract';
|
|
9
|
-
import type {
|
|
10
|
-
|
|
11
|
-
export {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
*
|
|
16
|
-
* feat-20260608-create-app-param-surface-trim / M2 / D-3: aggregates the three
|
|
17
|
-
* host-injected build-tool channels:
|
|
18
|
-
*
|
|
19
|
-
* - shaderManifestUrl: the URL the host's vite-plugin-shader emit step
|
|
20
|
-
* wrote `manifest.json` to. When this field is omitted (or `bundler`
|
|
21
|
-
* itself is omitted), createRenderer falls back to
|
|
22
|
-
* '/shaders/manifest.json' (D-2 q5-A) so the LO 1.1 zero-config takeoff
|
|
23
|
-
* path keeps working without explicit injection. Tests can inject via a
|
|
24
|
-
* `data:application/json,...` URL to bypass fetch.
|
|
25
|
-
*
|
|
26
|
-
* - importTransport: dev-only ImportTransport forwarded verbatim to the
|
|
27
|
-
* AssetRegistry third ctor slot so DDC-miss assets can lazy-import.
|
|
28
|
-
* Absent => shipped form (a DDC miss fails fast with `asset-not-imported`).
|
|
29
|
-
*
|
|
30
|
-
* - build: exact checkout revision emitted by the build-tool adapter and
|
|
31
|
-
* carried into renderer-owned inspection identity.
|
|
32
|
-
*
|
|
33
|
-
* The interface is duplicated structurally in `@forgeax/engine-app`
|
|
34
|
-
* (BundlerOptions exported from packages/app); demos consume through the app
|
|
35
|
-
* package, the engine accepts via this local minimal shape so packages/runtime
|
|
36
|
-
* does NOT depend on packages/app (charter P4 + reverse-coupling deny-list).
|
|
37
|
-
* TypeScript structural typing makes the two interchangeable at every call
|
|
38
|
-
* site (M3 forgeaxBundlerAdapter() returns the same shape).
|
|
39
|
-
*/
|
|
40
|
-
export interface BundlerOptions {
|
|
41
|
-
readonly importTransport?: ImportTransport | undefined;
|
|
42
|
-
readonly shaderManifestUrl?: string | undefined;
|
|
43
|
-
/** Exact checkout revision emitted by the build-tool adapter. */
|
|
44
|
-
readonly build?: string | undefined;
|
|
45
|
-
}
|
|
46
|
-
/** Build a Renderer from the backend pack supplied by the Runtime host. */
|
|
47
|
-
/**
|
|
48
|
-
* Per-variant PipelineLayout selector (M4.5 / D-10 option A).
|
|
49
|
-
*
|
|
50
|
-
* The resolved HDRP group(2) contract needs the 7-slot BGL chain
|
|
51
|
-
* (`hdrpPbrPipelineLayout`); ordinary material contracts keep the 1-slot
|
|
52
|
-
* mesh-array BGL chain (`pbrPipelineLayout`). Variant keys select source
|
|
53
|
-
* artifacts only and never override this contract.
|
|
54
|
-
*
|
|
55
|
-
* Returns `null` when the selected layout is unavailable. An HDRP variant
|
|
56
|
-
* never falls back to the URP layout: its clustered WGSL and group(2) ABI
|
|
57
|
-
* must be admitted together or the draw fails closed.
|
|
58
|
-
*
|
|
59
|
-
* Pure function — exported for unit-test access (M4.5 / w35).
|
|
60
|
-
*/
|
|
61
|
-
/**
|
|
62
|
-
* Closed enum of pipeline-layout kinds the selector can dispatch to.
|
|
63
|
-
*
|
|
64
|
-
* `pbr` — standard PBR (1-entry mesh-array BGL).
|
|
65
|
-
* `pbr-skin` — bug-20260611-skin-pipeline-layout: 3-entry mesh-array BGL
|
|
66
|
-
* (binding 0 meshes + binding 1 current palette + binding 2 previous
|
|
67
|
-
* palette) for the `forgeax::pbr-skin`
|
|
68
|
-
* material shader.
|
|
69
|
-
* `hdrp-pbr` — feat-20260609 HDRP cluster-forward variant (7-slot group(2)
|
|
70
|
-
* BGL substituted at slot 2).
|
|
71
|
-
* `sprite-urp` — bug-20260708 M2 (c): sprite / sprite-lit shaders reuse
|
|
72
|
-
* the URP 1-slot mesh-array BGL (they don't declare
|
|
73
|
-
* CLUSTER_FORWARD_AVAILABLE) but their canonical all-true variant key
|
|
74
|
-
* `''` (`SPRITE_PASS_PER_INSTANCE_REGION_VARIANT_SET`) MUST NOT trigger
|
|
75
|
-
* the `variantSet===''` → HDRP branch of the selector. Callers
|
|
76
|
-
* (`buildPipelineContext`) resolve `sprite-urp` from the sprite
|
|
77
|
-
* `materialShaderId` and pass it through; the selector short-circuits
|
|
78
|
-
* to `pbrPipelineLayout` before the HDRP check.
|
|
79
|
-
*
|
|
80
|
-
* AC-09 grep gate: the selector body (`selectPipelineLayoutForVariant`)
|
|
81
|
-
* **MUST NOT** contain literal `'forgeax::pbr-skin'` (or another
|
|
82
|
-
* shader-id literal). The caller resolves `LayoutKind` upstream and passes
|
|
83
|
-
* the structured value through (charter P4 consistent abstraction). New
|
|
84
|
-
* material-shader layouts add a `LayoutKind` member + a PipelineState slot
|
|
85
|
-
* + a switch arm here in one cut (charter P3 extensibility).
|
|
86
|
-
*/
|
|
87
|
-
export type LayoutKind = 'pbr' | 'pbr-skin' | 'hdrp-pbr' | 'hdrp-skin' | 'sprite-urp' | 'unlit-urp';
|
|
88
|
-
/** The closed group(2) contract resolved from the selected WGSL artifact. */
|
|
89
|
-
export type { PipelineGroup2Contract } from '../pbr-pipeline';
|
|
90
|
-
export { resolvePipelineGroup2Contract } from '../pbr-pipeline';
|
|
91
|
-
/**
|
|
92
|
-
* Return every device-capability HDRP PBR variant that needs a lazy module
|
|
93
|
-
* label seeded during renderer boot. Color availability is intentionally not
|
|
94
|
-
* filtered: colored and no-color meshes use distinct composed WGSL modules.
|
|
95
|
-
* Transmission is filtered by the same sampled-texture capability gate as
|
|
96
|
-
* Standard transmission because HDRP shares the material texture ABI.
|
|
97
|
-
*/
|
|
98
|
-
export declare function selectHdrpPbrPrewarmVariants(manifestEntry: MaterialShaderManifestEntry | undefined, storageBufferCapable: boolean, extendedLightingShaderAvailableOrTransmissionCapable?: boolean, transmissionCapable?: boolean, directionalPcssAvailable?: boolean, projectorAvailable?: boolean): readonly MaterialShaderManifestEntry['variants'][number][];
|
|
99
|
-
/** Return every active-capability pbr-skin variant used by URP and HDRP draws. */
|
|
100
|
-
export declare function selectSkinPrewarmVariants(manifestEntry: MaterialShaderManifestEntry | undefined, storageBufferCapable: boolean): readonly MaterialShaderManifestEntry['variants'][number][];
|
|
101
|
-
/**
|
|
102
|
-
* Select both Standard transmission states from the manifest for exact-label
|
|
103
|
-
* prewarming. The requested keys come from declared variants; no key is
|
|
104
|
-
* synthesized and no source fallback is permitted.
|
|
105
|
-
*/
|
|
106
|
-
export declare function selectStandardPbrTransmissionPrewarmVariants(manifestEntry: MaterialShaderManifestEntry | undefined, storageBufferCapable: boolean, directionalPcssAvailable?: boolean, projectorAvailable?: boolean, extendedLightingShaderAvailable?: boolean): readonly MaterialShaderManifestEntry['variants'][number][];
|
|
107
|
-
/**
|
|
108
|
-
* Select the PBR variant that matches a fallback mesh with no COLOR_0 input.
|
|
109
|
-
* Unknown/custom material IDs may still use the legacy PBR fallback, so that
|
|
110
|
-
* path must obey the same geometry-owned vertex-color axis as registered PBR.
|
|
111
|
-
*/
|
|
112
|
-
export declare function selectNoColorPbrVariant(manifestEntry: MaterialShaderManifestEntry | undefined, storageBufferCapable: boolean, variantSet: string | undefined, extendedLightingShaderAvailable?: boolean, directionalPcssAvailable?: boolean, projectorAvailable?: boolean): MaterialShaderManifestEntry['variants'][number] | undefined;
|
|
113
|
-
export type MaterialShaderBindingContract = RenderFeatureMaterialShaderBindingContract;
|
|
114
|
-
export type MaterialShaderVertexInputContract = 'none' | 'render-material';
|
|
115
|
-
export declare function resolveMaterialShaderBindingContract(source: string): MaterialShaderBindingContract;
|
|
116
|
-
export declare function resolveMaterialShaderVertexInputContract(source: string): MaterialShaderVertexInputContract;
|
|
117
|
-
/**
|
|
118
|
-
* Decide whether a custom material's user-region can use the shared PBR
|
|
119
|
-
* bind-group layout. Resource names are not part of a WebGPU layout contract:
|
|
120
|
-
* the only safe reuse test is that every derived binding in the custom schema
|
|
121
|
-
* is an identical prefix of the canonical user-region descriptor, including
|
|
122
|
-
* binding kind and its full shape (sample type, view dimension, sampler mode,
|
|
123
|
-
* dynamic-offset flags, and visibility). A texture3d/array or comparison /
|
|
124
|
-
* storage resource must therefore take the per-shader layout path even when
|
|
125
|
-
* its field count is small.
|
|
126
|
-
*/
|
|
127
|
-
export declare function isSharedMaterialUserRegionCompatible(paramSchema: readonly ParamSchemaEntry[]): boolean;
|
|
128
|
-
export declare function allowsUnlitPreparedFallback(depthFormatOverride: GPUTextureFormat | null | undefined, vertexLayout: string | undefined, materialShaderId?: string): boolean;
|
|
129
|
-
/**
|
|
130
|
-
* Prepared VFX draws own their vertex inputs and bind groups. A missing
|
|
131
|
-
* authored material shader is therefore retryable, but it is never safe to
|
|
132
|
-
* substitute the built-in PBR module: PBR declares mesh/instance groups that
|
|
133
|
-
* the VFX draw does not bind. Returning true keeps the feature on its
|
|
134
|
-
* structured next-frame recovery path instead of creating an invalid PSO.
|
|
135
|
-
*/
|
|
136
|
-
export declare function shouldDeferMissingPreparedMaterialShader(vertexLayout: string | undefined): boolean;
|
|
137
|
-
export declare function selectPipelineLayoutForVariant(state: {
|
|
138
|
-
readonly pbrPipelineLayout: PipelineLayout | null;
|
|
139
|
-
readonly pbrProbePipelineLayout?: PipelineLayout | null;
|
|
140
|
-
readonly hdrpPbrPipelineLayout: PipelineLayout | null;
|
|
141
|
-
readonly hdrpProbePbrPipelineLayout?: PipelineLayout | null;
|
|
142
|
-
readonly pbrSkinPipelineLayout: PipelineLayout | null;
|
|
143
|
-
readonly pbrSkinProbePipelineLayout?: PipelineLayout | null;
|
|
144
|
-
readonly hdrpSkinPipelineLayout?: PipelineLayout | null;
|
|
145
|
-
} | null, variantSet: string | undefined, layoutKind?: LayoutKind): PipelineLayout | null;
|
|
146
|
-
/**
|
|
147
|
-
* Resolve a requested material variant against the actual backend capabilities.
|
|
148
|
-
* Record callers use the native-capability request; the backend-owned axes
|
|
149
|
-
* must be rewritten before the request reaches shader lookup and PSO layout
|
|
150
|
-
* selection.
|
|
151
|
-
*/
|
|
152
|
-
export declare function resolveMaterialShaderVariantSet(requestedVariantSet: string | undefined, variants: ReadonlyArray<{
|
|
153
|
-
readonly defines: Readonly<Record<string, boolean>>;
|
|
154
|
-
}>, backendKind: RhiDevice['caps']['backendKind'], storageBuffer: boolean, maxSampledTexturesPerShaderStageOrProjectorAvailable?: number | boolean): string | undefined;
|
|
155
|
-
/**
|
|
156
|
-
* Keep a single-source material on its canonical module identity. A manifest
|
|
157
|
-
* entry with no variants cannot consume a synthesized capability or geometry
|
|
158
|
-
* axis, so carrying one into the pipeline cache only creates an uncached lazy
|
|
159
|
-
* compile beside the prewarmed source module.
|
|
160
|
-
*/
|
|
161
|
-
export declare function normalizeMaterialShaderVariantSet(requestedVariantSet: string | undefined, manifestEntry: MaterialShaderManifestEntry | undefined): string | undefined;
|
|
3
|
+
import type { BundlerOptions } from './bundler-contract';
|
|
4
|
+
import type { RendererAssemblyImplementation } from './host-contract';
|
|
5
|
+
export type { BundlerOptions } from './bundler-contract';
|
|
6
|
+
export type { LayoutKind, MaterialShaderBindingContract, MaterialShaderManifestEntry, MaterialShaderVertexInputContract, MeshSsboBufferWrapper, MeshSsboGrowController, MeshSsboGrowControllerInit, MeshSsboGrowDevice, MeshSsboGrowErrorRegistry, MeshSsboGrowResult, MeshSsboState, } from './webgpu-renderer';
|
|
7
|
+
export { allowsUnlitPreparedFallback, assembleMaterialProjection, createMeshSsboGrowController, deriveStorageBufferCeiling, exposeRenderer, isSharedMaterialUserRegionCompatible, normalizeMaterialShaderVariantSet, projectMaterialPipeline, resolveMaterialShaderBindingContract, resolveMaterialShaderVariantSet, resolveMaterialShaderVertexInputContract, routeMaterialPipeline, selectHdrpPbrPrewarmVariants, selectNoColorPbrVariant, selectPipelineLayoutForVariant, selectProbePrewarmVariants, selectSkinPrewarmVariants, selectStandardPbrTransmissionPrewarmVariants, shouldDeferMissingPreparedMaterialShader, updateMaterialRuntimeValues, } from './webgpu-renderer';
|
|
8
|
+
/** Build a renderer after selecting the host-supplied backend pack. */
|
|
162
9
|
export declare function createRenderer(canvas: unknown, options?: RendererOptions, bundler?: BundlerOptions, backend?: RhiBackendPack): Promise<RendererAssemblyImplementation>;
|
|
163
|
-
/** Narrow the concrete host to the lease/receipt-only public contract. */
|
|
164
|
-
export declare function exposeRenderer(renderer: RendererHostImplementation): Renderer;
|
|
165
|
-
/**
|
|
166
|
-
* Derive a usable storage-buffer ceiling from device limits.
|
|
167
|
-
*
|
|
168
|
-
* Mirrors the `SKIN_PALETTE_MAX_BINDING_BYTES` 0/undefined floor pattern
|
|
169
|
-
* (createRenderer.ts:4070-4073): when `maxStorageBufferBindingSize` is 0 or
|
|
170
|
-
* undefined (WebKit `downlevel_webgl2_defaults`), climb the fallback chain —
|
|
171
|
-
* `maxBufferSize` → `maxUniformBufferBindingSize` → WebGPU spec floor
|
|
172
|
-
* 134217728 (128 MiB).
|
|
173
|
-
*
|
|
174
|
-
* Pure helper — no device dependency, directly testable in node.
|
|
175
|
-
*/
|
|
176
|
-
export declare function deriveStorageBufferCeiling(limits: Readonly<{
|
|
177
|
-
maxStorageBufferBindingSize?: number;
|
|
178
|
-
maxBufferSize?: number;
|
|
179
|
-
maxUniformBufferBindingSize?: number;
|
|
180
|
-
}>): number;
|
|
181
|
-
/**
|
|
182
|
-
* Mesh + material buffer wrapper carrying the inner `Buffer` handle plus
|
|
183
|
-
* the byte-size at the time of allocation. The wrapper-object identity is
|
|
184
|
-
* stable across grow events — only `.buffer` and `.sizeInBytes` are mutated
|
|
185
|
-
* in place — so `PipelineState.meshStorageBuffer` / `materialUniformBuffer`
|
|
186
|
-
* fields capture the wrapper once and survive grow events without a re-bind
|
|
187
|
-
* cycle through the public Renderer surface (research §F8 R1).
|
|
188
|
-
*/
|
|
189
|
-
export interface MeshSsboBufferWrapper {
|
|
190
|
-
buffer: Buffer | null;
|
|
191
|
-
sizeInBytes: number;
|
|
192
|
-
}
|
|
193
|
-
/** Closure-local grow state surfaced for spy assertions in unit tests. */
|
|
194
|
-
export interface MeshSsboState {
|
|
195
|
-
slotCount: number;
|
|
196
|
-
mesh: MeshSsboBufferWrapper;
|
|
197
|
-
material: MeshSsboBufferWrapper;
|
|
198
|
-
}
|
|
199
|
-
/** `growMeshSsbo` return shape (D-5: Result-like, never throws). */
|
|
200
|
-
export type MeshSsboGrowResult = {
|
|
201
|
-
readonly ok: true;
|
|
202
|
-
} | {
|
|
203
|
-
readonly ok: false;
|
|
204
|
-
readonly code: 'mesh-ssbo-ceiling-reached' | 'mesh-ssbo-capacity-exceeded';
|
|
205
|
-
/** Pre-grow slotCount — the caller can render up to this many slots (degraded subset). */
|
|
206
|
-
readonly degradedToSlotCount: number;
|
|
207
|
-
};
|
|
208
|
-
/** Minimal device surface the grow controller needs (mocked in unit tests). */
|
|
209
|
-
export interface MeshSsboGrowDevice {
|
|
210
|
-
readonly limits: {
|
|
211
|
-
readonly maxStorageBufferBindingSize: number;
|
|
212
|
-
};
|
|
213
|
-
readonly createBuffer: (descriptor: {
|
|
214
|
-
readonly label?: string;
|
|
215
|
-
readonly size: number;
|
|
216
|
-
readonly usage: number;
|
|
217
|
-
readonly mappedAtCreation?: boolean;
|
|
218
|
-
}) => Buffer;
|
|
219
|
-
}
|
|
220
|
-
/** Minimal error-registry surface (just `fire` — `RhiErrorListenerRegistry` matches). */
|
|
221
|
-
export interface MeshSsboGrowErrorRegistry {
|
|
222
|
-
fire: (e: MeshSsboCeilingReachedError | MeshSsboCapacityExceededError) => void;
|
|
223
|
-
}
|
|
224
|
-
export interface MeshSsboGrowControllerInit {
|
|
225
|
-
readonly device: MeshSsboGrowDevice;
|
|
226
|
-
readonly errorRegistry: MeshSsboGrowErrorRegistry;
|
|
227
|
-
readonly initialSlotCount: number;
|
|
228
|
-
readonly perEntityStride: number;
|
|
229
|
-
readonly meshUsage: number;
|
|
230
|
-
readonly materialUsage: number;
|
|
231
|
-
}
|
|
232
|
-
export interface MeshSsboGrowController {
|
|
233
|
-
readonly state: MeshSsboState;
|
|
234
|
-
/** Allocate the initial mesh + material buffer pair at `initialSlotCount`. */
|
|
235
|
-
readonly initialBuild: () => void;
|
|
236
|
-
/** Grow to satisfy `neededSlots`; idempotent + ceiling-aware. */
|
|
237
|
-
readonly growMeshSsbo: (neededSlots: number) => MeshSsboGrowResult;
|
|
238
|
-
}
|
|
239
|
-
/**
|
|
240
|
-
* Build a closure-scoped mesh-SSBO grow controller. Module-scope so unit
|
|
241
|
-
* tests (`__tests__/mesh-ssbo-grow.test.ts`) can construct it with a fake
|
|
242
|
-
* device + spy errorRegistry without spinning up the full WebGPU renderer
|
|
243
|
-
* (charter F2 minimal surface — the controller is the testable seam).
|
|
244
|
-
*/
|
|
245
|
-
export declare function createMeshSsboGrowController(init: MeshSsboGrowControllerInit): MeshSsboGrowController;
|
|
246
10
|
//# sourceMappingURL=factory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src/assembly/factory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src/assembly/factory.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAA0B,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AAqCtE,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,YAAY,EACV,UAAU,EACV,6BAA6B,EAC7B,2BAA2B,EAC3B,iCAAiC,EACjC,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,kBAAkB,EAClB,yBAAyB,EACzB,kBAAkB,EAClB,aAAa,GACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC1B,4BAA4B,EAC5B,0BAA0B,EAC1B,cAAc,EACd,oCAAoC,EACpC,iCAAiC,EACjC,uBAAuB,EACvB,oCAAoC,EACpC,+BAA+B,EAC/B,wCAAwC,EACxC,qBAAqB,EACrB,4BAA4B,EAC5B,uBAAuB,EACvB,8BAA8B,EAC9B,0BAA0B,EAC1B,yBAAyB,EACzB,4CAA4C,EAC5C,wCAAwC,EACxC,2BAA2B,GAC5B,MAAM,mBAAmB,CAAC;AAqD3B,uEAAuE;AACvE,wBAAsB,cAAc,CAClC,MAAM,EAAE,OAAO,EACf,OAAO,CAAC,EAAE,eAAe,EACzB,OAAO,CAAC,EAAE,cAAc,EACxB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,8BAA8B,CAAC,CAqBzC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type { MaterialValue } from '@forgeax/engine-types';
|
|
1
|
+
import { type CookedMaterialRecord } from '@forgeax/engine-pack/material-cook';
|
|
2
|
+
import type { MaterialValue, StandardLayerPlan } from '@forgeax/engine-types';
|
|
3
3
|
export interface MaterialRenderPassProjection {
|
|
4
4
|
readonly name: string;
|
|
5
5
|
readonly module: string;
|
|
@@ -16,6 +16,7 @@ export interface MaterialRenderProjection {
|
|
|
16
16
|
readonly passes: readonly MaterialRenderPassProjection[];
|
|
17
17
|
readonly runtimeValues: Readonly<Record<string, MaterialValue | null>>;
|
|
18
18
|
readonly staticSelection: readonly string[];
|
|
19
|
+
readonly layerPlan: StandardLayerPlan;
|
|
19
20
|
}
|
|
20
21
|
export declare function assembleMaterialProjection(record: CookedMaterialRecord): MaterialRenderProjection;
|
|
21
22
|
//# sourceMappingURL=assembly.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assembly.d.ts","sourceRoot":"","sources":["../../../src/assembly/material/assembly.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"assembly.d.ts","sourceRoot":"","sources":["../../../src/assembly/material/assembly.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG9E,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACxD,QAAQ,CAAC,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACzD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,SAAS,4BAA4B,EAAE,CAAC;IACzD,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAAC,CAAC,CAAC;IACvE,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5C,QAAQ,CAAC,SAAS,EAAE,iBAAiB,CAAC;CACvC;AAkBD,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,oBAAoB,GAAG,wBAAwB,CAoBjG"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { MaterialParameter, MaterialPass, StandardLayerPlan } from '@forgeax/engine-types';
|
|
2
|
+
/**
|
|
3
|
+
* Renderer projection of the compiler-owned Standard layer contract.
|
|
4
|
+
*
|
|
5
|
+
* The renderer receives the prepared parameter/pass snapshot and never keeps
|
|
6
|
+
* a second parameter-name inventory. This function is intentionally pure so
|
|
7
|
+
* assembly and tests observe the same mode and pass family as cooking.
|
|
8
|
+
*/
|
|
9
|
+
export declare function projectStandardLayerPlan(parameters: readonly MaterialParameter[], passes: readonly MaterialPass[]): StandardLayerPlan;
|
|
10
|
+
//# sourceMappingURL=standard-layer-projection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"standard-layer-projection.d.ts","sourceRoot":"","sources":["../../../src/assembly/material/standard-layer-projection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAGhG;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,SAAS,iBAAiB,EAAE,EACxC,MAAM,EAAE,SAAS,YAAY,EAAE,GAC9B,iBAAiB,CAEnB"}
|