@forgeax/engine-render 0.1.33 → 0.1.35
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 +1062 -127
- 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/device-feature-admission.d.ts +2 -2
- 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/host-contract.d.ts +6 -5
- package/dist/assembly/host-contract.d.ts.map +1 -1
- 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/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/render-target-host.d.ts +5 -0
- package/dist/assembly/render-target-host.d.ts.map +1 -1
- 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/webgpu-pbr-ready.d.ts +1 -0
- package/dist/assembly/webgpu-pbr-ready.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 +1 -1
- 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 +2 -1
- package/dist/assembly/webgpu-renderer.d.ts.map +1 -1
- package/dist/authoring.mjs +2 -4
- package/dist/authoring.mjs.map +1 -1
- package/dist/barrel-distortion.d.ts +47 -0
- package/dist/barrel-distortion.d.ts.map +1 -0
- package/dist/chunk-3XUBWRY2.mjs +1842 -0
- package/dist/chunk-3XUBWRY2.mjs.map +1 -0
- package/dist/{chunk-OO3DRYK7.mjs → chunk-G6HDNGY7.mjs} +2400 -1767
- package/dist/chunk-G6HDNGY7.mjs.map +1 -0
- package/dist/{chunk-ZDQWGQW7.mjs → chunk-LM5IE7GF.mjs} +4 -4
- package/dist/{chunk-ZDQWGQW7.mjs.map → chunk-LM5IE7GF.mjs.map} +1 -1
- package/dist/{chunk-VOZWDM3L.mjs → chunk-LNIUIKQ7.mjs} +1514 -498
- package/dist/chunk-LNIUIKQ7.mjs.map +1 -0
- package/dist/chunk-MXTWKZO4.mjs +3268 -0
- package/dist/chunk-MXTWKZO4.mjs.map +1 -0
- package/dist/chunk-MZ4C7EHF.mjs +6942 -0
- package/dist/chunk-MZ4C7EHF.mjs.map +1 -0
- package/dist/chunk-RIPAEGI6.mjs +48 -0
- package/dist/chunk-RIPAEGI6.mjs.map +1 -0
- package/dist/{chunk-LEAXOMYJ.mjs → chunk-SGPUJW3F.mjs} +117 -5
- package/dist/chunk-SGPUJW3F.mjs.map +1 -0
- package/dist/{chunk-PA5DRJNI.mjs → chunk-X2KA6WHM.mjs} +29 -4
- package/dist/chunk-X2KA6WHM.mjs.map +1 -0
- package/dist/{chunk-BLXGONR2.mjs → chunk-XSFB7XXQ.mjs} +51 -4
- package/dist/chunk-XSFB7XXQ.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/barrel-distortion.d.ts +13 -0
- package/dist/components/barrel-distortion.d.ts.map +1 -0
- 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/construct-renderer.d.ts +1 -1
- package/dist/construct-renderer.d.ts.map +1 -1
- package/dist/construct-renderer.mjs +8406 -5785
- package/dist/construct-renderer.mjs.map +1 -1
- package/dist/device/gpu-residency.d.ts +19 -19
- 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/errors/cloud.d.ts +59 -0
- package/dist/errors/cloud.d.ts.map +1 -0
- package/dist/errors/render.d.ts +20 -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 +5 -1
- package/dist/extract/contracts.d.ts.map +1 -1
- package/dist/extract/material-context.d.ts +7 -0
- package/dist/extract/material-context.d.ts.map +1 -0
- 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 +6 -2
- package/dist/features/error-reporting.d.ts.map +1 -1
- package/dist/features/host.d.ts +15 -0
- package/dist/features/host.d.ts.map +1 -1
- package/dist/features/plan.d.ts +10 -0
- package/dist/features/plan.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 +48 -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/glyph-text-layout-system.d.ts +1 -1
- package/dist/glyph-text-layout-system.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.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 +47 -3
- 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 +26 -2
- package/dist/gpu-driven/view-gpu.d.ts.map +1 -1
- package/dist/gpu-scene.d.ts +5 -0
- 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/frame-resources.d.ts.map +1 -1
- package/dist/ibl/skylight-bind-group.d.ts +14 -5
- package/dist/ibl/skylight-bind-group.d.ts.map +1 -1
- package/dist/index.d.ts +30 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +780 -9
- package/dist/index.mjs.map +1 -1
- package/dist/inspection-types.d.ts +135 -1
- 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 +47 -100
- package/dist/instances.d.ts.map +1 -1
- package/dist/internal.mjs +7 -8
- package/dist/internal.mjs.map +1 -1
- package/dist/pbr-pipeline.d.ts +22 -4
- 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/lut-gpu.d.ts +2 -2
- package/dist/pipeline/standard-output/lut-gpu.d.ts.map +1 -1
- package/dist/pipeline/standard-output/resources.d.ts +2 -2
- package/dist/pipeline/standard-output/resources.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.map +1 -1
- package/dist/pipeline-builder.d.ts +1 -1
- package/dist/pipeline-builder.d.ts.map +1 -1
- 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/publication/contract.d.ts +77 -0
- package/dist/publication/contract.d.ts.map +1 -0
- package/dist/publication/dependencies.d.ts +7 -0
- package/dist/publication/dependencies.d.ts.map +1 -0
- package/dist/publication/prepare-geometry.d.ts +9 -0
- package/dist/publication/prepare-geometry.d.ts.map +1 -0
- package/dist/publication/programs.d.ts +5 -0
- package/dist/publication/programs.d.ts.map +1 -0
- package/dist/publication/publisher.d.ts +33 -0
- package/dist/publication/publisher.d.ts.map +1 -0
- package/dist/publication/receiver.d.ts +29 -0
- package/dist/publication/receiver.d.ts.map +1 -0
- package/dist/publication/resource-scope.d.ts +18 -0
- package/dist/publication/resource-scope.d.ts.map +1 -0
- package/dist/publication/targets.d.ts +33 -0
- package/dist/publication/targets.d.ts.map +1 -0
- package/dist/publication/video.d.ts +5 -0
- package/dist/publication/video.d.ts.map +1 -0
- 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 +43 -9
- package/dist/record/frame-snapshot.d.ts.map +1 -1
- package/dist/record/frame.d.ts +15 -65
- 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/helpers.d.ts +2 -2
- package/dist/record/helpers.d.ts.map +1 -1
- package/dist/record/main-pass-geometry.d.ts +22 -6
- package/dist/record/main-pass-geometry.d.ts.map +1 -1
- package/dist/record/main-pass-material.d.ts +14 -10
- package/dist/record/main-pass-material.d.ts.map +1 -1
- package/dist/record/main-pass-sprite-draws.d.ts +3 -16
- 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/motion-blur-receipt.d.ts +11 -0
- package/dist/record/motion-blur-receipt.d.ts.map +1 -0
- package/dist/record/prepared-material-bindings.d.ts +3 -3
- package/dist/record/prepared-material-bindings.d.ts.map +1 -1
- 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 +24 -5
- 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 +1 -1
- package/dist/record/skybox-post-pass.d.ts.map +1 -1
- package/dist/record/sprite-instance-buffer.d.ts +31 -0
- package/dist/record/sprite-instance-buffer.d.ts.map +1 -0
- package/dist/record/target-capture-graph.d.ts +19 -0
- package/dist/record/target-capture-graph.d.ts.map +1 -0
- package/dist/record/typed-frame-graph.d.ts +24 -15
- 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 +14 -4
- 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 +46 -5
- 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 +103 -2
- 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 +18 -9
- 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-projections.d.ts +3 -2
- package/dist/render-system-projections.d.ts.map +1 -1
- 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 +22 -21
- 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 +18 -7
- package/dist/scene/render-scene.d.ts.map +1 -1
- package/dist/scene/render-source.d.ts +42 -0
- package/dist/scene/render-source.d.ts.map +1 -0
- package/dist/scene/source-systems.d.ts +6 -0
- package/dist/scene/source-systems.d.ts.map +1 -0
- 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/systems/skin-palette-types.d.ts +10 -0
- package/dist/systems/skin-palette-types.d.ts.map +1 -1
- package/dist/systems/transparent-dispatch.d.ts +2 -2
- package/dist/systems/transparent-dispatch.d.ts.map +1 -1
- package/dist/systems/transparent-sort-config.d.ts +2 -1
- package/dist/systems/transparent-sort-config.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 +6 -7
- 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/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 +14 -2
- package/dist/typed-render-graph-primitives.d.ts.map +1 -1
- package/dist/volume/component.d.ts +9 -4
- 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/package.json +22 -21
- package/src/__tests__/atmosphere-daylight.dawn.test.ts +72 -0
- package/src/__tests__/auto-exposure-transaction.integration.test.ts +4 -9
- 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__/construct-renderer-identity.unit.test.ts +49 -0
- package/src/__tests__/detached-recovery-graph.unit.test.ts +277 -0
- package/src/__tests__/device-feature-admission.unit.test.ts +3 -2
- 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__/factory-contract.integration.test.ts +295 -45
- package/src/__tests__/feature-depth-input.dawn.test.ts +129 -2
- 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-material-artifacts.unit.test.ts +143 -0
- package/src/__tests__/gpu-driven-pbr.dawn.test.ts +5 -6
- package/src/__tests__/gpu-driven-production.integration.test.ts +482 -3
- package/src/__tests__/gpu-driven-shadow-views.dawn.test.ts +6 -5
- package/src/__tests__/gpu-driven-view-gpu-evidence.ts +94 -6
- 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-scene.unit.test.ts +119 -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 +97 -305
- package/src/__tests__/instances-world-ownership.integration.test.ts +62 -0
- package/src/__tests__/ktx2-basis-gpu-consumer.dawn.test.ts +4 -1
- package/src/__tests__/main-pass-material-medium-selection.unit.test.ts +145 -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__/materials-standard-contract.unit.test.ts +0 -1
- 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 +13 -7
- 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 +66 -8
- package/src/__tests__/physical-material-budget.unit.test.ts +40 -0
- package/src/__tests__/prepared-graphics-capability.unit.test.ts +66 -2
- package/src/__tests__/probe-bindings.unit.test.ts +582 -1
- package/src/__tests__/probe-scene-dirty.integration.test.ts +28 -1
- 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 +8 -0
- package/src/__tests__/render-feature-diagnostics.unit.test.ts +15 -2
- package/src/__tests__/render-feature-error-reporting.unit.test.ts +21 -1
- 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-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 +20 -20
- 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 +42 -8
- package/src/__tests__/renderer-frame-generation-fence.integration.test.ts +16 -0
- package/src/__tests__/renderer-frame-transaction.integration.test.ts +26 -10
- package/src/__tests__/resource-allocation.unit.test.ts +123 -0
- 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 +15 -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-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.integration.test.ts +182 -1
- 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__/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 +4 -2
- package/src/__tests__/volumetric-fog-budget-recovery.integration.test.ts +30 -20
- 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 +113 -9
- package/src/__tests__/volumetric-fog-topology.unit.test.ts +5 -3
- 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/device-feature-admission.ts +2 -2
- 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/host-contract.ts +8 -5
- 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/recovery/device-loss-fanout.ts +13 -0
- package/src/assembly/recovery/renderer-recover.ts +50 -18
- package/src/assembly/render-feature-post-processes.ts +54 -0
- package/src/assembly/render-target-host.ts +57 -47
- package/src/assembly/renderer-facade.ts +7 -2
- 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 +3 -3
- package/src/assembly/webgpu-pbr-ready.ts +9 -1
- package/src/assembly/webgpu-ready-per-pass.ts +104 -0
- package/src/assembly/webgpu-ready.ts +116 -62
- 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 +303 -313
- package/src/assembly/webgpu-vertex-layouts.ts +1 -1
- package/src/barrel-distortion.ts +247 -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/barrel-distortion.ts +46 -0
- 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/sprite-instances.ts +1 -1
- package/src/construct-renderer.ts +1 -1
- package/src/device/gpu-residency.ts +26 -25
- package/src/dynamic-geometry.ts +12 -1
- package/src/errors/cloud.ts +103 -0
- package/src/errors/render.ts +47 -8
- package/src/examples/single-layer-medium-surface.ts +59 -0
- package/src/extract/camera.ts +15 -1
- package/src/extract/contracts.ts +5 -0
- package/src/extract/material-context.ts +21 -0
- package/src/features/barrel-distortion.ts +172 -0
- package/src/features/error-reporting.ts +26 -6
- package/src/features/host.ts +128 -19
- package/src/features/plan.ts +10 -0
- package/src/features/render-graph-contribution.ts +9 -0
- package/src/features/render-graph-raster.ts +45 -3
- package/src/features/targets.ts +66 -0
- package/src/features/types.ts +51 -0
- package/src/fullscreen-post-process-pass.ts +41 -9
- package/src/glyph-text-layout-system.ts +2 -2
- package/src/gpu-dirty-ranges.ts +48 -0
- package/src/gpu-driven/batch-topology.ts +53 -0
- package/src/gpu-driven/material-artifacts.ts +33 -25
- package/src/gpu-driven/prepared-draw.ts +12 -4
- package/src/gpu-driven/production-raster-material.ts +1894 -0
- package/src/gpu-driven/production-raster.ts +825 -784
- 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 +164 -10
- package/src/gpu-scene.ts +75 -84
- package/src/hdrp-buffers.ts +4 -3
- package/src/ibl/frame-resources.ts +0 -1
- package/src/ibl/skylight-bind-group.ts +62 -32
- package/src/index.ts +205 -9
- package/src/inspection-types.ts +162 -0
- package/src/instance-buffer-cache.ts +4 -4
- package/src/instances.ts +152 -569
- package/src/pbr-pipeline.ts +230 -30
- 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/lut-gpu.ts +3 -3
- package/src/pipeline/standard-output/resources.ts +2 -2
- package/src/pipeline/standard-output/types.ts +12 -1
- package/src/pipeline/standard-pipeline.ts +291 -18
- package/src/pipeline/standard-post.ts +90 -24
- package/src/pipeline-builder.ts +1 -1
- package/src/plugin.ts +4 -0
- package/src/points-lines/__tests__/points-lines.bench.ts +17 -8
- package/src/prepare/prepared-graphics-resolver.ts +2 -0
- package/src/publication/__tests__/derived-geometry.integration.test.ts +177 -0
- package/src/publication/__tests__/features.integration.test.ts +122 -0
- package/src/publication/__tests__/programs.unit.test.ts +25 -0
- package/src/publication/__tests__/publication.integration.test.ts +370 -0
- package/src/publication/__tests__/targets.integration.test.ts +120 -0
- package/src/publication/__tests__/video.browser.test.ts +50 -0
- package/src/publication/contract.ts +104 -0
- package/src/publication/dependencies.ts +54 -0
- package/src/publication/prepare-geometry.ts +94 -0
- package/src/publication/programs.ts +45 -0
- package/src/publication/publisher.ts +618 -0
- package/src/publication/receiver.ts +297 -0
- package/src/publication/resource-scope.ts +31 -0
- package/src/publication/targets.ts +182 -0
- package/src/publication/video.ts +33 -0
- package/src/record/__tests__/main-pass-geometry.unit.test.ts +30 -0
- package/src/record/__tests__/material-bg-cache.unit.test.ts +15 -1
- package/src/record/__tests__/sprite-material-abi.unit.test.ts +9 -11
- package/src/record/__tests__/temporal-payload.unit.test.ts +1 -1
- 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__/video-texture-view.unit.test.ts +9 -9
- 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 +855 -0
- package/src/record/fold-instance-buffer.ts +51 -0
- package/src/record/frame-lighting.ts +36 -2
- package/src/record/frame-snapshot.ts +45 -9
- package/src/record/frame.ts +258 -1105
- package/src/record/gpu-draw-receipts.ts +38 -0
- package/src/record/gpu-timing.ts +48 -5
- package/src/record/helpers.ts +2 -2
- package/src/record/main-pass-geometry.ts +272 -84
- package/src/record/main-pass-material.ts +102 -36
- package/src/record/main-pass-sprite-draws.ts +13 -217
- package/src/record/main-pass.ts +164 -27
- package/src/record/motion-blur-receipt.ts +91 -0
- package/src/record/prepared-material-bindings.ts +11 -6
- package/src/record/probe-blend-buffer.ts +180 -0
- package/src/record/recovery-pipeline.ts +35 -3
- package/src/record/render-context.ts +41 -5
- package/src/record/shadow-pass.ts +30 -4
- package/src/record/skybox-post-pass.ts +28 -4
- package/src/record/sprite-instance-buffer.ts +155 -0
- package/src/record/target-capture-graph.ts +258 -0
- package/src/record/typed-frame-graph.ts +776 -340
- package/src/record/view-ubo.ts +27 -4
- package/src/record/volume-params.ts +225 -0
- package/src/recovery/render-system-candidate.ts +243 -50
- package/src/reflection/record-owner.ts +7 -3
- package/src/render-contract.ts +54 -5
- package/src/render-graph-primitives.ts +7 -1
- package/src/render-pipeline.ts +130 -0
- package/src/render-system-extract-tail.ts +90 -78
- package/src/render-system-extract.ts +76 -76
- package/src/render-system-presentation.ts +56 -0
- package/src/render-system-producer-roots.ts +96 -0
- package/src/render-system-projections.ts +3 -2
- package/src/render-system-residency.ts +159 -0
- package/src/render-system.ts +421 -408
- package/src/scene/probe-blend.ts +96 -4
- package/src/scene/render-scene.ts +416 -337
- package/src/scene/render-source.ts +90 -0
- package/src/scene/source-systems.ts +33 -0
- 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 +5 -1
- package/src/systems/skin-palette-types.ts +11 -0
- package/src/systems/transparent-dispatch.ts +2 -2
- package/src/systems/transparent-sort-config.ts +3 -1
- 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/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 +70 -2
- package/src/volume/component.ts +10 -9
- package/src/volume/extract.ts +11 -5
- package/src/volume/inspection.ts +3 -0
- package/src/volume/passes.ts +87 -4
- package/src/volume/resources.ts +2 -1
- package/dist/chunk-3RTCJTH4.mjs +0 -1610
- package/dist/chunk-3RTCJTH4.mjs.map +0 -1
- package/dist/chunk-BLXGONR2.mjs.map +0 -1
- package/dist/chunk-ILQ5MEZF.mjs +0 -32
- package/dist/chunk-ILQ5MEZF.mjs.map +0 -1
- package/dist/chunk-LEAXOMYJ.mjs.map +0 -1
- package/dist/chunk-NB2S7ZRX.mjs +0 -1783
- package/dist/chunk-NB2S7ZRX.mjs.map +0 -1
- package/dist/chunk-NNQL7CB3.mjs +0 -1713
- package/dist/chunk-NNQL7CB3.mjs.map +0 -1
- package/dist/chunk-OO3DRYK7.mjs.map +0 -1
- package/dist/chunk-PA5DRJNI.mjs.map +0 -1
- package/dist/chunk-PLAXOOX5.mjs +0 -1907
- package/dist/chunk-PLAXOOX5.mjs.map +0 -1
- package/dist/chunk-RXZ3RGOU.mjs +0 -53
- package/dist/chunk-RXZ3RGOU.mjs.map +0 -1
- package/dist/chunk-VOZWDM3L.mjs.map +0 -1
|
@@ -0,0 +1,634 @@
|
|
|
1
|
+
import { World } from '@forgeax/engine-ecs';
|
|
2
|
+
import { describe, expect, it } from 'vitest';
|
|
3
|
+
import { CloudLayer, CloudQualityValue } from '../../components/cloud-layer';
|
|
4
|
+
import { DirectionalLight } from '../../components/directional-light';
|
|
5
|
+
import { freezeRenderFeaturePlan } from '../../features/plan';
|
|
6
|
+
import { createSceneDataCatalog } from '../../temporal/scene-data-catalog';
|
|
7
|
+
import {
|
|
8
|
+
buildCloudDensityCache,
|
|
9
|
+
evaluateCloudDensity,
|
|
10
|
+
reconstructCloudDensityCache,
|
|
11
|
+
sampleCloudDensity,
|
|
12
|
+
snapshotCloudDensityCache,
|
|
13
|
+
} from '../density';
|
|
14
|
+
import { extractCloudLayer } from '../extract';
|
|
15
|
+
import {
|
|
16
|
+
CLOUD_LAYER_FEATURE_IDENTITY,
|
|
17
|
+
CLOUD_RESOLVE_FULLSCREEN_WGSL,
|
|
18
|
+
CLOUD_TRANSPORT_FULLSCREEN_WGSL,
|
|
19
|
+
createCloudLayerFeature,
|
|
20
|
+
} from '../feature';
|
|
21
|
+
import {
|
|
22
|
+
applyCloudSolarTransmittance,
|
|
23
|
+
integrateCloudCameraPath,
|
|
24
|
+
integrateCloudInterior,
|
|
25
|
+
integrateCloudSolarColumn,
|
|
26
|
+
} from '../optics';
|
|
27
|
+
import { validateCloudLayer } from '../parameters';
|
|
28
|
+
import { inspectCloudLayerResources } from '../resources';
|
|
29
|
+
import { createCloudShadowProjection, sampleCloudShadow } from '../shadow';
|
|
30
|
+
import { cloudTemporalResetReasons, createCloudHistory, reprojectCloudHistory } from '../temporal';
|
|
31
|
+
|
|
32
|
+
function params() {
|
|
33
|
+
const result = validateCloudLayer({
|
|
34
|
+
seed: 42,
|
|
35
|
+
baseHeight: 10,
|
|
36
|
+
thickness: 20,
|
|
37
|
+
scale: 0.02,
|
|
38
|
+
coverage: 0.35,
|
|
39
|
+
density: 1.5,
|
|
40
|
+
wind: [3, 0, -1],
|
|
41
|
+
quality: 'low',
|
|
42
|
+
shadowRange: 100,
|
|
43
|
+
});
|
|
44
|
+
expect(result.ok).toBe(true);
|
|
45
|
+
if (!result.ok) throw result.error;
|
|
46
|
+
return result.value;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
describe('CloudLayer authoring and deterministic field', () => {
|
|
50
|
+
it('publishes a closed schema and validates its source facts', () => {
|
|
51
|
+
expect(CloudLayer.name).toBe('CloudLayer');
|
|
52
|
+
expect(CloudLayer.fields).toMatchObject({
|
|
53
|
+
seed: { type: 'u32', default: 1337 },
|
|
54
|
+
baseHeight: { type: 'f32', default: 120 },
|
|
55
|
+
thickness: { type: 'f32', default: 80 },
|
|
56
|
+
scale: { type: 'f32', default: 0.004 },
|
|
57
|
+
coverage: { type: 'f32', default: 0.48 },
|
|
58
|
+
density: { type: 'f32', default: 1 },
|
|
59
|
+
wind: { type: 'array<f32, 3>' },
|
|
60
|
+
quality: { type: 'f32', default: CloudQualityValue.medium },
|
|
61
|
+
shadowRange: { type: 'f32', default: 512 },
|
|
62
|
+
});
|
|
63
|
+
const invalid = validateCloudLayer({ coverage: 2 });
|
|
64
|
+
expect(invalid.ok).toBe(false);
|
|
65
|
+
if (!invalid.ok) expect(invalid.error.code).toBe('cloud-layer-invalid-parameter');
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it('admitted a scene placement plan with a depth-bounded HDR composite', () => {
|
|
69
|
+
const world = new World();
|
|
70
|
+
world
|
|
71
|
+
.spawn({ component: CloudLayer, data: { ...params(), quality: CloudQualityValue.low } })
|
|
72
|
+
.unwrap();
|
|
73
|
+
world
|
|
74
|
+
.spawn({
|
|
75
|
+
component: DirectionalLight,
|
|
76
|
+
data: { direction: [0.3, -0.9, 0.2], color: [1, 0.9, 0.8], intensity: 2 },
|
|
77
|
+
})
|
|
78
|
+
.unwrap();
|
|
79
|
+
const feature = createCloudLayerFeature();
|
|
80
|
+
const frameCloud = extractCloudLayer(world);
|
|
81
|
+
if (!frameCloud.ok) throw frameCloud.error;
|
|
82
|
+
if (frameCloud.value === undefined) throw new Error('cloud frame was not extracted');
|
|
83
|
+
const extracted = feature.extract({
|
|
84
|
+
worlds: [world],
|
|
85
|
+
owner: 0,
|
|
86
|
+
frameNumber: 1,
|
|
87
|
+
caps: { compute: true, storageBuffer: true, rgba16floatRenderable: true } as never,
|
|
88
|
+
frame: {
|
|
89
|
+
cloudLayer: frameCloud.value,
|
|
90
|
+
view: {
|
|
91
|
+
identity: 'test-view',
|
|
92
|
+
width: 64,
|
|
93
|
+
height: 32,
|
|
94
|
+
cameraRevision: 0,
|
|
95
|
+
deviceGeneration: 0,
|
|
96
|
+
cameraPosition: [0, 3, 0],
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
if (!extracted.ok) throw extracted.error;
|
|
101
|
+
expect(extracted.ok).toBe(true);
|
|
102
|
+
expect(extracted.value.params?.seed).toBe(42);
|
|
103
|
+
expect(extracted.value.sunRadiance?.[0]).toBeCloseTo(2);
|
|
104
|
+
expect(extracted.value.sunRadiance?.[1]).toBeCloseTo(1.8);
|
|
105
|
+
expect(extracted.value.sunRadiance?.[2]).toBeCloseTo(1.6);
|
|
106
|
+
const planned = feature.plan(extracted.value, {
|
|
107
|
+
caps: {
|
|
108
|
+
compute: true,
|
|
109
|
+
storageBuffer: true,
|
|
110
|
+
rgba16floatRenderable: true,
|
|
111
|
+
} as never,
|
|
112
|
+
frame: { frameNumber: 1 },
|
|
113
|
+
generation: 1,
|
|
114
|
+
targets: [
|
|
115
|
+
{ name: 'motion-input', kind: 'color', format: 'rgba16float', sampleCount: 1 },
|
|
116
|
+
{ name: 'motion-output', kind: 'color', format: 'rgba16float', sampleCount: 1 },
|
|
117
|
+
{ name: 'depth', kind: 'depth', format: 'depth24plus-stencil8', sampleCount: 1 },
|
|
118
|
+
{ name: 'cloud-shadow', kind: 'color', format: 'rgba16float', sampleCount: 1 },
|
|
119
|
+
{
|
|
120
|
+
name: 'cloud-history-radiance-previous',
|
|
121
|
+
kind: 'color',
|
|
122
|
+
format: 'rgba16float',
|
|
123
|
+
sampleCount: 1,
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: 'cloud-history-radiance-current',
|
|
127
|
+
kind: 'color',
|
|
128
|
+
format: 'rgba16float',
|
|
129
|
+
sampleCount: 1,
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: 'cloud-history-transmittance-previous',
|
|
133
|
+
kind: 'color',
|
|
134
|
+
format: 'rgba16float',
|
|
135
|
+
sampleCount: 1,
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
name: 'cloud-history-transmittance-current',
|
|
139
|
+
kind: 'color',
|
|
140
|
+
format: 'rgba16float',
|
|
141
|
+
sampleCount: 1,
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
name: 'cloud-history-depth-previous',
|
|
145
|
+
kind: 'color',
|
|
146
|
+
format: 'rgba16float',
|
|
147
|
+
sampleCount: 1,
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
name: 'cloud-history-depth-current',
|
|
151
|
+
kind: 'color',
|
|
152
|
+
format: 'rgba16float',
|
|
153
|
+
sampleCount: 1,
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
sceneData: createSceneDataCatalog({
|
|
157
|
+
featureIdentity: CLOUD_LAYER_FEATURE_IDENTITY,
|
|
158
|
+
generation: 1,
|
|
159
|
+
planIdentity: `${CLOUD_LAYER_FEATURE_IDENTITY}:1`,
|
|
160
|
+
rgba16floatRenderable: true,
|
|
161
|
+
}),
|
|
162
|
+
});
|
|
163
|
+
expect(planned.ok).toBe(true);
|
|
164
|
+
if (!planned.ok) throw planned.error;
|
|
165
|
+
const frozen = freezeRenderFeaturePlan(CLOUD_LAYER_FEATURE_IDENTITY, planned.value, [
|
|
166
|
+
{ name: 'motion-input', kind: 'color', format: 'rgba16float', sampleCount: 1 },
|
|
167
|
+
{ name: 'motion-output', kind: 'color', format: 'rgba16float', sampleCount: 1 },
|
|
168
|
+
{ name: 'depth', kind: 'depth', format: 'depth24plus-stencil8', sampleCount: 1 },
|
|
169
|
+
{ name: 'cloud-shadow', kind: 'color', format: 'rgba16float', sampleCount: 1 },
|
|
170
|
+
{
|
|
171
|
+
name: 'cloud-history-radiance-previous',
|
|
172
|
+
kind: 'color',
|
|
173
|
+
format: 'rgba16float',
|
|
174
|
+
sampleCount: 1,
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
name: 'cloud-history-radiance-current',
|
|
178
|
+
kind: 'color',
|
|
179
|
+
format: 'rgba16float',
|
|
180
|
+
sampleCount: 1,
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
name: 'cloud-history-transmittance-previous',
|
|
184
|
+
kind: 'color',
|
|
185
|
+
format: 'rgba16float',
|
|
186
|
+
sampleCount: 1,
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
name: 'cloud-history-transmittance-current',
|
|
190
|
+
kind: 'color',
|
|
191
|
+
format: 'rgba16float',
|
|
192
|
+
sampleCount: 1,
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: 'cloud-history-depth-previous',
|
|
196
|
+
kind: 'color',
|
|
197
|
+
format: 'rgba16float',
|
|
198
|
+
sampleCount: 1,
|
|
199
|
+
},
|
|
200
|
+
{ name: 'cloud-history-depth-current', kind: 'color', format: 'rgba16float', sampleCount: 1 },
|
|
201
|
+
]);
|
|
202
|
+
expect(frozen.ok).toBe(true);
|
|
203
|
+
if (!frozen.ok) throw frozen.error;
|
|
204
|
+
expect(feature.placement).toBe('scene');
|
|
205
|
+
expect(feature.shaderModuleMode).toBe('immediate');
|
|
206
|
+
expect(frozen.value.passes.map((pass) => pass.name)).toContain('cloud-layer-transport');
|
|
207
|
+
expect(frozen.value.passes.map((pass) => pass.name)).toContain('cloud-layer-resolve');
|
|
208
|
+
expect(frozen.value.passes.map((pass) => pass.name)).toContain('cloud-layer-shadow');
|
|
209
|
+
const shadowPass = frozen.value.passes.find(
|
|
210
|
+
(pass) => pass.kind === 'raster' && pass.name === 'cloud-layer-shadow',
|
|
211
|
+
);
|
|
212
|
+
expect(shadowPass?.kind).toBe('raster');
|
|
213
|
+
if (shadowPass?.kind === 'raster') {
|
|
214
|
+
// The light-space shadow branch reconstructs its receiver from the
|
|
215
|
+
// snapped projection and never samples scene depth. Keeping depth out
|
|
216
|
+
// of the graph reads avoids an artificial read-before-main dependency.
|
|
217
|
+
expect(shadowPass.sampledTargets).not.toContain('depth');
|
|
218
|
+
}
|
|
219
|
+
const fullscreen = frozen.value.resources.find(
|
|
220
|
+
(resource) => resource.kind === 'fullscreen-program',
|
|
221
|
+
);
|
|
222
|
+
expect(fullscreen?.kind).toBe('fullscreen-program');
|
|
223
|
+
if (fullscreen?.kind === 'fullscreen-program') {
|
|
224
|
+
expect(fullscreen.reads).toEqual([
|
|
225
|
+
'motion-input',
|
|
226
|
+
'cloud-history-radiance-previous',
|
|
227
|
+
'cloud-history-transmittance-previous',
|
|
228
|
+
'cloud-history-depth-previous',
|
|
229
|
+
{ key: 'depth', sampleType: 'depth' },
|
|
230
|
+
]);
|
|
231
|
+
expect(fullscreen.params?.byteSize).toBe(176);
|
|
232
|
+
expect(fullscreen.storageBindings).toEqual([8]);
|
|
233
|
+
expect(fullscreen.usesView).toBe(true);
|
|
234
|
+
}
|
|
235
|
+
const shadowFullscreen = frozen.value.resources.find(
|
|
236
|
+
(resource) =>
|
|
237
|
+
resource.kind === 'fullscreen-program' && resource.name === 'cloud-layer-shadow',
|
|
238
|
+
);
|
|
239
|
+
expect(shadowFullscreen?.kind).toBe('fullscreen-program');
|
|
240
|
+
if (shadowFullscreen?.kind === 'fullscreen-program') {
|
|
241
|
+
expect(shadowFullscreen.params?.byteSize).toBe(176);
|
|
242
|
+
}
|
|
243
|
+
const transportFullscreen = frozen.value.resources.find(
|
|
244
|
+
(resource) =>
|
|
245
|
+
resource.kind === 'fullscreen-program' && resource.name === 'cloud-layer-transport',
|
|
246
|
+
);
|
|
247
|
+
expect(transportFullscreen?.kind).toBe('fullscreen-program');
|
|
248
|
+
if (transportFullscreen?.kind === 'fullscreen-program') {
|
|
249
|
+
expect(transportFullscreen.fragmentEntryPoint).toBe('fs_transport');
|
|
250
|
+
expect(transportFullscreen.params?.byteSize).toBe(176);
|
|
251
|
+
expect(transportFullscreen.storageBindings).toEqual([8]);
|
|
252
|
+
expect(transportFullscreen.reads).toEqual([
|
|
253
|
+
'motion-input',
|
|
254
|
+
'cloud-shadow',
|
|
255
|
+
{ key: 'depth', sampleType: 'depth' },
|
|
256
|
+
]);
|
|
257
|
+
}
|
|
258
|
+
const resolveFullscreen = frozen.value.resources.find(
|
|
259
|
+
(resource) =>
|
|
260
|
+
resource.kind === 'fullscreen-program' && resource.name === 'cloud-layer-resolve',
|
|
261
|
+
);
|
|
262
|
+
expect(resolveFullscreen?.kind).toBe('fullscreen-program');
|
|
263
|
+
if (resolveFullscreen?.kind === 'fullscreen-program') {
|
|
264
|
+
expect(resolveFullscreen.reads).toEqual([
|
|
265
|
+
'motion-input',
|
|
266
|
+
'cloud-history-radiance-current',
|
|
267
|
+
'cloud-history-transmittance-current',
|
|
268
|
+
'cloud-history-depth-current',
|
|
269
|
+
'cloud-history-radiance-previous',
|
|
270
|
+
'cloud-history-transmittance-previous',
|
|
271
|
+
'cloud-history-depth-previous',
|
|
272
|
+
{ key: 'depth', sampleType: 'depth' },
|
|
273
|
+
]);
|
|
274
|
+
}
|
|
275
|
+
const transportPass = frozen.value.passes.find(
|
|
276
|
+
(pass) => pass.kind === 'raster' && pass.name === 'cloud-layer-transport',
|
|
277
|
+
);
|
|
278
|
+
expect(transportPass?.kind).toBe('raster');
|
|
279
|
+
if (transportPass?.kind === 'raster') {
|
|
280
|
+
expect(transportPass.colorAttachments).toHaveLength(3);
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
it('is deterministic, periodic and reconstructible from the cache snapshot', () => {
|
|
285
|
+
const source = params();
|
|
286
|
+
const first = buildCloudDensityCache(source);
|
|
287
|
+
const second = buildCloudDensityCache(source);
|
|
288
|
+
expect(first.digest).toBe(second.digest);
|
|
289
|
+
expect([...first.data]).toEqual([...second.data]);
|
|
290
|
+
expect(first.formationData.byteLength).toBe(first.data.byteLength * 3);
|
|
291
|
+
expect(first.byteLength).toBe(first.formationData.byteLength);
|
|
292
|
+
expect([...first.formationData]).toEqual([...second.formationData]);
|
|
293
|
+
const evaluationOnly = validateCloudLayer({
|
|
294
|
+
...source,
|
|
295
|
+
coverage: 0.72,
|
|
296
|
+
density: 0.55,
|
|
297
|
+
wind: [11, 0, -4],
|
|
298
|
+
});
|
|
299
|
+
expect(evaluationOnly.ok).toBe(true);
|
|
300
|
+
if (!evaluationOnly.ok) throw evaluationOnly.error;
|
|
301
|
+
const evaluationCache = buildCloudDensityCache(evaluationOnly.value);
|
|
302
|
+
expect(evaluationCache.sourceKey).toBe(first.sourceKey);
|
|
303
|
+
expect(evaluationCache.digest).toBe(first.digest);
|
|
304
|
+
expect([...evaluationCache.formationData]).toEqual([...first.formationData]);
|
|
305
|
+
const snapshot = snapshotCloudDensityCache(first);
|
|
306
|
+
const restored = reconstructCloudDensityCache(source, snapshot);
|
|
307
|
+
expect(restored.ok).toBe(true);
|
|
308
|
+
if (!restored.ok) throw restored.error;
|
|
309
|
+
expect(restored.value.digest).toBe(first.digest);
|
|
310
|
+
expect(sampleCloudDensity(first, source, [0, 20, 0])).toBeCloseTo(
|
|
311
|
+
sampleCloudDensity(first, source, [1 / source.scale, 20, 0]),
|
|
312
|
+
2,
|
|
313
|
+
);
|
|
314
|
+
expect(evaluateCloudDensity(source, [0, 0, 0]).density).toBe(0);
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
it('samples the authored field at cache texel centers without a half-cell shift', () => {
|
|
318
|
+
const source = { ...params(), coverage: 0.8 };
|
|
319
|
+
const cache = buildCloudDensityCache(source);
|
|
320
|
+
let maxError = 0;
|
|
321
|
+
let shiftedError = 0;
|
|
322
|
+
for (let z = 0; z < cache.resolution; z += 3) {
|
|
323
|
+
for (let y = 1; y < cache.resolution - 1; y += 3) {
|
|
324
|
+
const x = (z * 7 + y * 3) % cache.resolution;
|
|
325
|
+
const point: [number, number, number] = [
|
|
326
|
+
(x + 0.5) / cache.resolution / source.scale,
|
|
327
|
+
source.baseHeight + ((y + 0.5) / cache.resolution) * source.thickness,
|
|
328
|
+
(z + 0.5) / cache.resolution / source.scale,
|
|
329
|
+
];
|
|
330
|
+
maxError = Math.max(
|
|
331
|
+
maxError,
|
|
332
|
+
Math.abs(
|
|
333
|
+
sampleCloudDensity(cache, source, point) - evaluateCloudDensity(source, point).density,
|
|
334
|
+
),
|
|
335
|
+
);
|
|
336
|
+
const shifted = [
|
|
337
|
+
point[0] + 0.5 / cache.resolution / source.scale,
|
|
338
|
+
point[1] + (0.5 / cache.resolution) * source.thickness,
|
|
339
|
+
point[2] + 0.5 / cache.resolution / source.scale,
|
|
340
|
+
];
|
|
341
|
+
shiftedError = Math.max(
|
|
342
|
+
shiftedError,
|
|
343
|
+
Math.abs(
|
|
344
|
+
sampleCloudDensity(cache, source, shifted) -
|
|
345
|
+
evaluateCloudDensity(source, point).density,
|
|
346
|
+
),
|
|
347
|
+
);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
// Three R8 bases are quantized before a nonlinear coverage/height remap.
|
|
351
|
+
// Compare normalized extinction, rather than making the tolerance depend
|
|
352
|
+
// on the authored density multiplier. The explicit half-cell falsifier
|
|
353
|
+
// preserves the addressing regression independently of the noise seed.
|
|
354
|
+
expect(maxError / source.density).toBeLessThan(0.015);
|
|
355
|
+
expect(shiftedError / source.density).toBeGreaterThan(0.05);
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
it('increases occupied density monotonically with authored coverage', () => {
|
|
359
|
+
const base = params();
|
|
360
|
+
let totalLow = 0;
|
|
361
|
+
let totalHigh = 0;
|
|
362
|
+
for (let z = 0; z < 12; z++) {
|
|
363
|
+
for (let x = 0; x < 12; x++) {
|
|
364
|
+
const position = [
|
|
365
|
+
x / 12 / base.scale,
|
|
366
|
+
base.baseHeight + base.thickness * 0.5,
|
|
367
|
+
z / 12 / base.scale,
|
|
368
|
+
];
|
|
369
|
+
const low = evaluateCloudDensity({ ...base, coverage: 0.3 }, position).density;
|
|
370
|
+
const high = evaluateCloudDensity({ ...base, coverage: 0.8 }, position).density;
|
|
371
|
+
expect(high).toBeGreaterThanOrEqual(low);
|
|
372
|
+
totalLow += low;
|
|
373
|
+
totalHigh += high;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
expect(totalHigh).toBeGreaterThan(totalLow + 1);
|
|
377
|
+
});
|
|
378
|
+
|
|
379
|
+
it('advects the cached formation when vertical wind is authored', () => {
|
|
380
|
+
const movingResult = validateCloudLayer({ ...params(), wind: [0, 10, 0] });
|
|
381
|
+
expect(movingResult.ok).toBe(true);
|
|
382
|
+
if (!movingResult.ok) throw movingResult.error;
|
|
383
|
+
const moving = movingResult.value;
|
|
384
|
+
const cache = buildCloudDensityCache(moving);
|
|
385
|
+
let analyticDelta = 0;
|
|
386
|
+
let cachedDelta = 0;
|
|
387
|
+
for (let x = 0; x < 16; x += 1) {
|
|
388
|
+
for (let y = 1; y < 8; y += 1) {
|
|
389
|
+
const position = [x * 37, moving.baseHeight + (moving.thickness * y) / 8, 71];
|
|
390
|
+
analyticDelta = Math.max(
|
|
391
|
+
analyticDelta,
|
|
392
|
+
Math.abs(
|
|
393
|
+
evaluateCloudDensity(moving, position, 7).density -
|
|
394
|
+
evaluateCloudDensity(moving, position, 0).density,
|
|
395
|
+
),
|
|
396
|
+
);
|
|
397
|
+
cachedDelta = Math.max(
|
|
398
|
+
cachedDelta,
|
|
399
|
+
Math.abs(
|
|
400
|
+
sampleCloudDensity(cache, moving, position, 7) -
|
|
401
|
+
sampleCloudDensity(cache, moving, position, 0),
|
|
402
|
+
),
|
|
403
|
+
);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
expect(analyticDelta).toBeGreaterThan(0.1);
|
|
407
|
+
expect(cachedDelta).toBeGreaterThan(0.1);
|
|
408
|
+
|
|
409
|
+
let longAnalyticDelta = 0;
|
|
410
|
+
let longCachedDelta = 0;
|
|
411
|
+
for (let x = 0; x < 16; x += 1) {
|
|
412
|
+
for (let y = 1; y < 8; y += 1) {
|
|
413
|
+
const position = [x * 37, moving.baseHeight + (moving.thickness * y) / 8, 71];
|
|
414
|
+
longAnalyticDelta = Math.max(
|
|
415
|
+
longAnalyticDelta,
|
|
416
|
+
Math.abs(
|
|
417
|
+
evaluateCloudDensity(moving, position, 107).density -
|
|
418
|
+
evaluateCloudDensity(moving, position, 100).density,
|
|
419
|
+
),
|
|
420
|
+
);
|
|
421
|
+
longCachedDelta = Math.max(
|
|
422
|
+
longCachedDelta,
|
|
423
|
+
Math.abs(
|
|
424
|
+
sampleCloudDensity(cache, moving, position, 107) -
|
|
425
|
+
sampleCloudDensity(cache, moving, position, 100),
|
|
426
|
+
),
|
|
427
|
+
);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
expect(longAnalyticDelta).toBeGreaterThan(0.1);
|
|
431
|
+
expect(longCachedDelta).toBeGreaterThan(0.1);
|
|
432
|
+
|
|
433
|
+
let analyticSeamDelta = 0;
|
|
434
|
+
let cachedSeamDelta = 0;
|
|
435
|
+
for (let x = 0; x < 16; x += 1) {
|
|
436
|
+
for (let y = 1; y < 8; y += 1) {
|
|
437
|
+
const position = [x * 37, moving.baseHeight + (moving.thickness * y) / 8, 71];
|
|
438
|
+
analyticSeamDelta = Math.max(
|
|
439
|
+
analyticSeamDelta,
|
|
440
|
+
Math.abs(
|
|
441
|
+
evaluateCloudDensity(moving, position, 5.00001).density -
|
|
442
|
+
evaluateCloudDensity(moving, position, 4.99999).density,
|
|
443
|
+
),
|
|
444
|
+
);
|
|
445
|
+
cachedSeamDelta = Math.max(
|
|
446
|
+
cachedSeamDelta,
|
|
447
|
+
Math.abs(
|
|
448
|
+
sampleCloudDensity(cache, moving, position, 5.00001) -
|
|
449
|
+
sampleCloudDensity(cache, moving, position, 4.99999),
|
|
450
|
+
),
|
|
451
|
+
);
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
expect(analyticSeamDelta).toBeLessThan(0.01);
|
|
455
|
+
expect(cachedSeamDelta).toBeLessThan(0.01);
|
|
456
|
+
});
|
|
457
|
+
|
|
458
|
+
it('keeps the production transport and resolve contracts explicit', () => {
|
|
459
|
+
expect(CLOUD_TRANSPORT_FULLSCREEN_WGSL).toContain('fs_transport');
|
|
460
|
+
expect(CLOUD_TRANSPORT_FULLSCREEN_WGSL).toContain('cloud_solar_cached_transmittance');
|
|
461
|
+
expect(CLOUD_TRANSPORT_FULLSCREEN_WGSL).toContain('@location(2) depth');
|
|
462
|
+
expect(CLOUD_TRANSPORT_FULLSCREEN_WGSL).toContain('cachedShadow.g');
|
|
463
|
+
expect(CLOUD_TRANSPORT_FULLSCREEN_WGSL).toContain('cachedShadow.b');
|
|
464
|
+
expect(CLOUD_TRANSPORT_FULLSCREEN_WGSL).toContain(
|
|
465
|
+
'let occupiedMin = min(firstHeight, lastHeight)',
|
|
466
|
+
);
|
|
467
|
+
expect(CLOUD_TRANSPORT_FULLSCREEN_WGSL).toContain('abs(sunDirection.y) > 0.2');
|
|
468
|
+
expect(CLOUD_TRANSPORT_FULLSCREEN_WGSL).toContain('let directionBudget = select(');
|
|
469
|
+
expect(CLOUD_TRANSPORT_FULLSCREEN_WGSL).toContain('let residualSteps = min(directionBudget');
|
|
470
|
+
expect(CLOUD_TRANSPORT_FULLSCREEN_WGSL).toContain('cloud_density(samplePosition)');
|
|
471
|
+
expect(CLOUD_RESOLVE_FULLSCREEN_WGSL).toContain('textureLoad(sceneDepth');
|
|
472
|
+
expect(CLOUD_RESOLVE_FULLSCREEN_WGSL).toContain('currentRadiance');
|
|
473
|
+
expect(CLOUD_RESOLVE_FULLSCREEN_WGSL).toContain('foregroundAccepted');
|
|
474
|
+
expect(CLOUD_RESOLVE_FULLSCREEN_WGSL).toContain('if (!currentValid || !foregroundAccepted)');
|
|
475
|
+
expect(CLOUD_RESOLVE_FULLSCREEN_WGSL).toContain('let minTransport');
|
|
476
|
+
});
|
|
477
|
+
});
|
|
478
|
+
|
|
479
|
+
describe('CloudLayer optical ownership', () => {
|
|
480
|
+
it('keeps camera, solar-column and interior paths distinct', () => {
|
|
481
|
+
const source = params();
|
|
482
|
+
const cache = buildCloudDensityCache(source);
|
|
483
|
+
const camera = integrateCloudCameraPath(
|
|
484
|
+
source,
|
|
485
|
+
{ origin: [0, 0, 0], direction: [0, 1, 0], maxDistance: 100 },
|
|
486
|
+
{ cache, steps: 8 },
|
|
487
|
+
);
|
|
488
|
+
const column = integrateCloudSolarColumn(source, [0, 15, 0], [0.4, 1, 0.2], {
|
|
489
|
+
cache,
|
|
490
|
+
steps: 8,
|
|
491
|
+
maxDistance: 100,
|
|
492
|
+
});
|
|
493
|
+
const interior = integrateCloudInterior(
|
|
494
|
+
source,
|
|
495
|
+
{ origin: [0, 15, 0], direction: [0, 1, 0], maxDistance: 100 },
|
|
496
|
+
{ sunRadiance: [2, 2, 2], sunDirection: [0.4, 1, 0.2] },
|
|
497
|
+
{ cache, steps: 8 },
|
|
498
|
+
);
|
|
499
|
+
expect(camera.path).toBe('camera');
|
|
500
|
+
expect(column.path).toBe('solar-column');
|
|
501
|
+
expect(interior.path).toBe('cloud-interior');
|
|
502
|
+
expect(camera.transmittance).toBeGreaterThanOrEqual(0);
|
|
503
|
+
expect(camera.transmittance).toBeLessThanOrEqual(1);
|
|
504
|
+
expect(interior.scattering[0]).toBeGreaterThanOrEqual(0);
|
|
505
|
+
expect(applyCloudSolarTransmittance([2, 3, 4], 0.5)).toEqual([1, 1.5, 2]);
|
|
506
|
+
});
|
|
507
|
+
|
|
508
|
+
it('projects stable world-space shadows and exposes low-sun fallback', () => {
|
|
509
|
+
const source = params();
|
|
510
|
+
const projection = createCloudShadowProjection({
|
|
511
|
+
center: [0, 0, 0],
|
|
512
|
+
sunDirection: [0.3, 0.9, 0.2],
|
|
513
|
+
range: 100,
|
|
514
|
+
resolution: 128,
|
|
515
|
+
});
|
|
516
|
+
const same = createCloudShadowProjection({
|
|
517
|
+
center: [0, 0, 0],
|
|
518
|
+
sunDirection: [0.3, 0.9, 0.2],
|
|
519
|
+
range: 100,
|
|
520
|
+
resolution: 128,
|
|
521
|
+
});
|
|
522
|
+
expect(projection.revision).toBe(same.revision);
|
|
523
|
+
const shadow = sampleCloudShadow(source, projection, [0, 15, 0]);
|
|
524
|
+
expect(shadow.revision).toBe(projection.revision);
|
|
525
|
+
const lowSun = createCloudShadowProjection({
|
|
526
|
+
center: [0, 0, 0],
|
|
527
|
+
sunDirection: [1, 0.01, 0],
|
|
528
|
+
range: 100,
|
|
529
|
+
});
|
|
530
|
+
expect(sampleCloudShadow(source, lowSun, [0, 15, 0]).fallback).toBe('low-sun');
|
|
531
|
+
});
|
|
532
|
+
});
|
|
533
|
+
|
|
534
|
+
describe('CloudLayer temporal history', () => {
|
|
535
|
+
const signature = {
|
|
536
|
+
sourceKey: 'cloud-layer-v1:42',
|
|
537
|
+
viewId: 'main',
|
|
538
|
+
authoringGeneration: 1,
|
|
539
|
+
cloudShadowRevision: 2,
|
|
540
|
+
cameraRevision: 3,
|
|
541
|
+
deviceGeneration: 4,
|
|
542
|
+
width: 64,
|
|
543
|
+
height: 32,
|
|
544
|
+
timeSeconds: 1,
|
|
545
|
+
quality: 'medium' as const,
|
|
546
|
+
};
|
|
547
|
+
|
|
548
|
+
it('resets on source, resize, camera, recovery and time discontinuity', () => {
|
|
549
|
+
expect(cloudTemporalResetReasons(undefined, signature)).toEqual(['history-missing']);
|
|
550
|
+
expect(cloudTemporalResetReasons(signature, { ...signature, sourceKey: 'changed' })).toContain(
|
|
551
|
+
'authoring-generation',
|
|
552
|
+
);
|
|
553
|
+
expect(cloudTemporalResetReasons(signature, { ...signature, width: 128 })).toContain('resize');
|
|
554
|
+
expect(cloudTemporalResetReasons(signature, { ...signature, timeSeconds: 2 })).toContain(
|
|
555
|
+
'time-discontinuity',
|
|
556
|
+
);
|
|
557
|
+
expect(cloudTemporalResetReasons(signature, signature, { cameraCut: true })).toContain(
|
|
558
|
+
'camera-cut',
|
|
559
|
+
);
|
|
560
|
+
expect(cloudTemporalResetReasons(signature, signature, { recovery: true })).toContain(
|
|
561
|
+
'recovery',
|
|
562
|
+
);
|
|
563
|
+
});
|
|
564
|
+
|
|
565
|
+
it('rejects disoccluded history and accepts bounded motion reprojection', () => {
|
|
566
|
+
const history = createCloudHistory(signature, 1, true);
|
|
567
|
+
expect(history.width).toBe(64);
|
|
568
|
+
expect(history.height).toBe(32);
|
|
569
|
+
const accepted = reprojectCloudHistory({
|
|
570
|
+
currentDepth: 10,
|
|
571
|
+
historyDepth: 10.1,
|
|
572
|
+
motion: [1, 0],
|
|
573
|
+
currentPixel: [20, 10],
|
|
574
|
+
historySize: [64, 32],
|
|
575
|
+
});
|
|
576
|
+
expect(accepted.accepted).toBe(true);
|
|
577
|
+
const rejected = reprojectCloudHistory({
|
|
578
|
+
currentDepth: 10,
|
|
579
|
+
historyDepth: 20,
|
|
580
|
+
motion: [0, 0],
|
|
581
|
+
currentPixel: [20, 10],
|
|
582
|
+
historySize: [64, 32],
|
|
583
|
+
});
|
|
584
|
+
expect(rejected.reason).toBe('depth-disocclusion');
|
|
585
|
+
});
|
|
586
|
+
});
|
|
587
|
+
|
|
588
|
+
describe('CloudLayer resource evidence', () => {
|
|
589
|
+
it('separates descriptor declarations from measured GPU residency', () => {
|
|
590
|
+
const source = params();
|
|
591
|
+
const cache = buildCloudDensityCache(source);
|
|
592
|
+
const shadow = createCloudShadowProjection({
|
|
593
|
+
center: [0, 0, 0],
|
|
594
|
+
sunDirection: [0.3, 0.9, 0.2],
|
|
595
|
+
range: 100,
|
|
596
|
+
resolution: 128,
|
|
597
|
+
});
|
|
598
|
+
const history = createCloudHistory(
|
|
599
|
+
{
|
|
600
|
+
sourceKey: 'cloud-layer-v1:42',
|
|
601
|
+
viewId: 'main',
|
|
602
|
+
authoringGeneration: 1,
|
|
603
|
+
cloudShadowRevision: shadow.revision,
|
|
604
|
+
cameraRevision: 0,
|
|
605
|
+
deviceGeneration: 0,
|
|
606
|
+
width: 64,
|
|
607
|
+
height: 32,
|
|
608
|
+
timeSeconds: 0,
|
|
609
|
+
quality: 'low',
|
|
610
|
+
},
|
|
611
|
+
1,
|
|
612
|
+
);
|
|
613
|
+
const declared = inspectCloudLayerResources({ generation: 1, cache, shadow, history });
|
|
614
|
+
expect(declared.gpuEvidence).toBe('declared');
|
|
615
|
+
expect(declared.shadowBytes).toBe(0);
|
|
616
|
+
expect(declared.historyBytes).toBe(0);
|
|
617
|
+
expect(declared.declaredShadowBytes).toBe(128 * 128 * 8);
|
|
618
|
+
expect(declared.declaredHistoryBytes).toBe(64 * 32 * 6 * 8);
|
|
619
|
+
const measured = inspectCloudLayerResources({
|
|
620
|
+
generation: 1,
|
|
621
|
+
cache,
|
|
622
|
+
shadow,
|
|
623
|
+
history,
|
|
624
|
+
shadowBytes: declared.declaredShadowBytes,
|
|
625
|
+
historyBytes: declared.declaredHistoryBytes,
|
|
626
|
+
inFlightBytes: 4096,
|
|
627
|
+
});
|
|
628
|
+
expect(measured.gpuEvidence).toBe('measured');
|
|
629
|
+
expect(measured.residentBytes).toBe(
|
|
630
|
+
cache.byteLength + declared.declaredShadowBytes + declared.declaredHistoryBytes,
|
|
631
|
+
);
|
|
632
|
+
expect(measured.inFlightBytes).toBe(4096);
|
|
633
|
+
});
|
|
634
|
+
});
|