@fps-games/editor 0.1.5-beta.5 → 0.1.7-beta.1
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/dist/agent-bridge/capabilities/assets.d.ts +8 -0
- package/dist/agent-bridge/capabilities/assets.d.ts.map +1 -0
- package/dist/agent-bridge/capabilities/assets.js +226 -0
- package/dist/agent-bridge/capabilities/assets.js.map +1 -0
- package/dist/agent-bridge/capabilities/editor-state.d.ts +5 -0
- package/dist/agent-bridge/capabilities/editor-state.d.ts.map +1 -0
- package/dist/agent-bridge/capabilities/editor-state.js +72 -0
- package/dist/agent-bridge/capabilities/editor-state.js.map +1 -0
- package/dist/agent-bridge/capabilities/host-lifecycle.d.ts +4 -0
- package/dist/agent-bridge/capabilities/host-lifecycle.d.ts.map +1 -0
- package/dist/agent-bridge/capabilities/host-lifecycle.js +87 -0
- package/dist/agent-bridge/capabilities/host-lifecycle.js.map +1 -0
- package/dist/agent-bridge/capabilities/prefabs.d.ts +5 -0
- package/dist/agent-bridge/capabilities/prefabs.d.ts.map +1 -0
- package/dist/agent-bridge/capabilities/prefabs.js +735 -0
- package/dist/agent-bridge/capabilities/prefabs.js.map +1 -0
- package/dist/agent-bridge/capabilities/scene-objects.d.ts +9 -0
- package/dist/agent-bridge/capabilities/scene-objects.d.ts.map +1 -0
- package/dist/agent-bridge/capabilities/scene-objects.js +394 -0
- package/dist/agent-bridge/capabilities/scene-objects.js.map +1 -0
- package/dist/agent-bridge/capabilities/selection.d.ts +5 -0
- package/dist/agent-bridge/capabilities/selection.d.ts.map +1 -0
- package/dist/agent-bridge/capabilities/selection.js +57 -0
- package/dist/agent-bridge/capabilities/selection.js.map +1 -0
- package/dist/agent-bridge/capabilities/shadows.d.ts +5 -0
- package/dist/agent-bridge/capabilities/shadows.d.ts.map +1 -0
- package/dist/agent-bridge/capabilities/shadows.js +1876 -0
- package/dist/agent-bridge/capabilities/shadows.js.map +1 -0
- package/dist/agent-bridge/capabilities/transform.d.ts +5 -0
- package/dist/agent-bridge/capabilities/transform.d.ts.map +1 -0
- package/dist/agent-bridge/capabilities/transform.js +162 -0
- package/dist/agent-bridge/capabilities/transform.js.map +1 -0
- package/dist/agent-bridge/capabilities/ui-regions.d.ts +4 -0
- package/dist/agent-bridge/capabilities/ui-regions.d.ts.map +1 -0
- package/dist/agent-bridge/capabilities/ui-regions.js +168 -0
- package/dist/agent-bridge/capabilities/ui-regions.js.map +1 -0
- package/dist/agent-bridge/capabilities/viewport.d.ts +5 -0
- package/dist/agent-bridge/capabilities/viewport.d.ts.map +1 -0
- package/dist/agent-bridge/capabilities/viewport.js +407 -0
- package/dist/agent-bridge/capabilities/viewport.js.map +1 -0
- package/dist/agent-bridge/capability-sources.d.ts +6 -0
- package/dist/agent-bridge/capability-sources.d.ts.map +1 -0
- package/dist/agent-bridge/capability-sources.js +26 -0
- package/dist/agent-bridge/capability-sources.js.map +1 -0
- package/dist/agent-bridge/diagnostics.d.ts +12 -0
- package/dist/agent-bridge/diagnostics.d.ts.map +1 -0
- package/dist/agent-bridge/diagnostics.js +45 -0
- package/dist/agent-bridge/diagnostics.js.map +1 -0
- package/dist/agent-bridge/index.d.ts +5 -0
- package/dist/agent-bridge/index.d.ts.map +1 -0
- package/dist/agent-bridge/index.js +5 -0
- package/dist/agent-bridge/index.js.map +1 -0
- package/dist/agent-bridge/register.d.ts +4 -0
- package/dist/agent-bridge/register.d.ts.map +1 -0
- package/dist/agent-bridge/register.js +908 -0
- package/dist/agent-bridge/register.js.map +1 -0
- package/dist/agent-bridge/shared.d.ts +189 -0
- package/dist/agent-bridge/shared.d.ts.map +1 -0
- package/dist/agent-bridge/shared.js +39 -0
- package/dist/agent-bridge/shared.js.map +1 -0
- package/dist/agent-bridge/source-types.d.ts +90 -0
- package/dist/agent-bridge/source-types.d.ts.map +1 -0
- package/dist/agent-bridge/source-types.js +2 -0
- package/dist/agent-bridge/source-types.js.map +1 -0
- package/dist/build-info.json +17 -17
- package/dist/local-editor-agent-actions.d.ts +8 -1
- package/dist/local-editor-agent-actions.d.ts.map +1 -1
- package/dist/local-editor-agent-actions.js +171 -12
- package/dist/local-editor-agent-actions.js.map +1 -1
- package/dist/local-editor-agent-bridge-transport.d.ts +95 -0
- package/dist/local-editor-agent-bridge-transport.d.ts.map +1 -0
- package/dist/local-editor-agent-bridge-transport.js +340 -0
- package/dist/local-editor-agent-bridge-transport.js.map +1 -0
- package/dist/local-editor-agent-bridge.d.ts +2 -0
- package/dist/local-editor-agent-bridge.d.ts.map +1 -0
- package/dist/local-editor-agent-bridge.js +2 -0
- package/dist/local-editor-agent-bridge.js.map +1 -0
- package/dist/local-editor-agent-context.d.ts +29 -1
- package/dist/local-editor-agent-context.d.ts.map +1 -1
- package/dist/local-editor-agent-context.js +403 -0
- package/dist/local-editor-agent-context.js.map +1 -1
- package/dist/local-editor-harness.d.ts +128 -6
- package/dist/local-editor-harness.d.ts.map +1 -1
- package/dist/local-editor-harness.js +2730 -151
- package/dist/local-editor-harness.js.map +1 -1
- package/dist/local-editor-marker-graph.d.ts +92 -0
- package/dist/local-editor-marker-graph.d.ts.map +1 -0
- package/dist/local-editor-marker-graph.js +1432 -0
- package/dist/local-editor-marker-graph.js.map +1 -0
- package/dist/local-editor-performance-stats.js +1 -1
- package/dist/local-editor-performance-stats.js.map +1 -1
- package/dist/playable-babylon-facade.d.ts +2 -2
- package/dist/playable-babylon-facade.d.ts.map +1 -1
- package/dist/playable-babylon-facade.js +1 -1
- package/dist/playable-babylon-facade.js.map +1 -1
- package/dist/playable-babylon-rendering.js +20 -0
- package/dist/playable-babylon-rendering.js.map +1 -1
- package/dist/playable-local-editor-host.d.ts +57 -7
- package/dist/playable-local-editor-host.d.ts.map +1 -1
- package/dist/playable-local-editor-host.js +25 -1
- package/dist/playable-local-editor-host.js.map +1 -1
- package/dist/playable-sdk.d.ts +4 -2
- package/dist/playable-sdk.d.ts.map +1 -1
- package/dist/playable-sdk.js +2 -1
- package/dist/playable-sdk.js.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/blob-shadow-system.d.ts.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/blob-shadow-system.js +6 -4
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/blob-shadow-system.js.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/planar-shadow-shaders.d.ts.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/planar-shadow-shaders.js +103 -1
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/planar-shadow-shaders.js.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/planar-shadow-system.d.ts.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/planar-shadow-system.js +330 -27
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/planar-shadow-system.js.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-artifact-system.d.ts.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-artifact-system.js +159 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-artifact-system.js.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-baker.js +8 -1
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-baker.js.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/types.d.ts +53 -2
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/types.d.ts.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/types.js +1 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/types.js.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/package.json +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/camera-controller.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/camera-controller.js +11 -0
- package/node_modules/@fps-games/editor-babylon/dist/camera-controller.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/editor-sky.d.ts +3 -1
- package/node_modules/@fps-games/editor-babylon/dist/editor-sky.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/editor-sky.js +114 -18
- package/node_modules/@fps-games/editor-babylon/dist/editor-sky.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/editor-world.d.ts +1 -0
- package/node_modules/@fps-games/editor-babylon/dist/editor-world.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/editor-world.js +3 -0
- package/node_modules/@fps-games/editor-babylon/dist/editor-world.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/index.d.ts +3 -0
- package/node_modules/@fps-games/editor-babylon/dist/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/index.js +3 -0
- package/node_modules/@fps-games/editor-babylon/dist/index.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/marker-overlay.d.ts +52 -0
- package/node_modules/@fps-games/editor-babylon/dist/marker-overlay.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-babylon/dist/marker-overlay.js +1395 -0
- package/node_modules/@fps-games/editor-babylon/dist/marker-overlay.js.map +1 -0
- package/node_modules/@fps-games/editor-babylon/dist/material-property-adapter.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/material-property-adapter.js +4 -65
- package/node_modules/@fps-games/editor-babylon/dist/material-property-adapter.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/material-slot-source-resolver.d.ts +28 -0
- package/node_modules/@fps-games/editor-babylon/dist/material-slot-source-resolver.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-babylon/dist/material-slot-source-resolver.js +235 -0
- package/node_modules/@fps-games/editor-babylon/dist/material-slot-source-resolver.js.map +1 -0
- package/node_modules/@fps-games/editor-babylon/dist/prefab-comparison-preview-controller.d.ts +37 -0
- package/node_modules/@fps-games/editor-babylon/dist/prefab-comparison-preview-controller.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-babylon/dist/prefab-comparison-preview-controller.js +451 -0
- package/node_modules/@fps-games/editor-babylon/dist/prefab-comparison-preview-controller.js.map +1 -0
- package/node_modules/@fps-games/editor-babylon/dist/projection-asset-container-importer.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/projection-asset-container-importer.js +14 -3
- package/node_modules/@fps-games/editor-babylon/dist/projection-asset-container-importer.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/projection-pick-resolver.d.ts +1 -0
- package/node_modules/@fps-games/editor-babylon/dist/projection-pick-resolver.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/projection-pick-resolver.js +20 -4
- package/node_modules/@fps-games/editor-babylon/dist/projection-pick-resolver.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/projection-source-owner-path.d.ts +3 -6
- package/node_modules/@fps-games/editor-babylon/dist/projection-source-owner-path.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/projection-source-owner-path.js +4 -37
- package/node_modules/@fps-games/editor-babylon/dist/projection-source-owner-path.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/projection.d.ts +74 -1
- package/node_modules/@fps-games/editor-babylon/dist/projection.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/projection.js +641 -52
- package/node_modules/@fps-games/editor-babylon/dist/projection.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/scene-view-camera-controller.d.ts +11 -0
- package/node_modules/@fps-games/editor-babylon/dist/scene-view-camera-controller.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/scene-view-camera-controller.js +113 -29
- package/node_modules/@fps-games/editor-babylon/dist/scene-view-camera-controller.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/shadow-preview-controller.d.ts +13 -1
- package/node_modules/@fps-games/editor-babylon/dist/shadow-preview-controller.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/shadow-preview-controller.js +543 -3
- package/node_modules/@fps-games/editor-babylon/dist/shadow-preview-controller.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/package.json +5 -5
- package/node_modules/@fps-games/editor-browser/dist/index.d.ts +8 -2
- package/node_modules/@fps-games/editor-browser/dist/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/index.js +4 -0
- package/node_modules/@fps-games/editor-browser/dist/index.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-asset-kind.d.ts +5 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-asset-kind.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-asset-kind.js +23 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-asset-kind.js.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-context-menu.js +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-context-menu.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-actions.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-actions.js +76 -9
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-actions.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-attach-dialog.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-attach-dialog.js +3 -2
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-attach-dialog.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-command-adapter.d.ts +21 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-command-adapter.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-command-adapter.js +75 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-command-adapter.js.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.d.ts +2 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.js +326 -72
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-scope.d.ts +5 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-scope.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-scope.js +92 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-scope.js.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-tree.d.ts +4 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-tree.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-tree.js +22 -7
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-tree.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-view.d.ts +4 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-view.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-view.js +24 -11
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-view.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-icons.d.ts +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-icons.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-icons.js +7 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-icons.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panel-registry.js +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panel-registry.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.d.ts +4 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.js +1471 -29
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-prefab-stage.d.ts +70 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-prefab-stage.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-prefab-stage.js +171 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-prefab-stage.js.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-primitives.d.ts +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-primitives.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-primitives.js +2 -2
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-primitives.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-shared.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-shared.js +9 -2
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-shared.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-types.d.ts +301 -3
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-types.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-workbench.d.ts +12 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-workbench.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-workbench.js +13 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-workbench.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.d.ts +6 -4
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.js +1501 -122
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/package.json +3 -3
- package/node_modules/@fps-games/editor-core/dist/agent-bridge.d.ts +18 -0
- package/node_modules/@fps-games/editor-core/dist/agent-bridge.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-core/dist/agent-bridge.js +102 -0
- package/node_modules/@fps-games/editor-core/dist/agent-bridge.js.map +1 -0
- package/node_modules/@fps-games/editor-core/dist/index.d.ts +1 -0
- package/node_modules/@fps-games/editor-core/dist/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-core/dist/index.js +1 -0
- package/node_modules/@fps-games/editor-core/dist/index.js.map +1 -1
- package/node_modules/@fps-games/editor-core/dist/scene-graph.d.ts +1 -1
- package/node_modules/@fps-games/editor-core/dist/scene-graph.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-core/dist/viewport-tools.d.ts +3 -1
- package/node_modules/@fps-games/editor-core/dist/viewport-tools.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-core/dist/viewport-tools.js +1 -0
- package/node_modules/@fps-games/editor-core/dist/viewport-tools.js.map +1 -1
- package/node_modules/@fps-games/editor-core/package.json +2 -2
- package/node_modules/@fps-games/editor-forge-play/package.json +2 -2
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/config.d.ts +3 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/config.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/config.js +9 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/config.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/generated-module.d.ts +6 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/generated-module.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/generated-module.js +89 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/generated-module.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/identity.d.ts +18 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/identity.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/identity.js +121 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/identity.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/index.d.ts +4 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/index.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/index.js +3 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/index.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/metadata.d.ts +27 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/metadata.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/metadata.js +782 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/metadata.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/node.d.ts +5 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/node.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/node.js +5 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/node.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/registry.d.ts +80 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/registry.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/registry.js +600 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/registry.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/types.d.ts +51 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/types.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/types.js +2 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/types.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/catalog.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/catalog.js +17 -3
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/catalog.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/document.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/document.js +2 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/document.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/types.d.ts +3 -2
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/types.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/document.d.ts +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/document.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/document.js +48 -20
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/document.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/index.d.ts +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/index.js +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/index.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/placement.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/placement.js +2 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/placement.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/types.d.ts +3 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/types.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/document/helpers.d.ts +97 -2
- package/node_modules/@fps-games/editor-playable-sdk/dist/document/helpers.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/document/helpers.js +1143 -8
- package/node_modules/@fps-games/editor-playable-sdk/dist/document/helpers.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/document/types.d.ts +145 -2
- package/node_modules/@fps-games/editor-playable-sdk/dist/document/types.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/index.d.ts +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/index.js +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/index.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/schema.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/schema.js +24 -9
- package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/schema.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/validators.d.ts +6 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/validators.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/validators.js +31 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/validators.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/index.d.ts +3 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/index.js +3 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/index.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/document-sections.d.ts +82 -2
- package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/document-sections.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/document-sections.js +396 -22
- package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/document-sections.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/index.d.ts +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/index.js +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/index.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/validation.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/validation.js +0 -3
- package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/validation.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/lighting-debug/math.d.ts +29 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/lighting-debug/math.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/lighting-debug/math.js +143 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/lighting-debug/math.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/lifecycle.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/lifecycle.js +3 -7
- package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/lifecycle.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/binding.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/binding.js +6 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/binding.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/types.d.ts +2 -10
- package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/types.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/field-patch.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/field-patch.js +107 -11
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/field-patch.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/reducer.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/reducer.js +4 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/reducer.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/transform.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/transform.js +19 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/transform.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/rendering-profile/panel.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/rendering-profile/panel.js +19 -3
- package/node_modules/@fps-games/editor-playable-sdk/dist/rendering-profile/panel.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/assets.d.ts +1 -2
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/assets.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/assets.js +0 -14
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/assets.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/import-plan.d.ts +1 -7
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/import-plan.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/import-plan.js +3 -32
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/import-plan.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/nodes.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/nodes.js +82 -63
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/nodes.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/types.d.ts +7 -23
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/types.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/compiler.d.ts +5 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/compiler.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/compiler.js +996 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/compiler.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/index.d.ts +3 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/index.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/index.js +3 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/index.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/types.d.ts +152 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/types.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/types.js +2 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/types.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/protocol.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/protocol.js +44 -2
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/protocol.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/descriptors.d.ts +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/descriptors.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/descriptors.js +244 -12
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/descriptors.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/inspector.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/inspector.js +216 -67
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/inspector.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/object.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/object.js +7 -4
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/object.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/patch.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/patch.js +45 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/patch.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/session/hierarchy.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/session/hierarchy.js +2 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/session/hierarchy.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/index.d.ts +5 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/index.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/index.js +5 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/index.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/legacy.d.ts +21 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/legacy.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/legacy.js +158 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/legacy.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/quality.d.ts +5 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/quality.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/quality.js +83 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/quality.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/resolver.d.ts +35 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/resolver.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/resolver.js +363 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/resolver.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/types.d.ts +105 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/types.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/types.js +6 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/types.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/static-shadows/artifact.d.ts +3 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/static-shadows/artifact.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/static-shadows/artifact.js +44 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/static-shadows/artifact.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/asset-authoring.d.ts +26 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/asset-authoring.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/asset-authoring.js +105 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/asset-authoring.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.d.ts +3 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.js +3 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/package.json +3 -3
- package/node_modules/@fps-games/editor-protocol/dist/agent-bridge.d.ts +1127 -0
- package/node_modules/@fps-games/editor-protocol/dist/agent-bridge.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-protocol/dist/agent-bridge.js +2180 -0
- package/node_modules/@fps-games/editor-protocol/dist/agent-bridge.js.map +1 -0
- package/node_modules/@fps-games/editor-protocol/dist/agent-trace.d.ts +68 -0
- package/node_modules/@fps-games/editor-protocol/dist/agent-trace.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-protocol/dist/agent-trace.js +23 -0
- package/node_modules/@fps-games/editor-protocol/dist/agent-trace.js.map +1 -0
- package/node_modules/@fps-games/editor-protocol/dist/agent.d.ts +57 -3
- package/node_modules/@fps-games/editor-protocol/dist/agent.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-protocol/dist/agent.js.map +1 -1
- package/node_modules/@fps-games/editor-protocol/dist/index.d.ts +21 -0
- package/node_modules/@fps-games/editor-protocol/dist/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-protocol/dist/index.js +3 -0
- package/node_modules/@fps-games/editor-protocol/dist/index.js.map +1 -1
- package/node_modules/@fps-games/editor-protocol/dist/marker-graph.d.ts +128 -0
- package/node_modules/@fps-games/editor-protocol/dist/marker-graph.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-protocol/dist/marker-graph.js +2 -0
- package/node_modules/@fps-games/editor-protocol/dist/marker-graph.js.map +1 -0
- package/node_modules/@fps-games/editor-protocol/package.json +1 -1
- package/package.json +8 -8
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import { createBlobShadowSystem, createPlanarShadowSystem, collectStaticProjectedShadowBakeRoots, createStaticProjectedShadowArtifactSystem, createStaticProjectedShadowBakeHashes, } from '@fps-games/babylon-renderer';
|
|
2
|
+
import { ShadowGenerator } from '@babylonjs/core/Lights/Shadows/shadowGenerator.js';
|
|
2
3
|
const PLANAR_PREVIEW_ROOT_BOUNDARY_PATTERNS = ['root', 'scene_builder_root'];
|
|
4
|
+
const SHADOW_DEBUG_STORAGE_KEY = 'fps.shadow.debug';
|
|
3
5
|
export function createBabylonEditorShadowPreviewController(options) {
|
|
4
6
|
let currentOptions = normalizeShadowPreviewOptions(options.options);
|
|
5
7
|
let blobSystem = null;
|
|
6
8
|
let staticSystem = null;
|
|
7
9
|
let planarSystem = null;
|
|
8
10
|
let planarLight = null;
|
|
11
|
+
let dynamicGenerator = null;
|
|
12
|
+
let dynamicLight = null;
|
|
13
|
+
let dynamicMapSize = 0;
|
|
9
14
|
const blobCasters = new Set();
|
|
10
15
|
const planarCasters = new Set();
|
|
16
|
+
const dynamicCasters = new Set();
|
|
11
17
|
const disposeBlob = () => {
|
|
12
18
|
blobSystem?.dispose();
|
|
13
19
|
blobSystem = null;
|
|
@@ -23,6 +29,16 @@ export function createBabylonEditorShadowPreviewController(options) {
|
|
|
23
29
|
staticSystem?.dispose();
|
|
24
30
|
staticSystem = null;
|
|
25
31
|
};
|
|
32
|
+
const disposeDynamic = () => {
|
|
33
|
+
dynamicGenerator?.dispose();
|
|
34
|
+
dynamicGenerator = null;
|
|
35
|
+
dynamicLight = null;
|
|
36
|
+
dynamicMapSize = 0;
|
|
37
|
+
dynamicCasters.clear();
|
|
38
|
+
for (const mesh of readSceneMeshes(options.scene)) {
|
|
39
|
+
setPreviewMeshReceiveShadows(mesh, false);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
26
42
|
const syncBlob = () => {
|
|
27
43
|
const blobOptions = currentOptions.blob;
|
|
28
44
|
if (!blobOptions || blobOptions.enabled === false) {
|
|
@@ -80,18 +96,82 @@ export function createBabylonEditorShadowPreviewController(options) {
|
|
|
80
96
|
const meshes = readSceneMeshes(options.scene);
|
|
81
97
|
const nextBlobCasters = new Set();
|
|
82
98
|
const nextPlanarCasters = new Set();
|
|
99
|
+
const nextDynamicCasters = new Set();
|
|
100
|
+
const nextDynamicReceivers = new Set();
|
|
83
101
|
for (const mesh of meshes) {
|
|
84
102
|
const mode = resolvePreviewMeshShadowMode(mesh, currentOptions.defaultMode ?? 'none');
|
|
103
|
+
if (!canRenderPreviewShadowCaster(mesh, mode, meshes))
|
|
104
|
+
continue;
|
|
85
105
|
if (mode === 'blob' && blobSystem)
|
|
86
106
|
nextBlobCasters.add(mesh);
|
|
87
107
|
if (mode === 'planar' && planarSystem)
|
|
88
108
|
nextPlanarCasters.add(mesh);
|
|
109
|
+
if (mode === 'dynamic')
|
|
110
|
+
nextDynamicCasters.add(mesh);
|
|
89
111
|
}
|
|
112
|
+
for (const mesh of meshes) {
|
|
113
|
+
if (isPreviewShadowReceiver(mesh, meshes))
|
|
114
|
+
nextDynamicReceivers.add(mesh);
|
|
115
|
+
}
|
|
116
|
+
logShadowDebug('preview.routes', {
|
|
117
|
+
blobCasters: [...nextBlobCasters].map(readShadowPreviewMeshDebugName),
|
|
118
|
+
planarCasters: [...nextPlanarCasters].map(readShadowPreviewMeshDebugName),
|
|
119
|
+
dynamicCasters: [...nextDynamicCasters].map(readShadowPreviewMeshDebugName),
|
|
120
|
+
dynamicReceivers: [...nextDynamicReceivers].map(readShadowPreviewMeshDebugName),
|
|
121
|
+
});
|
|
122
|
+
syncDynamic(nextDynamicReceivers);
|
|
90
123
|
syncDynamicShadowCasters(blobSystem, blobCasters, nextBlobCasters);
|
|
91
124
|
syncDynamicShadowCasters(planarSystem, planarCasters, nextPlanarCasters);
|
|
125
|
+
syncBabylonDynamicShadowCasters(dynamicGenerator, dynamicCasters, nextDynamicCasters);
|
|
126
|
+
for (const mesh of meshes) {
|
|
127
|
+
setPreviewMeshReceiveShadows(mesh, false);
|
|
128
|
+
}
|
|
129
|
+
if (dynamicGenerator) {
|
|
130
|
+
for (const mesh of nextDynamicReceivers) {
|
|
131
|
+
setPreviewMeshReceiveShadows(mesh, true);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
92
134
|
blobSystem?.refresh();
|
|
93
135
|
planarSystem?.refresh();
|
|
94
136
|
};
|
|
137
|
+
const syncDynamic = (receivers) => {
|
|
138
|
+
const meshes = readSceneMeshes(options.scene);
|
|
139
|
+
const dynamicCasters = meshes.filter(mesh => {
|
|
140
|
+
const mode = resolvePreviewMeshShadowMode(mesh, currentOptions.defaultMode ?? 'none');
|
|
141
|
+
return mode === 'dynamic' && canRenderPreviewShadowCaster(mesh, mode, meshes);
|
|
142
|
+
});
|
|
143
|
+
if (dynamicCasters.length === 0) {
|
|
144
|
+
disposeDynamic();
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
const light = resolveDynamicDirectionalLight(options.projection, dynamicCasters, currentOptions);
|
|
148
|
+
if (!light) {
|
|
149
|
+
disposeDynamic();
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
const mapSize = resolveDynamicShadowMapSize(dynamicCasters);
|
|
153
|
+
if (!dynamicGenerator || dynamicLight !== light || dynamicMapSize !== mapSize) {
|
|
154
|
+
disposeDynamic();
|
|
155
|
+
dynamicLight = light;
|
|
156
|
+
dynamicMapSize = mapSize;
|
|
157
|
+
dynamicGenerator = new ShadowGenerator(mapSize, light);
|
|
158
|
+
configureDynamicShadowGeneratorFilter(dynamicGenerator);
|
|
159
|
+
dynamicGenerator.setDarkness(resolveDynamicShadowDarkness(dynamicCasters));
|
|
160
|
+
dynamicGenerator.bias = resolveDynamicShadowBias(dynamicCasters);
|
|
161
|
+
dynamicGenerator.normalBias = resolveDynamicShadowNormalBias(dynamicCasters);
|
|
162
|
+
if (options.scene)
|
|
163
|
+
options.scene.shadowsEnabled = true;
|
|
164
|
+
configureDirectionalLightShadowFrustum(light, currentOptions, dynamicCasters, [...receivers]);
|
|
165
|
+
logShadowDebug('preview.dynamic.created', createDynamicShadowDebugSnapshot(light, dynamicGenerator, dynamicCasters, [...receivers]));
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
configureDynamicShadowGeneratorFilter(dynamicGenerator);
|
|
169
|
+
dynamicGenerator.setDarkness(resolveDynamicShadowDarkness(dynamicCasters));
|
|
170
|
+
dynamicGenerator.bias = resolveDynamicShadowBias(dynamicCasters);
|
|
171
|
+
dynamicGenerator.normalBias = resolveDynamicShadowNormalBias(dynamicCasters);
|
|
172
|
+
configureDirectionalLightShadowFrustum(light, currentOptions, dynamicCasters, [...receivers]);
|
|
173
|
+
logShadowDebug('preview.dynamic.updated', createDynamicShadowDebugSnapshot(light, dynamicGenerator, dynamicCasters, [...receivers]));
|
|
174
|
+
};
|
|
95
175
|
syncRoutes();
|
|
96
176
|
return {
|
|
97
177
|
setOptions(nextOptions) {
|
|
@@ -112,6 +192,18 @@ export function createBabylonEditorShadowPreviewController(options) {
|
|
|
112
192
|
}
|
|
113
193
|
disposeStatic();
|
|
114
194
|
},
|
|
195
|
+
getDebugInfo() {
|
|
196
|
+
return {
|
|
197
|
+
planar: {
|
|
198
|
+
enabled: !!planarSystem,
|
|
199
|
+
casterCount: planarCasters.size,
|
|
200
|
+
casters: (planarSystem?.getCasterDebugInfo() ?? []).map(info => ({
|
|
201
|
+
...info,
|
|
202
|
+
...readPlanarShadowSourceNodeInfo(info, options.scene),
|
|
203
|
+
})),
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
},
|
|
115
207
|
refresh() {
|
|
116
208
|
syncRoutes();
|
|
117
209
|
},
|
|
@@ -119,12 +211,14 @@ export function createBabylonEditorShadowPreviewController(options) {
|
|
|
119
211
|
disposeBlob();
|
|
120
212
|
disposeStatic();
|
|
121
213
|
disposePlanar();
|
|
214
|
+
disposeDynamic();
|
|
122
215
|
syncRoutes();
|
|
123
216
|
},
|
|
124
217
|
dispose() {
|
|
125
218
|
disposeBlob();
|
|
126
219
|
disposeStatic();
|
|
127
220
|
disposePlanar();
|
|
221
|
+
disposeDynamic();
|
|
128
222
|
},
|
|
129
223
|
};
|
|
130
224
|
}
|
|
@@ -216,11 +310,42 @@ function syncDynamicShadowCasters(system, current, next) {
|
|
|
216
310
|
}
|
|
217
311
|
for (const mesh of next) {
|
|
218
312
|
if (!current.has(mesh)) {
|
|
219
|
-
system.addCaster(mesh);
|
|
313
|
+
const added = system.addCaster(mesh);
|
|
314
|
+
if (added !== false)
|
|
315
|
+
current.add(mesh);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
function syncBabylonDynamicShadowCasters(generator, current, next) {
|
|
320
|
+
for (const mesh of [...current]) {
|
|
321
|
+
if (!next.has(mesh)) {
|
|
322
|
+
generator?.removeShadowCaster(mesh, true);
|
|
323
|
+
current.delete(mesh);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
if (!generator) {
|
|
327
|
+
current.clear();
|
|
328
|
+
return;
|
|
329
|
+
}
|
|
330
|
+
for (const mesh of next) {
|
|
331
|
+
if (!current.has(mesh)) {
|
|
332
|
+
generator.addShadowCaster(mesh, true);
|
|
220
333
|
current.add(mesh);
|
|
221
334
|
}
|
|
222
335
|
}
|
|
223
336
|
}
|
|
337
|
+
function setPreviewMeshReceiveShadows(mesh, receive) {
|
|
338
|
+
if (!isBabylonInstancedMesh(mesh)) {
|
|
339
|
+
mesh.receiveShadows = receive;
|
|
340
|
+
}
|
|
341
|
+
const sourceMesh = mesh.sourceMesh;
|
|
342
|
+
if (sourceMesh && sourceMesh !== mesh && !isBabylonInstancedMesh(sourceMesh)) {
|
|
343
|
+
sourceMesh.receiveShadows = receive;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
function isBabylonInstancedMesh(mesh) {
|
|
347
|
+
return mesh.getClassName?.() === 'InstancedMesh';
|
|
348
|
+
}
|
|
224
349
|
function readSceneMeshes(scene) {
|
|
225
350
|
return Array.isArray(scene?.meshes) ? scene.meshes : [];
|
|
226
351
|
}
|
|
@@ -242,12 +367,427 @@ function readPreviewDefaultMode(value) {
|
|
|
242
367
|
function readProjectionShadowMode(mesh) {
|
|
243
368
|
for (const node of walkNodeAndParents(mesh)) {
|
|
244
369
|
const editorProjection = readEditorProjectionMetadata(node);
|
|
245
|
-
const
|
|
246
|
-
if (
|
|
370
|
+
const shadowPlanMode = readProjectionShadowPlanPreviewMode(editorProjection?.shadowPlan);
|
|
371
|
+
if (shadowPlanMode)
|
|
372
|
+
return shadowPlanMode;
|
|
373
|
+
const shadowMode = readProjectionShadowSettingsPreviewMode(editorProjection?.shadow);
|
|
374
|
+
if (shadowMode)
|
|
375
|
+
return shadowMode;
|
|
376
|
+
const mode = readLegacyProjectionShadowMode(editorProjection?.shadowMode);
|
|
377
|
+
if (mode)
|
|
247
378
|
return mode;
|
|
248
379
|
}
|
|
249
380
|
return null;
|
|
250
381
|
}
|
|
382
|
+
function readProjectionShadowPlanPreviewMode(value) {
|
|
383
|
+
const plan = readObject(value);
|
|
384
|
+
if (!plan)
|
|
385
|
+
return null;
|
|
386
|
+
const backend = plan.backend;
|
|
387
|
+
if (backend === 'none')
|
|
388
|
+
return 'none';
|
|
389
|
+
if (backend === 'blob')
|
|
390
|
+
return 'blob';
|
|
391
|
+
if (backend === 'static-baked')
|
|
392
|
+
return 'static';
|
|
393
|
+
if (backend === 'projected')
|
|
394
|
+
return 'planar';
|
|
395
|
+
if (backend === 'dynamic-map')
|
|
396
|
+
return 'dynamic';
|
|
397
|
+
return readProjectionShadowSettingsPreviewMode({ mode: plan.mode });
|
|
398
|
+
}
|
|
399
|
+
function readProjectionShadowPlan(mesh) {
|
|
400
|
+
for (const node of walkNodeAndParents(mesh)) {
|
|
401
|
+
const plan = readObject(readEditorProjectionMetadata(node)?.shadowPlan);
|
|
402
|
+
if (plan)
|
|
403
|
+
return plan;
|
|
404
|
+
}
|
|
405
|
+
return null;
|
|
406
|
+
}
|
|
407
|
+
function readProjectionShadowSettings(mesh) {
|
|
408
|
+
for (const node of walkNodeAndParents(mesh)) {
|
|
409
|
+
const shadow = readObject(readEditorProjectionMetadata(node)?.shadow);
|
|
410
|
+
if (shadow)
|
|
411
|
+
return shadow;
|
|
412
|
+
}
|
|
413
|
+
return null;
|
|
414
|
+
}
|
|
415
|
+
function readProjectionNodeIds(mesh) {
|
|
416
|
+
const ids = [];
|
|
417
|
+
for (const node of walkNodeAndParents(mesh)) {
|
|
418
|
+
const projection = readEditorProjectionMetadata(node);
|
|
419
|
+
const nodeId = projection?.nodeId;
|
|
420
|
+
const rootNodeId = projection?.rootNodeId;
|
|
421
|
+
if (typeof nodeId === 'string' && !ids.includes(nodeId))
|
|
422
|
+
ids.push(nodeId);
|
|
423
|
+
if (typeof rootNodeId === 'string' && !ids.includes(rootNodeId))
|
|
424
|
+
ids.push(rootNodeId);
|
|
425
|
+
}
|
|
426
|
+
return ids;
|
|
427
|
+
}
|
|
428
|
+
function canRenderPreviewShadowCaster(mesh, mode, meshes) {
|
|
429
|
+
if (mode !== 'blob' && mode !== 'planar' && mode !== 'dynamic')
|
|
430
|
+
return true;
|
|
431
|
+
const plan = readProjectionShadowPlan(mesh);
|
|
432
|
+
if (!plan)
|
|
433
|
+
return meshes.some(candidate => isPreviewShadowReceiver(candidate, meshes));
|
|
434
|
+
const receiverIds = readShadowPlanReceiverIds(plan);
|
|
435
|
+
if (receiverIds.length === 0)
|
|
436
|
+
return false;
|
|
437
|
+
const receiverIdSet = new Set(receiverIds);
|
|
438
|
+
return meshes.some(candidate => {
|
|
439
|
+
if (!isPreviewShadowReceiver(candidate, meshes))
|
|
440
|
+
return false;
|
|
441
|
+
return readProjectionNodeIds(candidate).some(nodeId => receiverIdSet.has(nodeId));
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
function isPreviewShadowReceiver(mesh, meshes) {
|
|
445
|
+
if (mesh.isDisposed?.() || hasGeneratedShadowDisabled(mesh))
|
|
446
|
+
return false;
|
|
447
|
+
const receive = readProjectionShadowSettings(mesh)?.receive;
|
|
448
|
+
if (receive === 'none')
|
|
449
|
+
return false;
|
|
450
|
+
if (receive === 'enabled' || receive === 'auto')
|
|
451
|
+
return true;
|
|
452
|
+
const receiverNodeIds = readProjectionNodeIds(mesh);
|
|
453
|
+
if (receiverNodeIds.length === 0)
|
|
454
|
+
return false;
|
|
455
|
+
return meshes.some(candidate => {
|
|
456
|
+
const mode = resolvePreviewMeshShadowMode(candidate, 'none');
|
|
457
|
+
if (mode !== 'blob' && mode !== 'planar' && mode !== 'dynamic')
|
|
458
|
+
return false;
|
|
459
|
+
const receiverIds = readShadowPlanReceiverIds(readProjectionShadowPlan(candidate));
|
|
460
|
+
return receiverNodeIds.some(nodeId => receiverIds.includes(nodeId));
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
function readShadowPlanReceiverIds(plan) {
|
|
464
|
+
return Array.isArray(plan?.receiverIds)
|
|
465
|
+
? plan.receiverIds.filter((entry) => typeof entry === 'string')
|
|
466
|
+
: [];
|
|
467
|
+
}
|
|
468
|
+
function resolveDynamicDirectionalLight(projection, casters, options) {
|
|
469
|
+
for (const caster of casters) {
|
|
470
|
+
const lightId = readProjectionShadowPlan(caster)?.lightId;
|
|
471
|
+
if (typeof lightId !== 'string')
|
|
472
|
+
continue;
|
|
473
|
+
const light = resolveDirectionalLight(projection, lightId);
|
|
474
|
+
if (light)
|
|
475
|
+
return light;
|
|
476
|
+
}
|
|
477
|
+
const planarLightId = options.planar
|
|
478
|
+
? options.planar.directionalLightNodeId ?? null
|
|
479
|
+
: null;
|
|
480
|
+
return resolveDirectionalLight(projection, planarLightId);
|
|
481
|
+
}
|
|
482
|
+
function createDynamicShadowDebugSnapshot(light, generator, casters, receivers) {
|
|
483
|
+
return {
|
|
484
|
+
light: {
|
|
485
|
+
name: light.name,
|
|
486
|
+
id: light.id,
|
|
487
|
+
position: toPlainVec3(light.position),
|
|
488
|
+
direction: toPlainVec3(light.direction),
|
|
489
|
+
orthoLeft: light.orthoLeft,
|
|
490
|
+
orthoRight: light.orthoRight,
|
|
491
|
+
orthoTop: light.orthoTop,
|
|
492
|
+
orthoBottom: light.orthoBottom,
|
|
493
|
+
shadowMinZ: light.shadowMinZ,
|
|
494
|
+
shadowMaxZ: light.shadowMaxZ,
|
|
495
|
+
autoUpdateExtends: light.autoUpdateExtends,
|
|
496
|
+
},
|
|
497
|
+
generator: generator
|
|
498
|
+
? {
|
|
499
|
+
mapSize: generator.getShadowMap?.()?.getSize?.(),
|
|
500
|
+
darkness: generator.getDarkness?.(),
|
|
501
|
+
bias: generator.bias,
|
|
502
|
+
normalBias: generator.normalBias,
|
|
503
|
+
useBlurExponentialShadowMap: generator.useBlurExponentialShadowMap,
|
|
504
|
+
useKernelBlur: generator.useKernelBlur,
|
|
505
|
+
blurKernel: generator.blurKernel,
|
|
506
|
+
renderList: (generator.getShadowMap?.()?.renderList ?? []).map(readShadowPreviewMeshDebugName),
|
|
507
|
+
}
|
|
508
|
+
: null,
|
|
509
|
+
casters: casters.map(mesh => ({
|
|
510
|
+
name: readShadowPreviewMeshDebugName(mesh),
|
|
511
|
+
bounds: readMeshWorldBounds(mesh),
|
|
512
|
+
})),
|
|
513
|
+
receivers: receivers.map(mesh => ({
|
|
514
|
+
name: readShadowPreviewMeshDebugName(mesh),
|
|
515
|
+
receiveShadows: mesh.receiveShadows,
|
|
516
|
+
bounds: readMeshWorldBounds(mesh),
|
|
517
|
+
})),
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
function resolveDynamicShadowMapSize(casters) {
|
|
521
|
+
return clampDynamicShadowResolution(Math.max(0, ...casters.map(caster => readShadowPlanNumber(caster, 'resolution'))));
|
|
522
|
+
}
|
|
523
|
+
function configureDynamicShadowGeneratorFilter(generator) {
|
|
524
|
+
generator.useBlurExponentialShadowMap = false;
|
|
525
|
+
generator.useKernelBlur = false;
|
|
526
|
+
generator.usePercentageCloserFiltering = true;
|
|
527
|
+
generator.filteringQuality = ShadowGenerator.QUALITY_HIGH;
|
|
528
|
+
}
|
|
529
|
+
function resolveDynamicShadowDarkness(casters) {
|
|
530
|
+
const opacity = Math.max(0, ...casters.map(caster => readShadowPlanNumber(caster, 'opacity')));
|
|
531
|
+
return Math.min(1, Math.max(0, 1 - (Number.isFinite(opacity) && opacity > 0 ? opacity : 0.42)));
|
|
532
|
+
}
|
|
533
|
+
function resolveDynamicShadowBias(casters) {
|
|
534
|
+
const values = casters.map(caster => readShadowPlanNumber(caster, 'bias')).filter(Number.isFinite);
|
|
535
|
+
return values.length > 0 ? Math.min(...values) : 0.0005;
|
|
536
|
+
}
|
|
537
|
+
function resolveDynamicShadowNormalBias(casters) {
|
|
538
|
+
const value = Math.max(0, ...casters.map(caster => readShadowPlanNumber(caster, 'normalBias')));
|
|
539
|
+
return Number.isFinite(value) && value > 0 ? value : 0.02;
|
|
540
|
+
}
|
|
541
|
+
function readShadowPlanNumber(caster, key) {
|
|
542
|
+
const params = readObject(readProjectionShadowPlan(caster)?.params);
|
|
543
|
+
const value = params?.[key];
|
|
544
|
+
return typeof value === 'number' && Number.isFinite(value) ? value : Number.NaN;
|
|
545
|
+
}
|
|
546
|
+
function clampDynamicShadowResolution(value) {
|
|
547
|
+
if (value >= 4096)
|
|
548
|
+
return 4096;
|
|
549
|
+
if (value >= 2048)
|
|
550
|
+
return 2048;
|
|
551
|
+
if (value >= 1024)
|
|
552
|
+
return 1024;
|
|
553
|
+
return 512;
|
|
554
|
+
}
|
|
555
|
+
function configureDirectionalLightShadowFrustum(light, options, casters = [], receivers = []) {
|
|
556
|
+
const dynamicBounds = createDynamicShadowFrustumBounds(casters, receivers, light.direction);
|
|
557
|
+
if (dynamicBounds) {
|
|
558
|
+
const maxExtent = Math.max(dynamicBounds.size.x, dynamicBounds.size.y, dynamicBounds.size.z);
|
|
559
|
+
const padding = Math.max(2, maxExtent * 0.25);
|
|
560
|
+
const halfSize = Math.max(4, maxExtent * 0.5 + padding);
|
|
561
|
+
const direction = normalizeVec3(light.direction) ?? { x: 0, y: -1, z: 0 };
|
|
562
|
+
const distance = Math.max(16, maxExtent + padding * 3);
|
|
563
|
+
setMutableVec3(light.position, {
|
|
564
|
+
x: dynamicBounds.center.x - direction.x * distance,
|
|
565
|
+
y: dynamicBounds.center.y - direction.y * distance,
|
|
566
|
+
z: dynamicBounds.center.z - direction.z * distance,
|
|
567
|
+
});
|
|
568
|
+
light.autoUpdateExtends = false;
|
|
569
|
+
light.orthoLeft = -halfSize;
|
|
570
|
+
light.orthoRight = halfSize;
|
|
571
|
+
light.orthoTop = halfSize;
|
|
572
|
+
light.orthoBottom = -halfSize;
|
|
573
|
+
light.shadowMinZ = 0.1;
|
|
574
|
+
light.shadowMaxZ = Math.max(32, distance + maxExtent + padding);
|
|
575
|
+
return;
|
|
576
|
+
}
|
|
577
|
+
const planar = options.planar || null;
|
|
578
|
+
const shadowOrtho = readObject(planar?.shadowOrtho);
|
|
579
|
+
light.orthoLeft = readFiniteNumber(shadowOrtho?.left, -20);
|
|
580
|
+
light.orthoRight = readFiniteNumber(shadowOrtho?.right, 20);
|
|
581
|
+
light.orthoTop = readFiniteNumber(shadowOrtho?.top, 20);
|
|
582
|
+
light.orthoBottom = readFiniteNumber(shadowOrtho?.bottom, -20);
|
|
583
|
+
light.shadowMinZ = 1;
|
|
584
|
+
light.shadowMaxZ = 80;
|
|
585
|
+
}
|
|
586
|
+
function createDynamicShadowFrustumBounds(casters, receivers, lightDirection) {
|
|
587
|
+
const direction = normalizeVec3(lightDirection);
|
|
588
|
+
const points = [];
|
|
589
|
+
const casterBounds = casters.map(readMeshWorldBounds).filter((entry) => Boolean(entry));
|
|
590
|
+
const receiverBounds = receivers.map(readMeshWorldBounds).filter((entry) => Boolean(entry));
|
|
591
|
+
for (const bounds of casterBounds) {
|
|
592
|
+
points.push(...getBoundsCorners(bounds));
|
|
593
|
+
if (direction) {
|
|
594
|
+
for (const receiver of receiverBounds) {
|
|
595
|
+
points.push(...projectBoundsOntoReceiver(bounds, receiver, direction));
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
if (points.length === 0)
|
|
600
|
+
return null;
|
|
601
|
+
const min = {
|
|
602
|
+
x: Math.min(...points.map(point => point.x)),
|
|
603
|
+
y: Math.min(...points.map(point => point.y)),
|
|
604
|
+
z: Math.min(...points.map(point => point.z)),
|
|
605
|
+
};
|
|
606
|
+
const max = {
|
|
607
|
+
x: Math.max(...points.map(point => point.x)),
|
|
608
|
+
y: Math.max(...points.map(point => point.y)),
|
|
609
|
+
z: Math.max(...points.map(point => point.z)),
|
|
610
|
+
};
|
|
611
|
+
const center = {
|
|
612
|
+
x: (min.x + max.x) / 2,
|
|
613
|
+
y: (min.y + max.y) / 2,
|
|
614
|
+
z: (min.z + max.z) / 2,
|
|
615
|
+
};
|
|
616
|
+
const size = {
|
|
617
|
+
x: max.x - min.x,
|
|
618
|
+
y: max.y - min.y,
|
|
619
|
+
z: max.z - min.z,
|
|
620
|
+
};
|
|
621
|
+
return { min, max, center, size };
|
|
622
|
+
}
|
|
623
|
+
function readMeshWorldBounds(mesh) {
|
|
624
|
+
try {
|
|
625
|
+
mesh.computeWorldMatrix?.(true);
|
|
626
|
+
const box = mesh.getBoundingInfo?.()?.boundingBox;
|
|
627
|
+
const min = box?.minimumWorld;
|
|
628
|
+
const max = box?.maximumWorld;
|
|
629
|
+
if (!isFiniteVec3(min) || !isFiniteVec3(max))
|
|
630
|
+
return null;
|
|
631
|
+
return {
|
|
632
|
+
min: { x: min.x, y: min.y, z: min.z },
|
|
633
|
+
max: { x: max.x, y: max.y, z: max.z },
|
|
634
|
+
};
|
|
635
|
+
}
|
|
636
|
+
catch {
|
|
637
|
+
return null;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
function getBoundsCorners(bounds) {
|
|
641
|
+
const { min, max } = bounds;
|
|
642
|
+
return [
|
|
643
|
+
{ x: min.x, y: min.y, z: min.z },
|
|
644
|
+
{ x: min.x, y: min.y, z: max.z },
|
|
645
|
+
{ x: min.x, y: max.y, z: min.z },
|
|
646
|
+
{ x: min.x, y: max.y, z: max.z },
|
|
647
|
+
{ x: max.x, y: min.y, z: min.z },
|
|
648
|
+
{ x: max.x, y: min.y, z: max.z },
|
|
649
|
+
{ x: max.x, y: max.y, z: min.z },
|
|
650
|
+
{ x: max.x, y: max.y, z: max.z },
|
|
651
|
+
];
|
|
652
|
+
}
|
|
653
|
+
function projectBoundsOntoReceiver(caster, receiver, direction) {
|
|
654
|
+
if (Math.abs(direction.y) < 0.00001)
|
|
655
|
+
return [];
|
|
656
|
+
const receiverY = receiver.max.y;
|
|
657
|
+
return getBoundsCorners(caster).map(point => {
|
|
658
|
+
const t = (receiverY - point.y) / direction.y;
|
|
659
|
+
if (!Number.isFinite(t))
|
|
660
|
+
return null;
|
|
661
|
+
const clampedT = Math.max(0, t);
|
|
662
|
+
return {
|
|
663
|
+
x: point.x + direction.x * clampedT,
|
|
664
|
+
y: receiverY,
|
|
665
|
+
z: point.z + direction.z * clampedT,
|
|
666
|
+
};
|
|
667
|
+
}).filter((entry) => Boolean(entry));
|
|
668
|
+
}
|
|
669
|
+
function normalizeVec3(value) {
|
|
670
|
+
if (!isFiniteVec3(value))
|
|
671
|
+
return null;
|
|
672
|
+
const length = Math.hypot(value.x, value.y, value.z);
|
|
673
|
+
if (!Number.isFinite(length) || length < 0.00001)
|
|
674
|
+
return null;
|
|
675
|
+
return { x: value.x / length, y: value.y / length, z: value.z / length };
|
|
676
|
+
}
|
|
677
|
+
function isFiniteVec3(value) {
|
|
678
|
+
const vec = value;
|
|
679
|
+
return Boolean(vec)
|
|
680
|
+
&& typeof vec?.x === 'number'
|
|
681
|
+
&& typeof vec?.y === 'number'
|
|
682
|
+
&& typeof vec?.z === 'number'
|
|
683
|
+
&& Number.isFinite(vec.x)
|
|
684
|
+
&& Number.isFinite(vec.y)
|
|
685
|
+
&& Number.isFinite(vec.z);
|
|
686
|
+
}
|
|
687
|
+
function setMutableVec3(target, value) {
|
|
688
|
+
if (!target)
|
|
689
|
+
return;
|
|
690
|
+
if (typeof target.set === 'function') {
|
|
691
|
+
target.set(value.x, value.y, value.z);
|
|
692
|
+
return;
|
|
693
|
+
}
|
|
694
|
+
target.x = value.x;
|
|
695
|
+
target.y = value.y;
|
|
696
|
+
target.z = value.z;
|
|
697
|
+
}
|
|
698
|
+
function readShadowPreviewMeshDebugName(mesh) {
|
|
699
|
+
const projection = readEditorProjectionMetadata(mesh);
|
|
700
|
+
const nodeId = typeof projection?.nodeId === 'string' ? projection.nodeId : null;
|
|
701
|
+
const name = typeof mesh.name === 'string' ? mesh.name : '<unnamed>';
|
|
702
|
+
return nodeId ? `${name}#${nodeId}` : name;
|
|
703
|
+
}
|
|
704
|
+
function readPlanarShadowSourceNodeInfo(info, scene) {
|
|
705
|
+
const nodeIds = new Set();
|
|
706
|
+
const sourceMeshUniqueIds = new Set(info.sourceMeshUniqueIds ?? []);
|
|
707
|
+
const sourceMeshNames = new Set(info.sourceMeshNames ?? []);
|
|
708
|
+
const hasSourceMeshIdentity = sourceMeshUniqueIds.size > 0;
|
|
709
|
+
for (const mesh of readSceneMeshes(scene)) {
|
|
710
|
+
const uniqueId = typeof mesh.uniqueId === 'number' ? mesh.uniqueId : null;
|
|
711
|
+
const matched = hasSourceMeshIdentity
|
|
712
|
+
? uniqueId !== null && sourceMeshUniqueIds.has(uniqueId)
|
|
713
|
+
: mesh.name === info.sourceName || sourceMeshNames.has(mesh.name ?? '');
|
|
714
|
+
if (!matched) {
|
|
715
|
+
continue;
|
|
716
|
+
}
|
|
717
|
+
const projection = readEditorProjectionMetadata(mesh);
|
|
718
|
+
const nodeId = typeof projection?.nodeId === 'string' ? projection.nodeId : null;
|
|
719
|
+
if (nodeId)
|
|
720
|
+
nodeIds.add(nodeId);
|
|
721
|
+
}
|
|
722
|
+
const sourceNodeIds = [...nodeIds];
|
|
723
|
+
return {
|
|
724
|
+
...(sourceNodeIds[0] ? { sourceNodeId: sourceNodeIds[0] } : {}),
|
|
725
|
+
...(sourceNodeIds.length > 0 ? { sourceNodeIds } : {}),
|
|
726
|
+
};
|
|
727
|
+
}
|
|
728
|
+
function toPlainVec3(value) {
|
|
729
|
+
return isFiniteVec3(value) ? { x: value.x, y: value.y, z: value.z } : null;
|
|
730
|
+
}
|
|
731
|
+
function logShadowDebug(event, details) {
|
|
732
|
+
if (!isShadowDebugLoggingEnabled())
|
|
733
|
+
return;
|
|
734
|
+
try {
|
|
735
|
+
console.info('[fps-shadow-debug]', event, `json=${stringifyShadowDebugDetails(details)}`, details);
|
|
736
|
+
}
|
|
737
|
+
catch {
|
|
738
|
+
// Debug logging must never affect rendering.
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
function stringifyShadowDebugDetails(details) {
|
|
742
|
+
try {
|
|
743
|
+
return JSON.stringify(details);
|
|
744
|
+
}
|
|
745
|
+
catch {
|
|
746
|
+
return '{"error":"shadowDebugDetailsNotSerializable"}';
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
function isShadowDebugLoggingEnabled() {
|
|
750
|
+
const global = globalThis;
|
|
751
|
+
if (global.__FPS_SHADOW_DEBUG__ === true)
|
|
752
|
+
return true;
|
|
753
|
+
const env = global.process?.env?.FPS_SHADOW_DEBUG;
|
|
754
|
+
if (env === '1' || env === 'true')
|
|
755
|
+
return true;
|
|
756
|
+
try {
|
|
757
|
+
const search = global.location?.search ?? '';
|
|
758
|
+
if (/(?:[?&])fpsShadowDebug(?:=1|=true|&|$)/.test(search))
|
|
759
|
+
return true;
|
|
760
|
+
}
|
|
761
|
+
catch { }
|
|
762
|
+
try {
|
|
763
|
+
const stored = global.localStorage?.getItem?.(SHADOW_DEBUG_STORAGE_KEY);
|
|
764
|
+
return stored === '1' || stored === 'true';
|
|
765
|
+
}
|
|
766
|
+
catch {
|
|
767
|
+
return false;
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
function readFiniteNumber(value, fallback) {
|
|
771
|
+
return typeof value === 'number' && Number.isFinite(value) ? value : fallback;
|
|
772
|
+
}
|
|
773
|
+
function readProjectionShadowSettingsPreviewMode(value) {
|
|
774
|
+
const shadow = readObject(value);
|
|
775
|
+
if (!shadow)
|
|
776
|
+
return null;
|
|
777
|
+
const mode = shadow.mode;
|
|
778
|
+
if (mode === 'inherit' || mode === 'auto' || mode === 'default')
|
|
779
|
+
return null;
|
|
780
|
+
if (mode === 'projected')
|
|
781
|
+
return 'planar';
|
|
782
|
+
if (mode === 'none' || mode === 'blob' || mode === 'static' || mode === 'dynamic')
|
|
783
|
+
return mode;
|
|
784
|
+
return null;
|
|
785
|
+
}
|
|
786
|
+
function readLegacyProjectionShadowMode(value) {
|
|
787
|
+
return value === 'default' || value === 'none' || value === 'blob' || value === 'static' || value === 'planar' || value === 'dynamic'
|
|
788
|
+
? value
|
|
789
|
+
: null;
|
|
790
|
+
}
|
|
251
791
|
function hasGeneratedShadowDisabled(mesh) {
|
|
252
792
|
for (const node of walkNodeAndParents(mesh)) {
|
|
253
793
|
const metadata = readObject(node.metadata);
|