@forgeax/engine-render 0.1.21 → 0.1.23
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 +150 -29
- package/dist/assembly/backend-contract.d.ts +13 -0
- package/dist/assembly/backend-contract.d.ts.map +1 -1
- package/dist/assembly/device-feature-admission.d.ts.map +1 -1
- package/dist/assembly/factory.d.ts +14 -6
- package/dist/assembly/factory.d.ts.map +1 -1
- package/dist/assembly/host-contract.d.ts +10 -0
- package/dist/assembly/host-contract.d.ts.map +1 -1
- package/dist/authoring.mjs +1 -1
- package/dist/{chunk-PCHBPYML.mjs → chunk-4L3P6DT5.mjs} +2 -2
- package/dist/chunk-4L3P6DT5.mjs.map +1 -0
- package/dist/{chunk-VFPLTKCU.mjs → chunk-4NPUASZR.mjs} +15 -4
- package/dist/chunk-4NPUASZR.mjs.map +1 -0
- package/dist/chunk-DIYW3M5D.mjs +5085 -0
- package/dist/chunk-DIYW3M5D.mjs.map +1 -0
- package/dist/chunk-FBC4R44J.mjs +1003 -0
- package/dist/chunk-FBC4R44J.mjs.map +1 -0
- package/dist/{chunk-FS2KNUQH.mjs → chunk-FF7K3FSO.mjs} +253 -489
- package/dist/chunk-FF7K3FSO.mjs.map +1 -0
- package/dist/chunk-HZUPSYW7.mjs +1104 -0
- package/dist/chunk-HZUPSYW7.mjs.map +1 -0
- package/dist/{chunk-6OPXDQ2E.mjs → chunk-QODA5UKU.mjs} +33 -294
- package/dist/chunk-QODA5UKU.mjs.map +1 -0
- package/dist/chunk-YALPS44A.mjs +296 -0
- package/dist/chunk-YALPS44A.mjs.map +1 -0
- package/dist/{chunk-5YADUCA7.mjs → chunk-ZUWKAZ2I.mjs} +585 -991
- package/dist/chunk-ZUWKAZ2I.mjs.map +1 -0
- package/dist/cluster-binner.d.ts +5 -0
- package/dist/cluster-binner.d.ts.map +1 -1
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/light-helpers.d.ts +4 -0
- package/dist/components/light-helpers.d.ts.map +1 -1
- package/dist/components/light-probe.d.ts +9 -0
- package/dist/components/light-probe.d.ts.map +1 -0
- package/dist/components/rect-area-light.d.ts +12 -0
- package/dist/components/rect-area-light.d.ts.map +1 -0
- package/dist/components/scene-instance.d.ts +4 -0
- package/dist/components/scene-instance.d.ts.map +1 -1
- package/dist/components/spot-light.d.ts +3 -0
- package/dist/components/spot-light.d.ts.map +1 -1
- package/dist/construct-renderer.mjs +10437 -10044
- package/dist/construct-renderer.mjs.map +1 -1
- package/dist/device/gpu-residency.d.ts +8 -1
- package/dist/device/gpu-residency.d.ts.map +1 -1
- package/dist/device/lifecycle-transaction.d.ts +2 -0
- package/dist/device/lifecycle-transaction.d.ts.map +1 -0
- package/dist/environment/lifecycle.d.ts.map +1 -1
- package/dist/errors/gpu-driven.d.ts +26 -0
- package/dist/errors/gpu-driven.d.ts.map +1 -0
- package/dist/errors/index.d.ts +1 -0
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/recover.d.ts +9 -1
- package/dist/errors/recover.d.ts.map +1 -1
- package/dist/errors/render.d.ts +26 -1
- package/dist/errors/render.d.ts.map +1 -1
- package/dist/extract/gpu-driven.d.ts +50 -0
- package/dist/extract/gpu-driven.d.ts.map +1 -0
- package/dist/extract/visibility.d.ts.map +1 -1
- package/dist/gpu-driven/batch-topology.d.ts +34 -0
- package/dist/gpu-driven/batch-topology.d.ts.map +1 -1
- package/dist/gpu-driven/prepared-draw.d.ts +63 -0
- package/dist/gpu-driven/prepared-draw.d.ts.map +1 -0
- package/dist/gpu-driven/production-raster.d.ts +98 -2
- package/dist/gpu-driven/production-raster.d.ts.map +1 -1
- package/dist/gpu-driven/view-gpu.d.ts +64 -1
- package/dist/gpu-driven/view-gpu.d.ts.map +1 -1
- package/dist/gpu-scene-schema.d.ts +14 -0
- package/dist/gpu-scene-schema.d.ts.map +1 -1
- package/dist/gpu-scene.d.ts +8 -1
- package/dist/gpu-scene.d.ts.map +1 -1
- package/dist/gpu-usage.d.ts +0 -1
- package/dist/gpu-usage.d.ts.map +1 -1
- package/dist/hdrp-buffers.d.ts +3 -3
- package/dist/hdrp-buffers.d.ts.map +1 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +90 -5
- package/dist/index.mjs.map +1 -1
- package/dist/inspection-types.d.ts +163 -1
- package/dist/inspection-types.d.ts.map +1 -1
- package/dist/internal.d.ts +9 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.mjs +23 -2
- package/dist/internal.mjs.map +1 -1
- package/dist/light-buffer-layout.d.ts +58 -149
- package/dist/light-buffer-layout.d.ts.map +1 -1
- package/dist/materials.d.ts.map +1 -1
- package/dist/pbr-pipeline.d.ts +26 -12
- package/dist/pbr-pipeline.d.ts.map +1 -1
- package/dist/pipeline/standard-forward-lane.d.ts.map +1 -1
- package/dist/pipeline/standard-lighting/graph.d.ts.map +1 -1
- package/dist/pipeline/standard-lighting/light-frame.d.ts +3 -3
- package/dist/pipeline/standard-lighting/light-frame.d.ts.map +1 -1
- package/dist/pipeline/standard-lighting/topology.d.ts +1 -1
- package/dist/pipeline/standard-lighting/topology.d.ts.map +1 -1
- package/dist/pipeline/standard-lighting/transport.d.ts.map +1 -1
- package/dist/pipeline/standard-pipeline.d.ts.map +1 -1
- package/dist/pipeline-builder.d.ts +2 -0
- package/dist/pipeline-builder.d.ts.map +1 -1
- package/dist/pipeline-spec.d.ts +1 -1
- package/dist/pipeline-spec.d.ts.map +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/prepare/extended-lighting/ltc-resources.d.ts +31 -0
- package/dist/prepare/extended-lighting/ltc-resources.d.ts.map +1 -0
- package/dist/prepare/extended-lighting/resources.d.ts +72 -0
- package/dist/prepare/extended-lighting/resources.d.ts.map +1 -0
- package/dist/prepare/extended-lighting/spot-modifiers.d.ts +42 -0
- package/dist/prepare/extended-lighting/spot-modifiers.d.ts.map +1 -0
- package/dist/prepare/extended-lighting/state.d.ts +24 -0
- package/dist/prepare/extended-lighting/state.d.ts.map +1 -0
- package/dist/record/frame-lighting.d.ts +8 -6
- package/dist/record/frame-lighting.d.ts.map +1 -1
- package/dist/record/frame-snapshot.d.ts +50 -10
- package/dist/record/frame-snapshot.d.ts.map +1 -1
- package/dist/record/frame.d.ts +7 -3
- package/dist/record/frame.d.ts.map +1 -1
- package/dist/record/gpu-timing.d.ts +19 -7
- package/dist/record/gpu-timing.d.ts.map +1 -1
- package/dist/record/helpers.d.ts +0 -20
- package/dist/record/helpers.d.ts.map +1 -1
- package/dist/record/main-pass-geometry.d.ts +6 -1
- package/dist/record/main-pass-geometry.d.ts.map +1 -1
- package/dist/record/main-pass-material.d.ts +3 -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/mesh-ssbo.d.ts.map +1 -1
- package/dist/record/render-context.d.ts +57 -6
- package/dist/record/render-context.d.ts.map +1 -1
- package/dist/record/shadow-pass.d.ts.map +1 -1
- package/dist/record/typed-frame-graph.d.ts +49 -2
- package/dist/record/typed-frame-graph.d.ts.map +1 -1
- package/dist/record/view-ubo.d.ts +1 -2
- package/dist/record/view-ubo.d.ts.map +1 -1
- package/dist/reflection/inspection.d.ts +10 -0
- package/dist/reflection/inspection.d.ts.map +1 -0
- package/dist/reflection/projection.d.ts +49 -0
- package/dist/reflection/projection.d.ts.map +1 -1
- package/dist/reflection/record-owner.d.ts +60 -0
- package/dist/reflection/record-owner.d.ts.map +1 -0
- package/dist/render-contract.d.ts +14 -8
- package/dist/render-contract.d.ts.map +1 -1
- package/dist/render-pipeline.d.ts +7 -0
- package/dist/render-pipeline.d.ts.map +1 -1
- package/dist/render-system-extract.d.ts +104 -16
- package/dist/render-system-extract.d.ts.map +1 -1
- package/dist/render-system.d.ts +12 -1
- package/dist/render-system.d.ts.map +1 -1
- package/dist/scene/probe-blend-record.d.ts +22 -0
- package/dist/scene/probe-blend-record.d.ts.map +1 -0
- package/dist/scene/probe-blend.d.ts +142 -0
- package/dist/scene/probe-blend.d.ts.map +1 -0
- package/dist/scene/render-scene-types.d.ts +0 -6
- package/dist/scene/render-scene-types.d.ts.map +1 -1
- package/dist/scene/render-scene.d.ts +103 -9
- package/dist/scene/render-scene.d.ts.map +1 -1
- package/dist/scene/visibility/bounds.d.ts +20 -0
- package/dist/scene/visibility/bounds.d.ts.map +1 -0
- package/dist/scene/visibility/budget.d.ts +16 -0
- package/dist/scene/visibility/budget.d.ts.map +1 -0
- package/dist/scene/visibility/facet.d.ts +73 -0
- package/dist/scene/visibility/facet.d.ts.map +1 -0
- package/dist/scene/visibility/gpu-frame-timing.d.ts +41 -0
- package/dist/scene/visibility/gpu-frame-timing.d.ts.map +1 -0
- package/dist/scene/visibility/gpu-lod.d.ts +46 -0
- package/dist/scene/visibility/gpu-lod.d.ts.map +1 -0
- package/dist/scene/visibility/inspection.d.ts +132 -0
- package/dist/scene/visibility/inspection.d.ts.map +1 -0
- package/dist/scene/visibility/lod-selector.d.ts +25 -0
- package/dist/scene/visibility/lod-selector.d.ts.map +1 -0
- package/dist/scene/visibility/occlusion-confidence.d.ts +81 -0
- package/dist/scene/visibility/occlusion-confidence.d.ts.map +1 -0
- package/dist/scene/visibility/occlusion-pass.d.ts +57 -0
- package/dist/scene/visibility/occlusion-pass.d.ts.map +1 -0
- package/dist/scene/visibility/occlusion-query-pool.d.ts +57 -0
- package/dist/scene/visibility/occlusion-query-pool.d.ts.map +1 -0
- package/dist/scene/visibility/occlusion-runtime.d.ts +96 -0
- package/dist/scene/visibility/occlusion-runtime.d.ts.map +1 -0
- package/dist/scene/visibility/types.d.ts +34 -0
- package/dist/scene/visibility/types.d.ts.map +1 -0
- package/dist/ssr/admission.d.ts +122 -0
- package/dist/ssr/admission.d.ts.map +1 -0
- package/dist/ssr/composition.d.ts +32 -0
- package/dist/ssr/composition.d.ts.map +1 -0
- package/dist/ssr/errors.d.ts +39 -0
- package/dist/ssr/errors.d.ts.map +1 -0
- package/dist/ssr/identity.d.ts +13 -0
- package/dist/ssr/identity.d.ts.map +1 -0
- package/dist/systems/skin-palette-allocator.d.ts +1 -1
- package/dist/temporal/frame-coordinator.d.ts +13 -0
- package/dist/temporal/frame-coordinator.d.ts.map +1 -1
- package/dist/temporal/frame.d.ts +2 -0
- package/dist/temporal/frame.d.ts.map +1 -1
- package/dist/temporal/index.mjs +6 -5
- package/dist/temporal/view.d.ts +7 -0
- package/dist/temporal/view.d.ts.map +1 -1
- package/dist/tilemap-chunk-extract-system.d.ts +1 -1
- package/dist/typed-render-graph-primitives.d.ts +4 -0
- package/dist/typed-render-graph-primitives.d.ts.map +1 -1
- package/dist/volume/passes.d.ts +8 -4
- package/dist/volume/passes.d.ts.map +1 -1
- package/package.json +20 -20
- package/src/__tests__/cluster-grid-default-surface.unit.test.ts +5 -0
- package/src/__tests__/detached-inspection.integration.test.ts +6 -0
- package/src/__tests__/device-feature-admission.unit.test.ts +13 -1
- package/src/__tests__/direct-light-snapshot.unit.test.ts +59 -3
- package/src/__tests__/environment-generation.integration.test.ts +16 -0
- package/src/__tests__/evidence-identity.ts +13 -0
- package/src/__tests__/evidence-identity.unit.test.ts +24 -0
- package/src/__tests__/extended-lighting-recovery.browser.test.ts +14 -0
- package/src/__tests__/extended-lighting-recovery.dawn.test.ts +14 -0
- package/src/__tests__/extended-lighting-recovery.integration.test.ts +81 -0
- package/src/__tests__/extended-lighting-resources.unit.test.ts +51 -0
- package/src/__tests__/extended-lighting-zero-feature.integration.test.ts +52 -0
- package/src/__tests__/factory-contract.integration.test.ts +33 -0
- package/src/__tests__/frame-observation.contract.test.ts +15 -0
- package/src/__tests__/gpu-driven-batch-topology-pbr.unit.test.ts +146 -0
- package/src/__tests__/gpu-driven-indirect-raster-evidence.ts +1 -0
- package/src/__tests__/gpu-driven-indirect-raster.dawn.test.ts +1 -0
- package/src/__tests__/gpu-driven-production.integration.test.ts +572 -9
- package/src/__tests__/gpu-driven-scaling.unit.test.ts +66 -2
- package/src/__tests__/gpu-driven-view-gpu-evidence.ts +26 -1
- package/src/__tests__/gpu-driven-view-graph.integration.test.ts +89 -2
- package/src/__tests__/gpu-driven-view.browser.test.ts +3 -3
- package/src/__tests__/gpu-driven-view.dawn.test.ts +3 -3
- package/src/__tests__/gpu-driven-view.unit.test.ts +50 -0
- package/src/__tests__/gpu-lod-evidence.ts +188 -0
- package/src/__tests__/gpu-lod-fallback.integration.test.ts +10 -0
- package/src/__tests__/gpu-lod-indirect.integration.test.ts +40 -0
- package/src/__tests__/gpu-lod-parity.dawn.test.ts +29 -0
- package/src/__tests__/gpu-lod-readiness.integration.test.ts +52 -0
- package/src/__tests__/gpu-lod-schema.unit.test.ts +66 -0
- package/src/__tests__/gpu-lod-selector.unit.test.ts +28 -0
- package/src/__tests__/gpu-lod-silhouette.browser.test.ts +13 -0
- package/src/__tests__/gpu-resource-store-stride.unit.test.ts +66 -1
- package/src/__tests__/gpu-scene.dawn.test.ts +8 -1
- package/src/__tests__/gpu-scene.unit.test.ts +49 -3
- package/src/__tests__/light-buffer-layout.unit.test.ts +113 -3
- package/src/__tests__/light-inspection.unit.test.ts +55 -0
- package/src/__tests__/light-resource-error.unit.test.ts +43 -0
- package/src/__tests__/lighting-scene-roundtrip.integration.test.ts +109 -0
- package/src/__tests__/lod-bounds.unit.test.ts +42 -0
- package/src/__tests__/lod-cpu-lane.integration.test.ts +55 -0
- package/src/__tests__/lod-cpu-no-change.perf.test.ts +19 -0
- package/src/__tests__/lod-gpu-frame-timing.unit.test.ts +49 -0
- package/src/__tests__/lod-multi-view.integration.test.ts +63 -0
- package/src/__tests__/lod-occlusion-device-loss.integration.test.ts +27 -0
- package/src/__tests__/lod-occlusion-final-decision.integration.test.ts +47 -0
- package/src/__tests__/lod-occlusion-inspection.integration.test.ts +217 -0
- package/src/__tests__/lod-occlusion-inspection.schema.test-d.ts +14 -0
- package/src/__tests__/lod-occlusion-inspection.unit.test.ts +72 -0
- package/src/__tests__/lod-occlusion-visual-evidence.ts +91 -0
- package/src/__tests__/lod-occlusion.browser.test.ts +15 -0
- package/src/__tests__/lod-occlusion.dawn.test.ts +20 -0
- package/src/__tests__/lod-selector.profile.test.ts +35 -0
- package/src/__tests__/lod-selector.unit.test.ts +68 -0
- package/src/__tests__/lod-visibility-identity.unit.test.ts +198 -0
- package/src/__tests__/lod-visibility-lifecycle.integration.test.ts +132 -0
- package/src/__tests__/ltc-resources.unit.test.ts +32 -0
- package/src/__tests__/material-contract-inventory.unit.test.ts +17 -0
- package/src/__tests__/occlusion-confidence.unit.test.ts +168 -0
- package/src/__tests__/occlusion-invalidation.integration.test.ts +37 -0
- package/src/__tests__/occlusion-pass-routing.unit.test.ts +16 -0
- package/src/__tests__/occlusion-pass.dawn.test.ts +20 -0
- package/src/__tests__/occlusion-pass.integration.test.ts +43 -0
- package/src/__tests__/occlusion-pass.rhi-null.test.ts +22 -0
- package/src/__tests__/occlusion-query-pool.rhi-null.test.ts +21 -0
- package/src/__tests__/occlusion-query-pool.unit.test.ts +95 -0
- package/src/__tests__/occlusion-query-ticket.integration.test.ts +47 -0
- package/src/__tests__/occlusion-query.dawn.test.ts +16 -0
- package/src/__tests__/occlusion-query.evidence.ts +178 -0
- package/src/__tests__/occlusion-query.rhi-null.test.ts +31 -0
- package/src/__tests__/occlusion-runtime.unit.test.ts +120 -0
- package/src/__tests__/prepared-gpu-driven-pbr.integration.test.ts +196 -0
- package/src/__tests__/probe-bindings.unit.test.ts +200 -0
- package/src/__tests__/probe-blend-numeric.unit.test.ts +67 -0
- package/src/__tests__/probe-blend-oracle.unit.test.ts +136 -0
- package/src/__tests__/probe-capacity.integration.test.ts +97 -0
- package/src/__tests__/probe-recovery.integration.test.ts +104 -0
- package/src/__tests__/probe-scene-dirty.integration.test.ts +211 -0
- package/src/__tests__/profiler-phase-catalog.test.ts +4 -1
- package/src/__tests__/profiler-phase-token.test.ts +1 -0
- package/src/__tests__/rect-area-boundary.unit.test.ts +24 -0
- package/src/__tests__/reflection-fallback-graph.unit.test.ts +67 -0
- package/src/__tests__/reflection-fallback-inspection.unit.test.ts +77 -0
- package/src/__tests__/reflection-fallback-lifecycle.integration.test.ts +21 -0
- package/src/__tests__/reflection-fallback-projection.unit.test.ts +90 -0
- package/src/__tests__/reflection-fallback-source.unit.test.ts +32 -0
- package/src/__tests__/reflection-probe-owner-placement.unit.test.ts +39 -0
- package/src/__tests__/reflection-probe-record-owner.characterization.unit.test.ts +120 -0
- package/src/__tests__/render-error-code-owner.test-d.ts +1 -0
- package/src/__tests__/render-feature-docs.unit.test.ts +12 -7
- package/src/__tests__/render-graph-fallback.integration.test.ts +24 -0
- package/src/__tests__/render-perf/extended-lighting.bench.test.ts +66 -0
- package/src/__tests__/render-scene-projection.unit.test.ts +447 -18
- package/src/__tests__/renderer-factory-material-contract.unit.test.ts +76 -0
- package/src/__tests__/skin-motion-regression.unit.test.ts +22 -0
- package/src/__tests__/skinned-shadow-caster.test.ts +2 -2
- package/src/__tests__/spot-modifier-projection.unit.test.ts +70 -0
- package/src/__tests__/ssr-admission-matrix.integration.test.ts +206 -0
- package/src/__tests__/ssr-composition.unit.test.ts +46 -0
- package/src/__tests__/ssr-fallback-zero-work.bench.test.ts +94 -0
- package/src/__tests__/ssr-recovery-errors.unit.test.ts +58 -0
- package/src/__tests__/standard-cluster-variant-resolution.unit.test.ts +67 -0
- package/src/__tests__/standard-clustered-pipeline.unit.test.ts +7 -0
- package/src/__tests__/standard-lighting-inspection.integration.test.ts +1 -1
- package/src/__tests__/standard-lighting-write.unit.test.ts +66 -2
- package/src/__tests__/temporal-fallback-generation.integration.test.ts +16 -0
- package/src/__tests__/temporal-view.unit.test.ts +3 -3
- package/src/__tests__/transmission-prewarm.unit.test.ts +69 -0
- package/src/__tests__/visibility-budget.integration.test.ts +140 -0
- package/src/__tests__/visibility-budget.unit.test.ts +70 -0
- package/src/__tests__/visibility-extract.integration.test.ts +11 -6
- package/src/__tests__/volumetric-fog-point-spot-accumulation.integration.test.ts +6 -3
- package/src/__tests__/volumetric-fog-stage-readback.dawn.test.ts +31 -28
- package/src/assembly/backend-contract.ts +13 -0
- package/src/assembly/device-feature-admission.ts +16 -9
- package/src/assembly/factory.ts +547 -93
- package/src/assembly/host-contract.ts +10 -0
- package/src/cluster-binner.ts +31 -0
- package/src/components/__tests__/lighting-authoring.unit.test.ts +39 -0
- package/src/components/__tests__/rect-area-light.unit.test.ts +33 -0
- package/src/components/index.ts +3 -0
- package/src/components/light-helpers.ts +52 -1
- package/src/components/light-probe.ts +13 -0
- package/src/components/rect-area-light.ts +15 -0
- package/src/components/scene-instance.ts +6 -0
- package/src/components/spot-light.ts +3 -0
- package/src/device/__tests__/extended-lighting-recovery.unit.test.ts +24 -0
- package/src/device/gpu-residency.ts +140 -9
- package/src/device/lifecycle-transaction.ts +12 -0
- package/src/environment/lifecycle.ts +8 -1
- package/src/errors/gpu-driven.ts +92 -0
- package/src/errors/index.ts +1 -0
- package/src/errors/recover.ts +32 -0
- package/src/errors/render.ts +55 -1
- package/src/extract/camera.ts +3 -3
- package/src/extract/gpu-driven.ts +108 -0
- package/src/extract/visibility.ts +0 -23
- package/src/gpu-driven/batch-topology.ts +206 -28
- package/src/gpu-driven/prepared-draw.ts +208 -0
- package/src/gpu-driven/production-raster.ts +953 -41
- package/src/gpu-driven/view-gpu.ts +411 -29
- package/src/gpu-scene-schema.ts +13 -0
- package/src/gpu-scene.ts +134 -65
- package/src/gpu-usage.ts +0 -1
- package/src/hdrp-buffers.ts +6 -6
- package/src/index.ts +74 -0
- package/src/inspection-types.ts +220 -1
- package/src/internal.ts +38 -0
- package/src/light-buffer-layout.ts +154 -324
- package/src/materials.ts +16 -2
- package/src/pbr-pipeline.ts +151 -45
- package/src/pipeline/standard-forward-lane.ts +47 -0
- package/src/pipeline/standard-lighting/graph.ts +2 -1
- package/src/pipeline/standard-lighting/light-frame.ts +3 -2
- package/src/pipeline/standard-lighting/topology.ts +1 -1
- package/src/pipeline/standard-lighting/transport.ts +2 -1
- package/src/pipeline/standard-pipeline.ts +2 -0
- package/src/pipeline-builder.ts +5 -2
- package/src/pipeline-spec.ts +12 -1
- package/src/plugin.ts +4 -0
- package/src/prepare/__tests__/extended-lighting-capability.unit.test.ts +56 -0
- package/src/prepare/extended-lighting/ltc-resources.ts +136 -0
- package/src/prepare/extended-lighting/resources.ts +389 -0
- package/src/prepare/extended-lighting/spot-modifiers.ts +194 -0
- package/src/prepare/extended-lighting/state.ts +92 -0
- package/src/record/__tests__/gpu-timing.unit.test.ts +177 -0
- package/src/record/__tests__/temporal-payload.unit.test.ts +23 -1
- package/src/record/__tests__/typed-frame-graph-plan.unit.test.ts +20 -1
- package/src/record/frame-lighting.ts +252 -53
- package/src/record/frame-snapshot.ts +57 -12
- package/src/record/frame.ts +410 -93
- package/src/record/gpu-timing.ts +108 -44
- package/src/record/helpers.ts +0 -58
- package/src/record/main-pass-geometry.ts +204 -39
- package/src/record/main-pass-material.ts +8 -1
- package/src/record/main-pass-sprite-draws.ts +52 -85
- package/src/record/mesh-ssbo.ts +47 -36
- package/src/record/render-context.ts +65 -4
- package/src/record/shadow-pass.ts +66 -40
- package/src/record/typed-frame-graph.ts +225 -83
- package/src/record/view-ubo.ts +14 -24
- package/src/reflection/inspection.ts +67 -0
- package/src/reflection/projection.ts +196 -1
- package/src/reflection/record-owner.ts +1283 -0
- package/src/render-contract.ts +17 -5
- package/src/render-pipeline.ts +5 -0
- package/src/render-system-extract.ts +493 -134
- package/src/render-system.ts +811 -615
- package/src/scene/__tests__/changed-block-summary.candidate.test.ts +36 -0
- package/src/scene/probe-blend-record.ts +54 -0
- package/src/scene/probe-blend.ts +813 -0
- package/src/scene/render-scene-types.ts +0 -7
- package/src/scene/render-scene.ts +848 -183
- package/src/scene/visibility/bounds.ts +57 -0
- package/src/scene/visibility/budget.ts +40 -0
- package/src/scene/visibility/facet.ts +400 -0
- package/src/scene/visibility/gpu-frame-timing.ts +101 -0
- package/src/scene/visibility/gpu-lod.ts +119 -0
- package/src/scene/visibility/inspection.ts +313 -0
- package/src/scene/visibility/lod-selector.ts +84 -0
- package/src/scene/visibility/occlusion-confidence.ts +478 -0
- package/src/scene/visibility/occlusion-pass.ts +165 -0
- package/src/scene/visibility/occlusion-query-pool.ts +178 -0
- package/src/scene/visibility/occlusion-runtime.ts +672 -0
- package/src/scene/visibility/types.ts +50 -0
- package/src/ssr/admission.ts +451 -0
- package/src/ssr/composition.ts +73 -0
- package/src/ssr/errors.ts +76 -0
- package/src/ssr/identity.ts +12 -0
- package/src/systems/skin-palette-allocator.ts +1 -1
- package/src/temporal/frame-coordinator.ts +26 -0
- package/src/temporal/frame.ts +14 -1
- package/src/temporal/view.ts +11 -0
- package/src/tilemap-chunk-extract-system.ts +4 -4
- package/src/typed-render-graph-primitives.ts +48 -0
- package/src/volume/passes.ts +46 -49
- package/dist/.tsbuildinfo +0 -1
- package/dist/chunk-5YADUCA7.mjs.map +0 -1
- package/dist/chunk-6OPXDQ2E.mjs.map +0 -1
- package/dist/chunk-BXBQQKFQ.mjs +0 -67
- package/dist/chunk-BXBQQKFQ.mjs.map +0 -1
- package/dist/chunk-FS2KNUQH.mjs.map +0 -1
- package/dist/chunk-PCHBPYML.mjs.map +0 -1
- package/dist/chunk-VFPLTKCU.mjs.map +0 -1
package/src/record/mesh-ssbo.ts
CHANGED
|
@@ -325,6 +325,8 @@ export function isMeshSsboDevMode(): boolean {
|
|
|
325
325
|
* @internal
|
|
326
326
|
*/
|
|
327
327
|
let _meshSsboScratch = new Uint8Array(0);
|
|
328
|
+
/** @internal */
|
|
329
|
+
let _meshSsboScratchFloats = new Float32Array(0);
|
|
328
330
|
|
|
329
331
|
/**
|
|
330
332
|
* feat-20260704 M3/w21: per-renderable `entity_world` upload (batched). All N
|
|
@@ -358,60 +360,69 @@ export function uploadMeshSsboBatch(
|
|
|
358
360
|
// Grow the module-scoped scratch monotonically; zero the used range.
|
|
359
361
|
if (_meshSsboScratch.length < neededBytes) {
|
|
360
362
|
_meshSsboScratch = new Uint8Array(neededBytes);
|
|
363
|
+
_meshSsboScratchFloats = new Float32Array(_meshSsboScratch.buffer);
|
|
361
364
|
} else {
|
|
362
365
|
_meshSsboScratch.fill(0, 0, neededBytes);
|
|
363
366
|
}
|
|
364
367
|
const normalMatrixScratch = mat3.create();
|
|
368
|
+
const strideFloats = MESH_PER_ENTITY_STRIDE / Float32Array.BYTES_PER_ELEMENT;
|
|
365
369
|
for (let i = 0; i < slotCount; i++) {
|
|
366
370
|
const entry = validatedOrdered[i];
|
|
367
371
|
if (entry === undefined) continue;
|
|
368
|
-
//
|
|
369
|
-
//
|
|
370
|
-
//
|
|
371
|
-
|
|
372
|
-
const slot = new Float32Array(_meshSsboScratch.buffer, i * MESH_PER_ENTITY_STRIDE, 48);
|
|
372
|
+
// Address the reusable flat view directly. Constructing one typed-array
|
|
373
|
+
// wrapper per visible entity made this otherwise contiguous upload create
|
|
374
|
+
// tens of thousands of short-lived JS objects every frame.
|
|
375
|
+
const slot = i * strideFloats;
|
|
373
376
|
const isFoldHead = foldDispatchPlan?.headBuckets.has(i) === true;
|
|
374
377
|
if (isFoldHead) {
|
|
375
378
|
// identity mat4
|
|
376
|
-
slot
|
|
377
|
-
slot
|
|
378
|
-
slot
|
|
379
|
-
slot
|
|
379
|
+
_meshSsboScratchFloats[slot] = 1;
|
|
380
|
+
_meshSsboScratchFloats[slot + 5] = 1;
|
|
381
|
+
_meshSsboScratchFloats[slot + 10] = 1;
|
|
382
|
+
_meshSsboScratchFloats[slot + 15] = 1;
|
|
380
383
|
// identity mat3 normal (cols at slot offsets 16/20/24)
|
|
381
|
-
slot
|
|
382
|
-
slot
|
|
383
|
-
slot
|
|
384
|
+
_meshSsboScratchFloats[slot + 16] = 1;
|
|
385
|
+
_meshSsboScratchFloats[slot + 20] = 1;
|
|
386
|
+
_meshSsboScratchFloats[slot + 24] = 1;
|
|
384
387
|
// Fold heads use the instance storage path; keep the mesh temporal
|
|
385
388
|
// fields deterministic for shader variants that still read the slot.
|
|
386
|
-
slot
|
|
387
|
-
slot
|
|
388
|
-
slot
|
|
389
|
-
slot
|
|
390
|
-
slot
|
|
389
|
+
_meshSsboScratchFloats[slot + 28] = 1;
|
|
390
|
+
_meshSsboScratchFloats[slot + 33] = 1;
|
|
391
|
+
_meshSsboScratchFloats[slot + 38] = 1;
|
|
392
|
+
_meshSsboScratchFloats[slot + 43] = 1;
|
|
393
|
+
_meshSsboScratchFloats[slot + 44] = 1;
|
|
391
394
|
} else {
|
|
392
395
|
const worldFromLocal = entry.source.transform.world;
|
|
393
|
-
for (let k = 0; k < 16; k++) slot
|
|
396
|
+
for (let k = 0; k < 16; k++) _meshSsboScratchFloats[slot + k] = worldFromLocal[k] ?? 0;
|
|
394
397
|
const normal = mat3.normalMatrix(normalMatrixScratch, worldFromLocal);
|
|
395
|
-
slot
|
|
396
|
-
slot
|
|
397
|
-
slot
|
|
398
|
-
slot
|
|
399
|
-
slot
|
|
400
|
-
slot
|
|
401
|
-
slot
|
|
402
|
-
slot
|
|
403
|
-
slot
|
|
398
|
+
_meshSsboScratchFloats[slot + 16] = normal[0] ?? 0;
|
|
399
|
+
_meshSsboScratchFloats[slot + 17] = normal[1] ?? 0;
|
|
400
|
+
_meshSsboScratchFloats[slot + 18] = normal[2] ?? 0;
|
|
401
|
+
_meshSsboScratchFloats[slot + 20] = normal[3] ?? 0;
|
|
402
|
+
_meshSsboScratchFloats[slot + 21] = normal[4] ?? 0;
|
|
403
|
+
_meshSsboScratchFloats[slot + 22] = normal[5] ?? 0;
|
|
404
|
+
_meshSsboScratchFloats[slot + 24] = normal[6] ?? 0;
|
|
405
|
+
_meshSsboScratchFloats[slot + 25] = normal[7] ?? 0;
|
|
406
|
+
_meshSsboScratchFloats[slot + 26] = normal[8] ?? 0;
|
|
404
407
|
const previousWorld = entry.source.temporal?.previousTransform.world ?? worldFromLocal;
|
|
405
|
-
for (let k = 0; k < 16; k++)
|
|
406
|
-
|
|
407
|
-
|
|
408
|
+
for (let k = 0; k < 16; k++) {
|
|
409
|
+
_meshSsboScratchFloats[slot + 28 + k] = previousWorld[k] ?? 0;
|
|
410
|
+
}
|
|
411
|
+
let reactiveMaterial = false;
|
|
412
|
+
for (const material of entry.source.materials) {
|
|
413
|
+
const shader = material.materialShaderId;
|
|
414
|
+
if (
|
|
408
415
|
material.transparent === true ||
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
(
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
416
|
+
shader === 'forgeax::sprite' ||
|
|
417
|
+
shader === 'forgeax::sprite-lit' ||
|
|
418
|
+
(shader !== undefined && !shader.startsWith('forgeax::'))
|
|
419
|
+
) {
|
|
420
|
+
reactiveMaterial = true;
|
|
421
|
+
break;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
_meshSsboScratchFloats[slot + 44] =
|
|
425
|
+
entry.source.temporal?.reactive === true || reactiveMaterial ? 1 : 0;
|
|
415
426
|
}
|
|
416
427
|
}
|
|
417
428
|
if (neededBytes > 0) {
|
|
@@ -20,7 +20,7 @@ import type {
|
|
|
20
20
|
TextureView,
|
|
21
21
|
} from '@forgeax/engine-rhi';
|
|
22
22
|
import { err, ok, RhiError } from '@forgeax/engine-rhi';
|
|
23
|
-
import type { MaterialRuntimeArtifact } from '@forgeax/engine-shader';
|
|
23
|
+
import type { MaterialRuntimeArtifact, MaterialShaderArtifact } from '@forgeax/engine-shader';
|
|
24
24
|
import type {
|
|
25
25
|
MaterialRenderState,
|
|
26
26
|
ParamSchemaEntry,
|
|
@@ -50,6 +50,7 @@ import type { PointsLinesInspection } from '../points-lines/inspection';
|
|
|
50
50
|
import type { PointsLinesRecordPlan } from '../points-lines/record';
|
|
51
51
|
import type { ReflectionProbeTable } from '../reflection/gpu-table';
|
|
52
52
|
import type { ReflectionProbeSelectionResult } from '../reflection/projection';
|
|
53
|
+
import type { SsrAdmissionIdentity } from '../ssr/identity';
|
|
53
54
|
import type { GpuPassTimingReason } from './gpu-pass-timing/errors';
|
|
54
55
|
import type {
|
|
55
56
|
GpuPassTimingCapture,
|
|
@@ -68,7 +69,33 @@ export interface ReflectionProbeRecordState {
|
|
|
68
69
|
readonly table: ReflectionProbeTable;
|
|
69
70
|
readonly selections: ReadonlyMap<string, ReflectionProbeSelectionResult>;
|
|
70
71
|
readonly graph: import('./typed-frame-graph').ReflectionProbeGraphState;
|
|
71
|
-
|
|
72
|
+
/** Detached committed fallback projections joined by main-pass renderable key. */
|
|
73
|
+
readonly fallbackProjections?: ReadonlyMap<
|
|
74
|
+
string,
|
|
75
|
+
import('../inspection-types').ReflectionFallbackReceipt
|
|
76
|
+
>;
|
|
77
|
+
/** Demand is derived from this frame's renderable/source selection. */
|
|
78
|
+
readonly fallbackDemand?: boolean;
|
|
79
|
+
/** True when at least one selected row must prove a non-zero readback. */
|
|
80
|
+
readonly fallbackHasNonNeutral?: boolean;
|
|
81
|
+
readonly completeSubmission: (
|
|
82
|
+
submitted: boolean,
|
|
83
|
+
completed?: Promise<unknown>,
|
|
84
|
+
fallbackOutput?: {
|
|
85
|
+
readonly format: TextureFormat;
|
|
86
|
+
readonly size: { readonly width: number; readonly height: number };
|
|
87
|
+
readonly frameId: number;
|
|
88
|
+
readonly graphGeneration: number;
|
|
89
|
+
readonly textureIdentity: number;
|
|
90
|
+
readonly readback?: Promise<{
|
|
91
|
+
readonly linearHdr: readonly [number, number, number, number];
|
|
92
|
+
readonly hash: string;
|
|
93
|
+
readonly graphGeneration: number;
|
|
94
|
+
readonly textureIdentity: number;
|
|
95
|
+
}>;
|
|
96
|
+
},
|
|
97
|
+
fallbackRequested?: boolean,
|
|
98
|
+
) => Promise<void>;
|
|
72
99
|
}
|
|
73
100
|
|
|
74
101
|
export interface MaterialShaderPipelineEntry {
|
|
@@ -103,12 +130,18 @@ import type { FoldDispatchPlan } from './mesh-ssbo';
|
|
|
103
130
|
|
|
104
131
|
export interface RenderSystemRuntime {
|
|
105
132
|
readonly device: RhiDevice;
|
|
133
|
+
/** Internal backend-fixture hook evaluated at the submit transaction edge. */
|
|
134
|
+
readonly beforeSubmit?: ((device: RhiDevice) => RhiError | undefined) | undefined;
|
|
106
135
|
readonly deviceScope: DeviceScope;
|
|
107
136
|
readonly errorRegistry: RhiErrorListenerRegistry;
|
|
108
137
|
readonly debugOverlay?: RenderDebugOverlay | undefined;
|
|
109
138
|
readonly healthRegistry: HealthListenerRegistry;
|
|
110
139
|
readonly getMaterialProjection?: (materialGuid: string) => MaterialRenderProjection | undefined;
|
|
111
140
|
readonly getMaterialArtifact?: (specializationKey: string) => MaterialRuntimeArtifact | undefined;
|
|
141
|
+
/** Producer-owned cooked Standard PBR artifact used by GPU-driven projection. */
|
|
142
|
+
readonly getMaterialShaderArtifact?: (
|
|
143
|
+
materialShaderId: string,
|
|
144
|
+
) => MaterialShaderArtifact | undefined;
|
|
112
145
|
readonly getMaterialShaderPipeline?: (
|
|
113
146
|
materialShaderId: string,
|
|
114
147
|
isHdr: boolean,
|
|
@@ -126,6 +159,7 @@ export interface RenderSystemRuntime {
|
|
|
126
159
|
vertexLayoutProjection?: VertexLayoutProjection,
|
|
127
160
|
shaderModuleMode?: RenderFeatureShaderModuleMode,
|
|
128
161
|
layoutKindOverride?: 'pbr' | 'pbr-skin',
|
|
162
|
+
additionalColorFormats?: readonly GPUTextureFormat[],
|
|
129
163
|
) => RhiRenderPipeline | null;
|
|
130
164
|
readonly getMaterialShaderPipelineEntry?: (
|
|
131
165
|
materialShaderId: string,
|
|
@@ -143,6 +177,8 @@ export interface RenderSystemRuntime {
|
|
|
143
177
|
vertexLayout?: string,
|
|
144
178
|
vertexLayoutProjection?: VertexLayoutProjection,
|
|
145
179
|
shaderModuleMode?: RenderFeatureShaderModuleMode,
|
|
180
|
+
layoutKindOverride?: 'pbr' | 'pbr-skin',
|
|
181
|
+
additionalColorFormats?: readonly GPUTextureFormat[],
|
|
146
182
|
) => MaterialShaderPipelineEntry | null;
|
|
147
183
|
readonly getMaterialShaderBindingContract?: (
|
|
148
184
|
materialShaderId: string,
|
|
@@ -295,9 +331,9 @@ export interface PipelineState {
|
|
|
295
331
|
readonly shadowCasterCascadeBuffer: Buffer;
|
|
296
332
|
readonly materialUniformBuffer: { readonly buffer: Buffer; readonly sizeInBytes: number };
|
|
297
333
|
readonly meshStorageBuffer: { readonly buffer: Buffer; readonly sizeInBytes: number };
|
|
298
|
-
readonly pointLightsBuffer: Buffer;
|
|
299
|
-
readonly spotLightsBuffer: Buffer;
|
|
300
334
|
readonly instancesBindGroupLayout: BindGroupLayout;
|
|
335
|
+
/** Probe-enabled slot-3 layout; omitted from no-probe bind groups. */
|
|
336
|
+
readonly probeInstancesBindGroupLayout?: BindGroupLayout;
|
|
301
337
|
readonly identityInstanceBuffer: Buffer;
|
|
302
338
|
readonly defaultSampler: Sampler;
|
|
303
339
|
readonly nearestSampler: Sampler;
|
|
@@ -307,10 +343,13 @@ export interface PipelineState {
|
|
|
307
343
|
readonly unlitPipelineMsaa: RhiRenderPipeline | null;
|
|
308
344
|
readonly unlitPipelineHdrMsaa: RhiRenderPipeline | null;
|
|
309
345
|
readonly pbrPipelineLayout: PipelineLayout | null;
|
|
346
|
+
readonly pbrProbePipelineLayout?: PipelineLayout | null;
|
|
310
347
|
readonly hdrpPbrPipelineLayout: PipelineLayout | null;
|
|
348
|
+
readonly hdrpProbePbrPipelineLayout?: PipelineLayout | null;
|
|
311
349
|
readonly hdrpClusterMembershipPipeline: ComputePipeline | null;
|
|
312
350
|
readonly hdrpClusterMembershipBindGroupLayout: BindGroupLayout | null;
|
|
313
351
|
readonly pbrSkinPipelineLayout: PipelineLayout | null;
|
|
352
|
+
readonly pbrSkinProbePipelineLayout?: PipelineLayout | null;
|
|
314
353
|
readonly pbrSkinMeshBindGroupLayout: BindGroupLayout | null;
|
|
315
354
|
readonly hdrpSkinPipelineLayout: PipelineLayout | null;
|
|
316
355
|
readonly hdrpSkinMeshBindGroupLayout: BindGroupLayout | null;
|
|
@@ -320,6 +359,19 @@ export interface PipelineState {
|
|
|
320
359
|
readonly unlitPipelineHdr: RhiRenderPipeline | null;
|
|
321
360
|
readonly shadowFallbackTextureView: TextureView;
|
|
322
361
|
readonly shadowAtlasFallbackTextureView: TextureView;
|
|
362
|
+
readonly extendedLightingAvailable?: boolean;
|
|
363
|
+
readonly iesProfileTexture?: Texture;
|
|
364
|
+
readonly cookieTexture?: Texture;
|
|
365
|
+
readonly cookieMatrixBuffer?: Buffer;
|
|
366
|
+
spotModifierUploadState?: {
|
|
367
|
+
readonly ies: Map<number, number>;
|
|
368
|
+
readonly cookie: Map<number, number>;
|
|
369
|
+
readonly cookieMatrix: Map<number, number>;
|
|
370
|
+
};
|
|
371
|
+
readonly iesProfileTextureView?: TextureView;
|
|
372
|
+
readonly cookieTextureView?: TextureView;
|
|
373
|
+
readonly ltcLambertTextureView?: TextureView;
|
|
374
|
+
readonly ltcGgxTextureView?: TextureView;
|
|
323
375
|
readonly shadowParamsBuffer: Buffer;
|
|
324
376
|
readonly skylightFallback: SkylightFallback | null;
|
|
325
377
|
readonly perPassResources: PerPassResources;
|
|
@@ -327,6 +379,10 @@ export interface PipelineState {
|
|
|
327
379
|
|
|
328
380
|
export interface RenderSystemInternals extends RenderSystemRuntime {
|
|
329
381
|
readonly canvas: HTMLCanvasElement | OffscreenCanvas;
|
|
382
|
+
/** Build identity injected by the host's build-tool adapter. */
|
|
383
|
+
readonly build?: string | undefined;
|
|
384
|
+
/** Host identity binding for the renderer-owned SSR dependency seam. */
|
|
385
|
+
readonly ssrIdentity?: SsrAdmissionIdentity | undefined;
|
|
330
386
|
readonly standardProfile?: StandardProfile | undefined;
|
|
331
387
|
readonly standardPipeline: RenderFrameState['activePipeline'];
|
|
332
388
|
readonly featureHost?: RenderFeatureHost | undefined;
|
|
@@ -398,6 +454,8 @@ export interface _StandardForwardSceneView {
|
|
|
398
454
|
readonly directionalShadowCacheReuse: boolean;
|
|
399
455
|
readonly world: World;
|
|
400
456
|
readonly gpuDrivenEntityKeys: ReadonlySet<number>;
|
|
457
|
+
/** Renderer-local world namespace paired with gpuDrivenEntityKeys. */
|
|
458
|
+
readonly gpuDrivenWorldKeys?: readonly number[];
|
|
401
459
|
readonly tonemapActive: boolean;
|
|
402
460
|
readonly geometryColorView: TextureView | null;
|
|
403
461
|
readonly geometryDepthView: TextureView | null;
|
|
@@ -406,6 +464,8 @@ export interface _StandardForwardSceneView {
|
|
|
406
464
|
readonly splitLdrSprite: boolean;
|
|
407
465
|
readonly ldrSpritePassView: TextureView | null;
|
|
408
466
|
readonly transparentColorFormat?: GPUTextureFormat;
|
|
467
|
+
/** Second Standard main-pass attachment used by the fallback producer. */
|
|
468
|
+
readonly reflectionFallbackColorFormat?: GPUTextureFormat;
|
|
409
469
|
readonly dispatch: readonly DispatchEntry[];
|
|
410
470
|
readonly hdrpClusterBindGroup: BindGroup | null;
|
|
411
471
|
readonly hdrpClusterMembershipBindGroup: BindGroup | null;
|
|
@@ -425,6 +485,7 @@ export interface _StandardForwardSceneView {
|
|
|
425
485
|
readonly payload: Uint8Array;
|
|
426
486
|
};
|
|
427
487
|
hdrpSsaoBlurredView?: TextureView;
|
|
488
|
+
readonly occlusion?: import('../scene/visibility/occlusion-runtime').OcclusionFrameProjection;
|
|
428
489
|
}
|
|
429
490
|
|
|
430
491
|
export type _InternalRenderPipelineContext = RenderPipelineContext & _StandardForwardSceneView;
|
|
@@ -23,12 +23,13 @@ import {
|
|
|
23
23
|
SHADOW_CASTER_SHADER_ID,
|
|
24
24
|
shadowCasterVariantSet,
|
|
25
25
|
} from '../pbr-pipeline';
|
|
26
|
+
import { COOKIE_MATRIX_BYTES } from '../prepare/extended-lighting/resources';
|
|
26
27
|
import type { DispatchEntry, ExtractedLights } from '../render-system-extract';
|
|
27
28
|
import { matchPass } from '../systems/pass-selector';
|
|
28
29
|
import { worldEntityKey } from './frame-snapshot';
|
|
30
|
+
import { resolveGeometryInstancesBindGroup } from './main-pass-geometry';
|
|
29
31
|
import {
|
|
30
32
|
getOrCreateFromChain,
|
|
31
|
-
getOrCreatePerEntity,
|
|
32
33
|
MAX_UNIFORM_INSTANCES,
|
|
33
34
|
MESH_PER_ENTITY_STRIDE,
|
|
34
35
|
MESH_SSBO_BYTES,
|
|
@@ -83,23 +84,79 @@ function ensureTypedShadowViewBg(
|
|
|
83
84
|
const { runtime, frameState, pipelineState } = c;
|
|
84
85
|
const shadowSampler = pipelineState.perPassResources.shadowSampler;
|
|
85
86
|
if (shadowSampler === null) return null;
|
|
87
|
+
const extendedLighting = pipelineState.extendedLightingAvailable ?? false;
|
|
88
|
+
const iesProfileTextureView = pipelineState.iesProfileTextureView;
|
|
89
|
+
const cookieTextureView = pipelineState.cookieTextureView;
|
|
90
|
+
const cookieMatrixBuffer = pipelineState.cookieMatrixBuffer;
|
|
91
|
+
const ltcLambertTextureView = pipelineState.ltcLambertTextureView;
|
|
92
|
+
const ltcGgxTextureView = pipelineState.ltcGgxTextureView;
|
|
93
|
+
const extendedLightingCacheKeys: object[] = [];
|
|
94
|
+
const extendedLightingEntries: BindGroupEntry[] = [];
|
|
95
|
+
if (extendedLighting) {
|
|
96
|
+
if (
|
|
97
|
+
iesProfileTextureView === undefined ||
|
|
98
|
+
cookieTextureView === undefined ||
|
|
99
|
+
cookieMatrixBuffer === undefined ||
|
|
100
|
+
ltcLambertTextureView === undefined ||
|
|
101
|
+
ltcGgxTextureView === undefined
|
|
102
|
+
) {
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
extendedLightingCacheKeys.push(
|
|
106
|
+
pipelineState.defaultSampler,
|
|
107
|
+
iesProfileTextureView,
|
|
108
|
+
cookieTextureView,
|
|
109
|
+
ltcLambertTextureView,
|
|
110
|
+
ltcGgxTextureView,
|
|
111
|
+
cookieMatrixBuffer,
|
|
112
|
+
);
|
|
113
|
+
extendedLightingEntries.push(
|
|
114
|
+
{
|
|
115
|
+
binding: 9,
|
|
116
|
+
resource: { kind: 'sampler', value: pipelineState.defaultSampler },
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
binding: 11,
|
|
120
|
+
resource: { kind: 'textureView', value: iesProfileTextureView },
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
binding: 12,
|
|
124
|
+
resource: { kind: 'textureView', value: cookieTextureView },
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
binding: 13,
|
|
128
|
+
resource: { kind: 'textureView', value: ltcLambertTextureView },
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
binding: 14,
|
|
132
|
+
resource: { kind: 'textureView', value: ltcGgxTextureView },
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
binding: 15,
|
|
136
|
+
resource: {
|
|
137
|
+
kind: 'buffer',
|
|
138
|
+
value: { buffer: cookieMatrixBuffer, size: COOKIE_MATRIX_BYTES },
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
);
|
|
142
|
+
}
|
|
86
143
|
const projectorAvailable = pipelineState.projectorAvailable !== false;
|
|
87
144
|
try {
|
|
88
145
|
return getOrCreateFromChain(
|
|
89
146
|
frameState.viewBindGroupCache,
|
|
90
147
|
[
|
|
91
148
|
pipelineState.viewUniformBuffer,
|
|
92
|
-
pipelineState.pointLightsBuffer,
|
|
93
|
-
pipelineState.spotLightsBuffer,
|
|
94
149
|
pipelineState.shadowFallbackTextureView,
|
|
95
150
|
shadowSampler,
|
|
96
151
|
pipelineState.shadowAtlasFallbackTextureView,
|
|
97
152
|
pipelineState.shadowParamsBuffer,
|
|
98
153
|
pipelineState.shadowCasterCascadeBuffer,
|
|
99
154
|
pipelineState.shadowFallbackTextureView,
|
|
100
|
-
...(
|
|
101
|
-
?
|
|
102
|
-
:
|
|
155
|
+
...(extendedLighting
|
|
156
|
+
? extendedLightingCacheKeys
|
|
157
|
+
: projectorAvailable
|
|
158
|
+
? [pipelineState.defaultWhiteTextureView, pipelineState.defaultSampler]
|
|
159
|
+
: []),
|
|
103
160
|
pipelineState.pointsLinesViewBuffer ?? pipelineState.viewUniformBuffer,
|
|
104
161
|
],
|
|
105
162
|
variant,
|
|
@@ -119,14 +176,6 @@ function ensureTypedShadowViewBg(
|
|
|
119
176
|
},
|
|
120
177
|
},
|
|
121
178
|
},
|
|
122
|
-
{
|
|
123
|
-
binding: 1,
|
|
124
|
-
resource: { kind: 'buffer', value: { buffer: pipelineState.pointLightsBuffer } },
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
binding: 2,
|
|
128
|
-
resource: { kind: 'buffer', value: { buffer: pipelineState.spotLightsBuffer } },
|
|
129
|
-
},
|
|
130
179
|
{
|
|
131
180
|
binding: 3,
|
|
132
181
|
resource: { kind: 'textureView', value: pipelineState.shadowFallbackTextureView },
|
|
@@ -161,6 +210,7 @@ function ensureTypedShadowViewBg(
|
|
|
161
210
|
binding: 8,
|
|
162
211
|
resource: { kind: 'textureView', value: pipelineState.shadowFallbackTextureView },
|
|
163
212
|
},
|
|
213
|
+
...extendedLightingEntries,
|
|
164
214
|
{
|
|
165
215
|
binding: 10,
|
|
166
216
|
resource: {
|
|
@@ -171,7 +221,7 @@ function ensureTypedShadowViewBg(
|
|
|
171
221
|
},
|
|
172
222
|
},
|
|
173
223
|
},
|
|
174
|
-
...(projectorAvailable
|
|
224
|
+
...(!extendedLighting && projectorAvailable
|
|
175
225
|
? [
|
|
176
226
|
{
|
|
177
227
|
binding: 11,
|
|
@@ -671,31 +721,7 @@ function recordShadowCasterDraws(
|
|
|
671
721
|
// handle = shadowInstanceBuffer; the HDRP main pass read end (:3820 below)
|
|
672
722
|
// must look up the same (compositeKey, instBuffer) leaf or the shadow
|
|
673
723
|
// instances silently drop.
|
|
674
|
-
const shadowInstancesBg =
|
|
675
|
-
c.frameState.instancesBgPerEntity,
|
|
676
|
-
worldEntityKey(entry.source.worldId, entry.source.entityKey),
|
|
677
|
-
[shadowInstanceBuffer],
|
|
678
|
-
'shadow-instances',
|
|
679
|
-
() => {
|
|
680
|
-
const result = runtime.device.createBindGroup({
|
|
681
|
-
label: 'shadow-instances-bg',
|
|
682
|
-
layout: pipelineState.instancesBindGroupLayout,
|
|
683
|
-
entries: [
|
|
684
|
-
{
|
|
685
|
-
binding: 0,
|
|
686
|
-
resource: {
|
|
687
|
-
kind: 'buffer',
|
|
688
|
-
value: { buffer: shadowInstanceBuffer },
|
|
689
|
-
},
|
|
690
|
-
},
|
|
691
|
-
],
|
|
692
|
-
});
|
|
693
|
-
if (!result.ok) throw result.error;
|
|
694
|
-
return result.value;
|
|
695
|
-
},
|
|
696
|
-
c.bindGroupCounts,
|
|
697
|
-
);
|
|
698
|
-
|
|
724
|
+
const shadowInstancesBg = resolveGeometryInstancesBindGroup(c, shadowInstanceBuffer);
|
|
699
725
|
shadowPass.setBindGroup(3, shadowInstancesBg);
|
|
700
726
|
// feat-20260608 M4 / w16: per-submesh shadow draw loop.
|
|
701
727
|
// Only draw submeshes whose topology is triangle-list or triangle-strip
|