@forgeax/engine-render 0.1.32 → 0.1.34
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 +1374 -142
- package/dist/assembly/analytic-fog-registration.d.ts +3 -0
- package/dist/assembly/analytic-fog-registration.d.ts.map +1 -0
- package/dist/assembly/backend-contract.d.ts +2 -0
- package/dist/assembly/backend-contract.d.ts.map +1 -1
- package/dist/assembly/barrel-distortion-inspection.d.ts +3 -0
- package/dist/assembly/barrel-distortion-inspection.d.ts.map +1 -0
- package/dist/assembly/canvas-draw-guard.d.ts +3 -0
- package/dist/assembly/canvas-draw-guard.d.ts.map +1 -0
- package/dist/assembly/cloud-shadow-entry.d.ts +4 -0
- package/dist/assembly/cloud-shadow-entry.d.ts.map +1 -0
- package/dist/assembly/dynamic-geometry-host.d.ts +4 -1
- package/dist/assembly/dynamic-geometry-host.d.ts.map +1 -1
- package/dist/assembly/dynamic-geometry-runtime.d.ts +1 -1
- package/dist/assembly/dynamic-geometry-runtime.d.ts.map +1 -1
- package/dist/assembly/factory.d.ts +1 -1
- package/dist/assembly/factory.d.ts.map +1 -1
- package/dist/assembly/fxaa-registration.d.ts +4 -0
- package/dist/assembly/fxaa-registration.d.ts.map +1 -0
- package/dist/assembly/host-contract.d.ts +3 -3
- package/dist/assembly/host-contract.d.ts.map +1 -1
- package/dist/assembly/lod-observation.d.ts +4 -0
- package/dist/assembly/lod-observation.d.ts.map +1 -0
- package/dist/assembly/material/assembly.d.ts.map +1 -1
- package/dist/assembly/material/pipeline-helpers.d.ts +5 -0
- package/dist/assembly/material/pipeline-helpers.d.ts.map +1 -1
- package/dist/assembly/material-shader-policy.d.ts +16 -2
- package/dist/assembly/material-shader-policy.d.ts.map +1 -1
- package/dist/assembly/material-shader-prewarm.d.ts.map +1 -1
- package/dist/assembly/motion-blur-registration.d.ts +3 -0
- package/dist/assembly/motion-blur-registration.d.ts.map +1 -0
- package/dist/assembly/recovery/device-loss-fanout.d.ts.map +1 -1
- package/dist/assembly/recovery/renderer-recover.d.ts +2 -0
- package/dist/assembly/recovery/renderer-recover.d.ts.map +1 -1
- package/dist/assembly/render-feature-post-processes.d.ts +6 -0
- package/dist/assembly/render-feature-post-processes.d.ts.map +1 -0
- package/dist/assembly/renderer-facade.d.ts.map +1 -1
- package/dist/assembly/renderer-feature-inspection.d.ts +1 -1
- package/dist/assembly/renderer-feature-inspection.d.ts.map +1 -1
- package/dist/assembly/renderer-frame-transaction.d.ts +12 -0
- package/dist/assembly/renderer-frame-transaction.d.ts.map +1 -1
- package/dist/assembly/renderer-inspection.d.ts +11 -0
- package/dist/assembly/renderer-inspection.d.ts.map +1 -1
- package/dist/assembly/temporal-post-process-prewarm.d.ts +13 -0
- package/dist/assembly/temporal-post-process-prewarm.d.ts.map +1 -0
- package/dist/assembly/webgpu-pbr-ready.d.ts +1 -0
- package/dist/assembly/webgpu-pbr-ready.d.ts.map +1 -1
- package/dist/assembly/webgpu-ready-contract.d.ts +4 -3
- package/dist/assembly/webgpu-ready-contract.d.ts.map +1 -1
- package/dist/assembly/webgpu-ready-per-pass.d.ts +39 -0
- package/dist/assembly/webgpu-ready-per-pass.d.ts.map +1 -0
- package/dist/assembly/webgpu-ready.d.ts +2 -2
- package/dist/assembly/webgpu-ready.d.ts.map +1 -1
- package/dist/assembly/webgpu-renderer-bootstrap.d.ts.map +1 -1
- package/dist/assembly/webgpu-renderer-observation-owner.d.ts +35 -0
- package/dist/assembly/webgpu-renderer-observation-owner.d.ts.map +1 -0
- package/dist/assembly/webgpu-renderer.d.ts +1 -1
- package/dist/assembly/webgpu-renderer.d.ts.map +1 -1
- package/dist/authoring.mjs +1 -1
- package/dist/barrel-distortion.d.ts +47 -0
- package/dist/barrel-distortion.d.ts.map +1 -0
- package/dist/bloom-admission.d.ts +13 -0
- package/dist/bloom-admission.d.ts.map +1 -0
- package/dist/{chunk-PA5DRJNI.mjs → chunk-ELJFJ2BU.mjs} +2 -2
- package/dist/chunk-ELJFJ2BU.mjs.map +1 -0
- package/dist/{chunk-JCIRYQ4V.mjs → chunk-HEB564WF.mjs} +10 -4
- package/dist/chunk-HEB564WF.mjs.map +1 -0
- package/dist/{chunk-JRIPCMYC.mjs → chunk-MKDIT2EM.mjs} +1584 -375
- package/dist/chunk-MKDIT2EM.mjs.map +1 -0
- package/dist/{chunk-S665NJNF.mjs → chunk-OCDLEI6I.mjs} +3 -3
- package/dist/{chunk-S665NJNF.mjs.map → chunk-OCDLEI6I.mjs.map} +1 -1
- package/dist/chunk-ODZWR6JQ.mjs +4927 -0
- package/dist/chunk-ODZWR6JQ.mjs.map +1 -0
- package/dist/{chunk-DRR7D3KX.mjs → chunk-SHFUFJ5N.mjs} +192 -18
- package/dist/chunk-SHFUFJ5N.mjs.map +1 -0
- package/dist/{chunk-4NNZQCL3.mjs → chunk-UI5SFODX.mjs} +223 -277
- package/dist/chunk-UI5SFODX.mjs.map +1 -0
- package/dist/{chunk-GWCEMDVR.mjs → chunk-UINHLCZA.mjs} +787 -80
- package/dist/chunk-UINHLCZA.mjs.map +1 -0
- package/dist/{chunk-6TFBXLRJ.mjs → chunk-WEX45HKH.mjs} +222 -337
- package/dist/chunk-WEX45HKH.mjs.map +1 -0
- package/dist/cloud/density.d.ts +55 -0
- package/dist/cloud/density.d.ts.map +1 -0
- package/dist/cloud/extract.d.ts +25 -0
- package/dist/cloud/extract.d.ts.map +1 -0
- package/dist/cloud/feature.d.ts +57 -0
- package/dist/cloud/feature.d.ts.map +1 -0
- package/dist/cloud/frame-context.d.ts +8 -0
- package/dist/cloud/frame-context.d.ts.map +1 -0
- package/dist/cloud/inspection.d.ts +59 -0
- package/dist/cloud/inspection.d.ts.map +1 -0
- package/dist/cloud/optics.d.ts +56 -0
- package/dist/cloud/optics.d.ts.map +1 -0
- package/dist/cloud/parameters.d.ts +73 -0
- package/dist/cloud/parameters.d.ts.map +1 -0
- package/dist/cloud/resources.d.ts +60 -0
- package/dist/cloud/resources.d.ts.map +1 -0
- package/dist/cloud/shadow.d.ts +42 -0
- package/dist/cloud/shadow.d.ts.map +1 -0
- package/dist/cloud/temporal.d.ts +74 -0
- package/dist/cloud/temporal.d.ts.map +1 -0
- package/dist/components/atmosphere.d.ts +2 -0
- package/dist/components/atmosphere.d.ts.map +1 -1
- package/dist/components/barrel-distortion.d.ts +13 -0
- package/dist/components/barrel-distortion.d.ts.map +1 -0
- package/dist/components/camera.d.ts +20 -4
- package/dist/components/camera.d.ts.map +1 -1
- package/dist/components/cloud-layer.d.ts +29 -0
- package/dist/components/cloud-layer.d.ts.map +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/instances.d.ts +20 -6
- package/dist/components/instances.d.ts.map +1 -1
- package/dist/components/mesh-filter.d.ts +6 -5
- package/dist/components/mesh-filter.d.ts.map +1 -1
- package/dist/components/motion-blur.d.ts +1 -0
- package/dist/components/motion-blur.d.ts.map +1 -1
- package/dist/construct-renderer.d.ts +1 -1
- package/dist/construct-renderer.d.ts.map +1 -1
- package/dist/construct-renderer.mjs +9751 -3528
- package/dist/construct-renderer.mjs.map +1 -1
- package/dist/device/gpu-residency.d.ts +6 -0
- package/dist/device/gpu-residency.d.ts.map +1 -1
- package/dist/dynamic-geometry.d.ts +5 -1
- package/dist/dynamic-geometry.d.ts.map +1 -1
- package/dist/environment/analytic-fog.d.ts +6 -0
- package/dist/environment/analytic-fog.d.ts.map +1 -0
- package/dist/errors/cloud.d.ts +59 -0
- package/dist/errors/cloud.d.ts.map +1 -0
- package/dist/errors/render.d.ts +23 -5
- package/dist/errors/render.d.ts.map +1 -1
- package/dist/examples/single-layer-medium-surface.d.ts +47 -0
- package/dist/examples/single-layer-medium-surface.d.ts.map +1 -0
- package/dist/extract/camera.d.ts.map +1 -1
- package/dist/extract/contracts.d.ts +12 -1
- package/dist/extract/contracts.d.ts.map +1 -1
- package/dist/extract/environment.d.ts +2 -0
- package/dist/extract/environment.d.ts.map +1 -1
- package/dist/features/barrel-distortion.d.ts +29 -0
- package/dist/features/barrel-distortion.d.ts.map +1 -0
- package/dist/features/error-reporting.d.ts +17 -0
- package/dist/features/error-reporting.d.ts.map +1 -0
- package/dist/features/host.d.ts +15 -0
- package/dist/features/host.d.ts.map +1 -1
- package/dist/features/motion-blur/motion-blur-feature.d.ts +20 -2
- package/dist/features/motion-blur/motion-blur-feature.d.ts.map +1 -1
- package/dist/features/motion-blur/motion-blur-params.d.ts +21 -0
- package/dist/features/motion-blur/motion-blur-params.d.ts.map +1 -1
- package/dist/features/motion-blur/motion-blur-runtime.d.ts +54 -0
- package/dist/features/motion-blur/motion-blur-runtime.d.ts.map +1 -0
- package/dist/features/plan.d.ts +15 -4
- package/dist/features/plan.d.ts.map +1 -1
- package/dist/features/prepared-gpu-work.d.ts +9 -5
- package/dist/features/prepared-gpu-work.d.ts.map +1 -1
- package/dist/features/render-graph-compute.d.ts.map +1 -1
- package/dist/features/render-graph-contribution.d.ts +5 -0
- package/dist/features/render-graph-contribution.d.ts.map +1 -1
- package/dist/features/render-graph-raster.d.ts +1 -0
- package/dist/features/render-graph-raster.d.ts.map +1 -1
- package/dist/features/targets.d.ts +2 -0
- package/dist/features/targets.d.ts.map +1 -1
- package/dist/features/types.d.ts +44 -0
- package/dist/features/types.d.ts.map +1 -1
- package/dist/fullscreen-post-process-pass.d.ts +15 -7
- package/dist/fullscreen-post-process-pass.d.ts.map +1 -1
- package/dist/gpu-dirty-ranges.d.ts +11 -0
- package/dist/gpu-dirty-ranges.d.ts.map +1 -0
- package/dist/gpu-driven/batch-topology.d.ts +17 -0
- package/dist/gpu-driven/batch-topology.d.ts.map +1 -1
- package/dist/gpu-driven/material-artifacts.d.ts +6 -0
- package/dist/gpu-driven/material-artifacts.d.ts.map +1 -1
- package/dist/gpu-driven/prepared-draw.d.ts +7 -0
- package/dist/gpu-driven/prepared-draw.d.ts.map +1 -1
- package/dist/gpu-driven/production-raster-material.d.ts +178 -0
- package/dist/gpu-driven/production-raster-material.d.ts.map +1 -0
- package/dist/gpu-driven/production-raster.d.ts +50 -4
- package/dist/gpu-driven/production-raster.d.ts.map +1 -1
- package/dist/gpu-driven/resource-allocation.d.ts +31 -0
- package/dist/gpu-driven/resource-allocation.d.ts.map +1 -0
- package/dist/gpu-driven/shadow-ownership.d.ts +14 -0
- package/dist/gpu-driven/shadow-ownership.d.ts.map +1 -0
- package/dist/gpu-driven/view-gpu.d.ts +35 -2
- package/dist/gpu-driven/view-gpu.d.ts.map +1 -1
- package/dist/gpu-scene.d.ts +11 -1
- package/dist/gpu-scene.d.ts.map +1 -1
- package/dist/hdrp-buffers.d.ts +2 -2
- package/dist/hdrp-buffers.d.ts.map +1 -1
- package/dist/ibl/skylight-bind-group.d.ts +10 -1
- package/dist/ibl/skylight-bind-group.d.ts.map +1 -1
- package/dist/index.d.ts +31 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +258 -8
- package/dist/index.mjs.map +1 -1
- package/dist/inspection-types.d.ts +178 -3
- package/dist/inspection-types.d.ts.map +1 -1
- package/dist/instance-buffer-cache.d.ts +4 -4
- package/dist/instance-buffer-cache.d.ts.map +1 -1
- package/dist/instances.d.ts +49 -94
- package/dist/instances.d.ts.map +1 -1
- package/dist/internal.mjs +7 -7
- package/dist/pbr-pipeline.d.ts +19 -1
- package/dist/pbr-pipeline.d.ts.map +1 -1
- package/dist/pipeline/single-layer-medium-passes.d.ts +73 -0
- package/dist/pipeline/single-layer-medium-passes.d.ts.map +1 -0
- package/dist/pipeline/standard-forward-lane.d.ts.map +1 -1
- package/dist/pipeline/standard-output/graph.d.ts.map +1 -1
- package/dist/pipeline/standard-output/types.d.ts +4 -2
- package/dist/pipeline/standard-output/types.d.ts.map +1 -1
- package/dist/pipeline/standard-pipeline.d.ts.map +1 -1
- package/dist/pipeline/standard-post.d.ts +28 -19
- package/dist/pipeline/standard-post.d.ts.map +1 -1
- package/dist/pipeline-builder.d.ts +1 -1
- package/dist/pipeline-builder.d.ts.map +1 -1
- package/dist/pipeline-spec.d.ts +2 -2
- package/dist/plugin.d.ts.map +1 -1
- package/dist/prepare/prepared-graphics-resolver.d.ts +2 -0
- package/dist/prepare/prepared-graphics-resolver.d.ts.map +1 -1
- package/dist/record/barrel-distortion-frame.d.ts +15 -0
- package/dist/record/barrel-distortion-frame.d.ts.map +1 -0
- package/dist/record/dynamic-geometry-consumption.d.ts +10 -2
- package/dist/record/dynamic-geometry-consumption.d.ts.map +1 -1
- package/dist/record/fold-buckets.d.ts +95 -0
- package/dist/record/fold-buckets.d.ts.map +1 -0
- package/dist/record/fold-instance-buffer.d.ts +6 -0
- package/dist/record/fold-instance-buffer.d.ts.map +1 -0
- package/dist/record/frame-lighting.d.ts +1 -0
- package/dist/record/frame-lighting.d.ts.map +1 -1
- package/dist/record/frame-snapshot.d.ts +40 -3
- 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 -62
- package/dist/record/frame.d.ts.map +1 -1
- package/dist/record/gpu-draw-receipts.d.ts +11 -0
- package/dist/record/gpu-draw-receipts.d.ts.map +1 -0
- package/dist/record/gpu-timing.d.ts +8 -0
- package/dist/record/gpu-timing.d.ts.map +1 -1
- package/dist/record/main-pass-geometry.d.ts +21 -5
- package/dist/record/main-pass-geometry.d.ts.map +1 -1
- package/dist/record/main-pass-material.d.ts +7 -1
- package/dist/record/main-pass-material.d.ts.map +1 -1
- package/dist/record/main-pass-sprite-draws.d.ts.map +1 -1
- package/dist/record/main-pass.d.ts +13 -2
- package/dist/record/main-pass.d.ts.map +1 -1
- package/dist/record/mesh-ssbo.d.ts +6 -5
- package/dist/record/mesh-ssbo.d.ts.map +1 -1
- package/dist/record/motion-blur-receipt.d.ts +11 -0
- package/dist/record/motion-blur-receipt.d.ts.map +1 -0
- package/dist/record/probe-blend-buffer.d.ts +16 -0
- package/dist/record/probe-blend-buffer.d.ts.map +1 -0
- package/dist/record/recovery-pipeline.d.ts.map +1 -1
- package/dist/record/render-context.d.ts +34 -31
- package/dist/record/render-context.d.ts.map +1 -1
- package/dist/record/shadow-pass.d.ts +2 -0
- package/dist/record/shadow-pass.d.ts.map +1 -1
- package/dist/record/skybox-post-pass.d.ts +6 -4
- package/dist/record/skybox-post-pass.d.ts.map +1 -1
- package/dist/record/typed-frame-graph.d.ts +22 -2
- package/dist/record/typed-frame-graph.d.ts.map +1 -1
- package/dist/record/view-ubo.d.ts +11 -3
- package/dist/record/view-ubo.d.ts.map +1 -1
- package/dist/record/volume-params.d.ts +9 -0
- package/dist/record/volume-params.d.ts.map +1 -0
- package/dist/recovery/render-system-candidate.d.ts +10 -0
- package/dist/recovery/render-system-candidate.d.ts.map +1 -1
- package/dist/reflection/record-owner.d.ts.map +1 -1
- package/dist/render-contract.d.ts +66 -8
- package/dist/render-contract.d.ts.map +1 -1
- package/dist/render-graph-primitives.d.ts.map +1 -1
- package/dist/render-pipeline.d.ts +106 -3
- package/dist/render-pipeline.d.ts.map +1 -1
- package/dist/render-system-extract-tail.d.ts +3 -2
- package/dist/render-system-extract-tail.d.ts.map +1 -1
- package/dist/render-system-extract.d.ts +24 -10
- package/dist/render-system-extract.d.ts.map +1 -1
- package/dist/render-system-presentation.d.ts +23 -0
- package/dist/render-system-presentation.d.ts.map +1 -0
- package/dist/render-system-producer-roots.d.ts +10 -0
- package/dist/render-system-producer-roots.d.ts.map +1 -0
- package/dist/render-system-residency.d.ts +12 -0
- package/dist/render-system-residency.d.ts.map +1 -0
- package/dist/render-system.d.ts +26 -15
- package/dist/render-system.d.ts.map +1 -1
- package/dist/scene/probe-blend.d.ts +27 -0
- package/dist/scene/probe-blend.d.ts.map +1 -1
- package/dist/scene/render-scene.d.ts +14 -5
- package/dist/scene/render-scene.d.ts.map +1 -1
- package/dist/ssao-buffers.d.ts +9 -0
- package/dist/ssao-buffers.d.ts.map +1 -1
- package/dist/surface/dynamic-input.d.ts +133 -0
- package/dist/surface/dynamic-input.d.ts.map +1 -0
- package/dist/surface/gpu-driven.d.ts +41 -0
- package/dist/surface/gpu-driven.d.ts.map +1 -0
- package/dist/surface/submission-observation.d.ts +136 -0
- package/dist/surface/submission-observation.d.ts.map +1 -0
- package/dist/systems/skin-palette-allocator.d.ts.map +1 -1
- package/dist/temporal/frame-coordinator.d.ts.map +1 -1
- package/dist/temporal/frame.d.ts +7 -0
- package/dist/temporal/frame.d.ts.map +1 -1
- package/dist/temporal/gpu.d.ts +13 -1
- package/dist/temporal/gpu.d.ts.map +1 -1
- package/dist/temporal/index.mjs +5 -5
- package/dist/temporal/inspection.d.ts.map +1 -1
- package/dist/temporal/standard-scene-data.d.ts.map +1 -1
- package/dist/temporal/target-coverage-attachment.d.ts.map +1 -1
- package/dist/temporal/view.d.ts +6 -1
- package/dist/temporal/view.d.ts.map +1 -1
- package/dist/transmission/single-layer-medium.d.ts +89 -0
- package/dist/transmission/single-layer-medium.d.ts.map +1 -0
- package/dist/typed-render-graph-primitives.d.ts +24 -9
- package/dist/typed-render-graph-primitives.d.ts.map +1 -1
- package/dist/volume/component.d.ts +9 -5
- package/dist/volume/component.d.ts.map +1 -1
- package/dist/volume/extract.d.ts +1 -1
- package/dist/volume/extract.d.ts.map +1 -1
- package/dist/volume/inspection.d.ts +2 -0
- package/dist/volume/inspection.d.ts.map +1 -1
- package/dist/volume/passes.d.ts +4 -1
- package/dist/volume/passes.d.ts.map +1 -1
- package/dist/volume/resources.d.ts.map +1 -1
- package/dist/volume/temporal.d.ts +3 -1
- package/dist/volume/temporal.d.ts.map +1 -1
- package/package.json +22 -21
- package/src/__tests__/analytic-fog-graph.unit.test.ts +199 -0
- package/src/__tests__/analytic-fog-optics.unit.test.ts +38 -0
- package/src/__tests__/atmosphere-daylight.dawn.test.ts +72 -0
- package/src/__tests__/barrel-distortion-lkg.integration.test.ts +353 -0
- package/src/__tests__/barrel-distortion.dawn.test.ts +41 -0
- package/src/__tests__/barrel-distortion.unit.test.ts +364 -0
- package/src/__tests__/bloom-exact-zero.unit.test.ts +112 -18
- package/src/__tests__/bloom-lifecycle.integration.test.ts +17 -4
- package/src/__tests__/construct-renderer-identity.unit.test.ts +49 -0
- package/src/__tests__/detached-recovery-graph.unit.test.ts +277 -0
- package/src/__tests__/device-loss-fanout.unit.test.ts +36 -1
- package/src/__tests__/docs-gate-green.unit.test.ts +112 -1
- package/src/__tests__/dynamic-resolution-plugin.integration.test.ts +20 -0
- package/src/__tests__/environment-fog-lanes.integration.test.ts +14 -0
- package/src/__tests__/environment-selection.unit.test.ts +12 -0
- package/src/__tests__/factory-contract.integration.test.ts +626 -113
- package/src/__tests__/feature-depth-input.dawn.test.ts +129 -2
- package/src/__tests__/frame-camera-selection.unit.test.ts +39 -1
- package/src/__tests__/frame-plan-contract.unit.test.ts +2 -0
- package/src/__tests__/fullscreen-feature-plan.unit.test.ts +14 -3
- package/src/__tests__/gpu-dirty-ranges.unit.test.ts +22 -0
- package/src/__tests__/gpu-driven-baseline.characterization.test.ts +16 -3
- package/src/__tests__/gpu-driven-batch-topology-pbr.unit.test.ts +12 -0
- package/src/__tests__/gpu-driven-indirect-raster-evidence.ts +2 -1
- package/src/__tests__/gpu-driven-material-artifacts.unit.test.ts +143 -0
- package/src/__tests__/gpu-driven-pbr.dawn.test.ts +2 -2
- package/src/__tests__/gpu-driven-production.integration.test.ts +482 -3
- package/src/__tests__/gpu-driven-shadow-views.dawn.test.ts +7 -6
- package/src/__tests__/gpu-driven-shadow-views.integration.test.ts +1 -1
- package/src/__tests__/gpu-driven-view-gpu-evidence.ts +103 -4
- package/src/__tests__/gpu-driven-view-graph.integration.test.ts +18 -2
- package/src/__tests__/gpu-driven-view.browser.test.ts +5 -8
- package/src/__tests__/gpu-driven-view.dawn.test.ts +6 -2
- package/src/__tests__/gpu-driven-view.unit.test.ts +1 -1
- package/src/__tests__/gpu-pass-timing-lifecycle.integration.test.ts +1 -0
- package/src/__tests__/gpu-pass-timing.browser.test.ts +6 -4
- package/src/__tests__/gpu-pass-timing.rhi-null.unit.test.ts +1 -0
- package/src/__tests__/gpu-resource-store-stride.unit.test.ts +12 -0
- package/src/__tests__/gpu-scene.unit.test.ts +210 -9
- package/src/__tests__/instance-allocation-failure.unit.test.ts +57 -0
- package/src/__tests__/instances-culling.integration.test.ts +10 -36
- package/src/__tests__/instances-store.unit.test.ts +105 -238
- package/src/__tests__/instances-world-ownership.integration.test.ts +62 -0
- package/src/__tests__/main-pass-material-medium-selection.unit.test.ts +146 -0
- package/src/__tests__/material-shader-prewarm.unit.test.ts +59 -0
- package/src/__tests__/material-snapshot-mutation.integration.test.ts +39 -1
- package/src/__tests__/mesh-submission-lifetime.unit.test.ts +31 -0
- package/src/__tests__/morph-culling-reentry.dawn.test.ts +5 -5
- package/src/__tests__/morph-visual-evidence.integration.test.ts +8 -7
- package/src/__tests__/motion-blur-compute.dawn.test.ts +589 -0
- package/src/__tests__/motion-blur.pixel.integration.test.ts +2 -2
- package/src/__tests__/nineslice-handle-surface.unit.test.ts +4 -4
- package/src/__tests__/pbr-view-layout.unit.test.ts +9 -0
- package/src/__tests__/physical-clearcoat.integration.test.ts +58 -0
- package/src/__tests__/prepared-gpu-driven-pbr.integration.test.ts +21 -0
- package/src/__tests__/prepared-graphics-capability.unit.test.ts +66 -2
- package/src/__tests__/prepared-graphics-lifecycle.unit.test.ts +86 -0
- package/src/__tests__/probe-bindings.unit.test.ts +582 -1
- package/src/__tests__/probe-scene-dirty.integration.test.ts +28 -1
- package/src/__tests__/public-surface.test-d.ts +8 -0
- package/src/__tests__/receipt-observation-retirement.unit.test.ts +65 -0
- package/src/__tests__/recovery-candidate-prepare.contract.test.ts +69 -0
- package/src/__tests__/render-error-code-owner.test-d.ts +9 -0
- package/src/__tests__/render-feature-diagnostics.unit.test.ts +15 -2
- package/src/__tests__/render-feature-error-reporting.unit.test.ts +44 -0
- package/src/__tests__/render-feature-prepared-diagnostics.unit.test.ts +10 -1
- package/src/__tests__/render-feature-retry.unit.test.ts +12 -1
- package/src/__tests__/render-feature-stage-fault-recovery.unit.test.ts +23 -0
- package/src/__tests__/render-scene-mixed-updates.integration.test.ts +145 -19
- package/src/__tests__/render-scene-projection.unit.test.ts +36 -11
- package/src/__tests__/render-scene-temporal-retry.unit.test.ts +37 -6
- package/src/__tests__/render-target-probe-soak.perf.test.ts +2 -2
- package/src/__tests__/render-temporal-environment-consumer.browser.test.ts +3 -3
- package/src/__tests__/render-temporal-environment-consumer.dawn.test.ts +5 -2
- package/src/__tests__/renderer-factory-material-contract.unit.test.ts +41 -7
- package/src/__tests__/renderer-frame-generation-fence.integration.test.ts +16 -0
- package/src/__tests__/renderer-frame-transaction.integration.test.ts +33 -11
- package/src/__tests__/resource-allocation.unit.test.ts +123 -0
- package/src/__tests__/shader-manifest-fixture.ts +4 -4
- package/src/__tests__/single-layer-medium-passes.unit.test.ts +275 -0
- package/src/__tests__/skin-motion-regression.unit.test.ts +70 -1
- package/src/__tests__/skin-palette-recycling.dawn.test.ts +97 -0
- package/src/__tests__/skinned-shadow-caster.test.ts +17 -0
- package/src/__tests__/ssr-carrier-public-contract.unit.test.ts +21 -0
- package/src/__tests__/ssr-gpu-dispatch.browser.test.ts +4 -4
- package/src/__tests__/ssr-gpu-dispatch.dawn.test.ts +2 -2
- package/src/__tests__/ssr-gpu-dispatch.ts +1 -1
- package/src/__tests__/ssr-receiver-coverage.dawn.test.ts +6 -2
- package/src/__tests__/standard-lighting-write.unit.test.ts +2 -1
- package/src/__tests__/standard-output-chain-contract.unit.test.ts +28 -0
- package/src/__tests__/standard-pbr-artifact-assembly.unit.test.ts +46 -1
- package/src/__tests__/standard-pipeline.dawn.test.ts +1 -1
- package/src/__tests__/standard-pipeline.integration.test.ts +200 -9
- package/src/__tests__/surface-dynamic-buffer-lifecycle.unit.test.ts +506 -0
- package/src/__tests__/surface-submission-observation.unit.test.ts +812 -0
- package/src/__tests__/temporal-history-lifecycle.unit.test.ts +32 -0
- package/src/__tests__/temporal-performance.integration.test.ts +3 -3
- package/src/__tests__/temporal-reset-matrix.unit.test.ts +10 -0
- package/src/__tests__/temporal-view.unit.test.ts +2 -1
- package/src/__tests__/typed-pipeline-topology.unit.test.ts +20 -4
- package/src/__tests__/visibility-instances.integration.test.ts +7 -19
- package/src/__tests__/visibility-producer-matrix.integration.test.ts +9 -20
- package/src/__tests__/volume-optics-oracle.unit.test.ts +7 -3
- package/src/__tests__/volumetric-fog-budget-recovery.integration.test.ts +189 -15
- package/src/__tests__/volumetric-fog-errors.unit.test.ts +4 -3
- package/src/__tests__/volumetric-fog-multiple.unit.test.ts +55 -0
- package/src/__tests__/volumetric-fog-spot-frame-optics.integration.test.ts +1 -1
- package/src/__tests__/volumetric-fog-stage-readback.dawn.test.ts +558 -68
- package/src/__tests__/volumetric-fog-temporal.unit.test.ts +27 -0
- package/src/__tests__/volumetric-fog-topology.unit.test.ts +23 -5
- package/src/assembly/analytic-fog-registration.ts +14 -0
- package/src/assembly/backend-contract.ts +30 -0
- package/src/assembly/barrel-distortion-inspection.ts +22 -0
- package/src/assembly/canvas-draw-guard.ts +11 -0
- package/src/assembly/cloud-shadow-entry.ts +22 -0
- package/src/assembly/dynamic-geometry-host.ts +65 -37
- package/src/assembly/dynamic-geometry-runtime.ts +7 -1
- package/src/assembly/factory.ts +2 -30
- package/src/assembly/fxaa-registration.ts +17 -0
- package/src/assembly/host-contract.ts +3 -3
- package/src/assembly/lod-observation.ts +12 -0
- package/src/assembly/material/assembly.ts +25 -13
- package/src/assembly/material/pipeline-helpers.ts +53 -12
- package/src/assembly/material-shader-policy.ts +55 -0
- package/src/assembly/material-shader-prewarm.ts +21 -10
- package/src/assembly/motion-blur-registration.ts +17 -0
- package/src/assembly/recovery/device-loss-fanout.ts +13 -0
- package/src/assembly/recovery/renderer-recover.ts +41 -18
- package/src/assembly/render-feature-post-processes.ts +54 -0
- package/src/assembly/renderer-facade.ts +6 -1
- package/src/assembly/renderer-feature-inspection.ts +8 -2
- package/src/assembly/renderer-frame-transaction.ts +23 -0
- package/src/assembly/renderer-inspection.ts +28 -0
- package/src/assembly/skin-palette-owner.ts +1 -1
- package/src/assembly/temporal-post-process-prewarm.ts +40 -0
- package/src/assembly/webgpu-pbr-ready.ts +9 -1
- package/src/assembly/webgpu-ready-contract.ts +8 -3
- package/src/assembly/webgpu-ready-per-pass.ts +104 -0
- package/src/assembly/webgpu-ready.ts +296 -306
- package/src/assembly/webgpu-renderer-bootstrap.ts +0 -12
- package/src/assembly/webgpu-renderer-observation-owner.ts +222 -0
- package/src/assembly/webgpu-renderer.ts +228 -281
- package/src/assembly/webgpu-vertex-layouts.ts +1 -1
- package/src/barrel-distortion.ts +247 -0
- package/src/bloom-admission.ts +21 -0
- package/src/cloud/__tests__/cloud-density-parity.dawn.test.ts +173 -0
- package/src/cloud/__tests__/cloud-layer-framebuffer-y.dawn.test.ts +265 -0
- package/src/cloud/__tests__/cloud-layer.browser.test.ts +432 -0
- package/src/cloud/__tests__/cloud-layer.unit.test.ts +634 -0
- package/src/cloud/density.ts +600 -0
- package/src/cloud/extract.ts +110 -0
- package/src/cloud/feature.ts +1810 -0
- package/src/cloud/frame-context.ts +42 -0
- package/src/cloud/inspection.ts +130 -0
- package/src/cloud/optics.ts +285 -0
- package/src/cloud/parameters.ts +255 -0
- package/src/cloud/resources.ts +122 -0
- package/src/cloud/shadow.ts +167 -0
- package/src/cloud/temporal.ts +226 -0
- package/src/components/__tests__/motion-blur.unit.test.ts +1 -0
- package/src/components/atmosphere.ts +4 -0
- package/src/components/barrel-distortion.ts +46 -0
- package/src/components/camera.ts +66 -10
- package/src/components/cloud-layer.ts +47 -0
- package/src/components/index.ts +2 -0
- package/src/components/instances.ts +18 -45
- package/src/components/mesh-filter.ts +11 -9
- package/src/components/motion-blur.ts +1 -0
- package/src/components/sprite-instances.ts +1 -1
- package/src/construct-renderer.ts +1 -1
- package/src/device/gpu-residency.ts +56 -12
- package/src/dynamic-geometry.ts +12 -1
- package/src/environment/analytic-fog.ts +44 -0
- package/src/environment/background.ts +2 -2
- package/src/errors/cloud.ts +103 -0
- package/src/errors/render.ts +58 -8
- package/src/examples/single-layer-medium-surface.ts +59 -0
- package/src/extract/camera.ts +35 -8
- package/src/extract/contracts.ts +12 -0
- package/src/extract/environment.ts +4 -0
- package/src/features/barrel-distortion.ts +172 -0
- package/src/features/error-reporting.ts +98 -0
- package/src/features/host.ts +138 -24
- package/src/features/motion-blur/__tests__/motion-blur-feature.unit.test.ts +111 -1
- package/src/features/motion-blur/__tests__/motion-blur-params.unit.test.ts +58 -3
- package/src/features/motion-blur/motion-blur-feature.ts +1519 -15
- package/src/features/motion-blur/motion-blur-params.ts +70 -2
- package/src/features/motion-blur/motion-blur-runtime.ts +176 -0
- package/src/features/plan.ts +33 -8
- package/src/features/prepared-gpu-work.ts +86 -35
- package/src/features/render-graph-compute.ts +13 -5
- package/src/features/render-graph-contribution.ts +11 -0
- package/src/features/render-graph-raster.ts +45 -3
- package/src/features/targets.ts +66 -0
- package/src/features/types.ts +47 -0
- package/src/fullscreen-post-process-pass.ts +41 -9
- package/src/gpu-dirty-ranges.ts +48 -0
- package/src/gpu-driven/batch-topology.ts +53 -0
- package/src/gpu-driven/material-artifacts.ts +35 -32
- package/src/gpu-driven/prepared-draw.ts +27 -14
- package/src/gpu-driven/production-raster-material.ts +1894 -0
- package/src/gpu-driven/production-raster.ts +904 -787
- package/src/gpu-driven/resource-allocation.ts +142 -0
- package/src/gpu-driven/shadow-ownership.ts +71 -0
- package/src/gpu-driven/view-gpu.ts +181 -10
- package/src/gpu-scene.ts +259 -101
- package/src/hdrp-buffers.ts +4 -3
- package/src/ibl/skylight-bind-group.ts +49 -7
- package/src/index.ts +228 -9
- package/src/inspection-types.ts +222 -2
- package/src/instance-buffer-cache.ts +4 -4
- package/src/instances.ts +151 -492
- package/src/pbr-pipeline.ts +219 -13
- package/src/pipeline/single-layer-medium-passes.ts +267 -0
- package/src/pipeline/standard-forward-lane.ts +313 -57
- package/src/pipeline/standard-output/graph.ts +8 -2
- package/src/pipeline/standard-output/types.ts +12 -1
- package/src/pipeline/standard-pipeline.ts +291 -18
- package/src/pipeline/standard-post.ts +397 -102
- package/src/pipeline-builder.ts +1 -1
- package/src/pipeline-spec.ts +5 -5
- package/src/plugin.ts +4 -0
- package/src/points-lines/__tests__/points-lines.bench.ts +17 -8
- package/src/points-lines/__tests__/view-ubo.unit.test.ts +2 -1
- package/src/prepare/prepared-graphics-resolver.ts +2 -0
- package/src/record/__tests__/main-pass-geometry.unit.test.ts +30 -0
- package/src/record/__tests__/sprite-material-abi.unit.test.ts +1 -1
- package/src/record/__tests__/temporal-payload.unit.test.ts +3 -2
- package/src/record/__tests__/transparent-group2-selection.unit.test.ts +11 -0
- package/src/record/__tests__/typed-frame-graph-plan.unit.test.ts +1 -0
- package/src/record/__tests__/view-ubo-layout.unit.test.ts +4 -3
- package/src/record/barrel-distortion-frame.ts +110 -0
- package/src/record/dynamic-geometry-consumption.ts +39 -9
- package/src/record/fold-buckets.ts +852 -0
- package/src/record/fold-instance-buffer.ts +51 -0
- package/src/record/frame-lighting.ts +36 -2
- package/src/record/frame-snapshot.ts +44 -4
- package/src/record/frame-targets.ts +10 -6
- package/src/record/frame.ts +373 -1099
- package/src/record/gpu-draw-receipts.ts +38 -0
- package/src/record/gpu-timing.ts +48 -5
- package/src/record/main-pass-geometry.ts +281 -83
- package/src/record/main-pass-material.ts +66 -4
- package/src/record/main-pass-sprite-draws.ts +13 -66
- package/src/record/main-pass.ts +156 -20
- package/src/record/mesh-ssbo.ts +43 -6
- package/src/record/motion-blur-receipt.ts +91 -0
- package/src/record/probe-blend-buffer.ts +180 -0
- package/src/record/recovery-pipeline.ts +35 -3
- package/src/record/render-context.ts +51 -31
- package/src/record/shadow-pass.ts +36 -2
- package/src/record/skybox-post-pass.ts +150 -200
- package/src/record/typed-frame-graph.ts +824 -44
- package/src/record/view-ubo.ts +26 -3
- package/src/record/volume-params.ts +225 -0
- package/src/recovery/render-system-candidate.ts +257 -52
- package/src/reflection/record-owner.ts +7 -3
- package/src/render-contract.ts +71 -8
- package/src/render-graph-primitives.ts +7 -1
- package/src/render-pipeline.ts +136 -1
- package/src/render-system-extract-tail.ts +72 -60
- package/src/render-system-extract.ts +117 -87
- package/src/render-system-presentation.ts +56 -0
- package/src/render-system-producer-roots.ts +96 -0
- package/src/render-system-residency.ts +159 -0
- package/src/render-system.ts +601 -482
- package/src/scene/probe-blend.ts +96 -4
- package/src/scene/render-scene.ts +431 -281
- package/src/ssao-buffers.ts +95 -2
- package/src/surface/__tests__/dynamic-input.unit.test.ts +374 -0
- package/src/surface/__tests__/gpu-driven.unit.test.ts +87 -0
- package/src/surface/dynamic-input.ts +658 -0
- package/src/surface/gpu-driven.ts +147 -0
- package/src/surface/submission-observation.ts +517 -0
- package/src/systems/skin-palette-allocator.ts +4 -1
- package/src/temporal/__tests__/temporal-frame-transaction.unit.test.ts +36 -0
- package/src/temporal/frame-coordinator.ts +8 -1
- package/src/temporal/frame.ts +20 -0
- package/src/temporal/gpu.ts +101 -17
- package/src/temporal/inspection.ts +7 -1
- package/src/temporal/standard-scene-data.ts +5 -0
- package/src/temporal/target-coverage-attachment.ts +4 -0
- package/src/temporal/view.ts +13 -2
- package/src/transmission/__tests__/single-layer-medium.unit.test.ts +149 -0
- package/src/transmission/__tests__/standard-transmission.dawn.test.ts +12 -11
- package/src/transmission/single-layer-medium.ts +322 -0
- package/src/typed-render-graph-primitives.ts +191 -50
- package/src/volume/component.ts +10 -10
- package/src/volume/extract.ts +11 -5
- package/src/volume/inspection.ts +3 -0
- package/src/volume/passes.ts +95 -8
- package/src/volume/resources.ts +2 -1
- package/src/volume/temporal.ts +11 -0
- package/dist/chunk-4NNZQCL3.mjs.map +0 -1
- package/dist/chunk-6TFBXLRJ.mjs.map +0 -1
- package/dist/chunk-DRR7D3KX.mjs.map +0 -1
- package/dist/chunk-GWCEMDVR.mjs.map +0 -1
- package/dist/chunk-JCIRYQ4V.mjs.map +0 -1
- package/dist/chunk-JRIPCMYC.mjs.map +0 -1
- package/dist/chunk-LULCA3OF.mjs +0 -1713
- package/dist/chunk-LULCA3OF.mjs.map +0 -1
- package/dist/chunk-PA5DRJNI.mjs.map +0 -1
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
import { World } from '@forgeax/engine-ecs';
|
|
2
|
+
import { Transform } from '@forgeax/engine-scene';
|
|
3
|
+
import { describe, expect, it } from 'vitest';
|
|
4
|
+
import { BarrelDistortion, Camera } from '../components';
|
|
5
|
+
import {
|
|
6
|
+
BARREL_DISTORTION_POST_PROCESS_ID,
|
|
7
|
+
BARREL_DISTORTION_WGSL,
|
|
8
|
+
createBarrelDistortionRenderFeature,
|
|
9
|
+
} from '../features/barrel-distortion';
|
|
10
|
+
import { createRenderFeatureHost, runRenderFeatureFrame } from '../features/host';
|
|
11
|
+
import { resolveStandardRenderFeatureTargets } from '../features/targets';
|
|
12
|
+
import {
|
|
13
|
+
attachBarrelDistortionCameraFrame,
|
|
14
|
+
createBarrelDistortionMapping,
|
|
15
|
+
mapDisplayToScene,
|
|
16
|
+
mapDisplayUvToSceneUv,
|
|
17
|
+
mapSceneToDisplay,
|
|
18
|
+
mapSceneUvToDisplayUv,
|
|
19
|
+
validateBarrelDistortionParameters,
|
|
20
|
+
} from '../index';
|
|
21
|
+
import { projectBarrelDistortionInspection } from '../inspection-types';
|
|
22
|
+
import { extractCameraSnapshots } from '../render-system-extract';
|
|
23
|
+
import { setActiveCamera } from '../systems/active-camera';
|
|
24
|
+
|
|
25
|
+
function spawnBarrelTestCamera(world: World, strength?: number): number {
|
|
26
|
+
const transform = {
|
|
27
|
+
component: Transform,
|
|
28
|
+
data: { pos: [0, 0, 0], quat: [0, 0, 0, 1], scale: [1, 1, 1] },
|
|
29
|
+
} as const;
|
|
30
|
+
const camera = {
|
|
31
|
+
component: Camera,
|
|
32
|
+
data: {
|
|
33
|
+
fov: Math.PI / 3,
|
|
34
|
+
aspect: 16 / 9,
|
|
35
|
+
near: 0.1,
|
|
36
|
+
far: 100,
|
|
37
|
+
projection: 0,
|
|
38
|
+
left: -1,
|
|
39
|
+
right: 1,
|
|
40
|
+
bottom: -1,
|
|
41
|
+
top: 1,
|
|
42
|
+
},
|
|
43
|
+
} as const;
|
|
44
|
+
if (strength === undefined) {
|
|
45
|
+
return world.spawn(transform, camera).unwrap() as unknown as number;
|
|
46
|
+
}
|
|
47
|
+
return world
|
|
48
|
+
.spawn(transform, camera, {
|
|
49
|
+
component: BarrelDistortion,
|
|
50
|
+
data: { strength },
|
|
51
|
+
})
|
|
52
|
+
.unwrap() as unknown as number;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
describe('bounded barrel distortion mapping', () => {
|
|
56
|
+
it('extracts work from the selected camera only', () => {
|
|
57
|
+
const world = new World();
|
|
58
|
+
const disabled = spawnBarrelTestCamera(world);
|
|
59
|
+
const enabled = spawnBarrelTestCamera(world, 0.2);
|
|
60
|
+
const zero = spawnBarrelTestCamera(world, 0);
|
|
61
|
+
const host = createRenderFeatureHost([createBarrelDistortionRenderFeature()]).unwrap();
|
|
62
|
+
const targets = resolveStandardRenderFeatureTargets({
|
|
63
|
+
tonemap: 'none',
|
|
64
|
+
antialias: 'none',
|
|
65
|
+
storageBuffer: false,
|
|
66
|
+
multisample: false,
|
|
67
|
+
colorAttachmentFormat: 'rgba8unorm',
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
const run = (frameNumber: number, entity: number) => {
|
|
71
|
+
setActiveCamera(world, entity);
|
|
72
|
+
const selected = extractCameraSnapshots(world)[0];
|
|
73
|
+
expect(selected?.entityKey).toBe(entity);
|
|
74
|
+
return runRenderFeatureFrame(host, {
|
|
75
|
+
worlds: [world],
|
|
76
|
+
owner: 0,
|
|
77
|
+
frameNumber,
|
|
78
|
+
generation: frameNumber,
|
|
79
|
+
...(selected === undefined ? {} : { selectedCamera: selected }),
|
|
80
|
+
targets,
|
|
81
|
+
caps: { rgba16floatRenderable: true } as never,
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
try {
|
|
86
|
+
// A non-active enabled camera must not activate the display feature.
|
|
87
|
+
expect(run(1, disabled).plans[0]?.plan).toEqual({ resources: [], passes: [] });
|
|
88
|
+
// An explicitly selected zero-strength companion is also zero work.
|
|
89
|
+
expect(run(2, zero).plans[0]?.plan).toEqual({ resources: [], passes: [] });
|
|
90
|
+
|
|
91
|
+
const active = run(3, enabled);
|
|
92
|
+
expect(active.errors).toEqual([]);
|
|
93
|
+
expect(active.plans[0]?.plan.resources).toHaveLength(3);
|
|
94
|
+
expect(active.plans[0]?.plan.passes).toHaveLength(1);
|
|
95
|
+
expect(active.fullscreenEffects.has(BARREL_DISTORTION_POST_PROCESS_ID)).toBe(true);
|
|
96
|
+
|
|
97
|
+
const backToDisabled = run(4, disabled);
|
|
98
|
+
expect(backToDisabled.plans[0]?.plan).toEqual({ resources: [], passes: [] });
|
|
99
|
+
expect(backToDisabled.fullscreenEffects.size).toBe(0);
|
|
100
|
+
} finally {
|
|
101
|
+
host.dispose();
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it('keeps an unconfigured camera at feature zero work', () => {
|
|
106
|
+
const host = createRenderFeatureHost([createBarrelDistortionRenderFeature()]).unwrap();
|
|
107
|
+
const frame = runRenderFeatureFrame(host, {
|
|
108
|
+
worlds: [new World()],
|
|
109
|
+
owner: 0,
|
|
110
|
+
frameNumber: 1,
|
|
111
|
+
caps: { rgba16floatRenderable: true } as never,
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
expect(frame.errors).toEqual([]);
|
|
115
|
+
expect(frame.fullscreenEffects.size).toBe(0);
|
|
116
|
+
expect(frame.preparedResourceBatches).toHaveLength(0);
|
|
117
|
+
expect(frame.requiresPreparedResourceKey).toBe(false);
|
|
118
|
+
expect(frame.plans[0]?.plan).toEqual({ resources: [], passes: [] });
|
|
119
|
+
host.dispose();
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
it('validates the production fullscreen entry point and keeps disabled plans exact-zero', () => {
|
|
123
|
+
expect(BARREL_DISTORTION_WGSL).toContain('@builtin(vertex_index) vertex_index : u32');
|
|
124
|
+
const feature = createBarrelDistortionRenderFeature();
|
|
125
|
+
expect(feature.identity).toBe(BARREL_DISTORTION_POST_PROCESS_ID);
|
|
126
|
+
expect(feature.requiredFullscreenPostProcesses).toEqual([
|
|
127
|
+
{ identity: BARREL_DISTORTION_POST_PROCESS_ID, source: BARREL_DISTORTION_WGSL },
|
|
128
|
+
]);
|
|
129
|
+
const disabled = feature.plan({ active: false }, {} as never);
|
|
130
|
+
expect(disabled.ok).toBe(true);
|
|
131
|
+
if (!disabled.ok) return;
|
|
132
|
+
expect(disabled.value.resources).toEqual([]);
|
|
133
|
+
expect(disabled.value.passes).toEqual([]);
|
|
134
|
+
|
|
135
|
+
const enabled = feature.plan({ active: true }, {} as never);
|
|
136
|
+
expect(enabled.ok).toBe(true);
|
|
137
|
+
if (!enabled.ok) return;
|
|
138
|
+
expect(enabled.value.resources).toHaveLength(3);
|
|
139
|
+
expect(enabled.value.resources[0]).toMatchObject({
|
|
140
|
+
kind: 'fullscreen-program',
|
|
141
|
+
name: BARREL_DISTORTION_POST_PROCESS_ID,
|
|
142
|
+
params: { byteSize: 16 },
|
|
143
|
+
});
|
|
144
|
+
expect(enabled.value.resources).toEqual(
|
|
145
|
+
expect.arrayContaining([
|
|
146
|
+
expect.objectContaining({
|
|
147
|
+
kind: 'graphics-program',
|
|
148
|
+
name: 'barrel-distortion-pipeline',
|
|
149
|
+
}),
|
|
150
|
+
expect.objectContaining({
|
|
151
|
+
kind: 'graphics-bindings',
|
|
152
|
+
name: 'barrel-distortion-bindings',
|
|
153
|
+
logicalTargets: { input: 'barrel-input' },
|
|
154
|
+
}),
|
|
155
|
+
]),
|
|
156
|
+
);
|
|
157
|
+
expect(enabled.value.passes).toMatchObject([
|
|
158
|
+
{
|
|
159
|
+
kind: 'raster',
|
|
160
|
+
name: 'barrel-distortion',
|
|
161
|
+
colorAttachments: [{ target: 'barrel-output' }],
|
|
162
|
+
sampledTargets: ['barrel-input'],
|
|
163
|
+
},
|
|
164
|
+
]);
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
it('keeps the disabled path exact and validates the authoring domain', () => {
|
|
168
|
+
const identity = createBarrelDistortionMapping(1920, 1080, undefined);
|
|
169
|
+
expect(identity.ok).toBe(true);
|
|
170
|
+
if (!identity.ok) return;
|
|
171
|
+
const mapped = { x: 0, y: 0 };
|
|
172
|
+
expect(mapDisplayToScene(mapped, identity.value, 321.5, 777.25)).toBe(true);
|
|
173
|
+
expect(mapped).toEqual({ x: 321.5, y: 777.25 });
|
|
174
|
+
|
|
175
|
+
expect(validateBarrelDistortionParameters({ strength: 0.351 }).ok).toBe(false);
|
|
176
|
+
expect(validateBarrelDistortionParameters({ centerX: Number.NaN }).ok).toBe(false);
|
|
177
|
+
expect(validateBarrelDistortionParameters({ centerY: 1.1 }).ok).toBe(false);
|
|
178
|
+
expect(createBarrelDistortionMapping(0, 1080, { strength: 0.2 }).ok).toBe(false);
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
it.each([
|
|
182
|
+
[1920, 1080, 0.5, 0.5, 0.2],
|
|
183
|
+
[1080, 1920, 0.2, 0.75, 0.35],
|
|
184
|
+
[2560, 1080, 0.8, 0.3, 0.1],
|
|
185
|
+
])('round trips UVs for %s x %s with center %s,%s', (width, height, centerX, centerY, strength) => {
|
|
186
|
+
const mapping = createBarrelDistortionMapping(width, height, {
|
|
187
|
+
centerX,
|
|
188
|
+
centerY,
|
|
189
|
+
strength,
|
|
190
|
+
});
|
|
191
|
+
expect(mapping.ok).toBe(true);
|
|
192
|
+
if (!mapping.ok) return;
|
|
193
|
+
for (const uv of [
|
|
194
|
+
[0.01, 0.01],
|
|
195
|
+
[0.2, 0.7],
|
|
196
|
+
[0.5, 0.5],
|
|
197
|
+
[0.93, 0.12],
|
|
198
|
+
[0.99, 0.99],
|
|
199
|
+
] as const) {
|
|
200
|
+
const display = { x: 0, y: 0 };
|
|
201
|
+
const scene = { x: 0, y: 0 };
|
|
202
|
+
expect(mapDisplayUvToSceneUv(scene, mapping.value, uv[0], uv[1])).toBe(true);
|
|
203
|
+
expect(mapSceneUvToDisplayUv(display, mapping.value, scene.x, scene.y)).toBe(true);
|
|
204
|
+
expect(display.x).toBeCloseTo(uv[0], 6);
|
|
205
|
+
expect(display.y).toBeCloseTo(uv[1], 6);
|
|
206
|
+
expect(scene.x).toBeGreaterThanOrEqual(0);
|
|
207
|
+
expect(scene.x).toBeLessThanOrEqual(1);
|
|
208
|
+
expect(scene.y).toBeGreaterThanOrEqual(0);
|
|
209
|
+
expect(scene.y).toBeLessThanOrEqual(1);
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
it('normalizes machine-precision boundaries without accepting real crop misses', () => {
|
|
214
|
+
const boundary = createBarrelDistortionMapping(1920, 1080, {
|
|
215
|
+
strength: 0.35,
|
|
216
|
+
centerX: 0,
|
|
217
|
+
centerY: 1,
|
|
218
|
+
}).unwrap();
|
|
219
|
+
const scene = { x: 0, y: 0 };
|
|
220
|
+
const display = { x: 0, y: 0 };
|
|
221
|
+
expect(mapDisplayUvToSceneUv(scene, boundary, 0, 1)).toBe(true);
|
|
222
|
+
expect(mapSceneUvToDisplayUv(display, boundary, scene.x, scene.y)).toBe(true);
|
|
223
|
+
expect(display).toEqual({ x: 0, y: 1 });
|
|
224
|
+
|
|
225
|
+
const centered = createBarrelDistortionMapping(1920, 1080, { strength: 0.35 }).unwrap();
|
|
226
|
+
// This source corner is genuinely outside the auto-cropped display; it
|
|
227
|
+
// must remain a miss instead of being clamped by the numerical repair.
|
|
228
|
+
expect(mapSceneUvToDisplayUv(display, centered, 0, 0.01)).toBe(false);
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
it('keeps the 1920x1080 offset-corner counterexample inside the inverse domain', () => {
|
|
232
|
+
const mapping = createBarrelDistortionMapping(1920, 1080, {
|
|
233
|
+
strength: 0.35,
|
|
234
|
+
centerX: 0,
|
|
235
|
+
centerY: 0,
|
|
236
|
+
}).unwrap();
|
|
237
|
+
const scene = { x: 0, y: 0 };
|
|
238
|
+
const display = { x: 0, y: 0 };
|
|
239
|
+
// The forward equation produces exactly 1.0000000000000002 for the
|
|
240
|
+
// inverse y at this valid displayed corner in binary64. It is a numerical
|
|
241
|
+
// boundary roundoff, not a crop miss, and must normalize to the edge.
|
|
242
|
+
expect(mapDisplayUvToSceneUv(scene, mapping, 0, 1)).toBe(true);
|
|
243
|
+
expect(mapSceneUvToDisplayUv(display, mapping, scene.x, scene.y)).toBe(true);
|
|
244
|
+
expect(display).toEqual({ x: 0, y: 1 });
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
it('keeps a seeded boundary sweep below the pixel error budget', () => {
|
|
248
|
+
const extents = [
|
|
249
|
+
[640, 360],
|
|
250
|
+
[1280, 720],
|
|
251
|
+
[1920, 1080],
|
|
252
|
+
] as const;
|
|
253
|
+
const centers = Array.from({ length: 25 }, (_, index) => index / 24);
|
|
254
|
+
const strengths = [0.05, 0.2, 0.35];
|
|
255
|
+
let seed = 0x9e3779b9;
|
|
256
|
+
const next = () => {
|
|
257
|
+
seed = (Math.imul(seed, 1664525) + 1013904223) >>> 0;
|
|
258
|
+
return seed / 0x1_0000_0000;
|
|
259
|
+
};
|
|
260
|
+
const positions: [number, number][] = [
|
|
261
|
+
[0, 0],
|
|
262
|
+
[0, 1],
|
|
263
|
+
[1, 0],
|
|
264
|
+
[1, 1],
|
|
265
|
+
...Array.from({ length: 21 }, () => [next(), next()] as [number, number]),
|
|
266
|
+
];
|
|
267
|
+
let rejected = 0;
|
|
268
|
+
let maxPixelError = 0;
|
|
269
|
+
for (const [width, height] of extents) {
|
|
270
|
+
for (const centerX of centers) {
|
|
271
|
+
for (const centerY of centers) {
|
|
272
|
+
for (const strength of strengths) {
|
|
273
|
+
const mapping = createBarrelDistortionMapping(width, height, {
|
|
274
|
+
strength,
|
|
275
|
+
centerX,
|
|
276
|
+
centerY,
|
|
277
|
+
}).unwrap();
|
|
278
|
+
for (const [ux, uy] of positions) {
|
|
279
|
+
const scene = { x: 0, y: 0 };
|
|
280
|
+
const display = { x: 0, y: 0 };
|
|
281
|
+
if (!mapDisplayUvToSceneUv(scene, mapping, ux, uy)) {
|
|
282
|
+
rejected += 1;
|
|
283
|
+
continue;
|
|
284
|
+
}
|
|
285
|
+
if (!mapSceneUvToDisplayUv(display, mapping, scene.x, scene.y)) {
|
|
286
|
+
rejected += 1;
|
|
287
|
+
continue;
|
|
288
|
+
}
|
|
289
|
+
maxPixelError = Math.max(
|
|
290
|
+
maxPixelError,
|
|
291
|
+
Math.abs(display.x - ux) * width,
|
|
292
|
+
Math.abs(display.y - uy) * height,
|
|
293
|
+
);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
expect(rejected).toBe(0);
|
|
300
|
+
expect(maxPixelError).toBeLessThanOrEqual(0.00001);
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
it('samples inward from the displayed edge under the documented direction', () => {
|
|
304
|
+
const mapping = createBarrelDistortionMapping(1920, 1080, { strength: 0.2 }).unwrap();
|
|
305
|
+
const scene = { x: 0, y: 0 };
|
|
306
|
+
expect(mapDisplayUvToSceneUv(scene, mapping, 0.75, 0.5)).toBe(true);
|
|
307
|
+
expect(scene.x).toBeCloseTo(0.707896, 5);
|
|
308
|
+
expect(scene.y).toBeCloseTo(0.5, 8);
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
it('rejects display and inverse points outside the physical output viewport', () => {
|
|
312
|
+
const mapping = createBarrelDistortionMapping(800, 600, { strength: 0.2 }).unwrap();
|
|
313
|
+
const out = { x: 0, y: 0 };
|
|
314
|
+
expect(mapDisplayToScene(out, mapping, -0.01, 10)).toBe(false);
|
|
315
|
+
expect(mapDisplayToScene(out, mapping, 801, 10)).toBe(false);
|
|
316
|
+
expect(mapSceneToDisplay(out, mapping, 10, 601)).toBe(false);
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
it('pairs the submitted mapping with immutable unjittered camera facts', () => {
|
|
320
|
+
const mapping = createBarrelDistortionMapping(640, 360, { strength: 0.2 }).unwrap();
|
|
321
|
+
const frame = attachBarrelDistortionCameraFrame(mapping, {
|
|
322
|
+
projection: 'perspective',
|
|
323
|
+
far: 100,
|
|
324
|
+
viewMatrix: new Float32Array(16).fill(1),
|
|
325
|
+
projectionMatrix: new Float32Array(16).fill(2),
|
|
326
|
+
});
|
|
327
|
+
expect(frame.camera).toMatchObject({ projection: 'perspective' });
|
|
328
|
+
expect(frame.camera?.viewMatrix).toEqual(Array(16).fill(1));
|
|
329
|
+
expect(frame.camera?.projectionMatrix).toEqual(Array(16).fill(2));
|
|
330
|
+
expect(Object.isFrozen(frame)).toBe(true);
|
|
331
|
+
expect(Object.isFrozen(frame.camera)).toBe(true);
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
it('projects the accepted mapping and LKG identity as one detached inspection', () => {
|
|
335
|
+
const mapping = attachBarrelDistortionCameraFrame(
|
|
336
|
+
createBarrelDistortionMapping(640, 360, { strength: 0.2 }).unwrap(),
|
|
337
|
+
{
|
|
338
|
+
projection: 'perspective',
|
|
339
|
+
far: 100,
|
|
340
|
+
viewMatrix: new Float32Array(16),
|
|
341
|
+
projectionMatrix: new Float32Array(16),
|
|
342
|
+
},
|
|
343
|
+
);
|
|
344
|
+
const inspection = projectBarrelDistortionInspection({
|
|
345
|
+
effectiveMapping: mapping,
|
|
346
|
+
frameId: 12,
|
|
347
|
+
deviceGeneration: 3,
|
|
348
|
+
graphGeneration: 7,
|
|
349
|
+
lastKnownGood: true,
|
|
350
|
+
});
|
|
351
|
+
expect(inspection).toMatchObject({
|
|
352
|
+
frameId: 12,
|
|
353
|
+
deviceGeneration: 3,
|
|
354
|
+
graphGeneration: 7,
|
|
355
|
+
lastKnownGood: true,
|
|
356
|
+
extent: { width: 640, height: 360 },
|
|
357
|
+
});
|
|
358
|
+
expect(inspection.effectiveMapping?.strength).toBe(0.2);
|
|
359
|
+
expect(Object.isFrozen(inspection)).toBe(true);
|
|
360
|
+
expect(Object.isFrozen(inspection.extent)).toBe(true);
|
|
361
|
+
expect(Object.isFrozen(inspection.effectiveMapping)).toBe(true);
|
|
362
|
+
expect(Object.isFrozen(inspection.effectiveMapping?.camera)).toBe(true);
|
|
363
|
+
});
|
|
364
|
+
});
|
|
@@ -5,11 +5,12 @@ import type { RhiDevice } from '@forgeax/engine-rhi';
|
|
|
5
5
|
import { rhi } from '@forgeax/engine-rhi-null';
|
|
6
6
|
import { ok } from '@forgeax/engine-types';
|
|
7
7
|
import { beforeAll, describe, expect, it } from 'vitest';
|
|
8
|
+
import { standardBloomAdmitted } from '../bloom-admission';
|
|
8
9
|
import { prepareStandardLighting } from '../pipeline/standard-lighting/prepare';
|
|
9
10
|
import { deriveStandardTopologyInput } from '../pipeline/standard-lighting/topology';
|
|
10
11
|
import { selectStandardClusterTransport } from '../pipeline/standard-lighting/transport';
|
|
11
12
|
import { standardPipeline } from '../pipeline/standard-pipeline';
|
|
12
|
-
import { inspectStandardBloomGraph
|
|
13
|
+
import { inspectStandardBloomGraph } from '../pipeline/standard-post';
|
|
13
14
|
import { DEFAULT_STANDARD_PROFILE, STANDARD_PIPELINE_ID } from '../pipeline/standard-profile';
|
|
14
15
|
import type { RenderPipelineFrame, RenderPipelineTopology } from '../render-pipeline';
|
|
15
16
|
|
|
@@ -23,7 +24,7 @@ beforeAll(async () => {
|
|
|
23
24
|
device = result.value;
|
|
24
25
|
});
|
|
25
26
|
|
|
26
|
-
function topology(bloom: 'off' | 'on'): RenderPipelineTopology {
|
|
27
|
+
function topology(bloom: 'off' | 'on', bloomIntensity = 1): RenderPipelineTopology {
|
|
27
28
|
return {
|
|
28
29
|
pipelineId: STANDARD_PIPELINE_ID,
|
|
29
30
|
standardProfile: DEFAULT_STANDARD_PROFILE,
|
|
@@ -34,7 +35,12 @@ function topology(bloom: 'off' | 'on'): RenderPipelineTopology {
|
|
|
34
35
|
storageFormat: 'bgra8unorm',
|
|
35
36
|
viewFormat: 'bgra8unorm-srgb',
|
|
36
37
|
},
|
|
37
|
-
camera: {
|
|
38
|
+
camera: {
|
|
39
|
+
tonemap: 'aces-filmic',
|
|
40
|
+
antialias: 'fxaa',
|
|
41
|
+
bloom,
|
|
42
|
+
bloomIntensity,
|
|
43
|
+
},
|
|
38
44
|
shadow: {
|
|
39
45
|
directional: { mapSize: 64, cascadeCount: 1 },
|
|
40
46
|
spotMapSize: 64,
|
|
@@ -80,7 +86,7 @@ function clusteredStandardLighting() {
|
|
|
80
86
|
return lighting.value;
|
|
81
87
|
}
|
|
82
88
|
|
|
83
|
-
function inspect(bloom: 'off' | 'on') {
|
|
89
|
+
function inspect(bloom: 'off' | 'on', bloomIntensity = 1) {
|
|
84
90
|
const graph = new RenderGraphBuilder<RenderPipelineFrame>();
|
|
85
91
|
const built = standardPipeline.build(
|
|
86
92
|
{
|
|
@@ -89,7 +95,7 @@ function inspect(bloom: 'off' | 'on') {
|
|
|
89
95
|
projectGpuDriven: () => ok(undefined),
|
|
90
96
|
contributeFeatures: () => ok(undefined),
|
|
91
97
|
},
|
|
92
|
-
topology(bloom),
|
|
98
|
+
topology(bloom, bloomIntensity),
|
|
93
99
|
);
|
|
94
100
|
if (!built.ok) throw built.error;
|
|
95
101
|
const compiled = graph.compile({ device, surfaceSize: { width: 640, height: 360 } });
|
|
@@ -98,6 +104,15 @@ function inspect(bloom: 'off' | 'on') {
|
|
|
98
104
|
}
|
|
99
105
|
|
|
100
106
|
describe('Standard Bloom exact-zero topology', () => {
|
|
107
|
+
it.each([
|
|
108
|
+
['off', 'aces-filmic', 1, false],
|
|
109
|
+
['on', 'aces-filmic', 0, false],
|
|
110
|
+
['on', 'none', 1, false],
|
|
111
|
+
['on', 'aces-filmic', 1, true],
|
|
112
|
+
] as const)('uses one effective admission for %s/%s/%s', (bloom, tonemap, intensity, expected) => {
|
|
113
|
+
expect(standardBloomAdmitted({ bloom, tonemap, bloomIntensity: intensity })).toBe(expected);
|
|
114
|
+
});
|
|
115
|
+
|
|
101
116
|
it('Bloom off declares no Bloom targets or passes', () => {
|
|
102
117
|
const info = inspect('off');
|
|
103
118
|
const bloomPasses = info.passes.filter((pass) => pass.name.startsWith('bloom-'));
|
|
@@ -109,6 +124,10 @@ describe('Standard Bloom exact-zero topology', () => {
|
|
|
109
124
|
targetCount: 0,
|
|
110
125
|
targetBytes: 0,
|
|
111
126
|
passCount: 0,
|
|
127
|
+
levelCount: 0,
|
|
128
|
+
levelDimensions: [],
|
|
129
|
+
downsamplePassCount: 0,
|
|
130
|
+
upsamplePassCount: 0,
|
|
112
131
|
});
|
|
113
132
|
expect({
|
|
114
133
|
targetCount: bloomResources.length,
|
|
@@ -127,6 +146,15 @@ describe('Standard Bloom exact-zero topology', () => {
|
|
|
127
146
|
});
|
|
128
147
|
});
|
|
129
148
|
|
|
149
|
+
it('treats intensity=0 as exact-zero even when the Camera enum is on', () => {
|
|
150
|
+
const info = inspect('on', 0);
|
|
151
|
+
expect(info.passes.filter((pass) => pass.name.startsWith('bloom-'))).toHaveLength(0);
|
|
152
|
+
expect(info.resources.filter((resource) => resource.label.startsWith('bloom-'))).toHaveLength(
|
|
153
|
+
0,
|
|
154
|
+
);
|
|
155
|
+
expect(inspectStandardBloomGraph(info).status).toBe('empty');
|
|
156
|
+
});
|
|
157
|
+
|
|
130
158
|
it('keeps Bloom declaration behind the camera gate in both lane owners', () => {
|
|
131
159
|
const forwardSource = readFileSync(
|
|
132
160
|
new URL('../pipeline/standard-forward-lane.ts', import.meta.url),
|
|
@@ -142,8 +170,8 @@ describe('Standard Bloom exact-zero topology', () => {
|
|
|
142
170
|
);
|
|
143
171
|
expect(forwardSource).toContain('addStandardPost');
|
|
144
172
|
expect(clusteredSource).toContain('addStandardPost');
|
|
145
|
-
const gate = postSource.indexOf(
|
|
146
|
-
const declaration = postSource.indexOf('
|
|
173
|
+
const gate = postSource.indexOf('bloom: !clearOnly && standardBloomAdmitted(topology.camera)');
|
|
174
|
+
const declaration = postSource.indexOf('const bloomSpecs = standardBloomTargetSpecs(');
|
|
147
175
|
expect(gate).toBeGreaterThanOrEqual(0);
|
|
148
176
|
expect(declaration).toBeGreaterThan(gate);
|
|
149
177
|
});
|
|
@@ -153,15 +181,27 @@ describe('Standard Bloom exact-zero topology', () => {
|
|
|
153
181
|
const info = inspect('on');
|
|
154
182
|
expect(inspectStandardBloomGraph(info)).toEqual({
|
|
155
183
|
status: 'valid',
|
|
156
|
-
targetCount:
|
|
157
|
-
targetBytes:
|
|
158
|
-
passCount:
|
|
184
|
+
targetCount: 10,
|
|
185
|
+
targetBytes: 3_069_440,
|
|
186
|
+
passCount: 10,
|
|
187
|
+
levelCount: 5,
|
|
188
|
+
levelDimensions: [
|
|
189
|
+
{ width: 320, height: 180 },
|
|
190
|
+
{ width: 160, height: 90 },
|
|
191
|
+
{ width: 80, height: 45 },
|
|
192
|
+
{ width: 40, height: 23 },
|
|
193
|
+
{ width: 20, height: 12 },
|
|
194
|
+
],
|
|
195
|
+
downsamplePassCount: 5,
|
|
196
|
+
upsamplePassCount: 4,
|
|
159
197
|
});
|
|
160
|
-
expect(
|
|
198
|
+
expect(
|
|
199
|
+
info.resources.find((resource) => resource.label === 'bloom-downsample-0'),
|
|
200
|
+
).toMatchObject({
|
|
161
201
|
descriptor: {
|
|
162
202
|
kind: 'texture',
|
|
163
203
|
format: 'rgba16float',
|
|
164
|
-
size:
|
|
204
|
+
size: { width: 320, height: 180 },
|
|
165
205
|
width: 320,
|
|
166
206
|
height: 180,
|
|
167
207
|
depthOrArrayLayers: 1,
|
|
@@ -171,7 +211,18 @@ describe('Standard Bloom exact-zero topology', () => {
|
|
|
171
211
|
});
|
|
172
212
|
expect(
|
|
173
213
|
info.passes.map((pass) => pass.name).filter((name) => name.startsWith('bloom-')),
|
|
174
|
-
).toEqual([
|
|
214
|
+
).toEqual([
|
|
215
|
+
'bloom-downsample-0',
|
|
216
|
+
'bloom-downsample-1',
|
|
217
|
+
'bloom-downsample-2',
|
|
218
|
+
'bloom-downsample-3',
|
|
219
|
+
'bloom-downsample-4',
|
|
220
|
+
'bloom-upsample-3',
|
|
221
|
+
'bloom-upsample-2',
|
|
222
|
+
'bloom-upsample-1',
|
|
223
|
+
'bloom-upsample-0',
|
|
224
|
+
'bloom-composite',
|
|
225
|
+
]);
|
|
175
226
|
}
|
|
176
227
|
});
|
|
177
228
|
|
|
@@ -180,7 +231,7 @@ describe('Standard Bloom exact-zero topology', () => {
|
|
|
180
231
|
const drifted = {
|
|
181
232
|
...info,
|
|
182
233
|
resources: info.resources.map((resource) =>
|
|
183
|
-
resource.label ===
|
|
234
|
+
resource.label === 'bloom-downsample-0'
|
|
184
235
|
? {
|
|
185
236
|
...resource,
|
|
186
237
|
descriptor:
|
|
@@ -196,6 +247,10 @@ describe('Standard Bloom exact-zero topology', () => {
|
|
|
196
247
|
targetCount: 0,
|
|
197
248
|
targetBytes: 0,
|
|
198
249
|
passCount: 0,
|
|
250
|
+
levelCount: 0,
|
|
251
|
+
levelDimensions: [],
|
|
252
|
+
downsamplePassCount: 0,
|
|
253
|
+
upsamplePassCount: 0,
|
|
199
254
|
});
|
|
200
255
|
});
|
|
201
256
|
|
|
@@ -203,15 +258,17 @@ describe('Standard Bloom exact-zero topology', () => {
|
|
|
203
258
|
const info = inspect('on');
|
|
204
259
|
const drifted = {
|
|
205
260
|
...info,
|
|
206
|
-
resources: info.resources.filter(
|
|
207
|
-
(resource) => resource.label !== STANDARD_BLOOM_TARGET_SPEC.bright.label,
|
|
208
|
-
),
|
|
261
|
+
resources: info.resources.filter((resource) => resource.label !== 'bloom-downsample-0'),
|
|
209
262
|
};
|
|
210
263
|
expect(inspectStandardBloomGraph(drifted)).toEqual({
|
|
211
264
|
status: 'invalid',
|
|
212
265
|
targetCount: 0,
|
|
213
266
|
targetBytes: 0,
|
|
214
267
|
passCount: 0,
|
|
268
|
+
levelCount: 0,
|
|
269
|
+
levelDimensions: [],
|
|
270
|
+
downsamplePassCount: 0,
|
|
271
|
+
upsamplePassCount: 0,
|
|
215
272
|
});
|
|
216
273
|
});
|
|
217
274
|
|
|
@@ -219,13 +276,50 @@ describe('Standard Bloom exact-zero topology', () => {
|
|
|
219
276
|
const info = inspect('on');
|
|
220
277
|
const drifted = {
|
|
221
278
|
...info,
|
|
222
|
-
passes: info.passes.filter((pass) => pass.name !== 'bloom-
|
|
279
|
+
passes: info.passes.filter((pass) => pass.name !== 'bloom-downsample-1'),
|
|
223
280
|
};
|
|
224
281
|
expect(inspectStandardBloomGraph(drifted)).toEqual({
|
|
225
282
|
status: 'invalid',
|
|
226
283
|
targetCount: 0,
|
|
227
284
|
targetBytes: 0,
|
|
228
285
|
passCount: 0,
|
|
286
|
+
levelCount: 0,
|
|
287
|
+
levelDimensions: [],
|
|
288
|
+
downsamplePassCount: 0,
|
|
289
|
+
upsamplePassCount: 0,
|
|
290
|
+
});
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
it('rejects forged odd-scale extents instead of reporting inferred sizes or cost', () => {
|
|
294
|
+
const info = inspect('on');
|
|
295
|
+
const forgedLabels = new Set(['bloom-downsample-0', 'bloom-downsample-1', 'bloom-upsample-0']);
|
|
296
|
+
const forged = {
|
|
297
|
+
...info,
|
|
298
|
+
resources: info.resources.map((resource) =>
|
|
299
|
+
forgedLabels.has(resource.label) && resource.descriptor.kind === 'texture'
|
|
300
|
+
? {
|
|
301
|
+
...resource,
|
|
302
|
+
descriptor: {
|
|
303
|
+
...resource.descriptor,
|
|
304
|
+
size: { width: 4, height: 4 },
|
|
305
|
+
width: 4,
|
|
306
|
+
height: 4,
|
|
307
|
+
},
|
|
308
|
+
extent: { width: 4, height: 4, depthOrArrayLayers: 1 },
|
|
309
|
+
byteSize: 128,
|
|
310
|
+
}
|
|
311
|
+
: resource,
|
|
312
|
+
),
|
|
313
|
+
};
|
|
314
|
+
expect(inspectStandardBloomGraph(forged)).toEqual({
|
|
315
|
+
status: 'invalid',
|
|
316
|
+
targetCount: 0,
|
|
317
|
+
targetBytes: 0,
|
|
318
|
+
passCount: 0,
|
|
319
|
+
levelCount: 0,
|
|
320
|
+
levelDimensions: [],
|
|
321
|
+
downsamplePassCount: 0,
|
|
322
|
+
upsamplePassCount: 0,
|
|
229
323
|
});
|
|
230
324
|
});
|
|
231
325
|
});
|
|
@@ -33,7 +33,12 @@ function build(bloom: 'off' | 'on') {
|
|
|
33
33
|
storageFormat: 'bgra8unorm',
|
|
34
34
|
viewFormat: 'bgra8unorm-srgb',
|
|
35
35
|
},
|
|
36
|
-
camera: {
|
|
36
|
+
camera: {
|
|
37
|
+
tonemap: 'aces-filmic',
|
|
38
|
+
antialias: 'fxaa',
|
|
39
|
+
bloom,
|
|
40
|
+
bloomIntensity: 1,
|
|
41
|
+
},
|
|
37
42
|
shadow: {
|
|
38
43
|
directional: { mapSize: 64, cascadeCount: 1 },
|
|
39
44
|
spotMapSize: 64,
|
|
@@ -103,7 +108,7 @@ describe('Standard Bloom lifecycle contract', () => {
|
|
|
103
108
|
const on = bloomSummary(build('on'));
|
|
104
109
|
const off = bloomSummary(build('off'));
|
|
105
110
|
const recovered = bloomSummary(build('on'));
|
|
106
|
-
expect(on.passes).toHaveLength(
|
|
111
|
+
expect(on.passes).toHaveLength(10);
|
|
107
112
|
expect(on.resources.length).toBeGreaterThan(0);
|
|
108
113
|
expect(off).toEqual({ passes: [], resources: [] });
|
|
109
114
|
expect(recovered).toEqual(on);
|
|
@@ -113,7 +118,15 @@ describe('Standard Bloom lifecycle contract', () => {
|
|
|
113
118
|
const names = build('on').passes.map((pass) => pass.name);
|
|
114
119
|
const order = [
|
|
115
120
|
'forward',
|
|
116
|
-
'bloom-
|
|
121
|
+
'bloom-downsample-0',
|
|
122
|
+
'bloom-downsample-1',
|
|
123
|
+
'bloom-downsample-2',
|
|
124
|
+
'bloom-downsample-3',
|
|
125
|
+
'bloom-downsample-4',
|
|
126
|
+
'bloom-upsample-3',
|
|
127
|
+
'bloom-upsample-2',
|
|
128
|
+
'bloom-upsample-1',
|
|
129
|
+
'bloom-upsample-0',
|
|
117
130
|
'bloom-composite',
|
|
118
131
|
'output-transform',
|
|
119
132
|
'fxaa',
|
|
@@ -132,7 +145,7 @@ describe('Standard Bloom lifecycle contract', () => {
|
|
|
132
145
|
const transaction = new LifecycleTransaction(bloom);
|
|
133
146
|
transaction.add({
|
|
134
147
|
kind: 'texture',
|
|
135
|
-
create: () => ({ label: 'bloom-
|
|
148
|
+
create: () => ({ label: 'bloom-downsample-0' }),
|
|
136
149
|
cleanup: () => undefined,
|
|
137
150
|
});
|
|
138
151
|
const committed = await transaction.commit();
|