@forgeax/engine-render 0.1.7 → 0.1.20
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 +140 -2
- package/dist/.tsbuildinfo +1 -1
- package/dist/assembly/backend-contract.d.ts +12 -0
- package/dist/assembly/backend-contract.d.ts.map +1 -1
- package/dist/assembly/factory.d.ts +26 -5
- package/dist/assembly/factory.d.ts.map +1 -1
- package/dist/assembly/host-contract.d.ts +4 -0
- package/dist/assembly/host-contract.d.ts.map +1 -1
- package/dist/assembly/renderer-frame-transaction.d.ts +39 -0
- package/dist/assembly/renderer-frame-transaction.d.ts.map +1 -0
- package/dist/assembly/renderer-inspection.d.ts +22 -0
- package/dist/assembly/renderer-inspection.d.ts.map +1 -0
- package/dist/assembly/renderer-lifecycle.d.ts +4 -0
- package/dist/assembly/renderer-lifecycle.d.ts.map +1 -0
- package/dist/authoring.mjs +4 -2
- package/dist/authoring.mjs.map +1 -1
- package/dist/chunk-4XINDLAY.mjs +9404 -0
- package/dist/chunk-4XINDLAY.mjs.map +1 -0
- package/dist/chunk-CDTWTHZR.mjs +752 -0
- package/dist/chunk-CDTWTHZR.mjs.map +1 -0
- package/dist/chunk-FJ6P52EE.mjs +46 -0
- package/dist/chunk-FJ6P52EE.mjs.map +1 -0
- package/dist/chunk-JDWARUOI.mjs +44 -0
- package/dist/chunk-JDWARUOI.mjs.map +1 -0
- package/dist/chunk-M2MP4ZOU.mjs +73 -0
- package/dist/chunk-M2MP4ZOU.mjs.map +1 -0
- package/dist/chunk-PCHBPYML.mjs +385 -0
- package/dist/chunk-PCHBPYML.mjs.map +1 -0
- package/dist/chunk-RXZ3RGOU.mjs +53 -0
- package/dist/chunk-RXZ3RGOU.mjs.map +1 -0
- package/dist/{chunk-YEJIUW7D.mjs → chunk-TBQJOK2L.mjs} +356 -543
- package/dist/chunk-TBQJOK2L.mjs.map +1 -0
- package/dist/{chunk-CQXZC5XI.mjs → chunk-VFPLTKCU.mjs} +79 -69
- package/dist/chunk-VFPLTKCU.mjs.map +1 -0
- package/dist/components/atmosphere.d.ts +9 -0
- package/dist/components/atmosphere.d.ts.map +1 -0
- package/dist/components/camera.d.ts +2 -1
- package/dist/components/camera.d.ts.map +1 -1
- package/dist/components/fog.d.ts +8 -0
- package/dist/components/fog.d.ts.map +1 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/light-helpers.d.ts.map +1 -1
- package/dist/components/motion-blur.d.ts +7 -0
- package/dist/components/motion-blur.d.ts.map +1 -0
- package/dist/components/spot-light.d.ts +12 -0
- package/dist/components/spot-light.d.ts.map +1 -1
- package/dist/construct-renderer.d.ts +2 -2
- package/dist/construct-renderer.d.ts.map +1 -1
- package/dist/construct-renderer.mjs +11146 -14507
- package/dist/construct-renderer.mjs.map +1 -1
- package/dist/device/device-scope.d.ts +4 -0
- package/dist/device/device-scope.d.ts.map +1 -1
- package/dist/device/gpu-residency.d.ts +19 -2
- package/dist/device/gpu-residency.d.ts.map +1 -1
- package/dist/environment/frame.d.ts +60 -0
- package/dist/environment/frame.d.ts.map +1 -0
- package/dist/environment/generation.d.ts +21 -0
- package/dist/environment/generation.d.ts.map +1 -0
- package/dist/environment/graph.d.ts +4 -0
- package/dist/environment/graph.d.ts.map +1 -0
- package/dist/environment/inspection.d.ts +48 -0
- package/dist/environment/inspection.d.ts.map +1 -0
- package/dist/environment/lifecycle.d.ts +39 -0
- package/dist/environment/lifecycle.d.ts.map +1 -0
- package/dist/environment/signature.d.ts +25 -0
- package/dist/environment/signature.d.ts.map +1 -0
- package/dist/errors/render.d.ts +204 -1
- package/dist/errors/render.d.ts.map +1 -1
- package/dist/extract/camera.d.ts +5 -0
- package/dist/extract/camera.d.ts.map +1 -0
- package/dist/extract/environment.d.ts +74 -0
- package/dist/extract/environment.d.ts.map +1 -0
- package/dist/extract/visibility.d.ts +1 -1
- package/dist/extract/visibility.d.ts.map +1 -1
- package/dist/features/host.d.ts +9 -2
- package/dist/features/host.d.ts.map +1 -1
- package/dist/features/motion-blur/motion-blur-feature.d.ts +16 -0
- package/dist/features/motion-blur/motion-blur-feature.d.ts.map +1 -0
- package/dist/features/motion-blur/motion-blur-params.d.ts +25 -0
- package/dist/features/motion-blur/motion-blur-params.d.ts.map +1 -0
- package/dist/features/plan.d.ts +17 -2
- package/dist/features/plan.d.ts.map +1 -1
- package/dist/features/prepared-gpu-work.d.ts +3 -1
- package/dist/features/prepared-gpu-work.d.ts.map +1 -1
- package/dist/features/prepared-graphics.d.ts +2 -1
- package/dist/features/prepared-graphics.d.ts.map +1 -1
- package/dist/features/render-graph-raster.d.ts +2 -1
- package/dist/features/render-graph-raster.d.ts.map +1 -1
- package/dist/features/targets.d.ts +3 -0
- package/dist/features/targets.d.ts.map +1 -1
- package/dist/features/types.d.ts +12 -0
- package/dist/features/types.d.ts.map +1 -1
- package/dist/fullscreen-post-process-pass.d.ts +7 -1
- package/dist/fullscreen-post-process-pass.d.ts.map +1 -1
- package/dist/gpu-scene.d.ts +2 -0
- package/dist/gpu-scene.d.ts.map +1 -1
- package/dist/gpu-usage.d.ts +2 -0
- package/dist/gpu-usage.d.ts.map +1 -1
- package/dist/ibl/skylight-bind-group.d.ts +5 -6
- package/dist/ibl/skylight-bind-group.d.ts.map +1 -1
- package/dist/index.d.ts +24 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +6 -4
- package/dist/index.mjs.map +1 -1
- package/dist/inspection-types.d.ts +43 -1
- package/dist/inspection-types.d.ts.map +1 -1
- package/dist/internal.d.ts +2 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.mjs +2 -0
- package/dist/light-buffer-layout.d.ts +20 -12
- package/dist/light-buffer-layout.d.ts.map +1 -1
- package/dist/materials.d.ts +22 -0
- package/dist/materials.d.ts.map +1 -1
- package/dist/pbr-pipeline.d.ts +16 -9
- package/dist/pbr-pipeline.d.ts.map +1 -1
- package/dist/pipeline/standard-forward-lane.d.ts.map +1 -1
- package/dist/pipeline/standard-pipeline.d.ts +3 -0
- package/dist/pipeline/standard-pipeline.d.ts.map +1 -1
- package/dist/pipeline/standard-post.d.ts +48 -0
- package/dist/pipeline/standard-post.d.ts.map +1 -0
- package/dist/pipeline/standard-profile.d.ts +12 -2
- package/dist/pipeline/standard-profile.d.ts.map +1 -1
- package/dist/pipeline-builder.d.ts +18 -0
- package/dist/pipeline-builder.d.ts.map +1 -1
- package/dist/pipeline-spec.d.ts.map +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/record/frame-lighting.d.ts +2 -0
- package/dist/record/frame-lighting.d.ts.map +1 -1
- package/dist/record/frame-snapshot.d.ts +137 -6
- 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 +6 -3
- package/dist/record/frame.d.ts.map +1 -1
- package/dist/record/gpu-timing.d.ts +32 -0
- package/dist/record/gpu-timing.d.ts.map +1 -0
- package/dist/record/main-pass-geometry.d.ts +11 -0
- package/dist/record/main-pass-geometry.d.ts.map +1 -1
- package/dist/record/main-pass-material.d.ts +9 -6
- package/dist/record/main-pass-material.d.ts.map +1 -1
- package/dist/record/main-pass-sprite-draws.d.ts +8 -1
- package/dist/record/main-pass-sprite-draws.d.ts.map +1 -1
- package/dist/record/main-pass.d.ts +2 -0
- package/dist/record/main-pass.d.ts.map +1 -1
- package/dist/record/mesh-ssbo.d.ts.map +1 -1
- package/dist/record/render-context.d.ts +81 -19
- package/dist/record/render-context.d.ts.map +1 -1
- package/dist/record/shadow-pass.d.ts.map +1 -1
- package/dist/record/skybox-post-pass.d.ts +1 -11
- package/dist/record/skybox-post-pass.d.ts.map +1 -1
- package/dist/record/typed-frame-graph.d.ts +36 -4
- package/dist/record/typed-frame-graph.d.ts.map +1 -1
- package/dist/record/view-ubo.d.ts +4 -1
- package/dist/record/view-ubo.d.ts.map +1 -1
- package/dist/render-contract.d.ts +157 -8
- package/dist/render-contract.d.ts.map +1 -1
- package/dist/render-data.d.ts +10 -6
- package/dist/render-data.d.ts.map +1 -1
- package/dist/render-graph-primitives.d.ts.map +1 -1
- package/dist/render-pipeline.d.ts +86 -6
- package/dist/render-pipeline.d.ts.map +1 -1
- package/dist/render-system-extract.d.ts +84 -8
- package/dist/render-system-extract.d.ts.map +1 -1
- package/dist/render-system.d.ts +30 -5
- package/dist/render-system.d.ts.map +1 -1
- package/dist/renderer-inspect.d.ts +29 -0
- package/dist/renderer-inspect.d.ts.map +1 -0
- package/dist/scene/render-scene.d.ts +36 -2
- package/dist/scene/render-scene.d.ts.map +1 -1
- package/dist/temporal/coverage.d.ts +42 -0
- package/dist/temporal/coverage.d.ts.map +1 -0
- package/dist/temporal/frame-coordinator.d.ts +99 -0
- package/dist/temporal/frame-coordinator.d.ts.map +1 -0
- package/dist/temporal/frame.d.ts +44 -0
- package/dist/temporal/frame.d.ts.map +1 -0
- package/dist/temporal/gpu.d.ts +39 -0
- package/dist/temporal/gpu.d.ts.map +1 -0
- package/dist/temporal/history.d.ts +37 -0
- package/dist/temporal/history.d.ts.map +1 -0
- package/dist/temporal/index.d.ts +7 -0
- package/dist/temporal/index.d.ts.map +1 -0
- package/dist/temporal/index.mjs +8 -0
- package/dist/temporal/index.mjs.map +1 -0
- package/dist/temporal/inspection.d.ts +36 -0
- package/dist/temporal/inspection.d.ts.map +1 -0
- package/dist/temporal/scene-data-catalog.d.ts +48 -0
- package/dist/temporal/scene-data-catalog.d.ts.map +1 -0
- package/dist/temporal/scene-data.d.ts +43 -0
- package/dist/temporal/scene-data.d.ts.map +1 -0
- package/dist/temporal/standard-scene-data.d.ts +61 -0
- package/dist/temporal/standard-scene-data.d.ts.map +1 -0
- package/dist/temporal/taa-history-resources.d.ts +22 -0
- package/dist/temporal/taa-history-resources.d.ts.map +1 -0
- package/dist/temporal/taa-history-store.d.ts +27 -0
- package/dist/temporal/taa-history-store.d.ts.map +1 -0
- package/dist/temporal/taa-resolve.d.ts +15 -0
- package/dist/temporal/taa-resolve.d.ts.map +1 -0
- package/dist/temporal/temporal-view.d.ts +40 -0
- package/dist/temporal/temporal-view.d.ts.map +1 -0
- package/dist/temporal/transaction.d.ts +9 -0
- package/dist/temporal/transaction.d.ts.map +1 -0
- package/dist/temporal/view.d.ts +56 -0
- package/dist/temporal/view.d.ts.map +1 -0
- package/dist/transmission/backdrop.d.ts +147 -0
- package/dist/transmission/backdrop.d.ts.map +1 -0
- package/dist/transmission/inspection.d.ts +57 -0
- package/dist/transmission/inspection.d.ts.map +1 -0
- package/dist/transmission/oracle.d.ts +42 -0
- package/dist/transmission/oracle.d.ts.map +1 -0
- package/dist/transmission/projection.d.ts +37 -0
- package/dist/transmission/projection.d.ts.map +1 -0
- package/dist/typed-render-graph-primitives.d.ts +30 -2
- package/dist/typed-render-graph-primitives.d.ts.map +1 -1
- package/dist/typed-shadow-atlas.d.ts +10 -0
- package/dist/typed-shadow-atlas.d.ts.map +1 -0
- package/dist/typed-shadow-passes.d.ts.map +1 -1
- package/dist/volume/capability.d.ts +57 -0
- package/dist/volume/capability.d.ts.map +1 -0
- package/dist/volume/component.d.ts +61 -0
- package/dist/volume/component.d.ts.map +1 -0
- package/dist/volume/extract.d.ts +11 -0
- package/dist/volume/extract.d.ts.map +1 -0
- package/dist/volume/inspection.d.ts +38 -0
- package/dist/volume/inspection.d.ts.map +1 -0
- package/dist/volume/passes.d.ts +38 -0
- package/dist/volume/passes.d.ts.map +1 -0
- package/dist/volume/recovery.d.ts +38 -0
- package/dist/volume/recovery.d.ts.map +1 -0
- package/dist/volume/resources.d.ts +57 -0
- package/dist/volume/resources.d.ts.map +1 -0
- package/dist/volume/temporal.d.ts +35 -0
- package/dist/volume/temporal.d.ts.map +1 -0
- package/package.json +24 -19
- package/src/__tests__/ai-user-cold-start.integration.test.ts +59 -0
- package/src/__tests__/ai-user-public-surface.test-d.ts +45 -0
- package/src/__tests__/bloom-exact-zero.unit.test.ts +202 -0
- package/src/__tests__/bloom-lifecycle.integration.test.ts +125 -0
- package/src/__tests__/construct-renderer-identity.unit.test.ts +4 -3
- package/src/__tests__/detached-inspection.integration.test.ts +177 -0
- package/src/__tests__/environment-fog-lanes.integration.test.ts +219 -0
- package/src/__tests__/environment-generation.integration.test.ts +141 -0
- package/src/__tests__/environment-selection.unit.test.ts +245 -0
- package/src/__tests__/factory-contract.integration.test.ts +1380 -9
- package/src/__tests__/frame-plan-contract.unit.test.ts +90 -0
- package/src/__tests__/fullscreen-feature-plan.unit.test.ts +7 -0
- package/src/__tests__/gpu-driven-production.integration.test.ts +74 -22
- package/src/__tests__/gpu-driven-view-graph.integration.test.ts +37 -0
- package/src/__tests__/gpu-scene.unit.test.ts +10 -0
- package/src/__tests__/injection-kind-owner.test-d.ts +2 -1
- package/src/__tests__/ktx2-basis-gpu-consumer.dawn.test.ts +14 -14
- package/src/__tests__/material-contract-inventory.unit.test.ts +62 -0
- package/src/__tests__/material-cooked-projection.unit.test.ts +18 -146
- package/src/__tests__/materials-transmission-validation.unit.test.ts +36 -0
- package/src/__tests__/mesh-buffer-usage-surface.unit.test.ts +1 -1
- package/src/__tests__/morph-feature-plan.unit.test.ts +7 -0
- package/src/__tests__/motion-blur.pixel.integration.test.ts +121 -0
- package/src/__tests__/public-surface.test-d.ts +15 -1
- package/src/__tests__/render-error-code-owner.test-d.ts +14 -0
- package/src/__tests__/render-error-detail-ssot.test-d.ts +11 -2
- package/src/__tests__/render-error-exhaustive.test-d.ts +3 -0
- package/src/__tests__/render-feature-errors.unit.test.ts +33 -3
- package/src/__tests__/render-feature-gpu-work.integration.test.ts +44 -0
- package/src/__tests__/render-feature-plan.test-d.ts +22 -89
- package/src/__tests__/render-scene-projection.unit.test.ts +28 -0
- package/src/__tests__/render-temporal-environment-consumer.browser.test.ts +26 -0
- package/src/__tests__/render-temporal-environment-consumer.dawn.test.ts +21 -0
- package/src/__tests__/renderer-factory-material-contract.unit.test.ts +423 -1
- package/src/__tests__/renderer-frame-transaction.integration.test.ts +405 -0
- package/src/__tests__/renderer-lifecycle.integration.test.ts +22 -0
- package/src/__tests__/scene-data-catalog.unit.test.ts +59 -0
- package/src/__tests__/scene-data-consumer.integration.test.ts +67 -0
- package/src/__tests__/scene-data-contract.test-d.ts +35 -0
- package/src/__tests__/scene-data-inspection.unit.test.ts +41 -0
- package/src/__tests__/scene-data-public-surface.test-d.ts +34 -0
- package/src/__tests__/shader-manifest-fixture.ts +111 -0
- package/src/__tests__/skinned-shadow-caster.test.ts +123 -0
- package/src/__tests__/standard-clustered-pipeline.unit.test.ts +24 -3
- package/src/__tests__/standard-pipeline.dawn.test.ts +15 -0
- package/src/__tests__/standard-pipeline.integration.test.ts +543 -1
- package/src/__tests__/standard-profile-oracle.unit.test.ts +12 -2
- package/src/__tests__/standard-temporal-producer.integration.test.ts +35 -0
- package/src/__tests__/surface-configuration.unit.test.ts +211 -12
- package/src/__tests__/taa-transaction.integration.test.ts +30 -0
- package/src/__tests__/temporal-admission.integration.test.ts +40 -0
- package/src/__tests__/temporal-coverage.unit.test.ts +35 -0
- package/src/__tests__/temporal-demand.unit.test.ts +44 -0
- package/src/__tests__/temporal-frame-coordinator.unit.test.ts +64 -0
- package/src/__tests__/temporal-graph-topology.unit.test.ts +51 -0
- package/src/__tests__/temporal-history-lifecycle.unit.test.ts +170 -0
- package/src/__tests__/temporal-performance.integration.test.ts +615 -0
- package/src/__tests__/temporal-reset-matrix.unit.test.ts +97 -0
- package/src/__tests__/temporal-transaction.integration.test.ts +60 -0
- package/src/__tests__/temporal-view.unit.test.ts +152 -0
- package/src/__tests__/transmission-prewarm.unit.test.ts +93 -0
- package/src/__tests__/typed-pipeline-topology.unit.test.ts +230 -1
- package/src/__tests__/urp-pipeline-targets.unit.test.ts +25 -1
- package/src/__tests__/urp-pipeline.unit.test.ts +4 -3
- package/src/__tests__/visibility-extract.integration.test.ts +27 -1
- package/src/__tests__/visibility-producer-matrix.integration.test.ts +10 -0
- package/src/__tests__/volume-optics-oracle.unit.test.ts +85 -0
- package/src/__tests__/volumetric-fog-budget-recovery.integration.test.ts +655 -0
- package/src/__tests__/volumetric-fog-component.unit.test.ts +71 -0
- package/src/__tests__/volumetric-fog-composite-stage-readback.dawn.test.ts +376 -0
- package/src/__tests__/volumetric-fog-errors.unit.test.ts +51 -0
- package/src/__tests__/volumetric-fog-inspection.unit.test.ts +77 -0
- package/src/__tests__/volumetric-fog-light-capability.unit.test.ts +19 -0
- package/src/__tests__/volumetric-fog-light-consumers.integration.test.ts +18 -0
- package/src/__tests__/volumetric-fog-light-errors.unit.test.ts +17 -0
- package/src/__tests__/volumetric-fog-light-topology.unit.test.ts +21 -0
- package/src/__tests__/volumetric-fog-light-transaction.integration.test.ts +53 -0
- package/src/__tests__/volumetric-fog-m9-watcher.integration.test.ts +27 -0
- package/src/__tests__/volumetric-fog-point-light-owner.integration.test.ts +44 -0
- package/src/__tests__/volumetric-fog-point-spot-accumulation.integration.test.ts +49 -0
- package/src/__tests__/volumetric-fog-point-spot-contract.unit.test.ts +28 -0
- package/src/__tests__/volumetric-fog-point-spot-lkg.integration.test.ts +65 -0
- package/src/__tests__/volumetric-fog-point-spot-selection.integration.test.ts +49 -0
- package/src/__tests__/volumetric-fog-point-spot-temporal.unit.test.ts +55 -0
- package/src/__tests__/volumetric-fog-projector-contract.unit.test.ts +22 -0
- package/src/__tests__/volumetric-fog-projector-inspection.unit.test.ts +12 -0
- package/src/__tests__/volumetric-fog-projector-surface-volume.integration.test.ts +11 -0
- package/src/__tests__/volumetric-fog-projector-transaction.integration.test.ts +26 -0
- package/src/__tests__/volumetric-fog-recovery.integration.test.ts +47 -0
- package/src/__tests__/volumetric-fog-selected-light-resolution.integration.test.ts +63 -0
- package/src/__tests__/volumetric-fog-spot-closure.integration.test.ts +26 -0
- package/src/__tests__/volumetric-fog-spot-contract.test-d.ts +21 -0
- package/src/__tests__/volumetric-fog-spot-contract.unit.test.ts +27 -0
- package/src/__tests__/volumetric-fog-spot-frame-optics.integration.test.ts +14 -0
- package/src/__tests__/volumetric-fog-spot-optics.integration.test.ts +29 -0
- package/src/__tests__/volumetric-fog-stage-readback.dawn.test.ts +550 -0
- package/src/__tests__/volumetric-fog-temporal-selected-light.unit.test.ts +33 -0
- package/src/__tests__/volumetric-fog-temporal.unit.test.ts +45 -0
- package/src/__tests__/volumetric-fog-topology.unit.test.ts +237 -0
- package/src/__tests__/volumetric-fog-transparent.integration.test.ts +27 -0
- package/src/assembly/backend-contract.ts +47 -1
- package/src/assembly/factory.ts +1480 -505
- package/src/assembly/host-contract.ts +4 -0
- package/src/assembly/renderer-frame-transaction.ts +75 -0
- package/src/assembly/renderer-inspection.ts +112 -0
- package/src/assembly/renderer-lifecycle.ts +6 -0
- package/src/components/__tests__/motion-blur.unit.test.ts +14 -0
- package/src/components/__tests__/schema-contract.unit.test.ts +6 -1
- package/src/components/atmosphere.ts +10 -0
- package/src/components/camera.ts +2 -1
- package/src/components/fog.ts +9 -0
- package/src/components/index.ts +3 -0
- package/src/components/light-helpers.ts +4 -0
- package/src/components/motion-blur.ts +8 -0
- package/src/components/spot-light.ts +22 -3
- package/src/construct-renderer.ts +40 -3
- package/src/device/device-scope.ts +15 -1
- package/src/device/gpu-residency.ts +168 -58
- package/src/environment/frame.ts +185 -0
- package/src/environment/generation.ts +23 -0
- package/src/environment/graph.ts +9 -0
- package/src/environment/inspection.ts +87 -0
- package/src/environment/lifecycle.ts +250 -0
- package/src/environment/signature.ts +55 -0
- package/src/errors/render.ts +404 -1
- package/src/extract/camera.ts +78 -0
- package/src/extract/environment.ts +171 -0
- package/src/extract/visibility.ts +38 -19
- package/src/features/host.ts +36 -5
- package/src/features/motion-blur/__tests__/motion-blur-feature.unit.test.ts +67 -0
- package/src/features/motion-blur/__tests__/motion-blur-params.unit.test.ts +53 -0
- package/src/features/motion-blur/motion-blur-feature.ts +119 -0
- package/src/features/motion-blur/motion-blur-params.ts +89 -0
- package/src/features/plan.ts +32 -3
- package/src/features/prepared-gpu-work.ts +21 -6
- package/src/features/prepared-graphics.ts +2 -1
- package/src/features/render-graph-raster.ts +2 -1
- package/src/features/targets.ts +24 -2
- package/src/features/types.ts +13 -0
- package/src/fullscreen-post-process-pass.ts +34 -4
- package/src/gpu-scene.ts +24 -0
- package/src/gpu-usage.ts +2 -0
- package/src/ibl/skylight-bind-group.ts +30 -38
- package/src/index.ts +104 -7
- package/src/inspection-types.ts +48 -0
- package/src/internal.ts +5 -0
- package/src/light-buffer-layout.ts +59 -26
- package/src/materials.ts +119 -24
- package/src/pbr-pipeline.ts +91 -29
- package/src/pipeline/standard-forward-lane.ts +178 -101
- package/src/pipeline/standard-pipeline.ts +176 -105
- package/src/pipeline/standard-post.ts +373 -0
- package/src/pipeline/standard-profile.ts +26 -3
- package/src/pipeline-builder.ts +102 -12
- package/src/pipeline-spec.ts +9 -0
- package/src/plugin.ts +2 -0
- package/src/record/__tests__/fullscreen-temporal-routing.unit.test.ts +25 -0
- package/src/record/__tests__/main-pass-geometry.unit.test.ts +47 -0
- package/src/record/__tests__/material-bg-cache.unit.test.ts +12 -1
- package/src/record/__tests__/material-pipeline-pending-cache.unit.test.ts +22 -0
- package/src/record/__tests__/sprite-material-abi.unit.test.ts +75 -0
- package/src/record/__tests__/standard-pbr-ubo-layout.unit.test.ts +67 -0
- package/src/record/__tests__/temporal-payload.unit.test.ts +164 -0
- package/src/record/__tests__/typed-frame-graph-plan.unit.test.ts +127 -0
- package/src/record/frame-lighting.ts +103 -89
- package/src/record/frame-snapshot.ts +170 -6
- package/src/record/frame-targets.ts +21 -8
- package/src/record/frame.ts +1014 -7
- package/src/record/gpu-timing.ts +224 -0
- package/src/record/main-pass-geometry.ts +86 -40
- package/src/record/main-pass-material.ts +120 -68
- package/src/record/main-pass-sprite-draws.ts +78 -101
- package/src/record/main-pass.ts +77 -4
- package/src/record/mesh-ssbo.ts +22 -3
- package/src/record/render-context.ts +194 -23
- package/src/record/shadow-pass.ts +197 -58
- package/src/record/skybox-post-pass.ts +97 -41
- package/src/record/typed-frame-graph.ts +704 -30
- package/src/record/view-ubo.ts +52 -4
- package/src/render-contract.ts +181 -6
- package/src/render-data.ts +50 -22
- package/src/render-graph-primitives.ts +18 -1
- package/src/render-pipeline.ts +144 -27
- package/src/render-system-extract.ts +522 -72
- package/src/render-system.ts +561 -41
- package/src/renderer-inspect.ts +66 -0
- package/src/scene/render-scene.ts +252 -7
- package/src/temporal/__tests__/taa-history-resources.unit.test.ts +45 -0
- package/src/temporal/coverage.ts +76 -0
- package/src/temporal/frame-coordinator.ts +311 -0
- package/src/temporal/frame.ts +128 -0
- package/src/temporal/gpu.ts +287 -0
- package/src/temporal/history.ts +92 -0
- package/src/temporal/index.ts +6 -0
- package/src/temporal/inspection.ts +97 -0
- package/src/temporal/scene-data-catalog.ts +200 -0
- package/src/temporal/scene-data.ts +149 -0
- package/src/temporal/standard-scene-data.ts +182 -0
- package/src/temporal/taa-history-resources.ts +128 -0
- package/src/temporal/taa-history-store.ts +79 -0
- package/src/temporal/taa-resolve.ts +34 -0
- package/src/temporal/temporal-view.ts +169 -0
- package/src/temporal/transaction.ts +17 -0
- package/src/temporal/view.ts +161 -0
- package/src/transmission/__tests__/capability.unit.test.ts +83 -0
- package/src/transmission/__tests__/composition.integration.test.ts +161 -0
- package/src/transmission/__tests__/inspection.unit.test.ts +241 -0
- package/src/transmission/__tests__/lifecycle.integration.test.ts +96 -0
- package/src/transmission/__tests__/oracle.unit.test.ts +131 -0
- package/src/transmission/__tests__/projection.unit.test.ts +71 -0
- package/src/transmission/__tests__/standard-transmission.dawn.test.ts +437 -0
- package/src/transmission/__tests__/transmission-backdrop-topology.unit.test.ts +109 -0
- package/src/transmission/__tests__/transmission-backdrop.dawn.test.ts +105 -0
- package/src/transmission/backdrop.ts +572 -0
- package/src/transmission/inspection.ts +190 -0
- package/src/transmission/oracle.ts +141 -0
- package/src/transmission/projection.ts +83 -0
- package/src/typed-render-graph-primitives.ts +194 -11
- package/src/typed-shadow-atlas.ts +17 -0
- package/src/typed-shadow-passes.ts +6 -5
- package/src/volume/capability.ts +173 -0
- package/src/volume/component.ts +110 -0
- package/src/volume/extract.ts +21 -0
- package/src/volume/inspection.ts +78 -0
- package/src/volume/passes.ts +680 -0
- package/src/volume/recovery.ts +86 -0
- package/src/volume/resources.ts +236 -0
- package/src/volume/temporal.ts +89 -0
- package/dist/__tests__/authoring-path.unit.test.d.ts +0 -2
- package/dist/__tests__/authoring-path.unit.test.d.ts.map +0 -1
- package/dist/__tests__/backend-selection-rhi-capture.test-d.d.ts +0 -2
- package/dist/__tests__/backend-selection-rhi-capture.test-d.d.ts.map +0 -1
- package/dist/__tests__/callback-inference.test-d.d.ts +0 -2
- package/dist/__tests__/callback-inference.test-d.d.ts.map +0 -1
- package/dist/__tests__/cluster-binner.test.d.ts +0 -2
- package/dist/__tests__/cluster-binner.test.d.ts.map +0 -1
- package/dist/__tests__/cluster-grid-default-surface.unit.test.d.ts +0 -2
- package/dist/__tests__/cluster-grid-default-surface.unit.test.d.ts.map +0 -1
- package/dist/__tests__/construct-renderer-identity.unit.test.d.ts +0 -2
- package/dist/__tests__/construct-renderer-identity.unit.test.d.ts.map +0 -1
- package/dist/__tests__/device-scope-lifecycle.unit.test.d.ts +0 -2
- package/dist/__tests__/device-scope-lifecycle.unit.test.d.ts.map +0 -1
- package/dist/__tests__/device-scope-stale-matrix.unit.test.d.ts +0 -2
- package/dist/__tests__/device-scope-stale-matrix.unit.test.d.ts.map +0 -1
- package/dist/__tests__/direct-extract-consumer-contract.test-d.d.ts +0 -2
- package/dist/__tests__/direct-extract-consumer-contract.test-d.d.ts.map +0 -1
- package/dist/__tests__/direct-light-snapshot.unit.test.d.ts +0 -2
- package/dist/__tests__/direct-light-snapshot.unit.test.d.ts.map +0 -1
- package/dist/__tests__/factory-contract.integration.test.d.ts +0 -2
- package/dist/__tests__/factory-contract.integration.test.d.ts.map +0 -1
- package/dist/__tests__/fallback-row-stride-surface.unit.test.d.ts +0 -2
- package/dist/__tests__/fallback-row-stride-surface.unit.test.d.ts.map +0 -1
- package/dist/__tests__/frame-observation.contract.test.d.ts +0 -2
- package/dist/__tests__/frame-observation.contract.test.d.ts.map +0 -1
- package/dist/__tests__/fullscreen-feature-plan.unit.test.d.ts +0 -2
- package/dist/__tests__/fullscreen-feature-plan.unit.test.d.ts.map +0 -1
- package/dist/__tests__/glyph-text-layout-recovery.unit.test.d.ts +0 -2
- package/dist/__tests__/glyph-text-layout-recovery.unit.test.d.ts.map +0 -1
- package/dist/__tests__/gpu-driven-indirect-raster-evidence.d.ts +0 -6
- package/dist/__tests__/gpu-driven-indirect-raster-evidence.d.ts.map +0 -1
- package/dist/__tests__/gpu-driven-indirect-raster.browser.test.d.ts +0 -2
- package/dist/__tests__/gpu-driven-indirect-raster.browser.test.d.ts.map +0 -1
- package/dist/__tests__/gpu-driven-indirect-raster.dawn.test.d.ts +0 -2
- package/dist/__tests__/gpu-driven-indirect-raster.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/gpu-driven-production.integration.test.d.ts +0 -2
- package/dist/__tests__/gpu-driven-production.integration.test.d.ts.map +0 -1
- package/dist/__tests__/gpu-driven-scaling.unit.test.d.ts +0 -2
- package/dist/__tests__/gpu-driven-scaling.unit.test.d.ts.map +0 -1
- package/dist/__tests__/gpu-driven-view-gpu-evidence.d.ts +0 -18
- package/dist/__tests__/gpu-driven-view-gpu-evidence.d.ts.map +0 -1
- package/dist/__tests__/gpu-driven-view-graph.integration.test.d.ts +0 -2
- package/dist/__tests__/gpu-driven-view-graph.integration.test.d.ts.map +0 -1
- package/dist/__tests__/gpu-driven-view-reference.d.ts +0 -15
- package/dist/__tests__/gpu-driven-view-reference.d.ts.map +0 -1
- package/dist/__tests__/gpu-driven-view.browser.test.d.ts +0 -2
- package/dist/__tests__/gpu-driven-view.browser.test.d.ts.map +0 -1
- package/dist/__tests__/gpu-driven-view.dawn.test.d.ts +0 -2
- package/dist/__tests__/gpu-driven-view.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/gpu-driven-view.unit.test.d.ts +0 -2
- package/dist/__tests__/gpu-driven-view.unit.test.d.ts.map +0 -1
- package/dist/__tests__/gpu-resource-store-stride.unit.test.d.ts +0 -2
- package/dist/__tests__/gpu-resource-store-stride.unit.test.d.ts.map +0 -1
- package/dist/__tests__/gpu-scene-render-graph-gpu.d.ts +0 -7
- package/dist/__tests__/gpu-scene-render-graph-gpu.d.ts.map +0 -1
- package/dist/__tests__/gpu-scene-render-graph.browser.test.d.ts +0 -2
- package/dist/__tests__/gpu-scene-render-graph.browser.test.d.ts.map +0 -1
- package/dist/__tests__/gpu-scene-render-graph.dawn.test.d.ts +0 -2
- package/dist/__tests__/gpu-scene-render-graph.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/gpu-scene-schema.unit.test.d.ts +0 -2
- package/dist/__tests__/gpu-scene-schema.unit.test.d.ts.map +0 -1
- package/dist/__tests__/gpu-scene.dawn.test.d.ts +0 -2
- package/dist/__tests__/gpu-scene.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/gpu-scene.unit.test.d.ts +0 -2
- package/dist/__tests__/gpu-scene.unit.test.d.ts.map +0 -1
- package/dist/__tests__/ibl/face-uniforms.unit.test.d.ts +0 -2
- package/dist/__tests__/ibl/face-uniforms.unit.test.d.ts.map +0 -1
- package/dist/__tests__/infinite-grid-no-vertex-probe.unit.test.d.ts +0 -2
- package/dist/__tests__/infinite-grid-no-vertex-probe.unit.test.d.ts.map +0 -1
- package/dist/__tests__/injection-kind-owner.test-d.d.ts +0 -2
- package/dist/__tests__/injection-kind-owner.test-d.d.ts.map +0 -1
- package/dist/__tests__/ktx2-basis-gpu-consumer.dawn.test.d.ts +0 -2
- package/dist/__tests__/ktx2-basis-gpu-consumer.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/light-buffer-layout.unit.test.d.ts +0 -2
- package/dist/__tests__/light-buffer-layout.unit.test.d.ts.map +0 -1
- package/dist/__tests__/material-contract-inventory.unit.test.d.ts +0 -2
- package/dist/__tests__/material-contract-inventory.unit.test.d.ts.map +0 -1
- package/dist/__tests__/material-cooked-projection.unit.test.d.ts +0 -2
- package/dist/__tests__/material-cooked-projection.unit.test.d.ts.map +0 -1
- package/dist/__tests__/material-snapshot-mutation.integration.test.d.ts +0 -2
- package/dist/__tests__/material-snapshot-mutation.integration.test.d.ts.map +0 -1
- package/dist/__tests__/material-static-dynamic-route.unit.test.d.ts +0 -2
- package/dist/__tests__/material-static-dynamic-route.unit.test.d.ts.map +0 -1
- package/dist/__tests__/material-stride-surface.unit.test.d.ts +0 -2
- package/dist/__tests__/material-stride-surface.unit.test.d.ts.map +0 -1
- package/dist/__tests__/mesh-buffer-usage-surface.unit.test.d.ts +0 -2
- package/dist/__tests__/mesh-buffer-usage-surface.unit.test.d.ts.map +0 -1
- package/dist/__tests__/mesh-material-bindings.unit.test.d.ts +0 -2
- package/dist/__tests__/mesh-material-bindings.unit.test.d.ts.map +0 -1
- package/dist/__tests__/mesh-stride-surface.unit.test.d.ts +0 -2
- package/dist/__tests__/mesh-stride-surface.unit.test.d.ts.map +0 -1
- package/dist/__tests__/morph-culling-reentry.dawn.test.d.ts +0 -2
- package/dist/__tests__/morph-culling-reentry.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/morph-feature-gpu-work.integration.test.d.ts +0 -2
- package/dist/__tests__/morph-feature-gpu-work.integration.test.d.ts.map +0 -1
- package/dist/__tests__/morph-feature-plan.unit.test.d.ts +0 -2
- package/dist/__tests__/morph-feature-plan.unit.test.d.ts.map +0 -1
- package/dist/__tests__/morph-visual-evidence.integration.test.d.ts +0 -2
- package/dist/__tests__/morph-visual-evidence.integration.test.d.ts.map +0 -1
- package/dist/__tests__/nineslice-handle-surface.unit.test.d.ts +0 -2
- package/dist/__tests__/nineslice-handle-surface.unit.test.d.ts.map +0 -1
- package/dist/__tests__/post-process-error-policy-owner.unit.test.d.ts +0 -2
- package/dist/__tests__/post-process-error-policy-owner.unit.test.d.ts.map +0 -1
- package/dist/__tests__/prepared-buffer-kind-owner.test-d.d.ts +0 -2
- package/dist/__tests__/prepared-buffer-kind-owner.test-d.d.ts.map +0 -1
- package/dist/__tests__/prepared-graphics-capability.unit.test.d.ts +0 -2
- package/dist/__tests__/prepared-graphics-capability.unit.test.d.ts.map +0 -1
- package/dist/__tests__/prepared-graphics-generation.unit.test.d.ts +0 -2
- package/dist/__tests__/prepared-graphics-generation.unit.test.d.ts.map +0 -1
- package/dist/__tests__/prepared-graphics-lifecycle.unit.test.d.ts +0 -2
- package/dist/__tests__/prepared-graphics-lifecycle.unit.test.d.ts.map +0 -1
- package/dist/__tests__/prepared-graphics-pipeline-warmup.unit.test.d.ts +0 -2
- package/dist/__tests__/prepared-graphics-pipeline-warmup.unit.test.d.ts.map +0 -1
- package/dist/__tests__/prepared-graphics-resolver.unit.test.d.ts +0 -2
- package/dist/__tests__/prepared-graphics-resolver.unit.test.d.ts.map +0 -1
- package/dist/__tests__/prepared-graphics-snapshot.unit.test.d.ts +0 -2
- package/dist/__tests__/prepared-graphics-snapshot.unit.test.d.ts.map +0 -1
- package/dist/__tests__/prepared-graphics-store.unit.test.d.ts +0 -2
- package/dist/__tests__/prepared-graphics-store.unit.test.d.ts.map +0 -1
- package/dist/__tests__/prepared-graphics-validation.unit.test.d.ts +0 -2
- package/dist/__tests__/prepared-graphics-validation.unit.test.d.ts.map +0 -1
- package/dist/__tests__/profiler-default-off.test.d.ts +0 -2
- package/dist/__tests__/profiler-default-off.test.d.ts.map +0 -1
- package/dist/__tests__/profiler-phase-catalog.test.d.ts +0 -2
- package/dist/__tests__/profiler-phase-catalog.test.d.ts.map +0 -1
- package/dist/__tests__/profiler-phase-integration.test.d.ts +0 -2
- package/dist/__tests__/profiler-phase-integration.test.d.ts.map +0 -1
- package/dist/__tests__/profiler-phase-token.test.d.ts +0 -2
- package/dist/__tests__/profiler-phase-token.test.d.ts.map +0 -1
- package/dist/__tests__/public-surface.test-d.d.ts +0 -2
- package/dist/__tests__/public-surface.test-d.d.ts.map +0 -1
- package/dist/__tests__/recover-error-policy-owner.unit.test.d.ts +0 -2
- package/dist/__tests__/recover-error-policy-owner.unit.test.d.ts.map +0 -1
- package/dist/__tests__/render-error-code-owner.test-d.d.ts +0 -2
- package/dist/__tests__/render-error-code-owner.test-d.d.ts.map +0 -1
- package/dist/__tests__/render-error-detail-ssot.test-d.d.ts +0 -2
- package/dist/__tests__/render-error-detail-ssot.test-d.d.ts.map +0 -1
- package/dist/__tests__/render-error-exhaustive.test-d.d.ts +0 -2
- package/dist/__tests__/render-error-exhaustive.test-d.d.ts.map +0 -1
- package/dist/__tests__/render-feature-assembly.test-d.d.ts +0 -2
- package/dist/__tests__/render-feature-assembly.test-d.d.ts.map +0 -1
- package/dist/__tests__/render-feature-context.test-d.d.ts +0 -2
- package/dist/__tests__/render-feature-context.test-d.d.ts.map +0 -1
- package/dist/__tests__/render-feature-contract.test-d.d.ts +0 -2
- package/dist/__tests__/render-feature-contract.test-d.d.ts.map +0 -1
- package/dist/__tests__/render-feature-diagnostics.unit.test.d.ts +0 -2
- package/dist/__tests__/render-feature-diagnostics.unit.test.d.ts.map +0 -1
- package/dist/__tests__/render-feature-docs.unit.test.d.ts +0 -2
- package/dist/__tests__/render-feature-docs.unit.test.d.ts.map +0 -1
- package/dist/__tests__/render-feature-errors.unit.test.d.ts +0 -2
- package/dist/__tests__/render-feature-errors.unit.test.d.ts.map +0 -1
- package/dist/__tests__/render-feature-gpu-work.integration.test.d.ts +0 -2
- package/dist/__tests__/render-feature-gpu-work.integration.test.d.ts.map +0 -1
- package/dist/__tests__/render-feature-plan.test-d.d.ts +0 -2
- package/dist/__tests__/render-feature-plan.test-d.d.ts.map +0 -1
- package/dist/__tests__/render-feature-plan.unit.test.d.ts +0 -2
- package/dist/__tests__/render-feature-plan.unit.test.d.ts.map +0 -1
- package/dist/__tests__/render-feature-prepared-diagnostics.unit.test.d.ts +0 -2
- package/dist/__tests__/render-feature-prepared-diagnostics.unit.test.d.ts.map +0 -1
- package/dist/__tests__/render-feature-prepared-errors.test-d.d.ts +0 -2
- package/dist/__tests__/render-feature-prepared-errors.test-d.d.ts.map +0 -1
- package/dist/__tests__/render-feature-prepared-graphics-docs.unit.test.d.ts +0 -2
- package/dist/__tests__/render-feature-prepared-graphics-docs.unit.test.d.ts.map +0 -1
- package/dist/__tests__/render-feature-prepared-graphics-isolation.unit.test.d.ts +0 -2
- package/dist/__tests__/render-feature-prepared-graphics-isolation.unit.test.d.ts.map +0 -1
- package/dist/__tests__/render-feature-prepared-graphics-negative.test-d.d.ts +0 -2
- package/dist/__tests__/render-feature-prepared-graphics-negative.test-d.d.ts.map +0 -1
- package/dist/__tests__/render-feature-prepared-graphics.test-d.d.ts +0 -2
- package/dist/__tests__/render-feature-prepared-graphics.test-d.d.ts.map +0 -1
- package/dist/__tests__/render-feature-prepared-graphics.unit.test.d.ts +0 -2
- package/dist/__tests__/render-feature-prepared-graphics.unit.test.d.ts.map +0 -1
- package/dist/__tests__/render-feature-public-surface.test-d.d.ts +0 -2
- package/dist/__tests__/render-feature-public-surface.test-d.d.ts.map +0 -1
- package/dist/__tests__/render-feature-retry.unit.test.d.ts +0 -2
- package/dist/__tests__/render-feature-retry.unit.test.d.ts.map +0 -1
- package/dist/__tests__/render-feature-scheduling.unit.test.d.ts +0 -2
- package/dist/__tests__/render-feature-scheduling.unit.test.d.ts.map +0 -1
- package/dist/__tests__/render-feature-stage-failed-policy-owner.unit.test.d.ts +0 -2
- package/dist/__tests__/render-feature-stage-failed-policy-owner.unit.test.d.ts.map +0 -1
- package/dist/__tests__/render-feature-stage-fault-recovery.unit.test.d.ts +0 -2
- package/dist/__tests__/render-feature-stage-fault-recovery.unit.test.d.ts.map +0 -1
- package/dist/__tests__/render-feature-visibility-context.test-d.d.ts +0 -2
- package/dist/__tests__/render-feature-visibility-context.test-d.d.ts.map +0 -1
- package/dist/__tests__/render-feature-visibility-context.unit.test.d.ts +0 -2
- package/dist/__tests__/render-feature-visibility-context.unit.test.d.ts.map +0 -1
- package/dist/__tests__/render-feature-zero-work.unit.test.d.ts +0 -2
- package/dist/__tests__/render-feature-zero-work.unit.test.d.ts.map +0 -1
- package/dist/__tests__/render-graph-compute-raster-gpu.d.ts +0 -7
- package/dist/__tests__/render-graph-compute-raster-gpu.d.ts.map +0 -1
- package/dist/__tests__/render-graph-compute-raster.browser.test.d.ts +0 -2
- package/dist/__tests__/render-graph-compute-raster.browser.test.d.ts.map +0 -1
- package/dist/__tests__/render-graph-compute-raster.dawn.test.d.ts +0 -2
- package/dist/__tests__/render-graph-compute-raster.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/render-graph-hzb-gpu.d.ts +0 -7
- package/dist/__tests__/render-graph-hzb-gpu.d.ts.map +0 -1
- package/dist/__tests__/render-graph-hzb.browser.test.d.ts +0 -2
- package/dist/__tests__/render-graph-hzb.browser.test.d.ts.map +0 -1
- package/dist/__tests__/render-graph-hzb.dawn.test.d.ts +0 -2
- package/dist/__tests__/render-graph-hzb.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/render-graph-primitives.unit.test.d.ts +0 -2
- package/dist/__tests__/render-graph-primitives.unit.test.d.ts.map +0 -1
- package/dist/__tests__/render-graph-storage-indirect-gpu.d.ts +0 -12
- package/dist/__tests__/render-graph-storage-indirect-gpu.d.ts.map +0 -1
- package/dist/__tests__/render-graph-storage-indirect.browser.test.d.ts +0 -2
- package/dist/__tests__/render-graph-storage-indirect.browser.test.d.ts.map +0 -1
- package/dist/__tests__/render-graph-storage-indirect.dawn.test.d.ts +0 -2
- package/dist/__tests__/render-graph-storage-indirect.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/render-scene-projection.unit.test.d.ts +0 -2
- package/dist/__tests__/render-scene-projection.unit.test.d.ts.map +0 -1
- package/dist/__tests__/renderer-factory-material-contract.unit.test.d.ts +0 -2
- package/dist/__tests__/renderer-factory-material-contract.unit.test.d.ts.map +0 -1
- package/dist/__tests__/renderer-lifecycle.integration.test.d.ts +0 -2
- package/dist/__tests__/renderer-lifecycle.integration.test.d.ts.map +0 -1
- package/dist/__tests__/rhi-backend-package-boundary.unit.test.d.ts +0 -2
- package/dist/__tests__/rhi-backend-package-boundary.unit.test.d.ts.map +0 -1
- package/dist/__tests__/scriptable-pack-consumer.test-d.d.ts +0 -2
- package/dist/__tests__/scriptable-pack-consumer.test-d.d.ts.map +0 -1
- package/dist/__tests__/shader-stage-surface.unit.test.d.ts +0 -2
- package/dist/__tests__/shader-stage-surface.unit.test.d.ts.map +0 -1
- package/dist/__tests__/ssao-config.unit.test.d.ts +0 -2
- package/dist/__tests__/ssao-config.unit.test.d.ts.map +0 -1
- package/dist/__tests__/ssao-kernel-surface.unit.test.d.ts +0 -2
- package/dist/__tests__/ssao-kernel-surface.unit.test.d.ts.map +0 -1
- package/dist/__tests__/standard-clustered-pipeline.unit.test.d.ts +0 -2
- package/dist/__tests__/standard-clustered-pipeline.unit.test.d.ts.map +0 -1
- package/dist/__tests__/standard-descriptors.test-d.d.ts +0 -2
- package/dist/__tests__/standard-descriptors.test-d.d.ts.map +0 -1
- package/dist/__tests__/standard-pipeline.dawn.test.d.ts +0 -2
- package/dist/__tests__/standard-pipeline.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/standard-pipeline.integration.test.d.ts +0 -2
- package/dist/__tests__/standard-pipeline.integration.test.d.ts.map +0 -1
- package/dist/__tests__/standard-profile-oracle.unit.test.d.ts +0 -2
- package/dist/__tests__/standard-profile-oracle.unit.test.d.ts.map +0 -1
- package/dist/__tests__/surface-configuration.unit.test.d.ts +0 -2
- package/dist/__tests__/surface-configuration.unit.test.d.ts.map +0 -1
- package/dist/__tests__/texture-usage-surface.unit.test.d.ts +0 -2
- package/dist/__tests__/texture-usage-surface.unit.test.d.ts.map +0 -1
- package/dist/__tests__/typed-pipeline-topology.unit.test.d.ts +0 -2
- package/dist/__tests__/typed-pipeline-topology.unit.test.d.ts.map +0 -1
- package/dist/__tests__/urp-pipeline-targets.unit.test.d.ts +0 -2
- package/dist/__tests__/urp-pipeline-targets.unit.test.d.ts.map +0 -1
- package/dist/__tests__/urp-pipeline.unit.test.d.ts +0 -2
- package/dist/__tests__/urp-pipeline.unit.test.d.ts.map +0 -1
- package/dist/__tests__/vertex-color-pipeline.unit.test.d.ts +0 -2
- package/dist/__tests__/vertex-color-pipeline.unit.test.d.ts.map +0 -1
- package/dist/__tests__/vertex-layout-consumer.unit.test.d.ts +0 -2
- package/dist/__tests__/vertex-layout-consumer.unit.test.d.ts.map +0 -1
- package/dist/__tests__/visibility-diagnostics.integration.test.d.ts +0 -2
- package/dist/__tests__/visibility-diagnostics.integration.test.d.ts.map +0 -1
- package/dist/__tests__/visibility-extract.integration.test.d.ts +0 -2
- package/dist/__tests__/visibility-extract.integration.test.d.ts.map +0 -1
- package/dist/__tests__/visibility-extract.perf.test.d.ts +0 -2
- package/dist/__tests__/visibility-extract.perf.test.d.ts.map +0 -1
- package/dist/__tests__/visibility-feature-dedup.integration.test.d.ts +0 -2
- package/dist/__tests__/visibility-feature-dedup.integration.test.d.ts.map +0 -1
- package/dist/__tests__/visibility-hidden-report.unit.test.d.ts +0 -2
- package/dist/__tests__/visibility-hidden-report.unit.test.d.ts.map +0 -1
- package/dist/__tests__/visibility-instances.integration.test.d.ts +0 -2
- package/dist/__tests__/visibility-instances.integration.test.d.ts.map +0 -1
- package/dist/__tests__/visibility-multi-world.integration.test.d.ts +0 -2
- package/dist/__tests__/visibility-multi-world.integration.test.d.ts.map +0 -1
- package/dist/__tests__/visibility-producer-matrix.integration.test.d.ts +0 -2
- package/dist/__tests__/visibility-producer-matrix.integration.test.d.ts.map +0 -1
- package/dist/__tests__/visibility-producer-matrix.unit.test.d.ts +0 -2
- package/dist/__tests__/visibility-producer-matrix.unit.test.d.ts.map +0 -1
- package/dist/__tests__/visibility-public-surface.test-d.d.ts +0 -2
- package/dist/__tests__/visibility-public-surface.test-d.d.ts.map +0 -1
- package/dist/__tests__/visibility-resolver.unit.test.d.ts +0 -2
- package/dist/__tests__/visibility-resolver.unit.test.d.ts.map +0 -1
- package/dist/__tests__/visibility-resource-short-circuit.unit.test.d.ts +0 -2
- package/dist/__tests__/visibility-resource-short-circuit.unit.test.d.ts.map +0 -1
- package/dist/__tests__/visibility-snapshot-contract.unit.test.d.ts +0 -2
- package/dist/__tests__/visibility-snapshot-contract.unit.test.d.ts.map +0 -1
- package/dist/__tests__/vocabulary.unit.test.d.ts +0 -2
- package/dist/__tests__/vocabulary.unit.test.d.ts.map +0 -1
- package/dist/chunk-CQXZC5XI.mjs.map +0 -1
- package/dist/chunk-HCOGPHKS.mjs +0 -93
- package/dist/chunk-HCOGPHKS.mjs.map +0 -1
- package/dist/chunk-YEJIUW7D.mjs.map +0 -1
- package/dist/components/__tests__/points-lines-admission.unit.test.d.ts +0 -2
- package/dist/components/__tests__/points-lines-admission.unit.test.d.ts.map +0 -1
- package/dist/components/__tests__/points-lines-schema.unit.test.d.ts +0 -2
- package/dist/components/__tests__/points-lines-schema.unit.test.d.ts.map +0 -1
- package/dist/components/__tests__/schema-contract.unit.test.d.ts +0 -2
- package/dist/components/__tests__/schema-contract.unit.test.d.ts.map +0 -1
- package/dist/components/__tests__/schema-parity.unit.test.d.ts +0 -2
- package/dist/components/__tests__/schema-parity.unit.test.d.ts.map +0 -1
- package/dist/components/__tests__/visibility-schema.unit.test.d.ts +0 -2
- package/dist/components/__tests__/visibility-schema.unit.test.d.ts.map +0 -1
- package/dist/points-lines/__tests__/bounds.unit.test.d.ts +0 -2
- package/dist/points-lines/__tests__/bounds.unit.test.d.ts.map +0 -1
- package/dist/points-lines/__tests__/cache-recovery.unit.test.d.ts +0 -2
- package/dist/points-lines/__tests__/cache-recovery.unit.test.d.ts.map +0 -1
- package/dist/points-lines/__tests__/inspection-lanes.integration.test.d.ts +0 -2
- package/dist/points-lines/__tests__/inspection-lanes.integration.test.d.ts.map +0 -1
- package/dist/points-lines/__tests__/inspection.unit.test.d.ts +0 -2
- package/dist/points-lines/__tests__/inspection.unit.test.d.ts.map +0 -1
- package/dist/points-lines/__tests__/lane-structural.integration.test.d.ts +0 -2
- package/dist/points-lines/__tests__/lane-structural.integration.test.d.ts.map +0 -1
- package/dist/points-lines/__tests__/points-lines.bench.d.ts +0 -2
- package/dist/points-lines/__tests__/points-lines.bench.d.ts.map +0 -1
- package/dist/points-lines/__tests__/raster-lane.integration.test.d.ts +0 -2
- package/dist/points-lines/__tests__/raster-lane.integration.test.d.ts.map +0 -1
- package/dist/points-lines/__tests__/snapshot.unit.test.d.ts +0 -2
- package/dist/points-lines/__tests__/snapshot.unit.test.d.ts.map +0 -1
- package/dist/points-lines/__tests__/view-ubo.unit.test.d.ts +0 -2
- package/dist/points-lines/__tests__/view-ubo.unit.test.d.ts.map +0 -1
- package/dist/record/__tests__/material-bg-cache.unit.test.d.ts +0 -2
- package/dist/record/__tests__/material-bg-cache.unit.test.d.ts.map +0 -1
- package/dist/record/__tests__/material-slot-plan.unit.test.d.ts +0 -2
- package/dist/record/__tests__/material-slot-plan.unit.test.d.ts.map +0 -1
- package/dist/record/__tests__/typed-frame-graph-plan.unit.test.d.ts +0 -2
- package/dist/record/__tests__/typed-frame-graph-plan.unit.test.d.ts.map +0 -1
- package/dist/record/__tests__/video-texture-view.unit.test.d.ts +0 -2
- package/dist/record/__tests__/video-texture-view.unit.test.d.ts.map +0 -1
|
@@ -6,7 +6,7 @@ import type {
|
|
|
6
6
|
RenderGraphError,
|
|
7
7
|
ResolveContext,
|
|
8
8
|
} from '@forgeax/engine-render-graph';
|
|
9
|
-
import type
|
|
9
|
+
import { RhiError, type TextureView } from '@forgeax/engine-rhi';
|
|
10
10
|
import { ok, type PassKind, type PassSelector, type Result } from '@forgeax/engine-types';
|
|
11
11
|
import {
|
|
12
12
|
GPU_TEXTURE_USAGE_COPY_SRC,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
recordBloomBrightPass,
|
|
27
27
|
recordBloomCompositePass,
|
|
28
28
|
} from './record/skybox-post-pass';
|
|
29
|
-
import {
|
|
29
|
+
import { STANDARD_OUTPUT_TRANSFORM_FEATURE_ID } from './render-contract';
|
|
30
30
|
import {
|
|
31
31
|
encodeFullscreenPass,
|
|
32
32
|
recordSsaoBlurPass,
|
|
@@ -34,6 +34,12 @@ import {
|
|
|
34
34
|
} from './render-graph-primitives';
|
|
35
35
|
import type { RenderPipelineFrame, RenderPipelineGpuDrivenProjection } from './render-pipeline';
|
|
36
36
|
import { createRenderPipelineTarget, type RenderPipelineTarget } from './render-pipeline';
|
|
37
|
+
import {
|
|
38
|
+
getTemporalBindGroupResources,
|
|
39
|
+
getTemporalGpuState,
|
|
40
|
+
getTemporalParamsBuffer,
|
|
41
|
+
stageTemporalGpuSubmit,
|
|
42
|
+
} from './temporal/gpu';
|
|
37
43
|
|
|
38
44
|
function resolvedView(resources: GraphResourceResolver, view: GraphTextureView): TextureView {
|
|
39
45
|
const result = resources.textureView(view);
|
|
@@ -41,6 +47,17 @@ function resolvedView(resources: GraphResourceResolver, view: GraphTextureView):
|
|
|
41
47
|
return result.value;
|
|
42
48
|
}
|
|
43
49
|
|
|
50
|
+
function throwTemporalEncodeFailure(expected: string, cause?: unknown): never {
|
|
51
|
+
throw new RhiError({
|
|
52
|
+
code: 'webgpu-runtime-error',
|
|
53
|
+
expected,
|
|
54
|
+
hint:
|
|
55
|
+
cause === undefined
|
|
56
|
+
? 'retry the temporal frame after repairing its GPU resource'
|
|
57
|
+
: String(cause),
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
44
61
|
export function typedFrameClearColor(frame: RenderPipelineFrame): GPUColor {
|
|
45
62
|
return {
|
|
46
63
|
r: frame.clear[0] ?? 0,
|
|
@@ -115,6 +132,8 @@ export interface TypedScenePassOptions {
|
|
|
115
132
|
readonly clearColor?: readonly [number, number, number, number] | undefined;
|
|
116
133
|
readonly colorLoadOp?: GPULoadOp | undefined;
|
|
117
134
|
readonly depthLoadOp?: GPULoadOp | undefined;
|
|
135
|
+
readonly recordMode?: 'opaque' | 'transmission' | 'transparent' | undefined;
|
|
136
|
+
readonly transmissionBackdrop?: GraphTextureView | undefined;
|
|
118
137
|
readonly extraAccesses?: readonly GraphAccess[] | undefined;
|
|
119
138
|
readonly gpuDriven?: RenderPipelineGpuDrivenProjection | undefined;
|
|
120
139
|
}
|
|
@@ -134,6 +153,9 @@ export function addTypedScenePass(
|
|
|
134
153
|
resource: target.view,
|
|
135
154
|
usage: 'sampled-read' as const,
|
|
136
155
|
})),
|
|
156
|
+
...(options.transmissionBackdrop === undefined
|
|
157
|
+
? []
|
|
158
|
+
: [{ resource: options.transmissionBackdrop, usage: 'sampled-read' as const }]),
|
|
137
159
|
...(options.extraAccesses ?? []),
|
|
138
160
|
...(options.gpuDriven?.accesses ?? []),
|
|
139
161
|
];
|
|
@@ -181,6 +203,10 @@ export function addTypedScenePass(
|
|
|
181
203
|
: resolvedView(resources, options.spotShadow.view);
|
|
182
204
|
const ssao =
|
|
183
205
|
options.ssao === undefined ? undefined : resolvedView(resources, options.ssao.view);
|
|
206
|
+
const transmissionBackdrop =
|
|
207
|
+
options.transmissionBackdrop === undefined
|
|
208
|
+
? null
|
|
209
|
+
: resolvedView(resources, options.transmissionBackdrop);
|
|
184
210
|
internal.frameState.currentDirectionalShadowView = directionalShadow ?? null;
|
|
185
211
|
internal.frameState.currentSpotShadowView = spotShadow ?? null;
|
|
186
212
|
const groups = buildPerFrameBindGroups(
|
|
@@ -189,7 +215,13 @@ export function addTypedScenePass(
|
|
|
189
215
|
internal.pipelineState,
|
|
190
216
|
internal.validated.length > 0 || options.gpuDriven !== undefined,
|
|
191
217
|
internal.bindGroupCounts,
|
|
192
|
-
{
|
|
218
|
+
{
|
|
219
|
+
directionalShadow,
|
|
220
|
+
spotShadow,
|
|
221
|
+
projector: internal.spotLightProjector?.view ?? internal.volumetricFog?.projectorView,
|
|
222
|
+
projectorSampler:
|
|
223
|
+
internal.spotLightProjector?.sampler ?? internal.volumetricFog?.projectorSampler,
|
|
224
|
+
},
|
|
193
225
|
);
|
|
194
226
|
if (groups.viewBindGroup !== null) {
|
|
195
227
|
options.gpuDriven?.encode(groups.viewBindGroup, pass, resources);
|
|
@@ -216,6 +248,10 @@ export function addTypedScenePass(
|
|
|
216
248
|
depthView,
|
|
217
249
|
passKind: options.passKind ?? 'forward',
|
|
218
250
|
...(options.clearColor === undefined ? {} : { clearColor: options.clearColor }),
|
|
251
|
+
...(options.recordMode === undefined ? {} : { recordMode: options.recordMode }),
|
|
252
|
+
...(options.transmissionBackdrop === undefined
|
|
253
|
+
? {}
|
|
254
|
+
: { transmissionBackdropView: transmissionBackdrop }),
|
|
219
255
|
},
|
|
220
256
|
);
|
|
221
257
|
},
|
|
@@ -261,6 +297,14 @@ export interface TypedBloomTargets {
|
|
|
261
297
|
readonly blurV: RenderPipelineTarget;
|
|
262
298
|
}
|
|
263
299
|
|
|
300
|
+
/** The semantic Bloom pass owner; graph inspection consumes these same identities. */
|
|
301
|
+
export const TYPED_BLOOM_PASS_NAMES = {
|
|
302
|
+
bright: 'bloom-bright',
|
|
303
|
+
blurH: 'bloom-blur-h',
|
|
304
|
+
blurV: 'bloom-blur-v',
|
|
305
|
+
composite: 'bloom-composite',
|
|
306
|
+
} as const;
|
|
307
|
+
|
|
264
308
|
export function addTypedBloomPasses(
|
|
265
309
|
graph: RenderGraphBuilder<RenderPipelineFrame>,
|
|
266
310
|
targets: TypedBloomTargets,
|
|
@@ -274,25 +318,25 @@ export function addTypedBloomPasses(
|
|
|
274
318
|
};
|
|
275
319
|
const descriptors = [
|
|
276
320
|
{
|
|
277
|
-
name:
|
|
321
|
+
name: TYPED_BLOOM_PASS_NAMES.bright,
|
|
278
322
|
reads: [targets.scene],
|
|
279
323
|
write: targets.bright,
|
|
280
324
|
encode: recordBloomBrightPass,
|
|
281
325
|
},
|
|
282
326
|
{
|
|
283
|
-
name:
|
|
327
|
+
name: TYPED_BLOOM_PASS_NAMES.blurH,
|
|
284
328
|
reads: [targets.bright],
|
|
285
329
|
write: targets.blurH,
|
|
286
330
|
encode: recordBloomBlurHPass,
|
|
287
331
|
},
|
|
288
332
|
{
|
|
289
|
-
name:
|
|
333
|
+
name: TYPED_BLOOM_PASS_NAMES.blurV,
|
|
290
334
|
reads: [targets.blurH],
|
|
291
335
|
write: targets.blurV,
|
|
292
336
|
encode: recordBloomBlurVPass,
|
|
293
337
|
},
|
|
294
338
|
{
|
|
295
|
-
name:
|
|
339
|
+
name: TYPED_BLOOM_PASS_NAMES.composite,
|
|
296
340
|
reads: [targets.scene, targets.blurV],
|
|
297
341
|
write: targets.composited,
|
|
298
342
|
encode: recordBloomCompositePass,
|
|
@@ -419,6 +463,116 @@ export interface TypedFullscreenPassOptions {
|
|
|
419
463
|
readonly outputOnly?: boolean | undefined;
|
|
420
464
|
readonly rawSwapchainOutput?: boolean | undefined;
|
|
421
465
|
readonly depth?: RenderPipelineTarget | undefined;
|
|
466
|
+
readonly additionalReads?: readonly {
|
|
467
|
+
readonly key: string;
|
|
468
|
+
readonly target: RenderPipelineTarget;
|
|
469
|
+
}[];
|
|
470
|
+
/** Optional per-pass copy of the params UBO payload. */
|
|
471
|
+
readonly paramsTransform?:
|
|
472
|
+
| ((params: Uint8Array | undefined) => Uint8Array | undefined)
|
|
473
|
+
| undefined;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
export interface TypedTemporalResolveTargets {
|
|
477
|
+
readonly scene: RenderPipelineTarget;
|
|
478
|
+
readonly currentTemporal: RenderPipelineTarget;
|
|
479
|
+
readonly depth: RenderPipelineTarget;
|
|
480
|
+
readonly historyColor: RenderPipelineTarget;
|
|
481
|
+
readonly historyTemporal: RenderPipelineTarget;
|
|
482
|
+
readonly writeColor: RenderPipelineTarget;
|
|
483
|
+
readonly writeTemporal: RenderPipelineTarget;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
export function addTypedTemporalResolvePass(
|
|
487
|
+
graph: RenderGraphBuilder<RenderPipelineFrame>,
|
|
488
|
+
targets: TypedTemporalResolveTargets,
|
|
489
|
+
): Result<void, RenderGraphError> {
|
|
490
|
+
const added = graph.addRasterPass('taa-resolve', {
|
|
491
|
+
accesses: [
|
|
492
|
+
{ resource: targets.scene.view, usage: 'sampled-read' },
|
|
493
|
+
{ resource: targets.currentTemporal.view, usage: 'sampled-read' },
|
|
494
|
+
{ resource: targets.historyColor.view, usage: 'sampled-read' },
|
|
495
|
+
{ resource: targets.historyTemporal.view, usage: 'sampled-read' },
|
|
496
|
+
{ resource: targets.writeColor.view, usage: 'color-attachment' },
|
|
497
|
+
{ resource: targets.writeTemporal.view, usage: 'color-attachment' },
|
|
498
|
+
],
|
|
499
|
+
colorAttachments: [
|
|
500
|
+
{
|
|
501
|
+
view: targets.writeColor.view,
|
|
502
|
+
loadOp: 'clear',
|
|
503
|
+
storeOp: 'store',
|
|
504
|
+
clearValue: { r: 0, g: 0, b: 0, a: 1 },
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
view: targets.writeTemporal.view,
|
|
508
|
+
loadOp: 'clear',
|
|
509
|
+
storeOp: 'store',
|
|
510
|
+
clearValue: { r: 0, g: 0, b: 0, a: 0 },
|
|
511
|
+
},
|
|
512
|
+
],
|
|
513
|
+
encode: ({ pass, frame, resources }) => {
|
|
514
|
+
const internal = frame as _InternalRenderPipelineContext;
|
|
515
|
+
const state = getTemporalGpuState(
|
|
516
|
+
internal.frameState,
|
|
517
|
+
frame.runtime.device,
|
|
518
|
+
(frame.runtime as import('./record/render-context').RenderSystemRuntime).deviceScope,
|
|
519
|
+
frame.targetW,
|
|
520
|
+
frame.targetH,
|
|
521
|
+
);
|
|
522
|
+
const built = getTemporalBindGroupResources(state);
|
|
523
|
+
const current = resolvedView(resources, targets.scene.view);
|
|
524
|
+
const currentTemporal = resolvedView(resources, targets.currentTemporal.view);
|
|
525
|
+
const historyColor = resolvedView(resources, targets.historyColor.view);
|
|
526
|
+
const historyTemporal = resolvedView(resources, targets.historyTemporal.view);
|
|
527
|
+
const params = getTemporalParamsBuffer(state);
|
|
528
|
+
if (params === undefined || built.sampler === null) {
|
|
529
|
+
throwTemporalEncodeFailure('TAA resolve has an admitted params buffer and sampler');
|
|
530
|
+
}
|
|
531
|
+
const payload = new ArrayBuffer(16);
|
|
532
|
+
new Float32Array(payload).set([
|
|
533
|
+
frame.camera.temporal?.currentJitterUv?.[0] ?? 0,
|
|
534
|
+
frame.camera.temporal?.currentJitterUv?.[1] ?? 0,
|
|
535
|
+
]);
|
|
536
|
+
const words = new Uint32Array(payload);
|
|
537
|
+
words[2] = state.valid && (frame.camera.temporal?.historyValid ?? true) ? 1 : 0;
|
|
538
|
+
words[3] = frame.camera.temporal?.temporalFrameIndex ?? 0;
|
|
539
|
+
const written = frame.runtime.device.queue.writeBuffer(params, 0, new Uint8Array(payload));
|
|
540
|
+
if (!written.ok)
|
|
541
|
+
throwTemporalEncodeFailure('TAA resolve params upload succeeds', written.error);
|
|
542
|
+
const bindGroup = frame.runtime.device.createBindGroup({
|
|
543
|
+
label: 'taa-resolve-bind-group',
|
|
544
|
+
layout: built.layout,
|
|
545
|
+
entries: [
|
|
546
|
+
{ binding: 0, resource: { kind: 'textureView', value: current } },
|
|
547
|
+
{ binding: 1, resource: { kind: 'sampler', value: built.sampler } },
|
|
548
|
+
{ binding: 2, resource: { kind: 'textureView', value: historyColor } },
|
|
549
|
+
{ binding: 3, resource: { kind: 'sampler', value: built.sampler } },
|
|
550
|
+
{ binding: 4, resource: { kind: 'textureView', value: historyTemporal } },
|
|
551
|
+
{ binding: 5, resource: { kind: 'sampler', value: built.sampler } },
|
|
552
|
+
{ binding: 6, resource: { kind: 'textureView', value: currentTemporal } },
|
|
553
|
+
{ binding: 7, resource: { kind: 'sampler', value: built.sampler } },
|
|
554
|
+
{ binding: 8, resource: { kind: 'buffer', value: { buffer: params } } },
|
|
555
|
+
] as never,
|
|
556
|
+
});
|
|
557
|
+
if (!bindGroup.ok) {
|
|
558
|
+
throwTemporalEncodeFailure('TAA resolve bind group creation succeeds', bindGroup.error);
|
|
559
|
+
}
|
|
560
|
+
const pipeline = frame.runtime.getPostProcessPipeline?.(
|
|
561
|
+
'forgeax.taa-resolve',
|
|
562
|
+
built.layout,
|
|
563
|
+
targets.writeColor.format as GPUTextureFormat,
|
|
564
|
+
);
|
|
565
|
+
if (pipeline === null || pipeline === undefined) {
|
|
566
|
+
throwTemporalEncodeFailure('TAA resolve pipeline is ready before frame encoding');
|
|
567
|
+
}
|
|
568
|
+
pass.setPipeline(pipeline);
|
|
569
|
+
pass.setBindGroup(1, bindGroup.value);
|
|
570
|
+
pass.draw(3, 1, 0, 0);
|
|
571
|
+
stageTemporalGpuSubmit(state);
|
|
572
|
+
internal.frameState.temporalGpuState = state;
|
|
573
|
+
},
|
|
574
|
+
});
|
|
575
|
+
return added;
|
|
422
576
|
}
|
|
423
577
|
|
|
424
578
|
export function addTypedFullscreenPass(
|
|
@@ -432,6 +586,10 @@ export function addTypedFullscreenPass(
|
|
|
432
586
|
...(options.depth === undefined
|
|
433
587
|
? []
|
|
434
588
|
: [{ resource: options.depth.view, usage: 'sampled-read' as const }]),
|
|
589
|
+
...(options.additionalReads?.map((read) => ({
|
|
590
|
+
resource: read.target.view,
|
|
591
|
+
usage: 'sampled-read' as const,
|
|
592
|
+
})) ?? []),
|
|
435
593
|
],
|
|
436
594
|
colorAttachments: [
|
|
437
595
|
{
|
|
@@ -454,6 +612,11 @@ export function addTypedFullscreenPass(
|
|
|
454
612
|
input: options.input,
|
|
455
613
|
output: options.output,
|
|
456
614
|
ldrColor: options.input,
|
|
615
|
+
'scene-color': options.input,
|
|
616
|
+
...(options.depth === undefined ? {} : { 'scene-depth': options.depth }),
|
|
617
|
+
...(options.additionalReads === undefined
|
|
618
|
+
? {}
|
|
619
|
+
: Object.fromEntries(options.additionalReads.map((read) => [read.key, read.target]))),
|
|
457
620
|
}),
|
|
458
621
|
outputFormat: options.output.format as GPUTextureFormat,
|
|
459
622
|
...(options.depth === undefined
|
|
@@ -462,6 +625,11 @@ export function addTypedFullscreenPass(
|
|
|
462
625
|
...(options.rawSwapchainOutput === undefined
|
|
463
626
|
? {}
|
|
464
627
|
: { rawSwapchainOutput: options.rawSwapchainOutput }),
|
|
628
|
+
...(options.paramsTransform === undefined
|
|
629
|
+
? {}
|
|
630
|
+
: {
|
|
631
|
+
paramsOverride: options.paramsTransform(frame.postProcessParams.get(options.shader)),
|
|
632
|
+
}),
|
|
465
633
|
});
|
|
466
634
|
},
|
|
467
635
|
});
|
|
@@ -524,18 +692,33 @@ export function addTypedCompositePostEffects(
|
|
|
524
692
|
return ok(undefined);
|
|
525
693
|
}
|
|
526
694
|
|
|
527
|
-
export function
|
|
695
|
+
export function addTypedOutputTransformPass(
|
|
528
696
|
graph: RenderGraphBuilder<RenderPipelineFrame>,
|
|
529
697
|
input: RenderPipelineTarget,
|
|
530
698
|
output: RenderPipelineTarget,
|
|
531
|
-
outputOnly =
|
|
699
|
+
options: { readonly outputOnly?: boolean; readonly outputTransform?: boolean } = {},
|
|
532
700
|
): Result<void, RenderGraphError> {
|
|
701
|
+
const outputOnly = options.outputOnly ?? false;
|
|
533
702
|
return addTypedFullscreenPass(graph, {
|
|
534
|
-
name: outputOnly ? '
|
|
535
|
-
shader:
|
|
703
|
+
name: outputOnly ? 'present' : 'output-transform',
|
|
704
|
+
shader: STANDARD_OUTPUT_TRANSFORM_FEATURE_ID,
|
|
536
705
|
input,
|
|
537
706
|
output,
|
|
538
707
|
outputOnly,
|
|
539
708
|
rawSwapchainOutput: outputOnly,
|
|
709
|
+
...(options.outputTransform === true
|
|
710
|
+
? {
|
|
711
|
+
paramsTransform: (params: Uint8Array | undefined): Uint8Array | undefined => {
|
|
712
|
+
if (params === undefined || params.byteLength !== 16) return params;
|
|
713
|
+
const transformed = params.slice();
|
|
714
|
+
new DataView(
|
|
715
|
+
transformed.buffer,
|
|
716
|
+
transformed.byteOffset,
|
|
717
|
+
transformed.byteLength,
|
|
718
|
+
).setFloat32(12, 1, true);
|
|
719
|
+
return transformed;
|
|
720
|
+
},
|
|
721
|
+
}
|
|
722
|
+
: {}),
|
|
540
723
|
});
|
|
541
724
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface DirectionalShadowAtlasGrid {
|
|
2
|
+
readonly columns: 1 | 2;
|
|
3
|
+
readonly rows: 1 | 2;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The directional CSM atlas layout is one compact contract for raster writes
|
|
8
|
+
* and shader reads: 1 -> 1x1, 2 -> 2x1, and 3/4 -> 2x2.
|
|
9
|
+
*/
|
|
10
|
+
export function resolveDirectionalShadowAtlasGrid(
|
|
11
|
+
cascadeCount: number,
|
|
12
|
+
): DirectionalShadowAtlasGrid {
|
|
13
|
+
const count = Math.max(1, Math.min(4, Math.round(cascadeCount)));
|
|
14
|
+
if (count === 1) return { columns: 1, rows: 1 };
|
|
15
|
+
if (count === 2) return { columns: 2, rows: 1 };
|
|
16
|
+
return { columns: 2, rows: 2 };
|
|
17
|
+
}
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
} from './record/shadow-pass';
|
|
11
11
|
import type { RenderPipelineFrame, RenderPipelineTopology } from './render-pipeline';
|
|
12
12
|
import { createRenderPipelineTarget, type RenderPipelineTarget } from './render-pipeline';
|
|
13
|
+
import { resolveDirectionalShadowAtlasGrid } from './typed-shadow-atlas';
|
|
13
14
|
|
|
14
15
|
export interface TypedShadowTargets {
|
|
15
16
|
readonly directional: RenderPipelineTarget;
|
|
@@ -43,18 +44,18 @@ export function addTypedShadowPasses(
|
|
|
43
44
|
graph: RenderGraphBuilder<RenderPipelineFrame>,
|
|
44
45
|
topology: RenderPipelineTopology,
|
|
45
46
|
): Result<TypedShadowTargets, RenderGraphError> {
|
|
46
|
-
const
|
|
47
|
+
const atlasGrid = resolveDirectionalShadowAtlasGrid(topology.shadow.cascadeCount);
|
|
47
48
|
const directional = createRenderPipelineTarget(graph, 'directional-shadow-depth', {
|
|
48
49
|
format: 'depth32float',
|
|
49
50
|
size: {
|
|
50
|
-
width: topology.shadow.mapSize *
|
|
51
|
-
height: topology.shadow.mapSize *
|
|
51
|
+
width: topology.shadow.mapSize * atlasGrid.columns,
|
|
52
|
+
height: topology.shadow.mapSize * atlasGrid.rows,
|
|
52
53
|
},
|
|
53
54
|
});
|
|
54
55
|
if (!directional.ok) return directional;
|
|
55
56
|
for (let cascade = 0; cascade < topology.shadow.cascadeCount; cascade += 1) {
|
|
56
|
-
const col = cascade %
|
|
57
|
-
const row = Math.floor(cascade /
|
|
57
|
+
const col = cascade % atlasGrid.columns;
|
|
58
|
+
const row = Math.floor(cascade / atlasGrid.columns);
|
|
58
59
|
const added = recordShadowPass(
|
|
59
60
|
graph,
|
|
60
61
|
`shadowCascade${cascade}`,
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { Entity, type EntityHandle, type World } from '@forgeax/engine-ecs';
|
|
2
|
+
import type { RhiCaps } from '@forgeax/engine-rhi';
|
|
3
|
+
import { Transform } from '@forgeax/engine-scene';
|
|
4
|
+
import { DirectionalLight } from '../components/directional-light';
|
|
5
|
+
import { PointLight } from '../components/point-light';
|
|
6
|
+
import { SpotLight } from '../components/spot-light';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The single capability predicate for the authored volumetric-fog producer.
|
|
10
|
+
* Shader sources are part of the device-bound bundle: compute/storage alone
|
|
11
|
+
* is not enough to claim that the three fused graph passes can execute.
|
|
12
|
+
*/
|
|
13
|
+
export function hasVolumetricFogCapability(
|
|
14
|
+
caps: Pick<RhiCaps, 'compute' | 'storageTexture'>,
|
|
15
|
+
shaders: unknown,
|
|
16
|
+
): boolean {
|
|
17
|
+
return caps.compute && caps.storageTexture && shaders !== undefined;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type VolumetricFogLightKind = 'directional' | 'point' | 'spot';
|
|
21
|
+
// The exact parity authoring mode is the closed `point-spot` pair.
|
|
22
|
+
|
|
23
|
+
export type VolumetricFogLightResolution =
|
|
24
|
+
| {
|
|
25
|
+
readonly status: 'available';
|
|
26
|
+
readonly entity: EntityHandle;
|
|
27
|
+
readonly kind: VolumetricFogLightKind;
|
|
28
|
+
}
|
|
29
|
+
| {
|
|
30
|
+
readonly status: 'unresolved';
|
|
31
|
+
readonly reason: 'missing-entity' | 'wrong-component' | 'ambiguous';
|
|
32
|
+
readonly entity: EntityHandle;
|
|
33
|
+
readonly expected: 'DirectionalLight | PointLight | SpotLight';
|
|
34
|
+
readonly actual: string;
|
|
35
|
+
readonly hint: string;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type VolumetricFogLightPairResolution =
|
|
39
|
+
| {
|
|
40
|
+
readonly status: 'available';
|
|
41
|
+
readonly mode: 'point-spot';
|
|
42
|
+
readonly point: EntityHandle;
|
|
43
|
+
readonly spot: EntityHandle;
|
|
44
|
+
}
|
|
45
|
+
| {
|
|
46
|
+
readonly status: 'unresolved';
|
|
47
|
+
readonly reason: 'missing-entity' | 'same-entity' | 'wrong-component';
|
|
48
|
+
readonly point: EntityHandle;
|
|
49
|
+
readonly spot: EntityHandle;
|
|
50
|
+
readonly expected: 'PointLight + SpotLight in the same World';
|
|
51
|
+
readonly actual: string;
|
|
52
|
+
readonly hint: string;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/** Resolve the narrow official Point+Spot pair without creating a light owner. */
|
|
56
|
+
export function resolveVolumetricFogLightPair(
|
|
57
|
+
world: World,
|
|
58
|
+
point: EntityHandle,
|
|
59
|
+
spot: EntityHandle,
|
|
60
|
+
): VolumetricFogLightPairResolution {
|
|
61
|
+
const expected = 'PointLight + SpotLight in the same World' as const;
|
|
62
|
+
if (!world.get(point, Entity).ok || !world.get(spot, Entity).ok) {
|
|
63
|
+
return {
|
|
64
|
+
status: 'unresolved',
|
|
65
|
+
reason: 'missing-entity',
|
|
66
|
+
point,
|
|
67
|
+
spot,
|
|
68
|
+
expected,
|
|
69
|
+
actual: 'point or spot entity is absent from this World',
|
|
70
|
+
hint: 'assign two live entities from the same World and retry',
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
if (point === spot) {
|
|
74
|
+
return {
|
|
75
|
+
status: 'unresolved',
|
|
76
|
+
reason: 'same-entity',
|
|
77
|
+
point,
|
|
78
|
+
spot,
|
|
79
|
+
expected,
|
|
80
|
+
actual: 'PointLight and SpotLight share one EntityHandle',
|
|
81
|
+
hint: 'spawn PointLight and SpotLight on two different entities',
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
const pointValid = world.hasComponent(point, PointLight) && world.hasComponent(point, Transform);
|
|
85
|
+
const spotValid = world.hasComponent(spot, SpotLight) && world.hasComponent(spot, Transform);
|
|
86
|
+
if (!pointValid || !spotValid) {
|
|
87
|
+
return {
|
|
88
|
+
status: 'unresolved',
|
|
89
|
+
reason: 'wrong-component',
|
|
90
|
+
point,
|
|
91
|
+
spot,
|
|
92
|
+
expected,
|
|
93
|
+
actual: `pointValid=${pointValid}; spotValid=${spotValid}`,
|
|
94
|
+
hint: 'attach PointLight and SpotLight with Transform to separate same-World entities',
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
return { status: 'available', mode: 'point-spot', point, spot };
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Resolve the required VolumetricFog.light reference in its owning World.
|
|
102
|
+
* PointLight is a valid primary selection for the exact Point+Spot pair.
|
|
103
|
+
* EntityHandle has no portable world tag, so a handle absent from this World
|
|
104
|
+
* (the same World contract) is reported as missing-entity;
|
|
105
|
+
* is reported as missing-entity; callers must not manufacture a light.
|
|
106
|
+
*/
|
|
107
|
+
export function resolveSelectedVolumetricLight(
|
|
108
|
+
world: World,
|
|
109
|
+
entity: EntityHandle,
|
|
110
|
+
): VolumetricFogLightResolution {
|
|
111
|
+
const expected = 'DirectionalLight | PointLight | SpotLight' as const;
|
|
112
|
+
if (!world.get(entity, Entity).ok) {
|
|
113
|
+
return {
|
|
114
|
+
status: 'unresolved',
|
|
115
|
+
reason: 'missing-entity',
|
|
116
|
+
entity,
|
|
117
|
+
expected,
|
|
118
|
+
actual: 'missing or foreign World entity',
|
|
119
|
+
hint: 'assign VolumetricFog.light to a live DirectionalLight or SpotLight in this World',
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
const hasDirectional = world.hasComponent(entity, DirectionalLight);
|
|
123
|
+
const hasSpot = world.hasComponent(entity, SpotLight);
|
|
124
|
+
if (hasDirectional && hasSpot) {
|
|
125
|
+
return {
|
|
126
|
+
status: 'unresolved',
|
|
127
|
+
reason: 'ambiguous',
|
|
128
|
+
entity,
|
|
129
|
+
expected,
|
|
130
|
+
actual: 'DirectionalLight + SpotLight',
|
|
131
|
+
hint: 'remove one mutually exclusive light component from the selected entity',
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
if (hasDirectional) return { status: 'available', entity, kind: 'directional' };
|
|
135
|
+
if (world.hasComponent(entity, PointLight) && world.hasComponent(entity, Transform)) {
|
|
136
|
+
return { status: 'available', entity, kind: 'point' };
|
|
137
|
+
}
|
|
138
|
+
if (hasSpot && world.hasComponent(entity, Transform)) {
|
|
139
|
+
return { status: 'available', entity, kind: 'spot' };
|
|
140
|
+
}
|
|
141
|
+
const actual = hasSpot
|
|
142
|
+
? 'SpotLight without Transform'
|
|
143
|
+
: world.hasComponent(entity, PointLight)
|
|
144
|
+
? 'PointLight'
|
|
145
|
+
: 'other component';
|
|
146
|
+
return {
|
|
147
|
+
status: 'unresolved',
|
|
148
|
+
reason: 'wrong-component',
|
|
149
|
+
entity,
|
|
150
|
+
expected,
|
|
151
|
+
actual,
|
|
152
|
+
hint: 'add exactly one supported light component and a Transform for PointLight or SpotLight in the same World',
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export interface IntegratedVolumeResource {
|
|
157
|
+
/** Logical resolved-volume identity; this is not a physical graph resource. */
|
|
158
|
+
readonly identity: 'volume-integrated';
|
|
159
|
+
readonly format: 'rgba16float';
|
|
160
|
+
readonly stage: 'resolved';
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export type VolumeConsumer = 'opaque' | 'transparent' | 'sprite' | 'vfx' | 'custom';
|
|
164
|
+
|
|
165
|
+
export function resolveIntegratedVolumeConsumer(
|
|
166
|
+
resource: IntegratedVolumeResource,
|
|
167
|
+
consumer: VolumeConsumer,
|
|
168
|
+
): { readonly consumer: VolumeConsumer; readonly resource: IntegratedVolumeResource } {
|
|
169
|
+
// The volume owner supplies this prepared logical resource. Consumers only
|
|
170
|
+
// receive its identity and format; they never allocate a view or own the
|
|
171
|
+
// history lifetime here.
|
|
172
|
+
return { consumer, resource };
|
|
173
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { defineComponent, type EntityHandle } from '@forgeax/engine-ecs';
|
|
2
|
+
import { err, ok, type Result } from '@forgeax/engine-types';
|
|
3
|
+
import {
|
|
4
|
+
VolumeDensityShapeMismatchError,
|
|
5
|
+
type VolumeError,
|
|
6
|
+
VolumeInvalidBoundsError,
|
|
7
|
+
VolumeInvalidParametersError,
|
|
8
|
+
VolumeOwnerConflictError,
|
|
9
|
+
} from '../errors/render';
|
|
10
|
+
|
|
11
|
+
export interface VolumeDensityBinding {
|
|
12
|
+
readonly guid: string;
|
|
13
|
+
readonly generation: number;
|
|
14
|
+
readonly shape: {
|
|
15
|
+
readonly viewDimension: '2d' | '2d-array' | '3d';
|
|
16
|
+
readonly extent: {
|
|
17
|
+
readonly width: number;
|
|
18
|
+
readonly height: number;
|
|
19
|
+
readonly depth?: number;
|
|
20
|
+
readonly layers?: number;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
readonly format: string;
|
|
24
|
+
readonly colorSpace?: 'linear' | 'srgb';
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface VolumeBounds {
|
|
28
|
+
readonly min: readonly [number, number, number];
|
|
29
|
+
readonly max: readonly [number, number, number];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface VolumetricFogAuthoring {
|
|
33
|
+
/** Invalid authoring reports closed code, expected, hint, and detail fields. */
|
|
34
|
+
/** The selected DirectionalLight or PointLight in this World. */
|
|
35
|
+
readonly light: EntityHandle;
|
|
36
|
+
/** The optional same-World SpotLight paired with a PointLight. */
|
|
37
|
+
readonly spotLight?: EntityHandle;
|
|
38
|
+
readonly density: VolumeDensityBinding;
|
|
39
|
+
readonly bounds: VolumeBounds;
|
|
40
|
+
readonly extinction: readonly [number, number, number];
|
|
41
|
+
readonly albedo: readonly [number, number, number];
|
|
42
|
+
readonly emission: readonly [number, number, number];
|
|
43
|
+
readonly anisotropy: number;
|
|
44
|
+
readonly maxDistance: number;
|
|
45
|
+
readonly ownerCount?: number;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export type VolumetricFogLightSelection =
|
|
49
|
+
| { readonly light: EntityHandle; readonly spotLight?: undefined }
|
|
50
|
+
| { readonly light: EntityHandle; readonly spotLight: EntityHandle };
|
|
51
|
+
|
|
52
|
+
export interface ValidatedVolumetricFog extends VolumetricFogAuthoring {
|
|
53
|
+
readonly ownerCount: 1;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export const VolumetricFog = defineComponent('VolumetricFog', {
|
|
57
|
+
light: { type: 'entity' },
|
|
58
|
+
spotLight: { type: 'entity' },
|
|
59
|
+
density: { type: 'shared<TextureAsset>', simulationTransient: true },
|
|
60
|
+
boundsMin: { type: 'array<f32, 3>' },
|
|
61
|
+
boundsMax: { type: 'array<f32, 3>' },
|
|
62
|
+
extinction: { type: 'array<f32, 3>' },
|
|
63
|
+
albedo: { type: 'array<f32, 3>' },
|
|
64
|
+
emission: { type: 'array<f32, 3>' },
|
|
65
|
+
anisotropy: { type: 'f32', default: 0 },
|
|
66
|
+
maxDistance: { type: 'f32', default: 100 },
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
function finiteVector(value: readonly [number, number, number]): boolean {
|
|
70
|
+
return value.every(Number.isFinite);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function validBounds(bounds: VolumeBounds): boolean {
|
|
74
|
+
if (!finiteVector(bounds.min) || !finiteVector(bounds.max)) return false;
|
|
75
|
+
return bounds.max.every((value, index) => value > (bounds.min[index] ?? value));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function validRange(
|
|
79
|
+
value: readonly [number, number, number],
|
|
80
|
+
min: number,
|
|
81
|
+
max = Infinity,
|
|
82
|
+
): boolean {
|
|
83
|
+
return value.every((entry) => Number.isFinite(entry) && entry >= min && entry <= max);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function validateVolumetricFog(
|
|
87
|
+
input: VolumetricFogAuthoring,
|
|
88
|
+
): Result<ValidatedVolumetricFog, VolumeError> {
|
|
89
|
+
const ownerCount = input.ownerCount ?? 1;
|
|
90
|
+
if (ownerCount !== 1) return err(new VolumeOwnerConflictError(ownerCount));
|
|
91
|
+
if (input.density.shape.viewDimension !== '3d' || input.density.colorSpace === 'srgb') {
|
|
92
|
+
return err(
|
|
93
|
+
new VolumeDensityShapeMismatchError(input.density.guid, input.density.shape.viewDimension),
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
if (!validBounds(input.bounds)) return err(new VolumeInvalidBoundsError(input.bounds));
|
|
97
|
+
if (
|
|
98
|
+
!validRange(input.extinction, 0) ||
|
|
99
|
+
!validRange(input.albedo, 0, 1) ||
|
|
100
|
+
!validRange(input.emission, 0) ||
|
|
101
|
+
!Number.isFinite(input.anisotropy) ||
|
|
102
|
+
input.anisotropy <= -1 ||
|
|
103
|
+
input.anisotropy >= 1 ||
|
|
104
|
+
!Number.isFinite(input.maxDistance) ||
|
|
105
|
+
input.maxDistance <= 0
|
|
106
|
+
) {
|
|
107
|
+
return err(new VolumeInvalidParametersError(input));
|
|
108
|
+
}
|
|
109
|
+
return ok({ ...input, ownerCount: 1 });
|
|
110
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { err, ok, type Result } from '@forgeax/engine-types';
|
|
2
|
+
import { type VolumeError, VolumeOwnerConflictError } from '../errors/render';
|
|
3
|
+
import {
|
|
4
|
+
type ValidatedVolumetricFog,
|
|
5
|
+
type VolumetricFogAuthoring,
|
|
6
|
+
validateVolumetricFog,
|
|
7
|
+
} from './component';
|
|
8
|
+
|
|
9
|
+
export type VolumetricFogExtract =
|
|
10
|
+
| { readonly status: 'off' }
|
|
11
|
+
| { readonly status: 'available'; readonly fog: ValidatedVolumetricFog };
|
|
12
|
+
|
|
13
|
+
export function extractVolumetricFog(
|
|
14
|
+
inputs: readonly VolumetricFogAuthoring[],
|
|
15
|
+
): Result<VolumetricFogExtract, VolumeError> {
|
|
16
|
+
if (inputs.length === 0) return ok({ status: 'off' });
|
|
17
|
+
if (inputs.length !== 1) return err(new VolumeOwnerConflictError(inputs.length));
|
|
18
|
+
const validated = validateVolumetricFog(inputs[0] as VolumetricFogAuthoring);
|
|
19
|
+
if (!validated.ok) return validated;
|
|
20
|
+
return ok({ status: 'available', fog: validated.value });
|
|
21
|
+
}
|