@fps-games/editor 0.1.6-beta.1 → 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-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-harness.d.ts +26 -2
- package/dist/local-editor-harness.d.ts.map +1 -1
- package/dist/local-editor-harness.js +773 -75
- package/dist/local-editor-harness.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 +5 -0
- package/dist/playable-local-editor-host.d.ts.map +1 -1
- package/dist/playable-local-editor-host.js +2 -0
- package/dist/playable-local-editor-host.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/projection.d.ts +30 -0
- package/node_modules/@fps-games/editor-babylon/dist/projection.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/projection.js +346 -11
- 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 +5 -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 +3 -1
- package/node_modules/@fps-games/editor-browser/dist/index.js.map +1 -1
- 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 +7 -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.js +2 -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.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.js +288 -71
- 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 +3 -0
- 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 +21 -14
- 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-prefab-stage.d.ts +19 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-prefab-stage.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-prefab-stage.js +79 -39
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-prefab-stage.js.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-types.d.ts +68 -1
- 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 +2 -0
- 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 +10 -0
- 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 +3 -2
- 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 +401 -241
- 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/viewport-tools.d.ts +1 -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.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-placement/document.d.ts +0 -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 +4 -42
- 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 +42 -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 +612 -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 +42 -0
- 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 +16 -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 +5 -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 +28 -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/mutation/field-patch.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/field-patch.js +99 -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 +16 -32
- 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 +5 -22
- 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 +4 -0
- 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.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/descriptors.js +224 -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 +158 -50
- 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/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/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/index.d.ts +2 -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 +2 -0
- package/node_modules/@fps-games/editor-protocol/dist/index.js.map +1 -1
- package/node_modules/@fps-games/editor-protocol/package.json +1 -1
- package/package.json +8 -8
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Constants } from '@babylonjs/core/Engines/constants.js';
|
|
2
2
|
import { DirectionalLight } from '@babylonjs/core/Lights/directionalLight.js';
|
|
3
3
|
import { Color3, Color4 } from '@babylonjs/core/Maths/math.color.js';
|
|
4
|
-
import { Vector3 } from '@babylonjs/core/Maths/math.vector.js';
|
|
4
|
+
import { Matrix, Vector3 } from '@babylonjs/core/Maths/math.vector.js';
|
|
5
|
+
import { Material } from '@babylonjs/core/Materials/material.js';
|
|
5
6
|
import { ShaderMaterial } from '@babylonjs/core/Materials/shaderMaterial.js';
|
|
6
7
|
import { StandardMaterial } from '@babylonjs/core/Materials/standardMaterial.js';
|
|
7
8
|
import { AbstractMesh } from '@babylonjs/core/Meshes/abstractMesh.js';
|
|
@@ -14,6 +15,8 @@ import { getPlanarShadowShaderAttributes, getPlanarShadowShaderSamplers, getPlan
|
|
|
14
15
|
import { DEFAULT_PLANAR_SHADOW_OPTIONS, } from './types.js';
|
|
15
16
|
const PLANAR_SHADOW_ALPHA_INDEX = 4;
|
|
16
17
|
const DEFAULT_SHADOW_DIRECTION = new Vector3(-0.3, -1, -0.2).normalize();
|
|
18
|
+
const STANDARD_ALPHA_LUMINANCE_WEIGHTS = new Vector3(0.3, 0.59, 0.11);
|
|
19
|
+
const PBR_ALPHA_LUMINANCE_WEIGHTS = new Vector3(0.2126, 0.7152, 0.0722);
|
|
17
20
|
export function createPlanarShadowSystem(scene, directionalLight, options = {}) {
|
|
18
21
|
return new BabylonPlanarShadowSystem(scene, directionalLight, options);
|
|
19
22
|
}
|
|
@@ -51,20 +54,30 @@ class BabylonPlanarShadowSystem {
|
|
|
51
54
|
addCaster(mesh) {
|
|
52
55
|
const root = this.findCasterRoot(mesh);
|
|
53
56
|
if (!this.initialized || this.casters.has(root))
|
|
54
|
-
return;
|
|
57
|
+
return false;
|
|
55
58
|
if (!this.isValidShadowSource(mesh))
|
|
56
|
-
return;
|
|
59
|
+
return false;
|
|
57
60
|
const shadow = this.createShadowForNode(root);
|
|
58
|
-
if (shadow)
|
|
59
|
-
|
|
61
|
+
if (!shadow)
|
|
62
|
+
return false;
|
|
63
|
+
this.casters.set(shadow.source, shadow);
|
|
64
|
+
return true;
|
|
60
65
|
}
|
|
61
66
|
removeCaster(mesh) {
|
|
62
67
|
const root = this.findCasterRoot(mesh);
|
|
63
68
|
this.disposeCaster(root);
|
|
64
69
|
}
|
|
65
70
|
addReceiver(mesh) {
|
|
66
|
-
|
|
71
|
+
this.registerReceiver(mesh, true);
|
|
72
|
+
}
|
|
73
|
+
registerReceiver(mesh, manual) {
|
|
74
|
+
if (!this.options.stencil.enabled || this.hasDisabledReceiver(mesh))
|
|
75
|
+
return;
|
|
76
|
+
const existing = this.receivers.get(mesh);
|
|
77
|
+
if (existing) {
|
|
78
|
+
existing.manual = existing.manual || manual;
|
|
67
79
|
return;
|
|
80
|
+
}
|
|
68
81
|
const originalRenderingGroup = mesh instanceof Mesh ? mesh.renderingGroupId : 0;
|
|
69
82
|
if (mesh instanceof Mesh)
|
|
70
83
|
mesh.renderingGroupId = this.options.stencil.receiverRenderingGroup;
|
|
@@ -80,7 +93,7 @@ class BabylonPlanarShadowSystem {
|
|
|
80
93
|
stencil.opStencilFail = Constants.KEEP;
|
|
81
94
|
stencil.opDepthFail = Constants.KEEP;
|
|
82
95
|
}
|
|
83
|
-
this.receivers.set(mesh, { mesh, originalRenderingGroup, material });
|
|
96
|
+
this.receivers.set(mesh, { mesh, originalRenderingGroup, material, manual });
|
|
84
97
|
}
|
|
85
98
|
removeReceiver(mesh) {
|
|
86
99
|
const info = this.receivers.get(mesh);
|
|
@@ -131,15 +144,17 @@ class BabylonPlanarShadowSystem {
|
|
|
131
144
|
setOptions(options) {
|
|
132
145
|
const wasEnabled = this.options.enabled;
|
|
133
146
|
const requiredUniqueMaterials = this.requiresPerShadowMaterial();
|
|
147
|
+
const previousStrategy = this.options.projection.strategy;
|
|
134
148
|
this.options = resolvePlanarShadowOptions(options, this.options);
|
|
135
149
|
this.casterPatterns = [...this.options.casters.includePatterns];
|
|
136
150
|
const requiresUniqueMaterials = this.requiresPerShadowMaterial();
|
|
151
|
+
const strategyChanged = previousStrategy !== this.options.projection.strategy;
|
|
137
152
|
if (!wasEnabled && this.options.enabled)
|
|
138
153
|
this.initialize();
|
|
139
154
|
else if (wasEnabled && !this.options.enabled)
|
|
140
155
|
this.dispose();
|
|
141
156
|
else {
|
|
142
|
-
if (requiredUniqueMaterials !== requiresUniqueMaterials)
|
|
157
|
+
if (requiredUniqueMaterials !== requiresUniqueMaterials || strategyChanged)
|
|
143
158
|
this.rebuildCasters();
|
|
144
159
|
this.refresh();
|
|
145
160
|
}
|
|
@@ -153,6 +168,28 @@ class BabylonPlanarShadowSystem {
|
|
|
153
168
|
getReceiverCount() {
|
|
154
169
|
return this.receivers.size;
|
|
155
170
|
}
|
|
171
|
+
getCasterDebugInfo() {
|
|
172
|
+
return [...this.casters.values()].map((info) => ({
|
|
173
|
+
sourceName: info.source.name,
|
|
174
|
+
sourceMeshNames: [...info.sourceMeshNames],
|
|
175
|
+
sourceMeshUniqueIds: [...info.sourceMeshUniqueIds],
|
|
176
|
+
shadowName: info.shadow.name,
|
|
177
|
+
strategy: info.strategy,
|
|
178
|
+
hasSkeleton: info.hasSkeleton,
|
|
179
|
+
projectedMeshCount: info.projectedMeshCount,
|
|
180
|
+
convexHullMeshCount: info.convexHullMeshCount,
|
|
181
|
+
alphaCutoutMeshCount: info.alphaCutoutMeshCount,
|
|
182
|
+
alphaCutoutChannels: [...info.alphaCutoutChannels],
|
|
183
|
+
alphaCutoutUvSets: [...info.alphaCutoutUvSets],
|
|
184
|
+
alphaCutoutLevels: [...info.alphaCutoutLevels],
|
|
185
|
+
alphaCutoutLuminanceWeights: info.alphaCutoutLuminanceWeights.map((weights) => ({
|
|
186
|
+
x: weights.x,
|
|
187
|
+
y: weights.y,
|
|
188
|
+
z: weights.z,
|
|
189
|
+
})),
|
|
190
|
+
fallbackReasons: [...info.fallbackReasons],
|
|
191
|
+
}));
|
|
192
|
+
}
|
|
156
193
|
dispose() {
|
|
157
194
|
if (this.renderObserver) {
|
|
158
195
|
this.scene.onBeforeRenderObservable.remove(this.renderObserver);
|
|
@@ -183,14 +220,17 @@ class BabylonPlanarShadowSystem {
|
|
|
183
220
|
this.scene.setRenderingAutoClearDepthStencil(this.options.stencil.receiverRenderingGroup, true, false, true);
|
|
184
221
|
this.scene.setRenderingAutoClearDepthStencil(this.options.stencil.shadowRenderingGroup, false, false, false);
|
|
185
222
|
}
|
|
186
|
-
createShadowMaterial(defines = []) {
|
|
187
|
-
const
|
|
188
|
-
|
|
223
|
+
createShadowMaterial(defines = [], alphaCutout = null) {
|
|
224
|
+
const materialDefines = alphaCutout
|
|
225
|
+
? [...defines, 'ALPHA_CUTOUT', ...(alphaCutout.layers[1] ? ['ALPHA_CUTOUT_SECONDARY'] : [])]
|
|
226
|
+
: defines;
|
|
227
|
+
const usesBoneTexture = materialDefines.includes('BONETEXTURE');
|
|
228
|
+
const usesBones = materialDefines.includes('BONE');
|
|
189
229
|
const material = new ShaderMaterial(`fps.planarShadow.${this.materials.size}`, this.scene, { vertex: PLANAR_SHADOW_SHADER_NAME, fragment: PLANAR_SHADOW_SHADER_NAME }, {
|
|
190
230
|
attributes: getPlanarShadowShaderAttributes(),
|
|
191
231
|
uniforms: getPlanarShadowShaderUniforms(),
|
|
192
232
|
samplers: getPlanarShadowShaderSamplers(),
|
|
193
|
-
defines,
|
|
233
|
+
defines: materialDefines,
|
|
194
234
|
});
|
|
195
235
|
material.backFaceCulling = false;
|
|
196
236
|
material.disableDepthWrite = true;
|
|
@@ -200,6 +240,15 @@ class BabylonPlanarShadowSystem {
|
|
|
200
240
|
material.onBindObservable.add((mesh) => {
|
|
201
241
|
if (mesh instanceof AbstractMesh)
|
|
202
242
|
this.bindShadowProjectionUniforms(material, mesh);
|
|
243
|
+
if (alphaCutout) {
|
|
244
|
+
const primary = alphaCutout.layers[0];
|
|
245
|
+
material.setTexture('shadowAlphaSampler', primary.texture);
|
|
246
|
+
material.setFloat('u_shadowAlphaCutoff', alphaCutout.cutoff);
|
|
247
|
+
bindPlanarShadowAlphaCutoutLayer(material, '', primary);
|
|
248
|
+
const secondary = alphaCutout.layers[1];
|
|
249
|
+
if (secondary)
|
|
250
|
+
bindPlanarShadowAlphaCutoutLayer(material, '2', secondary);
|
|
251
|
+
}
|
|
203
252
|
});
|
|
204
253
|
if (usesBones) {
|
|
205
254
|
let lastBoundTexture = null;
|
|
@@ -345,13 +394,19 @@ class BabylonPlanarShadowSystem {
|
|
|
345
394
|
refreshReceivers() {
|
|
346
395
|
if (!this.options.stencil.enabled)
|
|
347
396
|
return;
|
|
348
|
-
for (const mesh of [...this.receivers
|
|
397
|
+
for (const [mesh, info] of [...this.receivers]) {
|
|
398
|
+
if (info.manual) {
|
|
399
|
+
if (this.hasDisabledReceiver(mesh) || this.matchesExcludePattern(mesh) || this.hasExcludedAncestor(mesh)) {
|
|
400
|
+
this.removeReceiver(mesh);
|
|
401
|
+
}
|
|
402
|
+
continue;
|
|
403
|
+
}
|
|
349
404
|
if (!this.matchesReceiver(mesh))
|
|
350
405
|
this.removeReceiver(mesh);
|
|
351
406
|
}
|
|
352
407
|
for (const mesh of this.scene.meshes) {
|
|
353
408
|
if (this.matchesReceiver(mesh))
|
|
354
|
-
this.
|
|
409
|
+
this.registerReceiver(mesh, false);
|
|
355
410
|
}
|
|
356
411
|
}
|
|
357
412
|
pruneDisposedCasters() {
|
|
@@ -423,30 +478,59 @@ class BabylonPlanarShadowSystem {
|
|
|
423
478
|
const shadowRoot = new TransformNode(`${root.name}_planarShadowRoot`, this.scene);
|
|
424
479
|
let hasSkeleton = false;
|
|
425
480
|
const pairs = [];
|
|
481
|
+
const fallbackReasons = [];
|
|
426
482
|
let sharedSkeleton = null;
|
|
427
483
|
let sharedMaterial = null;
|
|
428
484
|
for (const mesh of validMeshes) {
|
|
429
485
|
if (!(mesh instanceof Mesh) && !(mesh instanceof InstancedMesh))
|
|
430
486
|
continue;
|
|
431
487
|
const geometrySource = mesh instanceof InstancedMesh ? mesh.sourceMesh : mesh;
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
488
|
+
const strategy = this.options.projection.strategy;
|
|
489
|
+
if (strategy !== 'convex-hull') {
|
|
490
|
+
const alphaCutout = resolvePlanarShadowAlphaCutout(geometrySource);
|
|
491
|
+
const material = this.resolveShadowMaterial(geometrySource, sharedSkeleton, sharedMaterial, alphaCutout);
|
|
492
|
+
if (geometrySource.skeleton) {
|
|
493
|
+
hasSkeleton = true;
|
|
494
|
+
sharedSkeleton = geometrySource.skeleton;
|
|
495
|
+
if (!alphaCutout)
|
|
496
|
+
sharedMaterial = material;
|
|
497
|
+
}
|
|
498
|
+
const shadowMesh = material ? this.createProjectedShadowMesh(mesh, material) : null;
|
|
440
499
|
if (shadowMesh) {
|
|
500
|
+
const alphaCutoutLayers = alphaCutout?.layers.filter((layer) => !!layer) ?? [];
|
|
441
501
|
shadowMesh.parent = shadowRoot;
|
|
442
|
-
pairs.push({
|
|
502
|
+
pairs.push({
|
|
503
|
+
mode: 'projected-mesh',
|
|
504
|
+
source: mesh,
|
|
505
|
+
shadow: shadowMesh,
|
|
506
|
+
alphaCutout: !!alphaCutout,
|
|
507
|
+
alphaCutoutChannels: alphaCutoutLayers.map((layer) => layer.channel),
|
|
508
|
+
alphaCutoutUvSets: alphaCutoutLayers.map((layer) => layer.coordinatesIndex),
|
|
509
|
+
alphaCutoutLevels: alphaCutoutLayers.map((layer) => layer.level),
|
|
510
|
+
alphaCutoutLuminanceWeights: alphaCutoutLayers.map((layer) => layer.luminanceWeights),
|
|
511
|
+
});
|
|
512
|
+
continue;
|
|
443
513
|
}
|
|
444
|
-
|
|
514
|
+
fallbackReasons.push(`${mesh.name}: projected mesh clone unavailable`);
|
|
515
|
+
if (strategy === 'projected-mesh')
|
|
516
|
+
continue;
|
|
445
517
|
}
|
|
446
518
|
const shadowMesh = this.createHullShadowMesh(mesh);
|
|
447
519
|
if (shadowMesh) {
|
|
448
520
|
shadowMesh.parent = shadowRoot;
|
|
449
|
-
pairs.push({
|
|
521
|
+
pairs.push({
|
|
522
|
+
mode: 'flat-hull',
|
|
523
|
+
source: mesh,
|
|
524
|
+
shadow: shadowMesh,
|
|
525
|
+
alphaCutout: false,
|
|
526
|
+
alphaCutoutChannels: [],
|
|
527
|
+
alphaCutoutUvSets: [],
|
|
528
|
+
alphaCutoutLevels: [],
|
|
529
|
+
alphaCutoutLuminanceWeights: [],
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
else {
|
|
533
|
+
fallbackReasons.push(`${mesh.name}: convex hull geometry unavailable`);
|
|
450
534
|
}
|
|
451
535
|
}
|
|
452
536
|
if (pairs.length === 0) {
|
|
@@ -463,6 +547,8 @@ class BabylonPlanarShadowSystem {
|
|
|
463
547
|
this.updateHullShadowMesh(pair.source, pair.shadow);
|
|
464
548
|
}
|
|
465
549
|
else {
|
|
550
|
+
pair.shadow.setEnabled(pair.source.isEnabled());
|
|
551
|
+
pair.shadow.isVisible = pair.source.isVisible;
|
|
466
552
|
pair.source.computeWorldMatrix(true).decompose(pair.shadow.scaling, pair.shadow.rotationQuaternion, pair.shadow.position);
|
|
467
553
|
}
|
|
468
554
|
}
|
|
@@ -473,7 +559,18 @@ class BabylonPlanarShadowSystem {
|
|
|
473
559
|
return {
|
|
474
560
|
source: root,
|
|
475
561
|
shadow: shadowRoot,
|
|
562
|
+
sourceMeshNames: uniqueStrings(pairs.map((pair) => pair.source.name)),
|
|
563
|
+
sourceMeshUniqueIds: uniqueNumbers(pairs.map((pair) => pair.source.uniqueId)),
|
|
476
564
|
hasSkeleton,
|
|
565
|
+
strategy: summarizePlanarShadowStrategy(pairs),
|
|
566
|
+
projectedMeshCount: pairs.filter((pair) => pair.mode === 'projected-mesh').length,
|
|
567
|
+
convexHullMeshCount: pairs.filter((pair) => pair.mode === 'flat-hull').length,
|
|
568
|
+
alphaCutoutMeshCount: pairs.filter((pair) => pair.alphaCutout).length,
|
|
569
|
+
alphaCutoutChannels: pairs.flatMap((pair) => pair.alphaCutoutChannels),
|
|
570
|
+
alphaCutoutUvSets: pairs.flatMap((pair) => pair.alphaCutoutUvSets),
|
|
571
|
+
alphaCutoutLevels: pairs.flatMap((pair) => pair.alphaCutoutLevels),
|
|
572
|
+
alphaCutoutLuminanceWeights: pairs.flatMap((pair) => pair.alphaCutoutLuminanceWeights),
|
|
573
|
+
fallbackReasons,
|
|
477
574
|
};
|
|
478
575
|
}
|
|
479
576
|
resolveSkeletonShadowMaterial(geometrySource, sharedSkeleton, sharedMaterial) {
|
|
@@ -486,7 +583,14 @@ class BabylonPlanarShadowSystem {
|
|
|
486
583
|
this.materials.add(material);
|
|
487
584
|
return material;
|
|
488
585
|
}
|
|
489
|
-
resolveShadowMaterial(geometrySource, sharedSkeleton, sharedMaterial) {
|
|
586
|
+
resolveShadowMaterial(geometrySource, sharedSkeleton, sharedMaterial, alphaCutout = null) {
|
|
587
|
+
if (alphaCutout) {
|
|
588
|
+
const material = geometrySource.skeleton
|
|
589
|
+
? this.createShadowMaterial(getPlanarShadowSkeletonDefines(geometrySource.skeleton?.bones.length ?? 0, !!this.scene.getEngine().getCaps().textureFloat && (geometrySource.skeleton?.bones.length ?? 0) > 4, geometrySource.isVerticesDataPresent('matricesIndicesExtra')), alphaCutout)
|
|
590
|
+
: this.createShadowMaterial([], alphaCutout);
|
|
591
|
+
this.materials.add(material);
|
|
592
|
+
return material;
|
|
593
|
+
}
|
|
490
594
|
if (this.requiresPerShadowMaterial()) {
|
|
491
595
|
const material = geometrySource.skeleton
|
|
492
596
|
? this.createShadowMaterial(getPlanarShadowSkeletonDefines(geometrySource.skeleton?.bones.length ?? 0, !!this.scene.getEngine().getCaps().textureFloat && (geometrySource.skeleton?.bones.length ?? 0) > 4, geometrySource.isVerticesDataPresent('matricesIndicesExtra')))
|
|
@@ -578,7 +682,11 @@ class BabylonPlanarShadowSystem {
|
|
|
578
682
|
const size = mesh.getBoundingInfo()?.boundingBox.extendSizeWorld;
|
|
579
683
|
if (!size)
|
|
580
684
|
return true;
|
|
581
|
-
|
|
685
|
+
const volume = size.x * size.y * size.z;
|
|
686
|
+
if (volume >= this.options.casters.minVolume)
|
|
687
|
+
return true;
|
|
688
|
+
const maxProjectedArea = Math.max(size.x * size.y, size.x * size.z, size.y * size.z);
|
|
689
|
+
return maxProjectedArea >= this.options.casters.minVolume;
|
|
582
690
|
}
|
|
583
691
|
findCasterRoot(mesh) {
|
|
584
692
|
let topmost = mesh;
|
|
@@ -603,6 +711,7 @@ class BabylonPlanarShadowSystem {
|
|
|
603
711
|
matchesReceiver(mesh) {
|
|
604
712
|
return this.options.stencil.enabled
|
|
605
713
|
&& !hasDisablePlanarShadowMetadata(mesh)
|
|
714
|
+
&& !this.hasDisabledReceiver(mesh)
|
|
606
715
|
&& !this.matchesExcludePattern(mesh)
|
|
607
716
|
&& !this.hasExcludedAncestor(mesh)
|
|
608
717
|
&& this.matchesReceiverPattern(mesh);
|
|
@@ -629,6 +738,9 @@ class BabylonPlanarShadowSystem {
|
|
|
629
738
|
}
|
|
630
739
|
return false;
|
|
631
740
|
}
|
|
741
|
+
hasDisabledReceiver(mesh) {
|
|
742
|
+
return hasDisabledPlanarShadowReceiver(mesh, node => this.matchesRootBoundaryPattern(node));
|
|
743
|
+
}
|
|
632
744
|
isAlreadyCoveredByCaster(node) {
|
|
633
745
|
for (const caster of this.casters.keys()) {
|
|
634
746
|
if (caster === node || isDescendantOf(node, caster) || isDescendantOf(caster, node))
|
|
@@ -697,6 +809,14 @@ function buildPlanarShadowHullGeometry(source, options) {
|
|
|
697
809
|
normals: normalsOut,
|
|
698
810
|
};
|
|
699
811
|
}
|
|
812
|
+
function bindPlanarShadowAlphaCutoutLayer(material, suffix, layer) {
|
|
813
|
+
material.setFloat(`u_shadowAlphaLevel${suffix}`, layer.level);
|
|
814
|
+
material.setFloat(`u_shadowAlphaChannelMode${suffix}`, layer.channel === 'red' ? 2 : layer.channel === 'luminance' ? 1 : 0);
|
|
815
|
+
material.setVector3(`u_shadowAlphaLuminanceWeights${suffix}`, layer.luminanceWeights);
|
|
816
|
+
material.setFloat(`u_shadowAlphaUvSet${suffix}`, layer.coordinatesIndex);
|
|
817
|
+
material.setMatrix(`u_shadowAlphaMatrix${suffix}`, layer.texture.getTextureMatrix?.() ?? Matrix.Identity());
|
|
818
|
+
material.setTexture(`shadowAlphaSampler${suffix}`, layer.texture);
|
|
819
|
+
}
|
|
700
820
|
function buildPlaneBasis(normal) {
|
|
701
821
|
const seed = Math.abs(Vector3.Dot(normal, Vector3.Up())) > 0.95
|
|
702
822
|
? Vector3.Right()
|
|
@@ -756,6 +876,7 @@ function resolvePlanarShadowOptions(override, base = DEFAULT_PLANAR_SHADOW_OPTIO
|
|
|
756
876
|
direction: { mode: 'follow-light' },
|
|
757
877
|
projection: {
|
|
758
878
|
footprintScale: readNonNegativeFiniteNumber(override.projection?.footprintScale, base.projection.footprintScale),
|
|
879
|
+
strategy: readPlanarShadowProjectionStrategy(override.projection?.strategy, base.projection.strategy),
|
|
759
880
|
},
|
|
760
881
|
stencil: {
|
|
761
882
|
enabled: override.stencil?.enabled ?? base.stencil.enabled,
|
|
@@ -777,6 +898,26 @@ function resolvePlanarShadowOptions(override, base = DEFAULT_PLANAR_SHADOW_OPTIO
|
|
|
777
898
|
debug: override.debug ?? base.debug,
|
|
778
899
|
};
|
|
779
900
|
}
|
|
901
|
+
function summarizePlanarShadowStrategy(pairs) {
|
|
902
|
+
const projectedCount = pairs.filter((pair) => pair.mode === 'projected-mesh').length;
|
|
903
|
+
const hullCount = pairs.filter((pair) => pair.mode === 'flat-hull').length;
|
|
904
|
+
if (projectedCount > 0 && hullCount === 0)
|
|
905
|
+
return 'projected-mesh';
|
|
906
|
+
if (hullCount > 0 && projectedCount === 0)
|
|
907
|
+
return 'convex-hull';
|
|
908
|
+
return 'auto';
|
|
909
|
+
}
|
|
910
|
+
function uniqueStrings(values) {
|
|
911
|
+
return [...new Set(values.filter(value => value.length > 0))];
|
|
912
|
+
}
|
|
913
|
+
function uniqueNumbers(values) {
|
|
914
|
+
return [...new Set(values.filter(value => Number.isFinite(value)))];
|
|
915
|
+
}
|
|
916
|
+
function readPlanarShadowProjectionStrategy(value, fallback) {
|
|
917
|
+
return value === 'auto' || value === 'projected-mesh' || value === 'convex-hull'
|
|
918
|
+
? value
|
|
919
|
+
: fallback;
|
|
920
|
+
}
|
|
780
921
|
function cloneResolvedOptions(options) {
|
|
781
922
|
return resolvePlanarShadowOptions(options);
|
|
782
923
|
}
|
|
@@ -821,6 +962,29 @@ function hasDisablePlanarShadowMetadata(node) {
|
|
|
821
962
|
&& (metadata.disablePlanarShadow === true
|
|
822
963
|
|| metadata.planarShadowInternal === true);
|
|
823
964
|
}
|
|
965
|
+
function hasDisabledPlanarShadowReceiver(node, isRootBoundary) {
|
|
966
|
+
let current = node;
|
|
967
|
+
while (current) {
|
|
968
|
+
if (readEditorProjectionShadowReceive(current) === 'none')
|
|
969
|
+
return true;
|
|
970
|
+
current = current.parent instanceof AbstractMesh && !isRootBoundary(current.parent)
|
|
971
|
+
? current.parent
|
|
972
|
+
: null;
|
|
973
|
+
}
|
|
974
|
+
return false;
|
|
975
|
+
}
|
|
976
|
+
function readEditorProjectionShadowReceive(node) {
|
|
977
|
+
const metadata = node.metadata;
|
|
978
|
+
if (!metadata || typeof metadata !== 'object')
|
|
979
|
+
return undefined;
|
|
980
|
+
const editorProjection = metadata.editorProjection;
|
|
981
|
+
if (!editorProjection || typeof editorProjection !== 'object')
|
|
982
|
+
return undefined;
|
|
983
|
+
const shadow = editorProjection.shadow;
|
|
984
|
+
if (!shadow || typeof shadow !== 'object')
|
|
985
|
+
return undefined;
|
|
986
|
+
return shadow.receive;
|
|
987
|
+
}
|
|
824
988
|
function isDisposedNode(node) {
|
|
825
989
|
return typeof node.isDisposed === 'function' && node.isDisposed();
|
|
826
990
|
}
|
|
@@ -833,6 +997,145 @@ function readMeshMaterial(mesh) {
|
|
|
833
997
|
? material
|
|
834
998
|
: null;
|
|
835
999
|
}
|
|
1000
|
+
function resolvePlanarShadowAlphaCutout(mesh) {
|
|
1001
|
+
return findAlphaCutout(mesh.material);
|
|
1002
|
+
}
|
|
1003
|
+
function findAlphaCutout(material) {
|
|
1004
|
+
if (!material || typeof material !== 'object')
|
|
1005
|
+
return null;
|
|
1006
|
+
const record = material;
|
|
1007
|
+
const cutoff = readAlphaCutoff(record.alphaCutOff ?? record.alphaCutoff);
|
|
1008
|
+
const geometryOpacityTexture = readBaseTexture(record.geometryOpacityTexture);
|
|
1009
|
+
if (geometryOpacityTexture && materialUsesOpacityAlpha(record)) {
|
|
1010
|
+
const layer = createPlanarShadowAlphaCutoutLayer(geometryOpacityTexture, 'red', PBR_ALPHA_LUMINANCE_WEIGHTS);
|
|
1011
|
+
return layer ? {
|
|
1012
|
+
cutoff,
|
|
1013
|
+
layers: [layer],
|
|
1014
|
+
} : null;
|
|
1015
|
+
}
|
|
1016
|
+
const surfaceLayer = resolvePlanarShadowSurfaceAlphaLayer(record);
|
|
1017
|
+
const opacityTexture = readBaseTexture(record.opacityTexture);
|
|
1018
|
+
if (opacityTexture && materialUsesOpacityAlpha(record)) {
|
|
1019
|
+
const opacityLayer = createPlanarShadowAlphaCutoutLayer(opacityTexture, opacityTexture.getAlphaFromRGB ? 'luminance' : 'alpha', resolveOpacityLuminanceWeights(record));
|
|
1020
|
+
if (!opacityLayer)
|
|
1021
|
+
return surfaceLayer ? { cutoff, layers: [surfaceLayer] } : null;
|
|
1022
|
+
return {
|
|
1023
|
+
cutoff,
|
|
1024
|
+
layers: surfaceLayer ? [opacityLayer, surfaceLayer] : [opacityLayer],
|
|
1025
|
+
};
|
|
1026
|
+
}
|
|
1027
|
+
if (surfaceLayer)
|
|
1028
|
+
return { cutoff, layers: [surfaceLayer] };
|
|
1029
|
+
const subMaterials = Array.isArray(record.subMaterials) ? record.subMaterials : [];
|
|
1030
|
+
for (const subMaterial of subMaterials) {
|
|
1031
|
+
const resolved = findAlphaCutout(subMaterial);
|
|
1032
|
+
if (resolved)
|
|
1033
|
+
return resolved;
|
|
1034
|
+
}
|
|
1035
|
+
return null;
|
|
1036
|
+
}
|
|
1037
|
+
function resolvePlanarShadowSurfaceAlphaLayer(material) {
|
|
1038
|
+
const albedoTexture = readBaseTexture(material.albedoTexture);
|
|
1039
|
+
if (albedoTexture && materialUsesAlbedoAlpha(material, albedoTexture)) {
|
|
1040
|
+
return createPlanarShadowAlphaCutoutLayer(albedoTexture, 'alpha', STANDARD_ALPHA_LUMINANCE_WEIGHTS, 1);
|
|
1041
|
+
}
|
|
1042
|
+
const diffuseTexture = readBaseTexture(material.diffuseTexture);
|
|
1043
|
+
if (diffuseTexture && materialUsesDiffuseAlpha(material, diffuseTexture)) {
|
|
1044
|
+
return createPlanarShadowAlphaCutoutLayer(diffuseTexture, 'alpha', STANDARD_ALPHA_LUMINANCE_WEIGHTS, 1);
|
|
1045
|
+
}
|
|
1046
|
+
const baseColorTexture = readBaseTexture(material.baseColorTexture);
|
|
1047
|
+
if (baseColorTexture && materialUsesBaseAlpha(material, baseColorTexture)) {
|
|
1048
|
+
return createPlanarShadowAlphaCutoutLayer(baseColorTexture, 'alpha', STANDARD_ALPHA_LUMINANCE_WEIGHTS, 1);
|
|
1049
|
+
}
|
|
1050
|
+
const baseTexture = readBaseTexture(material.baseTexture);
|
|
1051
|
+
if (baseTexture && materialUsesBaseAlpha(material, baseTexture)) {
|
|
1052
|
+
return createPlanarShadowAlphaCutoutLayer(baseTexture, 'alpha', STANDARD_ALPHA_LUMINANCE_WEIGHTS, 1);
|
|
1053
|
+
}
|
|
1054
|
+
return null;
|
|
1055
|
+
}
|
|
1056
|
+
function createPlanarShadowAlphaCutoutLayer(texture, channel, luminanceWeights, level = readTextureLevel(texture)) {
|
|
1057
|
+
const coordinatesIndex = readSupportedTextureCoordinatesIndex(texture);
|
|
1058
|
+
return coordinatesIndex == null
|
|
1059
|
+
? null
|
|
1060
|
+
: {
|
|
1061
|
+
texture,
|
|
1062
|
+
channel,
|
|
1063
|
+
coordinatesIndex,
|
|
1064
|
+
level,
|
|
1065
|
+
luminanceWeights,
|
|
1066
|
+
};
|
|
1067
|
+
}
|
|
1068
|
+
function readBaseTexture(value) {
|
|
1069
|
+
return value && typeof value === 'object' && typeof value.getClassName === 'function'
|
|
1070
|
+
? value
|
|
1071
|
+
: null;
|
|
1072
|
+
}
|
|
1073
|
+
function readSupportedTextureCoordinatesIndex(texture) {
|
|
1074
|
+
return texture.coordinatesIndex === 0
|
|
1075
|
+
|| texture.coordinatesIndex === 1
|
|
1076
|
+
|| texture.coordinatesIndex === 2
|
|
1077
|
+
|| texture.coordinatesIndex === 3
|
|
1078
|
+
|| texture.coordinatesIndex === 4
|
|
1079
|
+
|| texture.coordinatesIndex === 5
|
|
1080
|
+
? texture.coordinatesIndex
|
|
1081
|
+
: null;
|
|
1082
|
+
}
|
|
1083
|
+
function readTextureLevel(texture) {
|
|
1084
|
+
return typeof texture.level === 'number' && Number.isFinite(texture.level) ? Math.max(0, texture.level) : 1;
|
|
1085
|
+
}
|
|
1086
|
+
function resolveOpacityLuminanceWeights(material) {
|
|
1087
|
+
const className = typeof material.getClassName === 'function'
|
|
1088
|
+
? String(material.getClassName.call(material))
|
|
1089
|
+
: '';
|
|
1090
|
+
return className.includes('PBR') ? PBR_ALPHA_LUMINANCE_WEIGHTS : STANDARD_ALPHA_LUMINANCE_WEIGHTS;
|
|
1091
|
+
}
|
|
1092
|
+
function materialUsesDiffuseAlpha(material, texture) {
|
|
1093
|
+
return materialAllowsTextureAlpha(material)
|
|
1094
|
+
&& texture.hasAlpha === true
|
|
1095
|
+
&& (material.useAlphaFromDiffuseTexture === true || materialUsesTextureAlpha(material, texture));
|
|
1096
|
+
}
|
|
1097
|
+
function materialUsesAlbedoAlpha(material, texture) {
|
|
1098
|
+
return materialAllowsTextureAlpha(material)
|
|
1099
|
+
&& texture.hasAlpha === true
|
|
1100
|
+
&& (material.useAlphaFromAlbedoTexture === true || materialUsesTextureAlpha(material, texture));
|
|
1101
|
+
}
|
|
1102
|
+
function materialUsesBaseAlpha(material, texture) {
|
|
1103
|
+
return materialAllowsTextureAlpha(material)
|
|
1104
|
+
&& texture.hasAlpha === true
|
|
1105
|
+
&& (material.useAlphaFromBaseColorTexture === true
|
|
1106
|
+
|| material._useAlphaFromBaseColorTexture === true
|
|
1107
|
+
|| materialUsesTextureAlpha(material, texture));
|
|
1108
|
+
}
|
|
1109
|
+
function materialUsesTextureAlpha(material, texture) {
|
|
1110
|
+
if (texture.hasAlpha !== true)
|
|
1111
|
+
return false;
|
|
1112
|
+
const needAlphaTesting = material.needAlphaTesting;
|
|
1113
|
+
if (typeof needAlphaTesting === 'function' && needAlphaTesting.call(material) === true)
|
|
1114
|
+
return true;
|
|
1115
|
+
return material.transparencyMode === Material.MATERIAL_ALPHATEST
|
|
1116
|
+
|| material.transparencyMode === Material.MATERIAL_ALPHATESTANDBLEND;
|
|
1117
|
+
}
|
|
1118
|
+
function materialUsesOpacityAlpha(material) {
|
|
1119
|
+
if (material.transparencyMode === Material.MATERIAL_OPAQUE)
|
|
1120
|
+
return false;
|
|
1121
|
+
const needAlphaTesting = material.needAlphaTesting;
|
|
1122
|
+
if (typeof needAlphaTesting === 'function' && needAlphaTesting.call(material) === true)
|
|
1123
|
+
return true;
|
|
1124
|
+
const needAlphaBlending = material.needAlphaBlending;
|
|
1125
|
+
if (typeof needAlphaBlending === 'function' && needAlphaBlending.call(material) === true)
|
|
1126
|
+
return true;
|
|
1127
|
+
return material.transparencyMode === Material.MATERIAL_ALPHATEST
|
|
1128
|
+
|| material.transparencyMode === Material.MATERIAL_ALPHABLEND
|
|
1129
|
+
|| material.transparencyMode === Material.MATERIAL_ALPHATESTANDBLEND;
|
|
1130
|
+
}
|
|
1131
|
+
function materialAllowsTextureAlpha(material) {
|
|
1132
|
+
return material.transparencyMode !== Material.MATERIAL_OPAQUE;
|
|
1133
|
+
}
|
|
1134
|
+
function readAlphaCutoff(value) {
|
|
1135
|
+
return typeof value === 'number' && Number.isFinite(value)
|
|
1136
|
+
? Math.min(1, Math.max(0, value))
|
|
1137
|
+
: 0.1;
|
|
1138
|
+
}
|
|
836
1139
|
function clamp01(value) {
|
|
837
1140
|
return Math.min(1, Math.max(0, value));
|
|
838
1141
|
}
|