@forgeax/engine-render 0.0.0-dev.8d955ade1c79
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/LICENSE +202 -0
- package/README.md +647 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/__tests__/authoring-path.unit.test.d.ts +2 -0
- package/dist/__tests__/authoring-path.unit.test.d.ts.map +1 -0
- package/dist/__tests__/backend-selection-rhi-capture.test-d.d.ts +2 -0
- package/dist/__tests__/backend-selection-rhi-capture.test-d.d.ts.map +1 -0
- package/dist/__tests__/callback-inference.test-d.d.ts +2 -0
- package/dist/__tests__/callback-inference.test-d.d.ts.map +1 -0
- package/dist/__tests__/cluster-binner.test.d.ts +2 -0
- package/dist/__tests__/cluster-binner.test.d.ts.map +1 -0
- package/dist/__tests__/cluster-grid-default-surface.unit.test.d.ts +2 -0
- package/dist/__tests__/cluster-grid-default-surface.unit.test.d.ts.map +1 -0
- package/dist/__tests__/construct-renderer-identity.unit.test.d.ts +2 -0
- package/dist/__tests__/construct-renderer-identity.unit.test.d.ts.map +1 -0
- package/dist/__tests__/device-scope-lifecycle.unit.test.d.ts +2 -0
- package/dist/__tests__/device-scope-lifecycle.unit.test.d.ts.map +1 -0
- package/dist/__tests__/device-scope-stale-matrix.unit.test.d.ts +2 -0
- package/dist/__tests__/device-scope-stale-matrix.unit.test.d.ts.map +1 -0
- package/dist/__tests__/direct-extract-consumer-contract.test-d.d.ts +2 -0
- package/dist/__tests__/direct-extract-consumer-contract.test-d.d.ts.map +1 -0
- package/dist/__tests__/direct-light-snapshot.unit.test.d.ts +2 -0
- package/dist/__tests__/direct-light-snapshot.unit.test.d.ts.map +1 -0
- package/dist/__tests__/factory-contract.integration.test.d.ts +2 -0
- package/dist/__tests__/factory-contract.integration.test.d.ts.map +1 -0
- package/dist/__tests__/fallback-row-stride-surface.unit.test.d.ts +2 -0
- package/dist/__tests__/fallback-row-stride-surface.unit.test.d.ts.map +1 -0
- package/dist/__tests__/frame-observation.contract.test.d.ts +2 -0
- package/dist/__tests__/frame-observation.contract.test.d.ts.map +1 -0
- package/dist/__tests__/fullscreen-feature-plan.unit.test.d.ts +2 -0
- package/dist/__tests__/fullscreen-feature-plan.unit.test.d.ts.map +1 -0
- package/dist/__tests__/glyph-text-layout-recovery.unit.test.d.ts +2 -0
- package/dist/__tests__/glyph-text-layout-recovery.unit.test.d.ts.map +1 -0
- package/dist/__tests__/gpu-driven-indirect-raster-evidence.d.ts +6 -0
- package/dist/__tests__/gpu-driven-indirect-raster-evidence.d.ts.map +1 -0
- package/dist/__tests__/gpu-driven-indirect-raster.browser.test.d.ts +2 -0
- package/dist/__tests__/gpu-driven-indirect-raster.browser.test.d.ts.map +1 -0
- package/dist/__tests__/gpu-driven-indirect-raster.dawn.test.d.ts +2 -0
- package/dist/__tests__/gpu-driven-indirect-raster.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/gpu-driven-production.integration.test.d.ts +2 -0
- package/dist/__tests__/gpu-driven-production.integration.test.d.ts.map +1 -0
- package/dist/__tests__/gpu-driven-scaling.unit.test.d.ts +2 -0
- package/dist/__tests__/gpu-driven-scaling.unit.test.d.ts.map +1 -0
- package/dist/__tests__/gpu-driven-view-gpu-evidence.d.ts +18 -0
- package/dist/__tests__/gpu-driven-view-gpu-evidence.d.ts.map +1 -0
- package/dist/__tests__/gpu-driven-view-graph.integration.test.d.ts +2 -0
- package/dist/__tests__/gpu-driven-view-graph.integration.test.d.ts.map +1 -0
- package/dist/__tests__/gpu-driven-view-reference.d.ts +15 -0
- package/dist/__tests__/gpu-driven-view-reference.d.ts.map +1 -0
- package/dist/__tests__/gpu-driven-view.browser.test.d.ts +2 -0
- package/dist/__tests__/gpu-driven-view.browser.test.d.ts.map +1 -0
- package/dist/__tests__/gpu-driven-view.dawn.test.d.ts +2 -0
- package/dist/__tests__/gpu-driven-view.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/gpu-driven-view.unit.test.d.ts +2 -0
- package/dist/__tests__/gpu-driven-view.unit.test.d.ts.map +1 -0
- package/dist/__tests__/gpu-resource-store-stride.unit.test.d.ts +2 -0
- package/dist/__tests__/gpu-resource-store-stride.unit.test.d.ts.map +1 -0
- package/dist/__tests__/gpu-scene-render-graph-gpu.d.ts +7 -0
- package/dist/__tests__/gpu-scene-render-graph-gpu.d.ts.map +1 -0
- package/dist/__tests__/gpu-scene-render-graph.browser.test.d.ts +2 -0
- package/dist/__tests__/gpu-scene-render-graph.browser.test.d.ts.map +1 -0
- package/dist/__tests__/gpu-scene-render-graph.dawn.test.d.ts +2 -0
- package/dist/__tests__/gpu-scene-render-graph.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/gpu-scene-schema.unit.test.d.ts +2 -0
- package/dist/__tests__/gpu-scene-schema.unit.test.d.ts.map +1 -0
- package/dist/__tests__/gpu-scene.dawn.test.d.ts +2 -0
- package/dist/__tests__/gpu-scene.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/gpu-scene.unit.test.d.ts +2 -0
- package/dist/__tests__/gpu-scene.unit.test.d.ts.map +1 -0
- package/dist/__tests__/ibl/face-uniforms.unit.test.d.ts +2 -0
- package/dist/__tests__/ibl/face-uniforms.unit.test.d.ts.map +1 -0
- package/dist/__tests__/infinite-grid-no-vertex-probe.unit.test.d.ts +2 -0
- package/dist/__tests__/infinite-grid-no-vertex-probe.unit.test.d.ts.map +1 -0
- package/dist/__tests__/injection-kind-owner.test-d.d.ts +2 -0
- package/dist/__tests__/injection-kind-owner.test-d.d.ts.map +1 -0
- package/dist/__tests__/ktx2-basis-gpu-consumer.dawn.test.d.ts +2 -0
- package/dist/__tests__/ktx2-basis-gpu-consumer.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/light-buffer-layout.unit.test.d.ts +2 -0
- package/dist/__tests__/light-buffer-layout.unit.test.d.ts.map +1 -0
- package/dist/__tests__/material-contract-inventory.unit.test.d.ts +2 -0
- package/dist/__tests__/material-contract-inventory.unit.test.d.ts.map +1 -0
- package/dist/__tests__/material-cooked-projection.unit.test.d.ts +2 -0
- package/dist/__tests__/material-cooked-projection.unit.test.d.ts.map +1 -0
- package/dist/__tests__/material-snapshot-mutation.integration.test.d.ts +2 -0
- package/dist/__tests__/material-snapshot-mutation.integration.test.d.ts.map +1 -0
- package/dist/__tests__/material-static-dynamic-route.unit.test.d.ts +2 -0
- package/dist/__tests__/material-static-dynamic-route.unit.test.d.ts.map +1 -0
- package/dist/__tests__/material-stride-surface.unit.test.d.ts +2 -0
- package/dist/__tests__/material-stride-surface.unit.test.d.ts.map +1 -0
- package/dist/__tests__/mesh-buffer-usage-surface.unit.test.d.ts +2 -0
- package/dist/__tests__/mesh-buffer-usage-surface.unit.test.d.ts.map +1 -0
- package/dist/__tests__/mesh-material-bindings.unit.test.d.ts +2 -0
- package/dist/__tests__/mesh-material-bindings.unit.test.d.ts.map +1 -0
- package/dist/__tests__/mesh-stride-surface.unit.test.d.ts +2 -0
- package/dist/__tests__/mesh-stride-surface.unit.test.d.ts.map +1 -0
- package/dist/__tests__/morph-culling-reentry.dawn.test.d.ts +2 -0
- package/dist/__tests__/morph-culling-reentry.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/morph-feature-gpu-work.integration.test.d.ts +2 -0
- package/dist/__tests__/morph-feature-gpu-work.integration.test.d.ts.map +1 -0
- package/dist/__tests__/morph-feature-plan.unit.test.d.ts +2 -0
- package/dist/__tests__/morph-feature-plan.unit.test.d.ts.map +1 -0
- package/dist/__tests__/morph-visual-evidence.integration.test.d.ts +2 -0
- package/dist/__tests__/morph-visual-evidence.integration.test.d.ts.map +1 -0
- package/dist/__tests__/nineslice-handle-surface.unit.test.d.ts +2 -0
- package/dist/__tests__/nineslice-handle-surface.unit.test.d.ts.map +1 -0
- package/dist/__tests__/post-process-error-policy-owner.unit.test.d.ts +2 -0
- package/dist/__tests__/post-process-error-policy-owner.unit.test.d.ts.map +1 -0
- package/dist/__tests__/prepared-buffer-kind-owner.test-d.d.ts +2 -0
- package/dist/__tests__/prepared-buffer-kind-owner.test-d.d.ts.map +1 -0
- package/dist/__tests__/prepared-graphics-capability.unit.test.d.ts +2 -0
- package/dist/__tests__/prepared-graphics-capability.unit.test.d.ts.map +1 -0
- package/dist/__tests__/prepared-graphics-generation.unit.test.d.ts +2 -0
- package/dist/__tests__/prepared-graphics-generation.unit.test.d.ts.map +1 -0
- package/dist/__tests__/prepared-graphics-lifecycle.unit.test.d.ts +2 -0
- package/dist/__tests__/prepared-graphics-lifecycle.unit.test.d.ts.map +1 -0
- package/dist/__tests__/prepared-graphics-pipeline-warmup.unit.test.d.ts +2 -0
- package/dist/__tests__/prepared-graphics-pipeline-warmup.unit.test.d.ts.map +1 -0
- package/dist/__tests__/prepared-graphics-resolver.unit.test.d.ts +2 -0
- package/dist/__tests__/prepared-graphics-resolver.unit.test.d.ts.map +1 -0
- package/dist/__tests__/prepared-graphics-snapshot.unit.test.d.ts +2 -0
- package/dist/__tests__/prepared-graphics-snapshot.unit.test.d.ts.map +1 -0
- package/dist/__tests__/prepared-graphics-store.unit.test.d.ts +2 -0
- package/dist/__tests__/prepared-graphics-store.unit.test.d.ts.map +1 -0
- package/dist/__tests__/prepared-graphics-validation.unit.test.d.ts +2 -0
- package/dist/__tests__/prepared-graphics-validation.unit.test.d.ts.map +1 -0
- package/dist/__tests__/profiler-default-off.test.d.ts +2 -0
- package/dist/__tests__/profiler-default-off.test.d.ts.map +1 -0
- package/dist/__tests__/profiler-phase-catalog.test.d.ts +2 -0
- package/dist/__tests__/profiler-phase-catalog.test.d.ts.map +1 -0
- package/dist/__tests__/profiler-phase-integration.test.d.ts +2 -0
- package/dist/__tests__/profiler-phase-integration.test.d.ts.map +1 -0
- package/dist/__tests__/profiler-phase-token.test.d.ts +2 -0
- package/dist/__tests__/profiler-phase-token.test.d.ts.map +1 -0
- package/dist/__tests__/public-surface.test-d.d.ts +2 -0
- package/dist/__tests__/public-surface.test-d.d.ts.map +1 -0
- package/dist/__tests__/recover-error-policy-owner.unit.test.d.ts +2 -0
- package/dist/__tests__/recover-error-policy-owner.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-error-code-owner.test-d.d.ts +2 -0
- package/dist/__tests__/render-error-code-owner.test-d.d.ts.map +1 -0
- package/dist/__tests__/render-error-detail-ssot.test-d.d.ts +2 -0
- package/dist/__tests__/render-error-detail-ssot.test-d.d.ts.map +1 -0
- package/dist/__tests__/render-error-exhaustive.test-d.d.ts +2 -0
- package/dist/__tests__/render-error-exhaustive.test-d.d.ts.map +1 -0
- package/dist/__tests__/render-feature-assembly.test-d.d.ts +2 -0
- package/dist/__tests__/render-feature-assembly.test-d.d.ts.map +1 -0
- package/dist/__tests__/render-feature-context.test-d.d.ts +2 -0
- package/dist/__tests__/render-feature-context.test-d.d.ts.map +1 -0
- package/dist/__tests__/render-feature-contract.test-d.d.ts +2 -0
- package/dist/__tests__/render-feature-contract.test-d.d.ts.map +1 -0
- package/dist/__tests__/render-feature-diagnostics.unit.test.d.ts +2 -0
- package/dist/__tests__/render-feature-diagnostics.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-docs.unit.test.d.ts +2 -0
- package/dist/__tests__/render-feature-docs.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-errors.unit.test.d.ts +2 -0
- package/dist/__tests__/render-feature-errors.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-gpu-work.integration.test.d.ts +2 -0
- package/dist/__tests__/render-feature-gpu-work.integration.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-plan.test-d.d.ts +2 -0
- package/dist/__tests__/render-feature-plan.test-d.d.ts.map +1 -0
- package/dist/__tests__/render-feature-plan.unit.test.d.ts +2 -0
- package/dist/__tests__/render-feature-plan.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-prepared-diagnostics.unit.test.d.ts +2 -0
- package/dist/__tests__/render-feature-prepared-diagnostics.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-prepared-errors.test-d.d.ts +2 -0
- package/dist/__tests__/render-feature-prepared-errors.test-d.d.ts.map +1 -0
- package/dist/__tests__/render-feature-prepared-graphics-docs.unit.test.d.ts +2 -0
- package/dist/__tests__/render-feature-prepared-graphics-docs.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-prepared-graphics-isolation.unit.test.d.ts +2 -0
- package/dist/__tests__/render-feature-prepared-graphics-isolation.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-prepared-graphics-negative.test-d.d.ts +2 -0
- package/dist/__tests__/render-feature-prepared-graphics-negative.test-d.d.ts.map +1 -0
- package/dist/__tests__/render-feature-prepared-graphics.test-d.d.ts +2 -0
- package/dist/__tests__/render-feature-prepared-graphics.test-d.d.ts.map +1 -0
- package/dist/__tests__/render-feature-prepared-graphics.unit.test.d.ts +2 -0
- package/dist/__tests__/render-feature-prepared-graphics.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-public-surface.test-d.d.ts +2 -0
- package/dist/__tests__/render-feature-public-surface.test-d.d.ts.map +1 -0
- package/dist/__tests__/render-feature-retry.unit.test.d.ts +2 -0
- package/dist/__tests__/render-feature-retry.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-scheduling.unit.test.d.ts +2 -0
- package/dist/__tests__/render-feature-scheduling.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-stage-failed-policy-owner.unit.test.d.ts +2 -0
- package/dist/__tests__/render-feature-stage-failed-policy-owner.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-stage-fault-recovery.unit.test.d.ts +2 -0
- package/dist/__tests__/render-feature-stage-fault-recovery.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-visibility-context.test-d.d.ts +2 -0
- package/dist/__tests__/render-feature-visibility-context.test-d.d.ts.map +1 -0
- package/dist/__tests__/render-feature-visibility-context.unit.test.d.ts +2 -0
- package/dist/__tests__/render-feature-visibility-context.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-feature-zero-work.unit.test.d.ts +2 -0
- package/dist/__tests__/render-feature-zero-work.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-graph-compute-raster-gpu.d.ts +7 -0
- package/dist/__tests__/render-graph-compute-raster-gpu.d.ts.map +1 -0
- package/dist/__tests__/render-graph-compute-raster.browser.test.d.ts +2 -0
- package/dist/__tests__/render-graph-compute-raster.browser.test.d.ts.map +1 -0
- package/dist/__tests__/render-graph-compute-raster.dawn.test.d.ts +2 -0
- package/dist/__tests__/render-graph-compute-raster.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/render-graph-hzb-gpu.d.ts +7 -0
- package/dist/__tests__/render-graph-hzb-gpu.d.ts.map +1 -0
- package/dist/__tests__/render-graph-hzb.browser.test.d.ts +2 -0
- package/dist/__tests__/render-graph-hzb.browser.test.d.ts.map +1 -0
- package/dist/__tests__/render-graph-hzb.dawn.test.d.ts +2 -0
- package/dist/__tests__/render-graph-hzb.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/render-graph-primitives.unit.test.d.ts +2 -0
- package/dist/__tests__/render-graph-primitives.unit.test.d.ts.map +1 -0
- package/dist/__tests__/render-graph-storage-indirect-gpu.d.ts +12 -0
- package/dist/__tests__/render-graph-storage-indirect-gpu.d.ts.map +1 -0
- package/dist/__tests__/render-graph-storage-indirect.browser.test.d.ts +2 -0
- package/dist/__tests__/render-graph-storage-indirect.browser.test.d.ts.map +1 -0
- package/dist/__tests__/render-graph-storage-indirect.dawn.test.d.ts +2 -0
- package/dist/__tests__/render-graph-storage-indirect.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/render-scene-projection.unit.test.d.ts +2 -0
- package/dist/__tests__/render-scene-projection.unit.test.d.ts.map +1 -0
- package/dist/__tests__/renderer-factory-material-contract.unit.test.d.ts +2 -0
- package/dist/__tests__/renderer-factory-material-contract.unit.test.d.ts.map +1 -0
- package/dist/__tests__/renderer-lifecycle.integration.test.d.ts +2 -0
- package/dist/__tests__/renderer-lifecycle.integration.test.d.ts.map +1 -0
- package/dist/__tests__/rhi-backend-package-boundary.unit.test.d.ts +2 -0
- package/dist/__tests__/rhi-backend-package-boundary.unit.test.d.ts.map +1 -0
- package/dist/__tests__/scriptable-pack-consumer.test-d.d.ts +2 -0
- package/dist/__tests__/scriptable-pack-consumer.test-d.d.ts.map +1 -0
- package/dist/__tests__/shader-stage-surface.unit.test.d.ts +2 -0
- package/dist/__tests__/shader-stage-surface.unit.test.d.ts.map +1 -0
- package/dist/__tests__/ssao-config.unit.test.d.ts +2 -0
- package/dist/__tests__/ssao-config.unit.test.d.ts.map +1 -0
- package/dist/__tests__/ssao-kernel-surface.unit.test.d.ts +2 -0
- package/dist/__tests__/ssao-kernel-surface.unit.test.d.ts.map +1 -0
- package/dist/__tests__/standard-clustered-pipeline.unit.test.d.ts +2 -0
- package/dist/__tests__/standard-clustered-pipeline.unit.test.d.ts.map +1 -0
- package/dist/__tests__/standard-descriptors.test-d.d.ts +2 -0
- package/dist/__tests__/standard-descriptors.test-d.d.ts.map +1 -0
- package/dist/__tests__/standard-pipeline.dawn.test.d.ts +2 -0
- package/dist/__tests__/standard-pipeline.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/standard-pipeline.integration.test.d.ts +2 -0
- package/dist/__tests__/standard-pipeline.integration.test.d.ts.map +1 -0
- package/dist/__tests__/standard-profile-oracle.unit.test.d.ts +2 -0
- package/dist/__tests__/standard-profile-oracle.unit.test.d.ts.map +1 -0
- package/dist/__tests__/surface-configuration.unit.test.d.ts +2 -0
- package/dist/__tests__/surface-configuration.unit.test.d.ts.map +1 -0
- package/dist/__tests__/texture-usage-surface.unit.test.d.ts +2 -0
- package/dist/__tests__/texture-usage-surface.unit.test.d.ts.map +1 -0
- package/dist/__tests__/typed-pipeline-topology.unit.test.d.ts +2 -0
- package/dist/__tests__/typed-pipeline-topology.unit.test.d.ts.map +1 -0
- package/dist/__tests__/urp-pipeline-targets.unit.test.d.ts +2 -0
- package/dist/__tests__/urp-pipeline-targets.unit.test.d.ts.map +1 -0
- package/dist/__tests__/urp-pipeline.unit.test.d.ts +2 -0
- package/dist/__tests__/urp-pipeline.unit.test.d.ts.map +1 -0
- package/dist/__tests__/vertex-color-pipeline.unit.test.d.ts +2 -0
- package/dist/__tests__/vertex-color-pipeline.unit.test.d.ts.map +1 -0
- package/dist/__tests__/vertex-layout-consumer.unit.test.d.ts +2 -0
- package/dist/__tests__/vertex-layout-consumer.unit.test.d.ts.map +1 -0
- package/dist/__tests__/visibility-diagnostics.integration.test.d.ts +2 -0
- package/dist/__tests__/visibility-diagnostics.integration.test.d.ts.map +1 -0
- package/dist/__tests__/visibility-extract.integration.test.d.ts +2 -0
- package/dist/__tests__/visibility-extract.integration.test.d.ts.map +1 -0
- package/dist/__tests__/visibility-extract.perf.test.d.ts +2 -0
- package/dist/__tests__/visibility-extract.perf.test.d.ts.map +1 -0
- package/dist/__tests__/visibility-feature-dedup.integration.test.d.ts +2 -0
- package/dist/__tests__/visibility-feature-dedup.integration.test.d.ts.map +1 -0
- package/dist/__tests__/visibility-hidden-report.unit.test.d.ts +2 -0
- package/dist/__tests__/visibility-hidden-report.unit.test.d.ts.map +1 -0
- package/dist/__tests__/visibility-instances.integration.test.d.ts +2 -0
- package/dist/__tests__/visibility-instances.integration.test.d.ts.map +1 -0
- package/dist/__tests__/visibility-multi-world.integration.test.d.ts +2 -0
- package/dist/__tests__/visibility-multi-world.integration.test.d.ts.map +1 -0
- package/dist/__tests__/visibility-producer-matrix.integration.test.d.ts +2 -0
- package/dist/__tests__/visibility-producer-matrix.integration.test.d.ts.map +1 -0
- package/dist/__tests__/visibility-producer-matrix.unit.test.d.ts +2 -0
- package/dist/__tests__/visibility-producer-matrix.unit.test.d.ts.map +1 -0
- package/dist/__tests__/visibility-public-surface.test-d.d.ts +2 -0
- package/dist/__tests__/visibility-public-surface.test-d.d.ts.map +1 -0
- package/dist/__tests__/visibility-resolver.unit.test.d.ts +2 -0
- package/dist/__tests__/visibility-resolver.unit.test.d.ts.map +1 -0
- package/dist/__tests__/visibility-resource-short-circuit.unit.test.d.ts +2 -0
- package/dist/__tests__/visibility-resource-short-circuit.unit.test.d.ts.map +1 -0
- package/dist/__tests__/visibility-snapshot-contract.unit.test.d.ts +2 -0
- package/dist/__tests__/visibility-snapshot-contract.unit.test.d.ts.map +1 -0
- package/dist/__tests__/vocabulary.unit.test.d.ts +2 -0
- package/dist/__tests__/vocabulary.unit.test.d.ts.map +1 -0
- package/dist/assembly/backend-contract.d.ts +37 -0
- package/dist/assembly/backend-contract.d.ts.map +1 -0
- package/dist/assembly/factory.d.ts +207 -0
- package/dist/assembly/factory.d.ts.map +1 -0
- package/dist/assembly/host-contract.d.ts +84 -0
- package/dist/assembly/host-contract.d.ts.map +1 -0
- package/dist/assembly/material/assembly.d.ts +21 -0
- package/dist/assembly/material/assembly.d.ts.map +1 -0
- package/dist/assembly/material/pipeline-projection.d.ts +30 -0
- package/dist/assembly/material/pipeline-projection.d.ts.map +1 -0
- package/dist/assets/asset-decoders.d.ts +5 -0
- package/dist/assets/asset-decoders.d.ts.map +1 -0
- package/dist/assets/render-asset-port.d.ts +17 -0
- package/dist/assets/render-asset-port.d.ts.map +1 -0
- package/dist/assets/resolve-render-asset.d.ts +6 -0
- package/dist/assets/resolve-render-asset.d.ts.map +1 -0
- package/dist/authoring.d.ts +12 -0
- package/dist/authoring.d.ts.map +1 -0
- package/dist/authoring.mjs +27 -0
- package/dist/authoring.mjs.map +1 -0
- package/dist/chunk-CQXZC5XI.mjs +182 -0
- package/dist/chunk-CQXZC5XI.mjs.map +1 -0
- package/dist/chunk-HCOGPHKS.mjs +93 -0
- package/dist/chunk-HCOGPHKS.mjs.map +1 -0
- package/dist/chunk-YEJIUW7D.mjs +1152 -0
- package/dist/chunk-YEJIUW7D.mjs.map +1 -0
- package/dist/cluster-binner.d.ts +152 -0
- package/dist/cluster-binner.d.ts.map +1 -0
- package/dist/components/__tests__/points-lines-admission.unit.test.d.ts +2 -0
- package/dist/components/__tests__/points-lines-admission.unit.test.d.ts.map +1 -0
- package/dist/components/__tests__/points-lines-schema.unit.test.d.ts +2 -0
- package/dist/components/__tests__/points-lines-schema.unit.test.d.ts.map +1 -0
- package/dist/components/__tests__/schema-contract.unit.test.d.ts +2 -0
- package/dist/components/__tests__/schema-contract.unit.test.d.ts.map +1 -0
- package/dist/components/__tests__/schema-parity.unit.test.d.ts +2 -0
- package/dist/components/__tests__/schema-parity.unit.test.d.ts.map +1 -0
- package/dist/components/__tests__/visibility-schema.unit.test.d.ts +2 -0
- package/dist/components/__tests__/visibility-schema.unit.test.d.ts.map +1 -0
- package/dist/components/camera.d.ts +311 -0
- package/dist/components/camera.d.ts.map +1 -0
- package/dist/components/directional-light.d.ts +76 -0
- package/dist/components/directional-light.d.ts.map +1 -0
- package/dist/components/glyph-text.d.ts +26 -0
- package/dist/components/glyph-text.d.ts.map +1 -0
- package/dist/components/index.d.ts +24 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/instances.d.ts +41 -0
- package/dist/components/instances.d.ts.map +1 -0
- package/dist/components/layer.d.ts +34 -0
- package/dist/components/layer.d.ts.map +1 -0
- package/dist/components/light-helpers.d.ts +53 -0
- package/dist/components/light-helpers.d.ts.map +1 -0
- package/dist/components/lines.d.ts +5 -0
- package/dist/components/lines.d.ts.map +1 -0
- package/dist/components/mesh-filter.d.ts +24 -0
- package/dist/components/mesh-filter.d.ts.map +1 -0
- package/dist/components/mesh-renderer.d.ts +33 -0
- package/dist/components/mesh-renderer.d.ts.map +1 -0
- package/dist/components/point-light-shadow.d.ts +27 -0
- package/dist/components/point-light-shadow.d.ts.map +1 -0
- package/dist/components/point-light.d.ts +35 -0
- package/dist/components/point-light.d.ts.map +1 -0
- package/dist/components/points.d.ts +15 -0
- package/dist/components/points.d.ts.map +1 -0
- package/dist/components/post-process-params.d.ts +5 -0
- package/dist/components/post-process-params.d.ts.map +1 -0
- package/dist/components/scene-instance.d.ts +140 -0
- package/dist/components/scene-instance.d.ts.map +1 -0
- package/dist/components/skybox-background.d.ts +56 -0
- package/dist/components/skybox-background.d.ts.map +1 -0
- package/dist/components/skylight.d.ts +55 -0
- package/dist/components/skylight.d.ts.map +1 -0
- package/dist/components/sort-key.d.ts +44 -0
- package/dist/components/sort-key.d.ts.map +1 -0
- package/dist/components/spot-light.d.ts +81 -0
- package/dist/components/spot-light.d.ts.map +1 -0
- package/dist/components/sprite-animation.d.ts +74 -0
- package/dist/components/sprite-animation.d.ts.map +1 -0
- package/dist/components/sprite-instances.d.ts +51 -0
- package/dist/components/sprite-instances.d.ts.map +1 -0
- package/dist/components/sprite-playback-mode.d.ts +42 -0
- package/dist/components/sprite-playback-mode.d.ts.map +1 -0
- package/dist/components/sprite-region-override.d.ts +46 -0
- package/dist/components/sprite-region-override.d.ts.map +1 -0
- package/dist/components/tile-layer.d.ts +106 -0
- package/dist/components/tile-layer.d.ts.map +1 -0
- package/dist/components/tilemap.d.ts +25 -0
- package/dist/components/tilemap.d.ts.map +1 -0
- package/dist/components/visibility.d.ts +22 -0
- package/dist/components/visibility.d.ts.map +1 -0
- package/dist/construct-renderer.d.ts +19 -0
- package/dist/construct-renderer.d.ts.map +1 -0
- package/dist/construct-renderer.mjs +27462 -0
- package/dist/construct-renderer.mjs.map +1 -0
- package/dist/debug-draw-glue.d.ts +5 -0
- package/dist/debug-draw-glue.d.ts.map +1 -0
- package/dist/device/device-scope.d.ts +83 -0
- package/dist/device/device-scope.d.ts.map +1 -0
- package/dist/device/gpu-residency.d.ts +337 -0
- package/dist/device/gpu-residency.d.ts.map +1 -0
- package/dist/device/resource-types.d.ts +8 -0
- package/dist/device/resource-types.d.ts.map +1 -0
- package/dist/engine-metrics.d.ts +23 -0
- package/dist/engine-metrics.d.ts.map +1 -0
- package/dist/errors/ecs-validation.d.ts +3 -0
- package/dist/errors/ecs-validation.d.ts.map +1 -0
- package/dist/errors/index.d.ts +4 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/recover.d.ts +105 -0
- package/dist/errors/recover.d.ts.map +1 -0
- package/dist/errors/render.d.ts +705 -0
- package/dist/errors/render.d.ts.map +1 -0
- package/dist/extract/visibility.d.ts +26 -0
- package/dist/extract/visibility.d.ts.map +1 -0
- package/dist/features/fullscreen.d.ts +19 -0
- package/dist/features/fullscreen.d.ts.map +1 -0
- package/dist/features/host.d.ts +106 -0
- package/dist/features/host.d.ts.map +1 -0
- package/dist/features/morph/morph-feature.d.ts +79 -0
- package/dist/features/morph/morph-feature.d.ts.map +1 -0
- package/dist/features/plan.d.ts +182 -0
- package/dist/features/plan.d.ts.map +1 -0
- package/dist/features/prepared-gpu-work.d.ts +117 -0
- package/dist/features/prepared-gpu-work.d.ts.map +1 -0
- package/dist/features/prepared-graphics-store.d.ts +66 -0
- package/dist/features/prepared-graphics-store.d.ts.map +1 -0
- package/dist/features/prepared-graphics.d.ts +215 -0
- package/dist/features/prepared-graphics.d.ts.map +1 -0
- package/dist/features/render-graph-compute.d.ts +13 -0
- package/dist/features/render-graph-compute.d.ts.map +1 -0
- package/dist/features/render-graph-contribution.d.ts +12 -0
- package/dist/features/render-graph-contribution.d.ts.map +1 -0
- package/dist/features/render-graph-raster.d.ts +38 -0
- package/dist/features/render-graph-raster.d.ts.map +1 -0
- package/dist/features/render-graph-resources.d.ts +11 -0
- package/dist/features/render-graph-resources.d.ts.map +1 -0
- package/dist/features/targets.d.ts +32 -0
- package/dist/features/targets.d.ts.map +1 -0
- package/dist/features/types.d.ts +68 -0
- package/dist/features/types.d.ts.map +1 -0
- package/dist/features/vocabulary.d.ts +14 -0
- package/dist/features/vocabulary.d.ts.map +1 -0
- package/dist/fullscreen-post-process-pass.d.ts +157 -0
- package/dist/fullscreen-post-process-pass.d.ts.map +1 -0
- package/dist/glyph-text-layout-system.d.ts +19 -0
- package/dist/glyph-text-layout-system.d.ts.map +1 -0
- package/dist/gpu-driven/batch-topology.d.ts +55 -0
- package/dist/gpu-driven/batch-topology.d.ts.map +1 -0
- package/dist/gpu-driven/production-raster.d.ts +51 -0
- package/dist/gpu-driven/production-raster.d.ts.map +1 -0
- package/dist/gpu-driven/view-gpu.d.ts +85 -0
- package/dist/gpu-driven/view-gpu.d.ts.map +1 -0
- package/dist/gpu-resource.d.ts +73 -0
- package/dist/gpu-resource.d.ts.map +1 -0
- package/dist/gpu-scene-schema.d.ts +78 -0
- package/dist/gpu-scene-schema.d.ts.map +1 -0
- package/dist/gpu-scene.d.ts +55 -0
- package/dist/gpu-scene.d.ts.map +1 -0
- package/dist/gpu-stage.d.ts +4 -0
- package/dist/gpu-stage.d.ts.map +1 -0
- package/dist/gpu-texture-usage.d.ts +6 -0
- package/dist/gpu-texture-usage.d.ts.map +1 -0
- package/dist/gpu-usage.d.ts +9 -0
- package/dist/gpu-usage.d.ts.map +1 -0
- package/dist/hdrp-buffers.d.ts +163 -0
- package/dist/hdrp-buffers.d.ts.map +1 -0
- package/dist/ibl/IblPipelineCache.d.ts +168 -0
- package/dist/ibl/IblPipelineCache.d.ts.map +1 -0
- package/dist/ibl/skylight-bind-group.d.ts +130 -0
- package/dist/ibl/skylight-bind-group.d.ts.map +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +169 -0
- package/dist/index.mjs.map +1 -0
- package/dist/inspection-types.d.ts +72 -0
- package/dist/inspection-types.d.ts.map +1 -0
- package/dist/instance-buffer-cache.d.ts +56 -0
- package/dist/instance-buffer-cache.d.ts.map +1 -0
- package/dist/internal.d.ts +2 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.mjs +3 -0
- package/dist/internal.mjs.map +1 -0
- package/dist/lifecycle.d.ts +62 -0
- package/dist/lifecycle.d.ts.map +1 -0
- package/dist/light-buffer-layout.d.ts +164 -0
- package/dist/light-buffer-layout.d.ts.map +1 -0
- package/dist/materials.d.ts +47 -0
- package/dist/materials.d.ts.map +1 -0
- package/dist/mesh-material-bindings.d.ts +43 -0
- package/dist/mesh-material-bindings.d.ts.map +1 -0
- package/dist/pbr-pipeline.d.ts +301 -0
- package/dist/pbr-pipeline.d.ts.map +1 -0
- package/dist/pipeline/standard-forward-lane.d.ts +5 -0
- package/dist/pipeline/standard-forward-lane.d.ts.map +1 -0
- package/dist/pipeline/standard-pipeline.d.ts +31 -0
- package/dist/pipeline/standard-pipeline.d.ts.map +1 -0
- package/dist/pipeline/standard-profile.d.ts +40 -0
- package/dist/pipeline/standard-profile.d.ts.map +1 -0
- package/dist/pipeline-builder.d.ts +122 -0
- package/dist/pipeline-builder.d.ts.map +1 -0
- package/dist/pipeline-spec-types.d.ts +24 -0
- package/dist/pipeline-spec-types.d.ts.map +1 -0
- package/dist/pipeline-spec.d.ts +367 -0
- package/dist/pipeline-spec.d.ts.map +1 -0
- package/dist/plugin.d.ts +4 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/points-lines/__tests__/bounds.unit.test.d.ts +2 -0
- package/dist/points-lines/__tests__/bounds.unit.test.d.ts.map +1 -0
- package/dist/points-lines/__tests__/cache-recovery.unit.test.d.ts +2 -0
- package/dist/points-lines/__tests__/cache-recovery.unit.test.d.ts.map +1 -0
- package/dist/points-lines/__tests__/inspection-lanes.integration.test.d.ts +2 -0
- package/dist/points-lines/__tests__/inspection-lanes.integration.test.d.ts.map +1 -0
- package/dist/points-lines/__tests__/inspection.unit.test.d.ts +2 -0
- package/dist/points-lines/__tests__/inspection.unit.test.d.ts.map +1 -0
- package/dist/points-lines/__tests__/lane-structural.integration.test.d.ts +2 -0
- package/dist/points-lines/__tests__/lane-structural.integration.test.d.ts.map +1 -0
- package/dist/points-lines/__tests__/points-lines.bench.d.ts +2 -0
- package/dist/points-lines/__tests__/points-lines.bench.d.ts.map +1 -0
- package/dist/points-lines/__tests__/raster-lane.integration.test.d.ts +2 -0
- package/dist/points-lines/__tests__/raster-lane.integration.test.d.ts.map +1 -0
- package/dist/points-lines/__tests__/snapshot.unit.test.d.ts +2 -0
- package/dist/points-lines/__tests__/snapshot.unit.test.d.ts.map +1 -0
- package/dist/points-lines/__tests__/view-ubo.unit.test.d.ts +2 -0
- package/dist/points-lines/__tests__/view-ubo.unit.test.d.ts.map +1 -0
- package/dist/points-lines/admission.d.ts +36 -0
- package/dist/points-lines/admission.d.ts.map +1 -0
- package/dist/points-lines/bounds.d.ts +8 -0
- package/dist/points-lines/bounds.d.ts.map +1 -0
- package/dist/points-lines/expansion-cache.d.ts +28 -0
- package/dist/points-lines/expansion-cache.d.ts.map +1 -0
- package/dist/points-lines/inspection.d.ts +53 -0
- package/dist/points-lines/inspection.d.ts.map +1 -0
- package/dist/points-lines/prepare.d.ts +67 -0
- package/dist/points-lines/prepare.d.ts.map +1 -0
- package/dist/points-lines/record.d.ts +60 -0
- package/dist/points-lines/record.d.ts.map +1 -0
- package/dist/points-lines/snapshot.d.ts +49 -0
- package/dist/points-lines/snapshot.d.ts.map +1 -0
- package/dist/post-process-errors.d.ts +182 -0
- package/dist/post-process-errors.d.ts.map +1 -0
- package/dist/prepare/prepared-graphics-resolver.d.ts +59 -0
- package/dist/prepare/prepared-graphics-resolver.d.ts.map +1 -0
- package/dist/record/__tests__/material-bg-cache.unit.test.d.ts +2 -0
- package/dist/record/__tests__/material-bg-cache.unit.test.d.ts.map +1 -0
- package/dist/record/__tests__/material-slot-plan.unit.test.d.ts +2 -0
- package/dist/record/__tests__/material-slot-plan.unit.test.d.ts.map +1 -0
- package/dist/record/__tests__/typed-frame-graph-plan.unit.test.d.ts +2 -0
- package/dist/record/__tests__/typed-frame-graph-plan.unit.test.d.ts.map +1 -0
- package/dist/record/__tests__/video-texture-view.unit.test.d.ts +2 -0
- package/dist/record/__tests__/video-texture-view.unit.test.d.ts.map +1 -0
- package/dist/record/frame-lighting.d.ts +121 -0
- package/dist/record/frame-lighting.d.ts.map +1 -0
- package/dist/record/frame-snapshot.d.ts +429 -0
- package/dist/record/frame-snapshot.d.ts.map +1 -0
- package/dist/record/frame-targets.d.ts +20 -0
- package/dist/record/frame-targets.d.ts.map +1 -0
- package/dist/record/frame.d.ts +71 -0
- package/dist/record/frame.d.ts.map +1 -0
- package/dist/record/helpers.d.ts +102 -0
- package/dist/record/helpers.d.ts.map +1 -0
- package/dist/record/main-pass-geometry.d.ts +28 -0
- package/dist/record/main-pass-geometry.d.ts.map +1 -0
- package/dist/record/main-pass-material.d.ts +204 -0
- package/dist/record/main-pass-material.d.ts.map +1 -0
- package/dist/record/main-pass-sprite-draws.d.ts +43 -0
- package/dist/record/main-pass-sprite-draws.d.ts.map +1 -0
- package/dist/record/main-pass.d.ts +20 -0
- package/dist/record/main-pass.d.ts.map +1 -0
- package/dist/record/mesh-ssbo.d.ts +446 -0
- package/dist/record/mesh-ssbo.d.ts.map +1 -0
- package/dist/record/render-context.d.ts +252 -0
- package/dist/record/render-context.d.ts.map +1 -0
- package/dist/record/shadow-pass.d.ts +52 -0
- package/dist/record/shadow-pass.d.ts.map +1 -0
- package/dist/record/skybox-post-pass.d.ts +33 -0
- package/dist/record/skybox-post-pass.d.ts.map +1 -0
- package/dist/record/typed-frame-graph.d.ts +35 -0
- package/dist/record/typed-frame-graph.d.ts.map +1 -0
- package/dist/record/view-ubo.d.ts +45 -0
- package/dist/record/view-ubo.d.ts.map +1 -0
- package/dist/render-contract.d.ts +424 -0
- package/dist/render-contract.d.ts.map +1 -0
- package/dist/render-data.d.ts +143 -0
- package/dist/render-data.d.ts.map +1 -0
- package/dist/render-graph-primitives.d.ts +76 -0
- package/dist/render-graph-primitives.d.ts.map +1 -0
- package/dist/render-pipeline.d.ts +110 -0
- package/dist/render-pipeline.d.ts.map +1 -0
- package/dist/render-system-extract.d.ts +868 -0
- package/dist/render-system-extract.d.ts.map +1 -0
- package/dist/render-system.d.ts +125 -0
- package/dist/render-system.d.ts.map +1 -0
- package/dist/scene/render-scene-types.d.ts +61 -0
- package/dist/scene/render-scene-types.d.ts.map +1 -0
- package/dist/scene/render-scene.d.ts +112 -0
- package/dist/scene/render-scene.d.ts.map +1 -0
- package/dist/scene-instances/post-spawn-resolve-joints.d.ts +30 -0
- package/dist/scene-instances/post-spawn-resolve-joints.d.ts.map +1 -0
- package/dist/shadow-atlas.d.ts +117 -0
- package/dist/shadow-atlas.d.ts.map +1 -0
- package/dist/ssao-buffers.d.ts +50 -0
- package/dist/ssao-buffers.d.ts.map +1 -0
- package/dist/ssao-config.d.ts +28 -0
- package/dist/ssao-config.d.ts.map +1 -0
- package/dist/systems/active-camera.d.ts +53 -0
- package/dist/systems/active-camera.d.ts.map +1 -0
- package/dist/systems/pass-selector.d.ts +24 -0
- package/dist/systems/pass-selector.d.ts.map +1 -0
- package/dist/systems/skin-palette-allocator.d.ts +49 -0
- package/dist/systems/skin-palette-allocator.d.ts.map +1 -0
- package/dist/systems/skin-palette-types.d.ts +14 -0
- package/dist/systems/skin-palette-types.d.ts.map +1 -0
- package/dist/systems/transparent-sort-config.d.ts +112 -0
- package/dist/systems/transparent-sort-config.d.ts.map +1 -0
- package/dist/tilemap-chunk-extract-system.d.ts +143 -0
- package/dist/tilemap-chunk-extract-system.d.ts.map +1 -0
- package/dist/typed-render-graph-primitives.d.ts +57 -0
- package/dist/typed-render-graph-primitives.d.ts.map +1 -0
- package/dist/typed-shadow-passes.d.ts +11 -0
- package/dist/typed-shadow-passes.d.ts.map +1 -0
- package/package.json +94 -0
- package/src/__tests__/authoring-path.unit.test.ts +23 -0
- package/src/__tests__/backend-selection-rhi-capture.test-d.ts +21 -0
- package/src/__tests__/callback-inference.test-d.ts +8 -0
- package/src/__tests__/cluster-binner.test.ts +272 -0
- package/src/__tests__/cluster-grid-default-surface.unit.test.ts +20 -0
- package/src/__tests__/construct-renderer-identity.unit.test.ts +23 -0
- package/src/__tests__/device-scope-lifecycle.unit.test.ts +151 -0
- package/src/__tests__/device-scope-stale-matrix.unit.test.ts +42 -0
- package/src/__tests__/direct-extract-consumer-contract.test-d.ts +23 -0
- package/src/__tests__/direct-light-snapshot.unit.test.ts +61 -0
- package/src/__tests__/factory-contract.integration.test.ts +280 -0
- package/src/__tests__/fallback-row-stride-surface.unit.test.ts +15 -0
- package/src/__tests__/frame-observation.contract.test.ts +112 -0
- package/src/__tests__/fullscreen-feature-plan.unit.test.ts +32 -0
- package/src/__tests__/glyph-text-layout-recovery.unit.test.ts +167 -0
- package/src/__tests__/gpu-driven-indirect-raster-evidence.ts +350 -0
- package/src/__tests__/gpu-driven-indirect-raster.browser.test.ts +12 -0
- package/src/__tests__/gpu-driven-indirect-raster.dawn.test.ts +16 -0
- package/src/__tests__/gpu-driven-production.integration.test.ts +436 -0
- package/src/__tests__/gpu-driven-scaling.unit.test.ts +87 -0
- package/src/__tests__/gpu-driven-view-gpu-evidence.ts +271 -0
- package/src/__tests__/gpu-driven-view-graph.integration.test.ts +290 -0
- package/src/__tests__/gpu-driven-view-reference.ts +111 -0
- package/src/__tests__/gpu-driven-view.browser.test.ts +30 -0
- package/src/__tests__/gpu-driven-view.dawn.test.ts +28 -0
- package/src/__tests__/gpu-driven-view.unit.test.ts +199 -0
- package/src/__tests__/gpu-resource-store-stride.unit.test.ts +59 -0
- package/src/__tests__/gpu-scene-render-graph-gpu.ts +308 -0
- package/src/__tests__/gpu-scene-render-graph.browser.test.ts +19 -0
- package/src/__tests__/gpu-scene-render-graph.dawn.test.ts +19 -0
- package/src/__tests__/gpu-scene-schema.unit.test.ts +16 -0
- package/src/__tests__/gpu-scene.dawn.test.ts +205 -0
- package/src/__tests__/gpu-scene.unit.test.ts +147 -0
- package/src/__tests__/ibl/face-uniforms.unit.test.ts +46 -0
- package/src/__tests__/infinite-grid-no-vertex-probe.unit.test.ts +92 -0
- package/src/__tests__/injection-kind-owner.test-d.ts +14 -0
- package/src/__tests__/ktx2-basis-gpu-consumer.dawn.test.ts +728 -0
- package/src/__tests__/light-buffer-layout.unit.test.ts +40 -0
- package/src/__tests__/material-contract-inventory.unit.test.ts +24 -0
- package/src/__tests__/material-cooked-projection.unit.test.ts +150 -0
- package/src/__tests__/material-snapshot-mutation.integration.test.ts +53 -0
- package/src/__tests__/material-static-dynamic-route.unit.test.ts +94 -0
- package/src/__tests__/material-stride-surface.unit.test.ts +32 -0
- package/src/__tests__/mesh-buffer-usage-surface.unit.test.ts +106 -0
- package/src/__tests__/mesh-material-bindings.unit.test.ts +89 -0
- package/src/__tests__/mesh-stride-surface.unit.test.ts +16 -0
- package/src/__tests__/morph-culling-reentry.dawn.test.ts +157 -0
- package/src/__tests__/morph-feature-gpu-work.integration.test.ts +80 -0
- package/src/__tests__/morph-feature-plan.unit.test.ts +53 -0
- package/src/__tests__/morph-visual-evidence.integration.test.ts +80 -0
- package/src/__tests__/nineslice-handle-surface.unit.test.ts +19 -0
- package/src/__tests__/post-process-error-policy-owner.unit.test.ts +201 -0
- package/src/__tests__/prepared-buffer-kind-owner.test-d.ts +29 -0
- package/src/__tests__/prepared-graphics-capability.unit.test.ts +65 -0
- package/src/__tests__/prepared-graphics-generation.unit.test.ts +161 -0
- package/src/__tests__/prepared-graphics-lifecycle.unit.test.ts +138 -0
- package/src/__tests__/prepared-graphics-pipeline-warmup.unit.test.ts +29 -0
- package/src/__tests__/prepared-graphics-resolver.unit.test.ts +285 -0
- package/src/__tests__/prepared-graphics-snapshot.unit.test.ts +105 -0
- package/src/__tests__/prepared-graphics-store.unit.test.ts +154 -0
- package/src/__tests__/prepared-graphics-validation.unit.test.ts +176 -0
- package/src/__tests__/profiler-default-off.test.ts +22 -0
- package/src/__tests__/profiler-phase-catalog.test.ts +66 -0
- package/src/__tests__/profiler-phase-integration.test.ts +62 -0
- package/src/__tests__/profiler-phase-token.test.ts +79 -0
- package/src/__tests__/public-surface.test-d.ts +94 -0
- package/src/__tests__/recover-error-policy-owner.unit.test.ts +107 -0
- package/src/__tests__/render-error-code-owner.test-d.ts +116 -0
- package/src/__tests__/render-error-detail-ssot.test-d.ts +139 -0
- package/src/__tests__/render-error-exhaustive.test-d.ts +110 -0
- package/src/__tests__/render-feature-assembly.test-d.ts +43 -0
- package/src/__tests__/render-feature-context.test-d.ts +57 -0
- package/src/__tests__/render-feature-contract.test-d.ts +49 -0
- package/src/__tests__/render-feature-diagnostics.unit.test.ts +149 -0
- package/src/__tests__/render-feature-docs.unit.test.ts +89 -0
- package/src/__tests__/render-feature-errors.unit.test.ts +47 -0
- package/src/__tests__/render-feature-gpu-work.integration.test.ts +316 -0
- package/src/__tests__/render-feature-plan.test-d.ts +161 -0
- package/src/__tests__/render-feature-plan.unit.test.ts +170 -0
- package/src/__tests__/render-feature-prepared-diagnostics.unit.test.ts +90 -0
- package/src/__tests__/render-feature-prepared-errors.test-d.ts +79 -0
- package/src/__tests__/render-feature-prepared-graphics-docs.unit.test.ts +80 -0
- package/src/__tests__/render-feature-prepared-graphics-isolation.unit.test.ts +72 -0
- package/src/__tests__/render-feature-prepared-graphics-negative.test-d.ts +36 -0
- package/src/__tests__/render-feature-prepared-graphics.test-d.ts +74 -0
- package/src/__tests__/render-feature-prepared-graphics.unit.test.ts +121 -0
- package/src/__tests__/render-feature-public-surface.test-d.ts +57 -0
- package/src/__tests__/render-feature-retry.unit.test.ts +87 -0
- package/src/__tests__/render-feature-scheduling.unit.test.ts +110 -0
- package/src/__tests__/render-feature-stage-failed-policy-owner.unit.test.ts +137 -0
- package/src/__tests__/render-feature-stage-fault-recovery.unit.test.ts +146 -0
- package/src/__tests__/render-feature-visibility-context.test-d.ts +33 -0
- package/src/__tests__/render-feature-visibility-context.unit.test.ts +37 -0
- package/src/__tests__/render-feature-zero-work.unit.test.ts +76 -0
- package/src/__tests__/render-graph-compute-raster-gpu.ts +342 -0
- package/src/__tests__/render-graph-compute-raster.browser.test.ts +16 -0
- package/src/__tests__/render-graph-compute-raster.dawn.test.ts +22 -0
- package/src/__tests__/render-graph-hzb-gpu.ts +239 -0
- package/src/__tests__/render-graph-hzb.browser.test.ts +16 -0
- package/src/__tests__/render-graph-hzb.dawn.test.ts +23 -0
- package/src/__tests__/render-graph-primitives.unit.test.ts +22 -0
- package/src/__tests__/render-graph-storage-indirect-gpu.ts +162 -0
- package/src/__tests__/render-graph-storage-indirect.browser.test.ts +21 -0
- package/src/__tests__/render-graph-storage-indirect.dawn.test.ts +28 -0
- package/src/__tests__/render-scene-projection.unit.test.ts +168 -0
- package/src/__tests__/renderer-factory-material-contract.unit.test.ts +121 -0
- package/src/__tests__/renderer-lifecycle.integration.test.ts +58 -0
- package/src/__tests__/rhi-backend-package-boundary.unit.test.ts +11 -0
- package/src/__tests__/scriptable-pack-consumer.test-d.ts +14 -0
- package/src/__tests__/shader-stage-surface.unit.test.ts +43 -0
- package/src/__tests__/ssao-config.unit.test.ts +36 -0
- package/src/__tests__/ssao-kernel-surface.unit.test.ts +14 -0
- package/src/__tests__/standard-clustered-pipeline.unit.test.ts +28 -0
- package/src/__tests__/standard-descriptors.test-d.ts +22 -0
- package/src/__tests__/standard-pipeline.dawn.test.ts +61 -0
- package/src/__tests__/standard-pipeline.integration.test.ts +124 -0
- package/src/__tests__/standard-profile-oracle.unit.test.ts +62 -0
- package/src/__tests__/surface-configuration.unit.test.ts +91 -0
- package/src/__tests__/texture-usage-surface.unit.test.ts +58 -0
- package/src/__tests__/typed-pipeline-topology.unit.test.ts +223 -0
- package/src/__tests__/urp-pipeline-targets.unit.test.ts +42 -0
- package/src/__tests__/urp-pipeline.unit.test.ts +14 -0
- package/src/__tests__/vertex-color-pipeline.unit.test.ts +132 -0
- package/src/__tests__/vertex-layout-consumer.unit.test.ts +25 -0
- package/src/__tests__/visibility-diagnostics.integration.test.ts +62 -0
- package/src/__tests__/visibility-extract.integration.test.ts +98 -0
- package/src/__tests__/visibility-extract.perf.test.ts +130 -0
- package/src/__tests__/visibility-feature-dedup.integration.test.ts +55 -0
- package/src/__tests__/visibility-hidden-report.unit.test.ts +36 -0
- package/src/__tests__/visibility-instances.integration.test.ts +46 -0
- package/src/__tests__/visibility-multi-world.integration.test.ts +86 -0
- package/src/__tests__/visibility-producer-matrix.integration.test.ts +168 -0
- package/src/__tests__/visibility-producer-matrix.unit.test.ts +96 -0
- package/src/__tests__/visibility-public-surface.test-d.ts +27 -0
- package/src/__tests__/visibility-resolver.unit.test.ts +85 -0
- package/src/__tests__/visibility-resource-short-circuit.unit.test.ts +80 -0
- package/src/__tests__/visibility-snapshot-contract.unit.test.ts +60 -0
- package/src/__tests__/vocabulary.unit.test.ts +21 -0
- package/src/assembly/backend-contract.ts +57 -0
- package/src/assembly/factory.ts +8130 -0
- package/src/assembly/host-contract.ts +101 -0
- package/src/assembly/material/assembly.ts +48 -0
- package/src/assembly/material/pipeline-projection.ts +63 -0
- package/src/assets/asset-decoders.ts +158 -0
- package/src/assets/render-asset-port.ts +44 -0
- package/src/assets/resolve-render-asset.ts +13 -0
- package/src/authoring.ts +17 -0
- package/src/cluster-binner.ts +700 -0
- package/src/components/__tests__/points-lines-admission.unit.test.ts +219 -0
- package/src/components/__tests__/points-lines-schema.unit.test.ts +56 -0
- package/src/components/__tests__/schema-contract.unit.test.ts +10 -0
- package/src/components/__tests__/schema-parity.unit.test.ts +25 -0
- package/src/components/__tests__/visibility-schema.unit.test.ts +35 -0
- package/src/components/camera.ts +512 -0
- package/src/components/directional-light.ts +120 -0
- package/src/components/glyph-text.ts +64 -0
- package/src/components/index.ts +54 -0
- package/src/components/instances.ts +206 -0
- package/src/components/layer.ts +69 -0
- package/src/components/light-helpers.ts +188 -0
- package/src/components/lines.ts +18 -0
- package/src/components/mesh-filter.ts +60 -0
- package/src/components/mesh-renderer.ts +61 -0
- package/src/components/point-light-shadow.ts +43 -0
- package/src/components/point-light.ts +65 -0
- package/src/components/points.ts +40 -0
- package/src/components/post-process-params.ts +35 -0
- package/src/components/scene-instance.ts +193 -0
- package/src/components/skybox-background.ts +103 -0
- package/src/components/skylight.ts +97 -0
- package/src/components/sort-key.ts +75 -0
- package/src/components/spot-light.ts +124 -0
- package/src/components/sprite-animation.ts +168 -0
- package/src/components/sprite-instances.ts +179 -0
- package/src/components/sprite-playback-mode.ts +79 -0
- package/src/components/sprite-region-override.ts +105 -0
- package/src/components/tile-layer.ts +167 -0
- package/src/components/tilemap.ts +48 -0
- package/src/components/visibility.ts +53 -0
- package/src/construct-renderer.ts +67 -0
- package/src/debug-draw-glue.ts +48 -0
- package/src/device/device-scope.ts +306 -0
- package/src/device/gpu-residency.ts +1822 -0
- package/src/device/resource-types.ts +20 -0
- package/src/engine-metrics.ts +82 -0
- package/src/errors/ecs-validation.ts +16 -0
- package/src/errors/index.ts +3 -0
- package/src/errors/recover.ts +161 -0
- package/src/errors/render.ts +1284 -0
- package/src/extract/visibility.ts +120 -0
- package/src/features/fullscreen.ts +46 -0
- package/src/features/host.ts +1363 -0
- package/src/features/morph/morph-feature.ts +377 -0
- package/src/features/plan.ts +447 -0
- package/src/features/prepared-gpu-work.ts +959 -0
- package/src/features/prepared-graphics-store.ts +449 -0
- package/src/features/prepared-graphics.ts +420 -0
- package/src/features/render-graph-compute.ts +69 -0
- package/src/features/render-graph-contribution.ts +75 -0
- package/src/features/render-graph-raster.ts +332 -0
- package/src/features/render-graph-resources.ts +38 -0
- package/src/features/targets.ts +70 -0
- package/src/features/types.ts +103 -0
- package/src/features/vocabulary.ts +24 -0
- package/src/fullscreen-post-process-pass.ts +363 -0
- package/src/glyph-text-layout-system.ts +421 -0
- package/src/gpu-driven/batch-topology.ts +245 -0
- package/src/gpu-driven/production-raster.ts +695 -0
- package/src/gpu-driven/view-gpu.ts +703 -0
- package/src/gpu-resource.ts +159 -0
- package/src/gpu-scene-schema.ts +136 -0
- package/src/gpu-scene.ts +722 -0
- package/src/gpu-stage.ts +9 -0
- package/src/gpu-texture-usage.ts +12 -0
- package/src/gpu-usage.ts +14 -0
- package/src/hdrp-buffers.ts +480 -0
- package/src/ibl/IblPipelineCache.ts +1006 -0
- package/src/ibl/skylight-bind-group.ts +513 -0
- package/src/index.ts +129 -0
- package/src/inspection-types.ts +80 -0
- package/src/instance-buffer-cache.ts +95 -0
- package/src/internal.ts +9 -0
- package/src/lifecycle.ts +168 -0
- package/src/light-buffer-layout.ts +346 -0
- package/src/materials.ts +214 -0
- package/src/mesh-material-bindings.ts +103 -0
- package/src/pbr-pipeline.ts +1137 -0
- package/src/pipeline/standard-forward-lane.ts +229 -0
- package/src/pipeline/standard-pipeline.ts +555 -0
- package/src/pipeline/standard-profile.ts +65 -0
- package/src/pipeline-builder.ts +382 -0
- package/src/pipeline-spec-types.ts +28 -0
- package/src/pipeline-spec.ts +1231 -0
- package/src/plugin.ts +69 -0
- package/src/points-lines/__tests__/bounds.unit.test.ts +21 -0
- package/src/points-lines/__tests__/cache-recovery.unit.test.ts +157 -0
- package/src/points-lines/__tests__/inspection-lanes.integration.test.ts +146 -0
- package/src/points-lines/__tests__/inspection.unit.test.ts +173 -0
- package/src/points-lines/__tests__/lane-structural.integration.test.ts +122 -0
- package/src/points-lines/__tests__/points-lines.bench.ts +400 -0
- package/src/points-lines/__tests__/raster-lane.integration.test.ts +44 -0
- package/src/points-lines/__tests__/snapshot.unit.test.ts +101 -0
- package/src/points-lines/__tests__/view-ubo.unit.test.ts +73 -0
- package/src/points-lines/admission.ts +238 -0
- package/src/points-lines/bounds.ts +23 -0
- package/src/points-lines/expansion-cache.ts +215 -0
- package/src/points-lines/inspection.ts +97 -0
- package/src/points-lines/prepare.ts +177 -0
- package/src/points-lines/record.ts +125 -0
- package/src/points-lines/snapshot.ts +130 -0
- package/src/post-process-errors.ts +302 -0
- package/src/prepare/prepared-graphics-resolver.ts +456 -0
- package/src/record/__tests__/material-bg-cache.unit.test.ts +41 -0
- package/src/record/__tests__/material-slot-plan.unit.test.ts +44 -0
- package/src/record/__tests__/typed-frame-graph-plan.unit.test.ts +41 -0
- package/src/record/__tests__/video-texture-view.unit.test.ts +90 -0
- package/src/record/frame-lighting.ts +1074 -0
- package/src/record/frame-snapshot.ts +500 -0
- package/src/record/frame-targets.ts +137 -0
- package/src/record/frame.ts +1598 -0
- package/src/record/helpers.ts +284 -0
- package/src/record/main-pass-geometry.ts +1065 -0
- package/src/record/main-pass-material.ts +1043 -0
- package/src/record/main-pass-sprite-draws.ts +1137 -0
- package/src/record/main-pass.ts +610 -0
- package/src/record/mesh-ssbo.ts +885 -0
- package/src/record/render-context.ts +384 -0
- package/src/record/shadow-pass.ts +698 -0
- package/src/record/skybox-post-pass.ts +593 -0
- package/src/record/typed-frame-graph.ts +461 -0
- package/src/record/view-ubo.ts +222 -0
- package/src/render-contract.ts +582 -0
- package/src/render-data.ts +385 -0
- package/src/render-graph-primitives.ts +811 -0
- package/src/render-pipeline.ts +259 -0
- package/src/render-system-extract.ts +4585 -0
- package/src/render-system.ts +1933 -0
- package/src/scene/render-scene-types.ts +67 -0
- package/src/scene/render-scene.ts +1087 -0
- package/src/scene-instances/post-spawn-resolve-joints.ts +165 -0
- package/src/shadow-atlas.ts +244 -0
- package/src/ssao-buffers.ts +334 -0
- package/src/ssao-config.ts +61 -0
- package/src/systems/active-camera.ts +116 -0
- package/src/systems/pass-selector.ts +49 -0
- package/src/systems/skin-palette-allocator.ts +251 -0
- package/src/systems/skin-palette-types.ts +14 -0
- package/src/systems/transparent-sort-config.ts +233 -0
- package/src/tilemap-chunk-extract-system.ts +1290 -0
- package/src/typed-render-graph-primitives.ts +541 -0
- package/src/typed-shadow-passes.ts +165 -0
|
@@ -0,0 +1,512 @@
|
|
|
1
|
+
// @forgeax/engine-render - Camera (projection variant + ortho extension).
|
|
2
|
+
//
|
|
3
|
+
// Schema: 9 f32 columns — perspective quartet (fov + aspect + near + far)
|
|
4
|
+
// + projection discriminator (0 = perspective, 1 = orthographic) + ortho
|
|
5
|
+
// quartet (left + right + bottom + top). The view matrix continues to be
|
|
6
|
+
// derived from the entity's Transform (AC-06 case B fires
|
|
7
|
+
// 'render-system-no-camera' when 0 such entities exist).
|
|
8
|
+
//
|
|
9
|
+
// Projection discriminator:
|
|
10
|
+
// projection === 0 → perspective path; RenderSystem builds
|
|
11
|
+
// mat4.perspective(out, fov, aspect, near, far).
|
|
12
|
+
// WebGPU [0, 1] NDC z; perspective reverse-Z hook is
|
|
13
|
+
// a future spin-off path (plan-strategy §R-7) kept
|
|
14
|
+
// outside M3 scope — the short-name mat4.perspective
|
|
15
|
+
// already writes [0, 1] NDC, matching the ortho branch.
|
|
16
|
+
// projection === 1 → orthographic path; RenderSystem builds
|
|
17
|
+
// mat4.orthographic(out, left, right, bottom, top,
|
|
18
|
+
// near, far) (WebGPU [0, 1] NDC; same z convention).
|
|
19
|
+
//
|
|
20
|
+
// Naming convention: forgeax uses the bare `Camera` name (no `Component`
|
|
21
|
+
// suffix) to follow the unity-style flavor for "individuating" component
|
|
22
|
+
// names per plan-strategy 7.2 + D-Q5a user lock.
|
|
23
|
+
//
|
|
24
|
+
// Related: requirements §AC-16 (Camera Ortho + Box3 / Sphere);
|
|
25
|
+
// plan-strategy §M3 range + §R-7 risk (single perspective camera
|
|
26
|
+
// in hello-room does NOT trigger depth-func conflict; multi-camera
|
|
27
|
+
// mixed perspective + ortho deferred to feat-future-camera-depth-func);
|
|
28
|
+
// plan-tasks.json w9 acceptanceCheck.
|
|
29
|
+
|
|
30
|
+
import { defineComponent, type SchemaOf, type ShapeOf } from '@forgeax/engine-ecs';
|
|
31
|
+
import { TONEMAP_SHADER_MODE } from '@forgeax/engine-shader';
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Projection discriminator literal union (AC-16 narrowing surface).
|
|
35
|
+
* Exposed for consumer code that maps `camera.projection` numeric values back
|
|
36
|
+
* to a switch-able string literal (e.g. RenderSystem dispatch / inspector
|
|
37
|
+
* snapshot rendering).
|
|
38
|
+
*/
|
|
39
|
+
export type CameraProjection = 'perspective' | 'orthographic';
|
|
40
|
+
|
|
41
|
+
/** Numeric encoding of perspective projection (schema value for `projection`). */
|
|
42
|
+
export const CAMERA_PROJECTION_PERSPECTIVE = 0;
|
|
43
|
+
/** Numeric encoding of orthographic projection (schema value for `projection`). */
|
|
44
|
+
export const CAMERA_PROJECTION_ORTHOGRAPHIC = 1;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Map a `camera.projection` numeric value to the closed `CameraProjection`
|
|
48
|
+
* string-literal union. Values other than 0 / 1 fall back to `'perspective'`
|
|
49
|
+
* (defensive for defaulted / uninitialised entities; charter proposition 4
|
|
50
|
+
* no silent exception).
|
|
51
|
+
*/
|
|
52
|
+
export function cameraProjectionFromF32(value: number): CameraProjection {
|
|
53
|
+
return value === CAMERA_PROJECTION_ORTHOGRAPHIC ? 'orthographic' : 'perspective';
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Tone-mapping mode discriminator literal union (AC-01 narrowing surface;
|
|
58
|
+
* feat-20260519-tonemap-reinhard-mvp / M1).
|
|
59
|
+
*
|
|
60
|
+
* Two members for the MVP:
|
|
61
|
+
* `'none'` - default; render-target stays `bgra8unorm-srgb`
|
|
62
|
+
* and the geometry pass writes directly to the
|
|
63
|
+
* swap-chain (zero-overhead opt-out path).
|
|
64
|
+
* `'reinhard-extended'` - Forgeax Reinhard 2002 extended (luminance-domain)
|
|
65
|
+
* opt-in;
|
|
66
|
+
* `'reinhard'` - Three r184 per-channel Reinhard opt-in;
|
|
67
|
+
* geometry pass routes through an `rgba16float`
|
|
68
|
+
* HDR target and a fullscreen tonemap pass
|
|
69
|
+
* (`packages/shader/src/tonemap.wgsl`).
|
|
70
|
+
*
|
|
71
|
+
* The remaining members mirror the Three r184 public names and formulas.
|
|
72
|
+
*/
|
|
73
|
+
export type Tonemap =
|
|
74
|
+
| 'none'
|
|
75
|
+
| 'reinhard-extended'
|
|
76
|
+
| 'reinhard'
|
|
77
|
+
| 'linear'
|
|
78
|
+
| 'cineon'
|
|
79
|
+
| 'aces-filmic'
|
|
80
|
+
| 'agx'
|
|
81
|
+
| 'neutral';
|
|
82
|
+
|
|
83
|
+
/** Numeric encoding of the no-op tonemap path (schema value for `tonemap`). */
|
|
84
|
+
export const TONEMAP_NONE = TONEMAP_SHADER_MODE.none;
|
|
85
|
+
/**
|
|
86
|
+
* Numeric encoding of the Reinhard-extended tonemap path
|
|
87
|
+
* (schema value for `tonemap`).
|
|
88
|
+
*/
|
|
89
|
+
export const TONEMAP_REINHARD_EXTENDED = TONEMAP_SHADER_MODE.reinhardExtended;
|
|
90
|
+
/** Numeric encoding of the Three r184 per-channel Reinhard path. */
|
|
91
|
+
export const TONEMAP_REINHARD = TONEMAP_SHADER_MODE.reinhard;
|
|
92
|
+
/** Numeric encoding of the linear (identity after exposure) tonemap path. */
|
|
93
|
+
export const TONEMAP_LINEAR = TONEMAP_SHADER_MODE.linear;
|
|
94
|
+
/** Numeric encoding of the Cineon (Kodak log) tonemap path. */
|
|
95
|
+
export const TONEMAP_CINEON = TONEMAP_SHADER_MODE.cineon;
|
|
96
|
+
/** Numeric encoding of the ACES filmic (Narkowicz 2015) tonemap path. */
|
|
97
|
+
export const TONEMAP_ACES_FILMIC = TONEMAP_SHADER_MODE.acesFilmic;
|
|
98
|
+
/** Numeric encoding of the AgX (Troy Sobotka / Blender 3.x) tonemap path. */
|
|
99
|
+
export const TONEMAP_AGX = TONEMAP_SHADER_MODE.agx;
|
|
100
|
+
/** Numeric encoding of the Khronos PBR neutral tonemap path. */
|
|
101
|
+
export const TONEMAP_NEUTRAL = TONEMAP_SHADER_MODE.neutral;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Map a `camera.tonemap` numeric value to the closed `Tonemap` string-literal
|
|
105
|
+
* union. Unknown values fall back to `'none'` for defensive schema decoding.
|
|
106
|
+
*/
|
|
107
|
+
export function tonemapFromF32(value: number): Tonemap {
|
|
108
|
+
switch (value) {
|
|
109
|
+
case TONEMAP_REINHARD_EXTENDED:
|
|
110
|
+
return 'reinhard-extended';
|
|
111
|
+
case TONEMAP_REINHARD:
|
|
112
|
+
return 'reinhard';
|
|
113
|
+
case TONEMAP_LINEAR:
|
|
114
|
+
return 'linear';
|
|
115
|
+
case TONEMAP_CINEON:
|
|
116
|
+
return 'cineon';
|
|
117
|
+
case TONEMAP_ACES_FILMIC:
|
|
118
|
+
return 'aces-filmic';
|
|
119
|
+
case TONEMAP_AGX:
|
|
120
|
+
return 'agx';
|
|
121
|
+
case TONEMAP_NEUTRAL:
|
|
122
|
+
return 'neutral';
|
|
123
|
+
default:
|
|
124
|
+
return 'none';
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Inverse of {@link tonemapFromF32}: map the closed `Tonemap` string-literal
|
|
130
|
+
* union to the u32 mode the tonemap WGSL `params.mode` switch reads. SSOT for
|
|
131
|
+
* the mode encoding shared by the extract-stage built-in tonemap provider
|
|
132
|
+
* (feat-20260621 M-A3 / w13: `Camera.tonemap` -> `forgeax::tonemap` 16B data)
|
|
133
|
+
* and any other consumer. `'none'` maps to 0 (the tonemap pass never dispatches
|
|
134
|
+
* on the LDR path, so 0 is only ever a placeholder).
|
|
135
|
+
*/
|
|
136
|
+
export function tonemapToU32(mode: Tonemap): number {
|
|
137
|
+
switch (mode) {
|
|
138
|
+
case 'reinhard-extended':
|
|
139
|
+
return TONEMAP_REINHARD_EXTENDED;
|
|
140
|
+
case 'reinhard':
|
|
141
|
+
return TONEMAP_REINHARD;
|
|
142
|
+
case 'linear':
|
|
143
|
+
return TONEMAP_LINEAR;
|
|
144
|
+
case 'cineon':
|
|
145
|
+
return TONEMAP_CINEON;
|
|
146
|
+
case 'aces-filmic':
|
|
147
|
+
return TONEMAP_ACES_FILMIC;
|
|
148
|
+
case 'agx':
|
|
149
|
+
return TONEMAP_AGX;
|
|
150
|
+
case 'neutral':
|
|
151
|
+
return TONEMAP_NEUTRAL;
|
|
152
|
+
case 'none':
|
|
153
|
+
return TONEMAP_NONE;
|
|
154
|
+
}
|
|
155
|
+
throw new RangeError(`Invalid tonemap mode: ${String(mode)}.`);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Anti-alias mode discriminator literal union
|
|
160
|
+
* (feat-20260528-fxaa-post-processing / w2;
|
|
161
|
+
* feat-20260604-learn-render-4-10-anti-aliasing-msaa adds `'msaa'`).
|
|
162
|
+
*
|
|
163
|
+
* Four members:
|
|
164
|
+
* `'none'` - default; no anti-aliasing (zero-overhead opt-out path)
|
|
165
|
+
* `'fxaa'` - FXAA 3.11 fullscreen post-processing pass (screen-space, shading-aliasing)
|
|
166
|
+
* `'msaa'` - 4x hardware multi-sample anti-aliasing (geometry-edge coverage).
|
|
167
|
+
* Active on both HDR and LDR-swap-chain paths, so a default Camera
|
|
168
|
+
* (`tonemap='none'`) with `antialias='msaa'` is NOT a silent no-op.
|
|
169
|
+
* `'taa'` - temporal anti-aliasing; renderer temporal projection owns its
|
|
170
|
+
* jitter and successful-submit history contract.
|
|
171
|
+
*
|
|
172
|
+
* MSAA and FXAA are orthogonal: MSAA resolves geometry-edge aliasing, FXAA
|
|
173
|
+
* resolves shading/high-frequency aliasing. TAA is mutually exclusive with both.
|
|
174
|
+
*/
|
|
175
|
+
export type Antialias = 'none' | 'fxaa' | 'msaa' | 'taa';
|
|
176
|
+
|
|
177
|
+
/** Numeric encoding of anti-alias disabled (schema value for `antialias`). */
|
|
178
|
+
export const ANTIALIAS_NONE = 0;
|
|
179
|
+
/** Numeric encoding of FXAA anti-aliasing (schema value for `antialias`). */
|
|
180
|
+
export const ANTIALIAS_FXAA = 1;
|
|
181
|
+
/** Numeric encoding of MSAA multi-sample anti-aliasing (schema value for `antialias`). */
|
|
182
|
+
export const ANTIALIAS_MSAA = 2;
|
|
183
|
+
/** Numeric encoding of temporal anti-aliasing (schema value for `antialias`). */
|
|
184
|
+
export const ANTIALIAS_TAA = 3;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Map a `camera.antialias` numeric value to the closed `Antialias`
|
|
188
|
+
* string-literal union. Invalid values fail-fast with structured error (charter P3).
|
|
189
|
+
*/
|
|
190
|
+
export function antialiasFromF32(value: number): Antialias {
|
|
191
|
+
if (value === ANTIALIAS_NONE) return 'none';
|
|
192
|
+
if (value === ANTIALIAS_FXAA) return 'fxaa';
|
|
193
|
+
if (value === ANTIALIAS_MSAA) return 'msaa';
|
|
194
|
+
if (value === ANTIALIAS_TAA) return 'taa';
|
|
195
|
+
throw new RangeError(
|
|
196
|
+
`Invalid antialias value: ${value}. Expected ${ANTIALIAS_NONE} (none), ${ANTIALIAS_FXAA} (fxaa), ${ANTIALIAS_MSAA} (msaa), or ${ANTIALIAS_TAA} (taa).`,
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Bloom enabled discriminator literal union
|
|
202
|
+
* (feat-20260531-bloom-first-declarative-render-graph-pass / w2).
|
|
203
|
+
*
|
|
204
|
+
* Two members:
|
|
205
|
+
* `'off'` - default; no bloom post-processing (zero-overhead opt-out path)
|
|
206
|
+
* `'on'` - bloom bright-pass + separable blur + composite pipeline
|
|
207
|
+
*
|
|
208
|
+
* Bloom is a discrete enum (0/1) — illegal values fail-fast with RangeError
|
|
209
|
+
* (charter P3), matching antialiasFromF32 precedent.
|
|
210
|
+
*/
|
|
211
|
+
export type BloomEnabled = 'off' | 'on';
|
|
212
|
+
|
|
213
|
+
/** Numeric encoding of bloom disabled (schema value for `bloom`). */
|
|
214
|
+
export const BLOOM_DISABLED = 0;
|
|
215
|
+
/** Numeric encoding of bloom enabled (schema value for `bloom`). */
|
|
216
|
+
export const BLOOM_ENABLED = 1;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Map a `camera.bloom` numeric value to the closed `BloomEnabled` string-literal
|
|
220
|
+
* union. Invalid values fail-fast with structured error (charter P3).
|
|
221
|
+
*/
|
|
222
|
+
export function bloomEnabledFromF32(value: number): BloomEnabled {
|
|
223
|
+
if (value === BLOOM_DISABLED) return 'off';
|
|
224
|
+
if (value === BLOOM_ENABLED) return 'on';
|
|
225
|
+
throw new RangeError(
|
|
226
|
+
`Invalid bloom value: ${value}. Expected ${BLOOM_DISABLED} (off) or ${BLOOM_ENABLED} (on).`,
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Camera projection parameters (perspective + orthographic variants) +
|
|
232
|
+
* tonemap trio (mode + exposure + whitePoint).
|
|
233
|
+
*
|
|
234
|
+
* Camera transform comes from the entity's `Transform` (AI users
|
|
235
|
+
* spawn camera entities with both components: see example below).
|
|
236
|
+
*
|
|
237
|
+
* Defaults (do not auto-apply; spawn explicitly for the perspective quartet):
|
|
238
|
+
* fov = pi/4 - 45-degree vertical field of view
|
|
239
|
+
* aspect = 16/9 - widescreen aspect (use canvas.width / canvas.height)
|
|
240
|
+
* near = 0.1
|
|
241
|
+
* far = 100
|
|
242
|
+
* projection = 0 - CAMERA_PROJECTION_PERSPECTIVE (layer-2)
|
|
243
|
+
* left = -1, right = 1, bottom = -1, top = 1 (orthographic; layer-2)
|
|
244
|
+
* tonemap = 0 - TONEMAP_NONE (layer-2; opt-in path stays
|
|
245
|
+
* 0-overhead by default)
|
|
246
|
+
* exposure = 1.0 - layer-2 default for the Reinhard-extended path
|
|
247
|
+
* @applicableWhen tonemap === 'reinhard-extended'
|
|
248
|
+
* whitePoint = 4.0 - layer-2 default for the Reinhard-extended path
|
|
249
|
+
* @applicableWhen tonemap === 'reinhard-extended'
|
|
250
|
+
* @minimum 0 (shader floor `max(Y, 1e-5)` keeps
|
|
251
|
+
* the divisor finite even at 0; D-O3)
|
|
252
|
+
* clearColor = [0, 0, 0, 0]
|
|
253
|
+
* - feat-20260709 M3 / D-3: clear-color is one
|
|
254
|
+
* inline `array<f32,4>` column (collapsed from the
|
|
255
|
+
* feat-20260608 clearR/G/B/A quartet). Defaults to
|
|
256
|
+
* transparent black; an explicit alpha remains
|
|
257
|
+
* visible through this public field.
|
|
258
|
+
*
|
|
259
|
+
* MVP supports a single active camera (the first archetype iteration hit;
|
|
260
|
+
* N>1 fires 'render-system-multi-camera' + uses first). Multi-viewport is
|
|
261
|
+
* OOS (see feat-future-multi-viewport). The orthographic path reuses the
|
|
262
|
+
* same near / far as the perspective path — both variants share the single
|
|
263
|
+
* Camera archetype (17 scalar f32 columns + one historyVersion u32 column +
|
|
264
|
+
* the `clearColor` array<f32,4> column + the `autoAspect` bool column).
|
|
265
|
+
*
|
|
266
|
+
* @example Perspective camera at (0, 0, 3) looking down -Z (zero-config tonemap):
|
|
267
|
+
* world.spawn(
|
|
268
|
+
* { component: Transform, data: {
|
|
269
|
+
* pos: [0, 0, 3],
|
|
270
|
+
* quat: [0, 0, 0, 1],
|
|
271
|
+
* scale: [1, 1, 1],
|
|
272
|
+
* } },
|
|
273
|
+
* { component: Camera, data: {
|
|
274
|
+
* fov: Math.PI / 4, aspect: 16 / 9, near: 0.1, far: 100,
|
|
275
|
+
* } },
|
|
276
|
+
* );
|
|
277
|
+
* // tonemap defaults to 0 (TONEMAP_NONE) - 0-overhead path.
|
|
278
|
+
*
|
|
279
|
+
* @example Opt-in Reinhard-extended tonemap (high-intensity HDR scene):
|
|
280
|
+
* world.spawn(
|
|
281
|
+
* { component: Transform, data: { ... } },
|
|
282
|
+
* { component: Camera, data: {
|
|
283
|
+
* fov: Math.PI / 4, aspect: 16 / 9, near: 0.1, far: 100,
|
|
284
|
+
* tonemap: TONEMAP_REINHARD_EXTENDED,
|
|
285
|
+
* exposure: 1.0,
|
|
286
|
+
* whitePoint: 4.0,
|
|
287
|
+
* } },
|
|
288
|
+
* );
|
|
289
|
+
*
|
|
290
|
+
* @example Orthographic camera spanning [-10, 10]^2 on the near plane:
|
|
291
|
+
* world.spawn(
|
|
292
|
+
* { component: Transform, data: {
|
|
293
|
+
* pos: [0, 0, 5],
|
|
294
|
+
* quat: [0, 0, 0, 1],
|
|
295
|
+
* scale: [1, 1, 1],
|
|
296
|
+
* } },
|
|
297
|
+
* { component: Camera, data: {
|
|
298
|
+
* fov: 0, aspect: 1, near: 0.1, far: 100,
|
|
299
|
+
* projection: CAMERA_PROJECTION_ORTHOGRAPHIC,
|
|
300
|
+
* left: -10, right: 10, bottom: -10, top: 10,
|
|
301
|
+
* } },
|
|
302
|
+
* );
|
|
303
|
+
*/
|
|
304
|
+
export const Camera = defineComponent('Camera', {
|
|
305
|
+
fov: { type: 'f32' },
|
|
306
|
+
aspect: { type: 'f32' },
|
|
307
|
+
near: { type: 'f32' },
|
|
308
|
+
far: { type: 'f32' },
|
|
309
|
+
projection: { type: 'f32', default: 0 },
|
|
310
|
+
left: { type: 'f32', default: -1 },
|
|
311
|
+
right: { type: 'f32', default: 1 },
|
|
312
|
+
bottom: { type: 'f32', default: -1 },
|
|
313
|
+
top: { type: 'f32', default: 1 },
|
|
314
|
+
tonemap: { type: 'f32', default: 0 },
|
|
315
|
+
exposure: { type: 'f32', default: 1.0 },
|
|
316
|
+
whitePoint: { type: 'f32', default: 4.0 },
|
|
317
|
+
antialias: { type: 'f32', default: 0 },
|
|
318
|
+
historyVersion: { type: 'u32', default: 0 },
|
|
319
|
+
bloom: { type: 'f32', default: 0 },
|
|
320
|
+
bloomThreshold: { type: 'f32', default: 1.0 },
|
|
321
|
+
bloomIntensity: { type: 'f32', default: 1.0 },
|
|
322
|
+
bloomBlurRadius: { type: 'f32', default: 4.0 },
|
|
323
|
+
// feat-20260709 M3 / D-3: clear-color is one inline `array<f32,4>` column.
|
|
324
|
+
// The earlier 4-scalar form (clearR/G/B/A) was chosen when this was believed
|
|
325
|
+
// to be the only SoA-safe shape; the Transform (pos/quat/scale) and light
|
|
326
|
+
// (direction/color) precedents disprove that -- an `array<f32,N>` IS an
|
|
327
|
+
// inline stride-N SoA column, read on the hot path as `col[i*N+a]` with zero
|
|
328
|
+
// allocation, so collapsing four scalars into one column removes three field
|
|
329
|
+
// names a reader must track without changing the storage layout or read
|
|
330
|
+
// pattern. The default `[0, 0, 0, 0]` is transparent black; explicit alpha
|
|
331
|
+
// stays visible through the same public array field.
|
|
332
|
+
clearColor: { type: 'array<f32, 4>', default: new Float32Array([0, 0, 0, 0]) },
|
|
333
|
+
// feat-20260617-host-engine-contract-and-video-cutscene / M3 / D-4: the
|
|
334
|
+
// aspect-sync sidecar on the createApp(canvas) path writes
|
|
335
|
+
// canvas.width / canvas.height into `aspect` every frame when this flag is
|
|
336
|
+
// true. Reuses the existing `bool` column tier (AnimationPlayer.paused /
|
|
337
|
+
// AudioSource.playing precedent) -- zero ECS infrastructure change. Default
|
|
338
|
+
// true so demos that never touch aspect track the canvas automatically
|
|
339
|
+
// (charter P1 default-is-correct); set false for render-to-texture /
|
|
340
|
+
// split-screen cameras that drive aspect themselves. Read it via
|
|
341
|
+
// world.get (readRow narrows bool -> JS boolean); the query-bundle path
|
|
342
|
+
// returns a raw 0/1 number (the `!== 0` always-true trap).
|
|
343
|
+
autoAspect: { type: 'bool', default: true },
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
// ─── Camera POD type (derived from Camera token — single source, AC-07) ─────
|
|
347
|
+
//
|
|
348
|
+
// ShapeOf<SchemaOf<typeof Camera>> resolves the 20-field POD from the Camera
|
|
349
|
+
// token's schema, which is itself derived from Camera.fields[k].type (D-A7).
|
|
350
|
+
// This replaces the hand-maintained CameraDataPod interface — the field set
|
|
351
|
+
// lives exclusively in the Camera component definition above.
|
|
352
|
+
type CameraPod = ShapeOf<SchemaOf<typeof Camera>>;
|
|
353
|
+
|
|
354
|
+
// ─── Camera factory functions (w13 SSOT refactoring) ─────────────────────
|
|
355
|
+
//
|
|
356
|
+
// Standalone factory functions that return 20-field CameraPod objects
|
|
357
|
+
// matching the Camera component column shape. Not static methods because
|
|
358
|
+
// TypeScript const-namespace merge is not supported, and Object.assign
|
|
359
|
+
// would break the Camera token's reference identity (archetype columns /
|
|
360
|
+
// queries key off the global owner identity associated with the token).
|
|
361
|
+
//
|
|
362
|
+
// Import as:
|
|
363
|
+
// import { Camera, perspective, orthographic } from '@forgeax/engine-render';
|
|
364
|
+
// world.spawn({ component: Camera, data: perspective({ fov: 60, aspect: 4/3 }) });
|
|
365
|
+
//
|
|
366
|
+
// Charter P1 progressive disclosure: Barrel re-exports put perspective
|
|
367
|
+
// / orthographic next to Camera in IDE autocomplete.
|
|
368
|
+
//
|
|
369
|
+
// D-A4 factory retention reason: perspective() / orthographic() carry
|
|
370
|
+
// required/optional parameter semantics that cannot be derived from
|
|
371
|
+
// the schema. perspective requires fov + aspect (no universal default),
|
|
372
|
+
// orthographic requires left/right/bottom/top. The schema/defaults system
|
|
373
|
+
// only records type + optional default value per field — it has no concept
|
|
374
|
+
// of "this field MUST be supplied by the caller." The factories encode
|
|
375
|
+
// that contract at the TypeScript type level, which schema/defaults alone
|
|
376
|
+
// cannot express. Per AC-07, the factories are kept; only the POD type
|
|
377
|
+
// and default literals are derived from the Camera token (SSOT).
|
|
378
|
+
|
|
379
|
+
interface CameraPerspectiveOpts {
|
|
380
|
+
fov: number;
|
|
381
|
+
aspect: number;
|
|
382
|
+
near?: number;
|
|
383
|
+
far?: number;
|
|
384
|
+
/**
|
|
385
|
+
* feat-20260617-host-engine-contract-and-video-cutscene / M3: when true
|
|
386
|
+
* (the schema default), the aspect-sync sidecar on the createApp(canvas)
|
|
387
|
+
* path overwrites `aspect` with `canvas.width / canvas.height` every frame.
|
|
388
|
+
* Omit it for the default-correct behaviour; set `false` to opt out (the
|
|
389
|
+
* factory then leaves `aspect` under your control -- render-to-texture,
|
|
390
|
+
* split-screen). Cameras built on the bare `createRenderer` path never
|
|
391
|
+
* receive aspect-sync regardless of this flag.
|
|
392
|
+
*/
|
|
393
|
+
autoAspect?: boolean;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
interface CameraOrthographicOpts {
|
|
397
|
+
left: number;
|
|
398
|
+
right: number;
|
|
399
|
+
bottom: number;
|
|
400
|
+
top: number;
|
|
401
|
+
near?: number;
|
|
402
|
+
far?: number;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* Build a CameraPod base from Camera.fields defaults (per-field SSOT).
|
|
407
|
+
* Fields without a default (fov / aspect / near / far — OOS-5) are left
|
|
408
|
+
* unset; caller fills them from opts or sentinel values.
|
|
409
|
+
*/
|
|
410
|
+
function cameraPodFromDefaults(): CameraPod {
|
|
411
|
+
const base: Record<string, unknown> = {};
|
|
412
|
+
for (const [key, field] of Object.entries(Camera.fields)) {
|
|
413
|
+
if ('default' in field && field.default !== undefined) {
|
|
414
|
+
base[key] = field.default;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
return base as CameraPod;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* Convenience factory: perspective CameraData POD.
|
|
422
|
+
*
|
|
423
|
+
* `fov` and `aspect` are required (no sensible universal default).
|
|
424
|
+
* `near` defaults to 0.1, `far` defaults to 100.
|
|
425
|
+
* Orthographic quartet defaults to [-1, 1]x[-1, 1]; tonemap defaults to
|
|
426
|
+
* TONEMAP_NONE (0-overhead path).
|
|
427
|
+
*
|
|
428
|
+
* When `autoAspect` is `true` (the default once shipped in M3), the
|
|
429
|
+
* aspect-sync sidecar on the `createApp(canvas)` path automatically writes
|
|
430
|
+
* `canvas.width / canvas.height` into `Camera.aspect` every frame. Set
|
|
431
|
+
* `autoAspect = false` to opt out (render-to-texture, split-screen).
|
|
432
|
+
* Cameras on the `createRenderer` path do not receive aspect-sync.
|
|
433
|
+
*
|
|
434
|
+
* @see {@link https://github.com/Ubpa/forgeax-engine/blob/main/docs/how-to/2026-06-18-host-engine-contract.md | Host-engine contract SSOT}
|
|
435
|
+
*
|
|
436
|
+
* @example
|
|
437
|
+
* ```ts
|
|
438
|
+
* import { Camera, perspective } from '@forgeax/engine-render';
|
|
439
|
+
* world.spawn(
|
|
440
|
+
* { component: Camera, data: perspective({ fov: Math.PI / 3, aspect: 4 / 3 }) }
|
|
441
|
+
* ).unwrap();
|
|
442
|
+
* ```
|
|
443
|
+
*
|
|
444
|
+
* @example With explicit near/far:
|
|
445
|
+
* ```ts
|
|
446
|
+
* const camData = perspective({ fov: Math.PI / 4, aspect: 16 / 9, near: 0.01, far: 1000 });
|
|
447
|
+
* world.spawn({ component: Camera, data: camData }).unwrap();
|
|
448
|
+
* ```
|
|
449
|
+
*
|
|
450
|
+
* @example With non-default clear color (default is `[0, 0, 0, 0]`).
|
|
451
|
+
* `clearColor` is an inline `array<f32,4>` field on `Camera`; spread the
|
|
452
|
+
* factory then override:
|
|
453
|
+
* ```ts
|
|
454
|
+
* world.spawn({
|
|
455
|
+
* component: Camera,
|
|
456
|
+
* data: { ...perspective({ fov: Math.PI / 3, aspect: 4 / 3 }), clearColor: [0, 1, 0, 1] },
|
|
457
|
+
* }).unwrap();
|
|
458
|
+
* ```
|
|
459
|
+
*/
|
|
460
|
+
export function perspective(opts: CameraPerspectiveOpts): CameraPod {
|
|
461
|
+
return {
|
|
462
|
+
// cameraPodFromDefaults() reads autoAspect's schema default (true), so an
|
|
463
|
+
// omitted opts.autoAspect lands the default-correct value; an explicit
|
|
464
|
+
// false overrides it below (D-4: factory one-step opt-out, charter P1).
|
|
465
|
+
...cameraPodFromDefaults(),
|
|
466
|
+
fov: opts.fov,
|
|
467
|
+
aspect: opts.aspect,
|
|
468
|
+
near: opts.near ?? 0.1,
|
|
469
|
+
far: opts.far ?? 100,
|
|
470
|
+
projection: CAMERA_PROJECTION_PERSPECTIVE,
|
|
471
|
+
...(opts.autoAspect !== undefined ? { autoAspect: opts.autoAspect } : {}),
|
|
472
|
+
};
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* Convenience factory: orthographic CameraData POD.
|
|
477
|
+
*
|
|
478
|
+
* All four ortho bounds (`left` / `right` / `bottom` / `top`) are required.
|
|
479
|
+
* `near` defaults to 0.1, `far` defaults to 100.
|
|
480
|
+
* Perspective fields get sentinel defaults (fov=0, aspect=1) for column
|
|
481
|
+
* alignment with the 12-field schema.
|
|
482
|
+
*
|
|
483
|
+
* @example
|
|
484
|
+
* ```ts
|
|
485
|
+
* import { Camera, orthographic } from '@forgeax/engine-render';
|
|
486
|
+
* world.spawn(
|
|
487
|
+
* { component: Camera, data: orthographic({
|
|
488
|
+
* left: -10, right: 10, bottom: -10, top: 10,
|
|
489
|
+
* }) }
|
|
490
|
+
* ).unwrap();
|
|
491
|
+
* ```
|
|
492
|
+
*
|
|
493
|
+
* @example Screen-aligned orthographic for pixel-unit rendering:
|
|
494
|
+
* ```ts
|
|
495
|
+
* const camData = orthographic({ left: 0, right: 800, bottom: 600, top: 0 });
|
|
496
|
+
* world.spawn({ component: Camera, data: camData }).unwrap();
|
|
497
|
+
* ```
|
|
498
|
+
*/
|
|
499
|
+
export function orthographic(opts: CameraOrthographicOpts): CameraPod {
|
|
500
|
+
return {
|
|
501
|
+
...cameraPodFromDefaults(),
|
|
502
|
+
fov: 0,
|
|
503
|
+
aspect: 1,
|
|
504
|
+
near: opts.near ?? 0.1,
|
|
505
|
+
far: opts.far ?? 100,
|
|
506
|
+
projection: CAMERA_PROJECTION_ORTHOGRAPHIC,
|
|
507
|
+
left: opts.left,
|
|
508
|
+
right: opts.right,
|
|
509
|
+
bottom: opts.bottom,
|
|
510
|
+
top: opts.top,
|
|
511
|
+
};
|
|
512
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
// @forgeax/engine-render - DirectionalLight (directional light parameters
|
|
2
|
+
// with merged shadow config).
|
|
3
|
+
//
|
|
4
|
+
// Schema: direction array<f32,3> + color array<f32,3> + intensity f32 + 1 bool
|
|
5
|
+
// castShadow + 8 f32 shadow columns (feat-20260709 M2: direction/color collapsed
|
|
6
|
+
// from 6 per-axis scalar columns to two inline array<f32,3> columns).
|
|
7
|
+
//
|
|
8
|
+
// Direction (xyz, outgoing) + color (rgb, linear space) + intensity in lux.
|
|
9
|
+
// No Transform dependency (directional lights have no position).
|
|
10
|
+
// The public world-unit convention is 1 world unit = 1 meter. Exposure is a
|
|
11
|
+
// camera output concern and is not folded into this light's intensity.
|
|
12
|
+
//
|
|
13
|
+
// 0 DirectionalLight + standard material -> physically correct black render
|
|
14
|
+
// (charter v2 P3/P4); details: AGENTS.md section Breaking changes 2026-05-18.
|
|
15
|
+
//
|
|
16
|
+
// Naming convention: bare entity name aligned with Bevy ECS conventions
|
|
17
|
+
// (feat-20260513-component-naming-bevy-align). Camera / Transform / etc.
|
|
18
|
+
// follow the same single-semantic-entity rule (charter proposition 5).
|
|
19
|
+
//
|
|
20
|
+
// charter mapping: proposition 1 (single import) + proposition 3 (silent
|
|
21
|
+
// failure -> explicit warning; first-frame warn) + proposition 5 (consistent
|
|
22
|
+
// abstraction: lighting parameters mirror GPU-side pbr.wgsl @group(0) view
|
|
23
|
+
// BG light fields).
|
|
24
|
+
//
|
|
25
|
+
// feat-20260621-merge-directionallightshadow-into-directionallight M1:
|
|
26
|
+
// DirectionalLightShadow's 9 shadow fields are merged into DirectionalLight
|
|
27
|
+
// to collapse the dual-component spawn into a single component (D-6 primary
|
|
28
|
+
// decision). castShadow defaults to true so zero-config spawns get shadows
|
|
29
|
+
// by default; set castShadow=false to opt out. D-6 directional stays
|
|
30
|
+
// first-hit-wins -- no ECS cardinality cap. Renderer allocation policy stays
|
|
31
|
+
// with the shadow atlas owner.
|
|
32
|
+
|
|
33
|
+
import { defineComponent } from '@forgeax/engine-ecs';
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Directional light (sun-like infinite light source) with merged shadow
|
|
37
|
+
* parameters.
|
|
38
|
+
*
|
|
39
|
+
* `direction` @semantics outgoing — points FROM light source TO surface
|
|
40
|
+
* (opposite of Three.js convention; the shader internally negates this
|
|
41
|
+
* vector to obtain the L vector for BRDF evaluation). `color` is
|
|
42
|
+
* linear-space rgb in [0, 1] per channel and `intensity` is lux. Exposure is
|
|
43
|
+
* applied after lighting by the camera output stage; no hidden light
|
|
44
|
+
* multiplier is applied here.
|
|
45
|
+
*
|
|
46
|
+
* castShadow defaults to true — zero-config spawns cast cascaded shadow maps.
|
|
47
|
+
* Set castShadow: false to opt out (shadow fields are still stored but their
|
|
48
|
+
* validation is skipped).
|
|
49
|
+
*
|
|
50
|
+
* Shadow fields (migrated from DirectionalLightShadow, feat-20260621 M1):
|
|
51
|
+
* cascadeCount ∈ {1,2,3,4} — number of cascades (default 4)
|
|
52
|
+
* splitLambda ∈ [0,1] — PSSM split weight (default 0.75)
|
|
53
|
+
* cascadeBlend ∈ [0,0.5] — blend width between cascades (default 0.2)
|
|
54
|
+
* mapSize >= 1 — shadow map resolution (default 2048)
|
|
55
|
+
* depthBias — shadow acne bias (default 0.005)
|
|
56
|
+
* normalBias — shadow acne normal offset (default 0.05)
|
|
57
|
+
* shadowDistance > 0 — how far shadows reach in front of the camera,
|
|
58
|
+
* in world units (default 200). This is the sole
|
|
59
|
+
* coverage knob: the CSM cascades are PSSM-split
|
|
60
|
+
* across [camera near, shadowDistance] and each
|
|
61
|
+
* cascade's orthographic bounds are fit to the
|
|
62
|
+
* camera frustum slice automatically. The near
|
|
63
|
+
* end is derived from the active camera's near
|
|
64
|
+
* plane (no separate near knob — any value other
|
|
65
|
+
* than the camera near either drops near shadows
|
|
66
|
+
* or wastes cascade-0 resolution).
|
|
67
|
+
* pcfKernelSize odd >= 1 — PCF kernel width (default 3)
|
|
68
|
+
*
|
|
69
|
+
* @example Spawn a single directional light with default shadows:
|
|
70
|
+
* world.spawn({ component: DirectionalLight, data: {
|
|
71
|
+
* direction: [-0.5, -1, -0.3], // [x, y, z]
|
|
72
|
+
* color: [1, 1, 1], // [r, g, b]
|
|
73
|
+
* intensity: 1,
|
|
74
|
+
* } });
|
|
75
|
+
*
|
|
76
|
+
* @example Opt out of shadows:
|
|
77
|
+
* world.spawn({ component: DirectionalLight, data: {
|
|
78
|
+
* direction: [0, -1, 0], // [x, y, z]
|
|
79
|
+
* castShadow: false,
|
|
80
|
+
* } });
|
|
81
|
+
*
|
|
82
|
+
* @example Explicit shadow config (single-component spawn):
|
|
83
|
+
* world.spawn({ component: DirectionalLight, data: {
|
|
84
|
+
* direction: [0.2, -0.98, 0], // [x, y, z]
|
|
85
|
+
* color: [1, 1, 1], intensity: 1, // color is [r, g, b]
|
|
86
|
+
* cascadeCount: 4, splitLambda: 0.75, cascadeBlend: 0.2,
|
|
87
|
+
* mapSize: 2048, shadowDistance: 200,
|
|
88
|
+
* } });
|
|
89
|
+
*
|
|
90
|
+
* @example 0-light scene must use an unlit shader (standard 0 light = physically correct black):
|
|
91
|
+
* const world = new World();
|
|
92
|
+
* // ... spawn cube + camera, no light ...
|
|
93
|
+
* await renderer.ready;
|
|
94
|
+
* renderer.draw(world); // standard material renders black; switch to an unlit shader (Materials.unlit(...)) for an unlit display
|
|
95
|
+
*/
|
|
96
|
+
export const DirectionalLight = defineComponent('DirectionalLight', {
|
|
97
|
+
// direction is the ONLY field with no default (D-5): omitting it lands the
|
|
98
|
+
// array layer-3 all-zero [0,0,0], which the renderer owner rejects -- there is no
|
|
99
|
+
// universal default direction, so "default is illegal" forces an explicit
|
|
100
|
+
// non-zero value. color carries an explicit layer-2 default [1,1,1] (white);
|
|
101
|
+
// the array layer-3 fallback is all-zero, so the default MUST be explicit.
|
|
102
|
+
direction: { type: 'array<f32, 3>' },
|
|
103
|
+
color: { type: 'array<f32, 3>', default: new Float32Array([1, 1, 1]) },
|
|
104
|
+
intensity: { type: 'f32', default: 1 },
|
|
105
|
+
// Shadow opt-out gate: defaults to true so zero-config spawns get shadows.
|
|
106
|
+
castShadow: { type: 'bool', default: true },
|
|
107
|
+
// 9 shadow fields migrated from DirectionalLightShadow (feat-20260621 M1).
|
|
108
|
+
cascadeCount: { type: 'f32', default: 4 },
|
|
109
|
+
splitLambda: { type: 'f32', default: 0.75 },
|
|
110
|
+
cascadeBlend: { type: 'f32', default: 0.2 },
|
|
111
|
+
mapSize: { type: 'f32', default: 2048 },
|
|
112
|
+
depthBias: { type: 'f32', default: 0.005 },
|
|
113
|
+
normalBias: { type: 'f32', default: 0.05 },
|
|
114
|
+
// Sole shadow coverage knob (feat replaces nearPlane/farPlane). The PSSM
|
|
115
|
+
// near end derives from the active camera near; shadowDistance is the far
|
|
116
|
+
// reach. Default 200 world units (matches UE-style "dynamic shadow
|
|
117
|
+
// distance"; the old farPlane default was 50).
|
|
118
|
+
shadowDistance: { type: 'f32', default: 200 },
|
|
119
|
+
pcfKernelSize: { type: 'f32', default: 3 },
|
|
120
|
+
});
|