@fps-games/editor 0.1.4-beta.4 → 0.1.5-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/build-info.json +45 -0
- package/dist/local-editor-harness.d.ts +25 -5
- package/dist/local-editor-harness.d.ts.map +1 -1
- package/dist/local-editor-harness.js +518 -90
- package/dist/local-editor-harness.js.map +1 -1
- package/dist/local-editor-performance-stats.d.ts +12 -0
- package/dist/local-editor-performance-stats.d.ts.map +1 -0
- package/dist/local-editor-performance-stats.js +46 -0
- package/dist/local-editor-performance-stats.js.map +1 -0
- package/dist/playable-babylon-facade.d.ts +4 -4
- package/dist/playable-babylon-facade.d.ts.map +1 -1
- package/dist/playable-babylon-facade.js +2 -2
- package/dist/playable-babylon-facade.js.map +1 -1
- package/dist/playable-babylon-rendering.d.ts +66 -9
- package/dist/playable-babylon-rendering.d.ts.map +1 -1
- package/dist/playable-babylon-rendering.js +567 -13
- package/dist/playable-babylon-rendering.js.map +1 -1
- package/dist/playable-local-editor-host.d.ts +12 -9
- package/dist/playable-local-editor-host.d.ts.map +1 -1
- package/dist/playable-local-editor-host.js.map +1 -1
- package/dist/playable-sdk-vite.d.ts +2 -0
- package/dist/playable-sdk-vite.d.ts.map +1 -0
- package/dist/playable-sdk-vite.js +2 -0
- package/dist/playable-sdk-vite.js.map +1 -0
- package/dist/playable-sdk.d.ts +6 -4
- package/dist/playable-sdk.d.ts.map +1 -1
- package/dist/playable-sdk.js +3 -2
- package/dist/playable-sdk.js.map +1 -1
- package/dist/static-shadow-cpu-worker.d.ts +7 -0
- package/dist/static-shadow-cpu-worker.d.ts.map +1 -0
- package/dist/static-shadow-cpu-worker.js +221 -0
- package/dist/static-shadow-cpu-worker.js.map +1 -0
- package/node_modules/@fps-games/babylon-renderer/dist/index.d.ts +5 -0
- package/node_modules/@fps-games/babylon-renderer/dist/index.d.ts.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/index.js +5 -0
- package/node_modules/@fps-games/babylon-renderer/dist/index.js.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/blob-shadow-shaders.d.ts +5 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/blob-shadow-shaders.d.ts.map +1 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/blob-shadow-shaders.js +46 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/blob-shadow-shaders.js.map +1 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/blob-shadow-system.d.ts +5 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/blob-shadow-system.d.ts.map +1 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/blob-shadow-system.js +398 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/blob-shadow-system.js.map +1 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-artifact-system.d.ts +4 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-artifact-system.d.ts.map +1 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-artifact-system.js +584 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-artifact-system.js.map +1 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-atlas.d.ts +61 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-atlas.d.ts.map +1 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-atlas.js +382 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-atlas.js.map +1 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-bake.d.ts +47 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-bake.d.ts.map +1 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-bake.js +285 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-bake.js.map +1 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-baker.d.ts +88 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-baker.d.ts.map +1 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-baker.js +813 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-baker.js.map +1 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-rendering.d.ts +27 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-rendering.d.ts.map +1 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-rendering.js +220 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-rendering.js.map +1 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-system.d.ts +38 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-system.d.ts.map +1 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-system.js +173 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-system.js.map +1 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/types.d.ts +286 -0
- 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 +82 -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/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/performance-monitor.d.ts +34 -0
- package/node_modules/@fps-games/editor-babylon/dist/performance-monitor.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-babylon/dist/performance-monitor.js +272 -0
- package/node_modules/@fps-games/editor-babylon/dist/performance-monitor.js.map +1 -0
- package/node_modules/@fps-games/editor-babylon/dist/projection-asset-container-importer.d.ts +49 -0
- package/node_modules/@fps-games/editor-babylon/dist/projection-asset-container-importer.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-babylon/dist/projection-asset-container-importer.js +141 -0
- package/node_modules/@fps-games/editor-babylon/dist/projection-asset-container-importer.js.map +1 -0
- package/node_modules/@fps-games/editor-babylon/dist/projection.d.ts +11 -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 +137 -6
- package/node_modules/@fps-games/editor-babylon/dist/projection.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/rendering.d.ts +19 -0
- package/node_modules/@fps-games/editor-babylon/dist/rendering.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-babylon/dist/rendering.js +66 -0
- package/node_modules/@fps-games/editor-babylon/dist/rendering.js.map +1 -0
- package/node_modules/@fps-games/editor-babylon/dist/shadow-preview-controller.d.ts +17 -3
- 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 +256 -8
- package/node_modules/@fps-games/editor-babylon/dist/shadow-preview-controller.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/transform-gizmo-controller.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/transform-gizmo-controller.js +19 -2
- package/node_modules/@fps-games/editor-babylon/dist/transform-gizmo-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 +1 -1
- package/node_modules/@fps-games/editor-browser/dist/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/index.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-rendering-actions.d.ts +8 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-rendering-actions.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-rendering-actions.js +14 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-rendering-actions.js.map +1 -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 +10 -2
- 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-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 +17 -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-panels.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.js +494 -43
- 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-types.d.ts +72 -5
- 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.d.ts +1 -1
- 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 +595 -5
- 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/editor-session.d.ts +14 -1
- package/node_modules/@fps-games/editor-core/dist/editor-session.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-core/dist/editor-session.js +34 -10
- package/node_modules/@fps-games/editor-core/dist/editor-session.js.map +1 -1
- package/node_modules/@fps-games/editor-core/dist/inspector.d.ts +2 -1
- package/node_modules/@fps-games/editor-core/dist/inspector.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-core/dist/inspector.js +11 -1
- package/node_modules/@fps-games/editor-core/dist/inspector.js.map +1 -1
- package/node_modules/@fps-games/editor-core/dist/serialized-object.d.ts +7 -0
- package/node_modules/@fps-games/editor-core/dist/serialized-object.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-core/dist/serialized-object.js +1 -0
- package/node_modules/@fps-games/editor-core/dist/serialized-object.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-placement/document.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/document.js +10 -5
- 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/placement.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/placement.js +3 -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/document/helpers.d.ts +4 -1
- 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 +29 -0
- 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 +12 -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 +5 -1
- 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 +1 -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 +8 -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 +1 -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 +1 -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 +34 -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 +272 -0
- 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/local-harness/forge-play.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/forge-play.js +0 -4
- package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/forge-play.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/field-patch.d.ts +12 -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 +161 -1
- 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/index.d.ts +4 -2
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/index.js +2 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/index.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/rendering-alpha-index.d.ts +19 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/rendering-alpha-index.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/rendering-alpha-index.js +57 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/rendering-alpha-index.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/types.d.ts +7 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/types.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/package-resolution/aliases.d.ts +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/package-resolution/aliases.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/package-resolution/aliases.js +5 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/package-resolution/aliases.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 +1003 -7
- 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/rendering-profile/profile.d.ts +12 -3
- package/node_modules/@fps-games/editor-playable-sdk/dist/rendering-profile/profile.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/rendering-profile/profile.js +521 -6
- package/node_modules/@fps-games/editor-playable-sdk/dist/rendering-profile/profile.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/rendering-profile/types.d.ts +217 -3
- package/node_modules/@fps-games/editor-playable-sdk/dist/rendering-profile/types.d.ts.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 +26 -0
- 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 +3 -1
- 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-source/client.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/client.js +4 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/client.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/companion-configs.d.ts +9 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/companion-configs.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/companion-configs.js +12 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/companion-configs.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/types.d.ts +2 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/types.d.ts.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 +75 -0
- 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/index.d.ts +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/index.js +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/index.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/inspector.d.ts +17 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/inspector.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/inspector.js +262 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/inspector.js.map +1 -0
- 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 -3
- 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/session/identity.d.ts +6 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/session/identity.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/session/identity.js +31 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/session/identity.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/session/index.d.ts +2 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/session/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/session/index.js +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/session/index.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/session/patches.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/session/patches.js +21 -9
- package/node_modules/@fps-games/editor-playable-sdk/dist/session/patches.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/static-shadows/artifact.d.ts +151 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/static-shadows/artifact.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/static-shadows/artifact.js +445 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/static-shadows/artifact.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/static-shadows/index.d.ts +2 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/static-shadows/index.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/static-shadows/index.js +2 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/static-shadows/index.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/upgrade-doctor/index.d.ts +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/upgrade-doctor/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/upgrade-doctor/index.js +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/upgrade-doctor/index.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/upgrade-doctor/inspectors.d.ts +2 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/upgrade-doctor/inspectors.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/upgrade-doctor/inspectors.js +37 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/upgrade-doctor/inspectors.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/upgrade-doctor/types.d.ts +15 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/upgrade-doctor/types.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/build-info-core.d.ts +36 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/build-info-core.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/build-info-core.js +65 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/build-info-core.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/build-info-node.d.ts +4 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/build-info-node.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/build-info-node.js +87 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/build-info-node.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.d.ts +5 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.js +5 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/plugin.d.ts +8 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/plugin.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/plugin.js +226 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/plugin.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/types.d.ts +64 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/types.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/types.js +2 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/types.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/package.json +7 -3
- package/node_modules/@fps-games/editor-protocol/package.json +1 -1
- package/package.json +12 -8
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { applyEditorSceneRenderingProfilePatch, createEditorScenePlanarShadowPreviewSettings, createEditorSceneRenderingPanelState, normalizeEditorSceneRenderingProfile, } from '@fps-games/editor-playable-sdk';
|
|
2
|
-
import { createBabylonDefaultPostProcessPipelineController, createBabylonEnvironmentTextureController, createPlanarShadowSystem, resolveBabylonDefaultPostProcessVolumeStack, } from '@fps-games/babylon-renderer';
|
|
1
|
+
import { applyEditorSceneRenderingProfileAction, applyEditorSceneRenderingProfilePatch, createEditorSceneBlobShadowPreviewSettings, createEditorScenePlanarShadowPreviewSettings, createEditorSceneRenderingPanelState, createEditorSceneStaticShadowArtifactDiagnostic, createEditorSceneStaticProjectedShadowPreviewSettings, normalizeEditorSceneRenderingProfile, } from '@fps-games/editor-playable-sdk';
|
|
2
|
+
import { createBabylonDefaultPostProcessPipelineController, createBabylonEnvironmentTextureController, createBlobShadowSystem, createPlanarShadowSystem, createStaticProjectedShadowBaker, createStaticProjectedShadowArtifactSystem, createStaticProjectedShadowBakeHashes, createStaticProjectedShadowProfileHash, resolveBabylonDefaultPostProcessVolumeStack, } from '@fps-games/babylon-renderer';
|
|
3
|
+
import { createStaticProjectedShadowCpuWorkerProcessor } from './static-shadow-cpu-worker.js';
|
|
3
4
|
const PLAYABLE_BABYLON_RENDERING_ALLOWED_SECTIONS = new Set([
|
|
5
|
+
'rendering-groups',
|
|
4
6
|
'environment',
|
|
5
7
|
'post-process',
|
|
6
8
|
'shadows',
|
|
@@ -11,8 +13,8 @@ export function createPlayableBabylonRenderingCapability(options) {
|
|
|
11
13
|
getWorldRendering(document) {
|
|
12
14
|
return createPlayableBabylonWorldRendering(document, options);
|
|
13
15
|
},
|
|
14
|
-
getRenderingPanelState(document) {
|
|
15
|
-
return createPlayableBabylonRenderingPanelState(document, options);
|
|
16
|
+
getRenderingPanelState(document, sceneContext) {
|
|
17
|
+
return createPlayableBabylonRenderingPanelState(document, options, sceneContext);
|
|
16
18
|
},
|
|
17
19
|
async onRenderingAction(input) {
|
|
18
20
|
return handlePlayableBabylonRenderingAction(input, options);
|
|
@@ -22,20 +24,20 @@ export function createPlayableBabylonRenderingCapability(options) {
|
|
|
22
24
|
},
|
|
23
25
|
};
|
|
24
26
|
}
|
|
25
|
-
export function createPlayableBabylonWorldRendering(document, options) {
|
|
27
|
+
export function createPlayableBabylonWorldRendering(document, options, sceneContext = {}) {
|
|
26
28
|
const context = createPlayableBabylonRenderingContext(document, options);
|
|
27
29
|
const postProcess = resolvePlayableBabylonRenderingPostProcess(context, options);
|
|
28
30
|
return {
|
|
29
31
|
environment: createPlayableBabylonEnvironmentTextureProfile(context.profile, options.getTextureAssets?.({ document }) ?? []),
|
|
30
32
|
postProcess: postProcess.profile,
|
|
31
|
-
shadowPreview: createPlayableBabylonShadowPreviewOptions(context, options),
|
|
33
|
+
shadowPreview: createPlayableBabylonShadowPreviewOptions(context, options, sceneContext),
|
|
32
34
|
};
|
|
33
35
|
}
|
|
34
|
-
export function createPlayableBabylonRenderingDiagnostics(document, options) {
|
|
36
|
+
export function createPlayableBabylonRenderingDiagnostics(document, options, sceneContext = {}) {
|
|
35
37
|
const context = createPlayableBabylonRenderingContext(document, options);
|
|
36
38
|
const textureAssets = options.getTextureAssets?.({ document }) ?? [];
|
|
37
39
|
const postProcess = resolvePlayableBabylonRenderingPostProcess(context, options);
|
|
38
|
-
const shadowPreview = createPlayableBabylonShadowPreviewOptions(context, options);
|
|
40
|
+
const shadowPreview = createPlayableBabylonShadowPreviewOptions(context, options, sceneContext);
|
|
39
41
|
return {
|
|
40
42
|
config: context.config,
|
|
41
43
|
profile: context.profile,
|
|
@@ -45,6 +47,7 @@ export function createPlayableBabylonRenderingDiagnostics(document, options) {
|
|
|
45
47
|
shadowPreview,
|
|
46
48
|
},
|
|
47
49
|
environmentTexture: resolvePlayableBabylonRenderingEnvironmentTextureDiagnostic(context.profile.environment.texture, textureAssets),
|
|
50
|
+
staticShadowArtifact: createPlayableBabylonStaticShadowArtifactDiagnostic(context, options, sceneContext),
|
|
48
51
|
postProcess,
|
|
49
52
|
shadowPreview,
|
|
50
53
|
};
|
|
@@ -124,18 +127,192 @@ export function createPlayableBabylonPlanarShadowOptions(profile, input = {}) {
|
|
|
124
127
|
export function createPlayableBabylonPlanarShadowSystem(scene, directionalLight, profile, input = {}) {
|
|
125
128
|
return createPlanarShadowSystem(scene, directionalLight, createPlayableBabylonPlanarShadowOptions(profile, input));
|
|
126
129
|
}
|
|
127
|
-
export function
|
|
130
|
+
export function createPlayableBabylonBlobShadowOptions(profile, input = {}) {
|
|
131
|
+
const includeProfileShadowMeshes = input.includeProfileShadowMeshes !== false;
|
|
132
|
+
const shadowMeshes = profile.shadowMeshes;
|
|
133
|
+
return createEditorSceneBlobShadowPreviewSettings(profile, {
|
|
134
|
+
...input,
|
|
135
|
+
additionalCasterIncludePatterns: mergePlayableBabylonPlanarShadowPatterns(...(includeProfileShadowMeshes ? shadowMeshes.shadowCasters : []), ...(input.additionalCasterIncludePatterns ?? [])),
|
|
136
|
+
additionalExcludePatterns: mergePlayableBabylonPlanarShadowPatterns(...(includeProfileShadowMeshes ? shadowMeshes.excludeFromShadow : []), ...(input.additionalExcludePatterns ?? [])),
|
|
137
|
+
additionalRootBoundaryPatterns: mergePlayableBabylonPlanarShadowPatterns(...(input.additionalRootBoundaryPatterns ?? [])),
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
export function createPlayableBabylonStaticProjectedShadowOptions(profile, input = {}) {
|
|
141
|
+
const includeProfileShadowMeshes = input.includeProfileShadowMeshes !== false;
|
|
142
|
+
const shadowMeshes = profile.shadowMeshes;
|
|
143
|
+
return {
|
|
144
|
+
...createEditorSceneStaticProjectedShadowPreviewSettings(profile, {
|
|
145
|
+
...input,
|
|
146
|
+
additionalCasterIncludePatterns: mergePlayableBabylonPlanarShadowPatterns(...(includeProfileShadowMeshes ? shadowMeshes.shadowCasters : []), ...(input.additionalCasterIncludePatterns ?? [])),
|
|
147
|
+
additionalExcludePatterns: mergePlayableBabylonPlanarShadowPatterns(...(includeProfileShadowMeshes ? shadowMeshes.excludeFromShadow : []), ...(input.additionalExcludePatterns ?? [])),
|
|
148
|
+
additionalRootBoundaryPatterns: mergePlayableBabylonPlanarShadowPatterns(...(input.additionalRootBoundaryPatterns ?? [])),
|
|
149
|
+
}),
|
|
150
|
+
...(input.artifact === undefined ? {} : { artifact: input.artifact }),
|
|
151
|
+
...(input.expectedHashes === undefined ? {} : { expectedHashes: input.expectedHashes }),
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
export function createPlayableBabylonStaticProjectedShadowArtifactSystem(scene, directionalLight, profile, input = {}) {
|
|
155
|
+
const staticProjected = createPlayableBabylonStaticProjectedShadowOptions(profile, input);
|
|
156
|
+
const expectedHashes = staticProjected.expectedHashes ?? createStaticProjectedShadowBakeHashes({
|
|
157
|
+
scene: scene,
|
|
158
|
+
directionalLight: directionalLight,
|
|
159
|
+
options: staticProjected,
|
|
160
|
+
});
|
|
161
|
+
return createStaticProjectedShadowArtifactSystem(scene, staticProjected.artifact ?? null, {
|
|
162
|
+
enabled: staticProjected.enabled,
|
|
163
|
+
appearance: staticProjected.appearance,
|
|
164
|
+
bake: {
|
|
165
|
+
blur: staticProjected.bake?.blur,
|
|
166
|
+
},
|
|
167
|
+
expectedHashes,
|
|
168
|
+
debug: staticProjected.debug,
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
export function createPlayableBabylonBlobShadowSystem(scene, profile, input = {}) {
|
|
172
|
+
return createBlobShadowSystem(scene, createPlayableBabylonBlobShadowOptions(profile, input));
|
|
173
|
+
}
|
|
174
|
+
export function createPlayableBabylonRenderingPanelState(document, options, sceneContext = {}) {
|
|
128
175
|
const context = createPlayableBabylonRenderingContext(document, options);
|
|
129
176
|
const baseState = options.getPanelState?.({ document }) ?? {};
|
|
130
177
|
const dirty = baseState.dirty ?? options.isDirty?.({ document });
|
|
178
|
+
const language = options.getLanguage?.({ document }) ?? 'en';
|
|
179
|
+
const renderingAction = readPlayableBabylonRenderingActionProgress(sceneContext.renderingAction);
|
|
180
|
+
const staticShadowBake = renderingAction?.actionId === 'bake-static-shadows'
|
|
181
|
+
? createPlayableBabylonBakingStaticShadowLifecycleState(renderingAction, language)
|
|
182
|
+
: baseState.staticShadowBake
|
|
183
|
+
?? createPlayableBabylonStaticShadowBakeLifecycleState(context, options, dirty === true, sceneContext);
|
|
131
184
|
return createEditorSceneRenderingPanelState(context.profile, {
|
|
132
185
|
...baseState,
|
|
133
186
|
...(dirty === undefined ? {} : { dirty }),
|
|
187
|
+
staticShadowBake,
|
|
134
188
|
}, {
|
|
135
|
-
language
|
|
189
|
+
language,
|
|
136
190
|
textureAssets: options.getTextureAssets?.({ document }) ?? [],
|
|
137
191
|
});
|
|
138
192
|
}
|
|
193
|
+
function createPlayableBabylonBakingStaticShadowLifecycleState(progress, language) {
|
|
194
|
+
const stats = readStaticShadowBakeStats(progress.details);
|
|
195
|
+
const label = progress.label
|
|
196
|
+
?? (language === 'zh' ? '正在烘焙静态阴影' : 'Baking static shadows');
|
|
197
|
+
return {
|
|
198
|
+
status: 'baking',
|
|
199
|
+
chunkCount: stats?.chunkCount ?? 0,
|
|
200
|
+
reason: progress.status ?? label,
|
|
201
|
+
stats,
|
|
202
|
+
progress: {
|
|
203
|
+
label,
|
|
204
|
+
...(typeof progress.value === 'number' && Number.isFinite(progress.value)
|
|
205
|
+
? { value: Math.max(0, Math.min(1, progress.value)) }
|
|
206
|
+
: {}),
|
|
207
|
+
indeterminate: progress.indeterminate !== false && typeof progress.value !== 'number',
|
|
208
|
+
},
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
function createPlayableBabylonStaticShadowBakeLifecycleState(context, options, dirty, sceneContext) {
|
|
212
|
+
const staticOptions = createPlayableBabylonStaticProjectedShadowOptions(context.profile, (resolvePlayableBabylonRenderingValue(options.shadowPreview === false ? undefined : options.shadowPreview?.staticProjected, context) ?? {}));
|
|
213
|
+
if (!staticOptions.enabled) {
|
|
214
|
+
return {
|
|
215
|
+
status: 'disabled',
|
|
216
|
+
chunkCount: 0,
|
|
217
|
+
reason: 'Static Baked Shadow is disabled.',
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
const artifact = options.getStaticShadowArtifact?.({ document: context.document }) ?? null;
|
|
221
|
+
if (!artifact) {
|
|
222
|
+
return {
|
|
223
|
+
status: 'missing',
|
|
224
|
+
chunkCount: 0,
|
|
225
|
+
reason: 'No static shadow bake artifact is available.',
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
const diagnostic = createEditorSceneStaticShadowArtifactDiagnostic(artifact, createPlayableBabylonStaticShadowExpectedHashes(context, options, staticOptions, sceneContext));
|
|
229
|
+
if (diagnostic.status === 'invalid') {
|
|
230
|
+
return {
|
|
231
|
+
status: 'invalid',
|
|
232
|
+
chunkCount: 0,
|
|
233
|
+
reason: diagnostic.reason,
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
if (diagnostic.status === 'out-of-date') {
|
|
237
|
+
return {
|
|
238
|
+
status: 'out-of-date',
|
|
239
|
+
chunkCount: diagnostic.chunkCount,
|
|
240
|
+
reason: diagnostic.reason,
|
|
241
|
+
generatedAt: artifact.generatedAt ?? null,
|
|
242
|
+
stats: createEditorSceneStaticShadowBakeStatsFromArtifact(artifact),
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
if (dirty) {
|
|
246
|
+
return {
|
|
247
|
+
status: 'preview-unsaved',
|
|
248
|
+
chunkCount: diagnostic.chunkCount,
|
|
249
|
+
reason: 'Static shadow preview has not been saved yet.',
|
|
250
|
+
generatedAt: artifact.generatedAt ?? null,
|
|
251
|
+
stats: createEditorSceneStaticShadowBakeStatsFromArtifact(artifact),
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
return {
|
|
255
|
+
status: 'up-to-date',
|
|
256
|
+
chunkCount: diagnostic.chunkCount,
|
|
257
|
+
reason: null,
|
|
258
|
+
generatedAt: artifact.generatedAt ?? null,
|
|
259
|
+
stats: createEditorSceneStaticShadowBakeStatsFromArtifact(artifact),
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
function createEditorSceneStaticShadowBakeStatsFromArtifact(artifact) {
|
|
263
|
+
const isV2 = artifact.version === 2;
|
|
264
|
+
const pageCount = isV2 ? artifact.pages.length : undefined;
|
|
265
|
+
return {
|
|
266
|
+
sourceRootCount: artifact.stats?.sourceRootCount ?? uniqueStaticShadowSourceNodeIds(artifact).length,
|
|
267
|
+
sourceMeshCount: artifact.stats?.sourceMeshCount,
|
|
268
|
+
attemptedChunkCount: artifact.stats?.attemptedChunkCount ?? artifact.chunks.length,
|
|
269
|
+
chunkCount: artifact.stats?.chunkCount ?? artifact.chunks.length,
|
|
270
|
+
textureCount: artifact.stats?.textureCount ?? pageCount ?? artifact.chunks.length,
|
|
271
|
+
skippedChunkCount: artifact.stats?.skippedChunkCount,
|
|
272
|
+
pageCount: artifact.stats?.pageCount ?? pageCount,
|
|
273
|
+
resolution: artifact.stats?.resolution,
|
|
274
|
+
chunkSize: artifact.stats?.chunkSize,
|
|
275
|
+
atlasSize: artifact.stats?.atlasSize,
|
|
276
|
+
atlasUsedPixels: artifact.stats?.atlasUsedPixels,
|
|
277
|
+
atlasAllocatedPixels: artifact.stats?.atlasAllocatedPixels,
|
|
278
|
+
atlasOccupancy: artifact.stats?.atlasOccupancy,
|
|
279
|
+
texelsPerMeter: artifact.stats?.texelsPerMeter,
|
|
280
|
+
effectiveTexelsPerMeter: artifact.stats?.effectiveTexelsPerMeter,
|
|
281
|
+
maxAtlasPages: artifact.stats?.maxAtlasPages,
|
|
282
|
+
sdfRadiusPx: artifact.stats?.sdfRadiusPx,
|
|
283
|
+
spatialChunkSize: artifact.stats?.spatialChunkSize,
|
|
284
|
+
effectiveSpatialChunkSize: artifact.stats?.effectiveSpatialChunkSize,
|
|
285
|
+
targetChunkCount: artifact.stats?.targetChunkCount,
|
|
286
|
+
bakedChunkCount: artifact.stats?.bakedChunkCount,
|
|
287
|
+
reusedChunkCount: artifact.stats?.reusedChunkCount,
|
|
288
|
+
durationMs: artifact.stats?.durationMs,
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
function uniqueStaticShadowSourceNodeIds(artifact) {
|
|
292
|
+
return [...new Set(artifact.chunks.flatMap(chunk => chunk.sourceNodeIds))];
|
|
293
|
+
}
|
|
294
|
+
function createPlayableBabylonStaticShadowArtifactDiagnostic(context, options, sceneContext) {
|
|
295
|
+
const artifact = options.getStaticShadowArtifact?.({ document: context.document }) ?? null;
|
|
296
|
+
const staticOptions = createPlayableBabylonStaticProjectedShadowOptions(context.profile, (resolvePlayableBabylonRenderingValue(options.shadowPreview === false ? undefined : options.shadowPreview?.staticProjected, context) ?? {}));
|
|
297
|
+
return createEditorSceneStaticShadowArtifactDiagnostic(artifact, createPlayableBabylonStaticShadowExpectedHashes(context, options, staticOptions, sceneContext));
|
|
298
|
+
}
|
|
299
|
+
function createPlayableBabylonStaticShadowExpectedHashes(context, options, staticOptions, sceneContext) {
|
|
300
|
+
if (staticOptions.expectedHashes)
|
|
301
|
+
return staticOptions.expectedHashes;
|
|
302
|
+
const scene = readBabylonScene(sceneContext.scene);
|
|
303
|
+
const shadowPreview = options.shadowPreview === false ? {} : options.shadowPreview ?? {};
|
|
304
|
+
const directionalLightNodeId = resolvePlayableBabylonRenderingValue(shadowPreview.directionalLightNodeId, context);
|
|
305
|
+
if (scene) {
|
|
306
|
+
return createStaticProjectedShadowBakeHashes({
|
|
307
|
+
scene,
|
|
308
|
+
directionalLight: resolveBabylonDirectionalLight(sceneContext.projection, directionalLightNodeId ?? null),
|
|
309
|
+
options: staticOptions,
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
return {
|
|
313
|
+
profileHash: createStaticProjectedShadowProfileHash(staticOptions),
|
|
314
|
+
};
|
|
315
|
+
}
|
|
139
316
|
export function createPlayableBabylonEnvironmentTextureProfile(profile, textureAssets = []) {
|
|
140
317
|
return {
|
|
141
318
|
textureUrl: resolvePlayableBabylonRenderingEnvironmentTextureUrl(profile.environment.texture, textureAssets),
|
|
@@ -256,18 +433,51 @@ function createPlayableBabylonRenderingContext(document, options) {
|
|
|
256
433
|
function resolvePlayableBabylonRenderingPostProcess(context, options) {
|
|
257
434
|
return resolveBabylonDefaultPostProcessVolumeStack(context.config, options.getPostProcessResolveInput?.(context));
|
|
258
435
|
}
|
|
259
|
-
function createPlayableBabylonShadowPreviewOptions(context, options) {
|
|
436
|
+
function createPlayableBabylonShadowPreviewOptions(context, options, sceneContext = {}) {
|
|
260
437
|
if (options.shadowPreview === false)
|
|
261
438
|
return null;
|
|
262
439
|
const shadowPreview = options.shadowPreview ?? {};
|
|
440
|
+
const blobInput = resolvePlayableBabylonRenderingValue(shadowPreview.blob, context) ?? {};
|
|
441
|
+
const staticInput = resolvePlayableBabylonRenderingValue(shadowPreview.staticProjected, context) ?? {};
|
|
263
442
|
const planarInput = resolvePlayableBabylonRenderingValue(shadowPreview.planar, context) ?? {};
|
|
443
|
+
const staticArtifact = staticInput.artifact === undefined
|
|
444
|
+
? options.getStaticShadowArtifact?.({ document: context.document }) ?? null
|
|
445
|
+
: staticInput.artifact;
|
|
264
446
|
const enabled = resolvePlayableBabylonRenderingValue(shadowPreview.enabled, context);
|
|
265
447
|
const directionalLightNodeId = resolvePlayableBabylonRenderingValue(shadowPreview.directionalLightNodeId, context);
|
|
266
|
-
|
|
448
|
+
const planarPreview = createPlayableBabylonPlanarShadowPreviewOptions(context.profile, {
|
|
267
449
|
...planarInput,
|
|
268
450
|
...(enabled === undefined ? {} : { enabled }),
|
|
269
451
|
...(directionalLightNodeId === undefined ? {} : { directionalLightNodeId }),
|
|
270
452
|
});
|
|
453
|
+
const blobPreview = createPlayableBabylonBlobShadowOptions(context.profile, {
|
|
454
|
+
...blobInput,
|
|
455
|
+
...(enabled === undefined ? {} : { enabled }),
|
|
456
|
+
});
|
|
457
|
+
const staticPreview = createPlayableBabylonStaticProjectedShadowOptions(context.profile, {
|
|
458
|
+
...staticInput,
|
|
459
|
+
artifact: staticArtifact,
|
|
460
|
+
...(enabled === undefined ? {} : { enabled }),
|
|
461
|
+
});
|
|
462
|
+
const expectedHashes = createPlayableBabylonStaticShadowExpectedHashes(context, options, staticPreview, sceneContext);
|
|
463
|
+
const filteredStaticArtifact = resolvePlayableBabylonStaticShadowArtifactForExpectedHashes(staticPreview.artifact ?? null, expectedHashes);
|
|
464
|
+
return {
|
|
465
|
+
defaultMode: context.profile.shadows.defaultMode,
|
|
466
|
+
blob: blobPreview,
|
|
467
|
+
staticProjected: {
|
|
468
|
+
...staticPreview,
|
|
469
|
+
artifact: filteredStaticArtifact,
|
|
470
|
+
...(readBabylonScene(sceneContext.scene) ? { expectedHashes } : {}),
|
|
471
|
+
...(directionalLightNodeId === undefined ? {} : { directionalLightNodeId }),
|
|
472
|
+
},
|
|
473
|
+
planar: planarPreview.planar ?? null,
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
function resolvePlayableBabylonStaticShadowArtifactForExpectedHashes(artifact, expectedHashes) {
|
|
477
|
+
if (!artifact)
|
|
478
|
+
return null;
|
|
479
|
+
const diagnostic = createEditorSceneStaticShadowArtifactDiagnostic(artifact, expectedHashes);
|
|
480
|
+
return diagnostic.status === 'up-to-date' ? artifact : null;
|
|
271
481
|
}
|
|
272
482
|
async function handlePlayableBabylonRenderingPropertyChange(input, options) {
|
|
273
483
|
const sectionId = typeof input.sectionId === 'string' ? input.sectionId : '';
|
|
@@ -288,21 +498,54 @@ async function handlePlayableBabylonRenderingPropertyChange(input, options) {
|
|
|
288
498
|
statusTone: 'warning',
|
|
289
499
|
});
|
|
290
500
|
}
|
|
291
|
-
await options.setConfig({
|
|
501
|
+
const setConfigResult = await options.setConfig({
|
|
292
502
|
document: input.document,
|
|
293
503
|
config: patch.config,
|
|
294
504
|
changedPaths: patch.changedPaths,
|
|
295
505
|
profile: patch.normalized,
|
|
506
|
+
change: {
|
|
507
|
+
path,
|
|
508
|
+
value: input.value,
|
|
509
|
+
},
|
|
296
510
|
});
|
|
297
511
|
const dirty = options.isDirty?.({ document: input.document });
|
|
298
512
|
return createPlayableBabylonRenderingResult(true, {
|
|
299
513
|
dirty,
|
|
300
514
|
status: `Rendering draft updated: ${patch.changedPaths.join(', ')}`,
|
|
301
515
|
statusTone: dirty === false ? 'success' : 'warning',
|
|
516
|
+
documentPatch: readPlayableBabylonRenderingDocumentPatch(setConfigResult),
|
|
302
517
|
});
|
|
303
518
|
}
|
|
304
519
|
async function handlePlayableBabylonRenderingAction(input, options) {
|
|
305
520
|
const actionId = typeof input.actionId === 'string' ? input.actionId : '';
|
|
521
|
+
if (actionId === 'bake-static-shadows') {
|
|
522
|
+
return bakePlayableBabylonStaticShadows(input, options);
|
|
523
|
+
}
|
|
524
|
+
if (actionId === 'rendering-alpha-preset.add' || actionId === 'rendering-alpha-preset.delete') {
|
|
525
|
+
const actionInput = createPlayableBabylonRenderingProfileActionInput(actionId, input);
|
|
526
|
+
const currentConfig = options.getConfig({ document: input.document });
|
|
527
|
+
const patch = applyEditorSceneRenderingProfileAction(currentConfig, actionInput);
|
|
528
|
+
if (patch.changedPaths.length === 0) {
|
|
529
|
+
return createPlayableBabylonRenderingResult(false, {
|
|
530
|
+
status: `Unsupported rendering action: ${actionId}`,
|
|
531
|
+
statusTone: 'warning',
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
const setConfigResult = await options.setConfig({
|
|
535
|
+
document: input.document,
|
|
536
|
+
config: patch.config,
|
|
537
|
+
changedPaths: patch.changedPaths,
|
|
538
|
+
profile: patch.normalized,
|
|
539
|
+
action: actionInput,
|
|
540
|
+
});
|
|
541
|
+
const dirty = options.isDirty?.({ document: input.document });
|
|
542
|
+
return createPlayableBabylonRenderingResult(true, {
|
|
543
|
+
dirty,
|
|
544
|
+
status: `Rendering draft updated: ${patch.changedPaths.join(', ')}`,
|
|
545
|
+
statusTone: dirty === false ? 'success' : 'warning',
|
|
546
|
+
documentPatch: readPlayableBabylonRenderingDocumentPatch(setConfigResult),
|
|
547
|
+
});
|
|
548
|
+
}
|
|
306
549
|
if (actionId !== 'revert-rendering') {
|
|
307
550
|
return createPlayableBabylonRenderingResult(false, {
|
|
308
551
|
status: `Unsupported rendering action: ${actionId || '(unknown)'}`,
|
|
@@ -328,6 +571,207 @@ async function handlePlayableBabylonRenderingAction(input, options) {
|
|
|
328
571
|
statusTone: 'success',
|
|
329
572
|
});
|
|
330
573
|
}
|
|
574
|
+
async function bakePlayableBabylonStaticShadows(input, options) {
|
|
575
|
+
if (!options.setStaticShadowArtifact) {
|
|
576
|
+
return createPlayableBabylonRenderingResult(false, {
|
|
577
|
+
status: 'Static shadow artifact storage is not available for this project.',
|
|
578
|
+
statusTone: 'warning',
|
|
579
|
+
});
|
|
580
|
+
}
|
|
581
|
+
const scene = readBabylonScene(input.scene);
|
|
582
|
+
if (!scene) {
|
|
583
|
+
return createPlayableBabylonRenderingResult(false, {
|
|
584
|
+
status: 'Static shadow bake requires the active Babylon scene.',
|
|
585
|
+
statusTone: 'warning',
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
const context = createPlayableBabylonRenderingContext(input.document, options);
|
|
589
|
+
const shadowPreview = options.shadowPreview === false ? {} : options.shadowPreview ?? {};
|
|
590
|
+
const staticInput = resolvePlayableBabylonRenderingValue(shadowPreview.staticProjected, context) ?? {};
|
|
591
|
+
const directionalLightNodeId = resolvePlayableBabylonRenderingValue(shadowPreview.directionalLightNodeId, context);
|
|
592
|
+
const staticOptions = createPlayableBabylonStaticProjectedShadowOptions(context.profile, {
|
|
593
|
+
...staticInput,
|
|
594
|
+
...(staticInput.enabled === undefined ? {} : { enabled: staticInput.enabled }),
|
|
595
|
+
});
|
|
596
|
+
if (!staticOptions.enabled) {
|
|
597
|
+
return createPlayableBabylonRenderingResult(false, {
|
|
598
|
+
status: 'Static Baked Shadow is disabled.',
|
|
599
|
+
statusTone: 'warning',
|
|
600
|
+
});
|
|
601
|
+
}
|
|
602
|
+
const reportProgress = readPlayableBabylonRenderingProgressReporter(input.reportProgress);
|
|
603
|
+
const previousArtifact = options.getStaticShadowArtifact?.({ document: input.document }) ?? null;
|
|
604
|
+
const workerProcessor = options.processStaticShadowSdfTile ? null : createStaticProjectedShadowCpuWorkerProcessor();
|
|
605
|
+
let artifact;
|
|
606
|
+
try {
|
|
607
|
+
artifact = await createStaticProjectedShadowBaker({
|
|
608
|
+
scene,
|
|
609
|
+
directionalLight: resolveBabylonDirectionalLight(input.projection, directionalLightNodeId ?? null),
|
|
610
|
+
options: staticOptions,
|
|
611
|
+
previousArtifact,
|
|
612
|
+
readMaskTexturePixels: options.readStaticShadowMaskTexturePixels,
|
|
613
|
+
processSdfTile: options.processStaticShadowSdfTile ?? workerProcessor?.processSdfTile,
|
|
614
|
+
encodeAtlasTexture: options.encodeStaticShadowAtlasTexture,
|
|
615
|
+
yieldToMainThread: async (progress) => {
|
|
616
|
+
await reportProgress?.(createPlayableBabylonStaticShadowBakeProgress(progress, staticOptions));
|
|
617
|
+
},
|
|
618
|
+
onProgress: async (progress) => {
|
|
619
|
+
await reportProgress?.(createPlayableBabylonStaticShadowBakeProgress(progress, staticOptions));
|
|
620
|
+
},
|
|
621
|
+
}).bake();
|
|
622
|
+
}
|
|
623
|
+
finally {
|
|
624
|
+
workerProcessor?.dispose();
|
|
625
|
+
}
|
|
626
|
+
await reportProgress?.({
|
|
627
|
+
actionId: 'bake-static-shadows',
|
|
628
|
+
label: 'Writing static shadow artifact',
|
|
629
|
+
status: 'Writing static shadow artifact...',
|
|
630
|
+
value: 0.98,
|
|
631
|
+
indeterminate: false,
|
|
632
|
+
details: createStaticShadowArtifactStatsDetails(artifact),
|
|
633
|
+
});
|
|
634
|
+
await options.setStaticShadowArtifact({
|
|
635
|
+
document: input.document,
|
|
636
|
+
artifact,
|
|
637
|
+
profile: context.profile,
|
|
638
|
+
});
|
|
639
|
+
const statusDetails = formatStaticShadowBakeResultDetails(artifact);
|
|
640
|
+
return createPlayableBabylonRenderingResult(true, {
|
|
641
|
+
dirty: options.isDirty?.({ document: input.document }),
|
|
642
|
+
status: `Baked ${artifact.chunks.length} static shadow chunk${artifact.chunks.length === 1 ? '' : 's'} from ${artifact.stats?.sourceRootCount ?? 0} static caster${artifact.stats?.sourceRootCount === 1 ? '' : 's'}.`,
|
|
643
|
+
statusTone: 'success',
|
|
644
|
+
statusDetails,
|
|
645
|
+
});
|
|
646
|
+
}
|
|
647
|
+
function readPlayableBabylonRenderingProgressReporter(value) {
|
|
648
|
+
return typeof value === 'function'
|
|
649
|
+
? value
|
|
650
|
+
: null;
|
|
651
|
+
}
|
|
652
|
+
function createPlayableBabylonStaticShadowBakeProgress(progress, options) {
|
|
653
|
+
const total = Math.max(0, progress.totalChunkCount);
|
|
654
|
+
const completed = Math.max(0, progress.completedChunkCount);
|
|
655
|
+
const chunkProgress = total > 0 ? completed / total : 1;
|
|
656
|
+
const atlasPageCount = Math.max(0, progress.atlasPageCount ?? 0);
|
|
657
|
+
const encodedPageCount = Math.max(0, progress.encodedTextureCount);
|
|
658
|
+
const value = progress.phase === 'collect'
|
|
659
|
+
? 0.08
|
|
660
|
+
: progress.phase === 'pack'
|
|
661
|
+
? 0.92
|
|
662
|
+
: progress.phase === 'encode'
|
|
663
|
+
? 0.92 + (atlasPageCount > 0 ? Math.min(encodedPageCount / atlasPageCount, 1) * 0.05 : 0.03)
|
|
664
|
+
: progress.phase === 'complete'
|
|
665
|
+
? 0.96
|
|
666
|
+
: 0.12 + chunkProgress * 0.78;
|
|
667
|
+
const status = progress.phase === 'collect'
|
|
668
|
+
? `Collecting ${progress.sourceRootCount} static shadow casters...`
|
|
669
|
+
: progress.phase === 'reuse'
|
|
670
|
+
? `Reusing ${progress.reusedChunkCount ?? 0} unchanged static shadow chunks...`
|
|
671
|
+
: progress.phase === 'sdf'
|
|
672
|
+
? `Generating static shadow SDF ${Math.min(completed + 1, total)} of ${total}...`
|
|
673
|
+
: progress.phase === 'pack'
|
|
674
|
+
? `Packing ${progress.encodedTextureCount} static shadow chunks into ${atlasPageCount} atlas page${atlasPageCount === 1 ? '' : 's'}...`
|
|
675
|
+
: progress.phase === 'encode'
|
|
676
|
+
? `Encoding static shadow atlas page ${Math.min(encodedPageCount + 1, atlasPageCount || encodedPageCount + 1)} of ${atlasPageCount || encodedPageCount + 1}...`
|
|
677
|
+
: progress.phase === 'complete'
|
|
678
|
+
? `Finishing ${encodedPageCount} static shadow atlas page${encodedPageCount === 1 ? '' : 's'}...`
|
|
679
|
+
: `Baking static shadow chunk ${Math.min(completed + 1, total)} of ${total}...`;
|
|
680
|
+
return {
|
|
681
|
+
actionId: 'bake-static-shadows',
|
|
682
|
+
label: total > 0
|
|
683
|
+
? `Static shadow bake ${Math.min(completed, total)} / ${total}`
|
|
684
|
+
: 'Static shadow bake',
|
|
685
|
+
status,
|
|
686
|
+
value,
|
|
687
|
+
indeterminate: total === 0 && progress.phase !== 'complete',
|
|
688
|
+
details: {
|
|
689
|
+
phase: progress.phase,
|
|
690
|
+
sourceRootCount: progress.sourceRootCount,
|
|
691
|
+
sourceMeshCount: progress.sourceMeshCount,
|
|
692
|
+
attemptedChunkCount: progress.totalChunkCount,
|
|
693
|
+
chunkCount: progress.completedChunkCount,
|
|
694
|
+
textureCount: progress.encodedTextureCount,
|
|
695
|
+
pageCount: progress.atlasPageCount,
|
|
696
|
+
resolution: options.bake?.resolution,
|
|
697
|
+
chunkSize: options.bake?.maxSize,
|
|
698
|
+
atlasSize: options.bake?.atlasSize,
|
|
699
|
+
texelsPerMeter: options.bake?.texelsPerMeter,
|
|
700
|
+
effectiveTexelsPerMeter: progress.effectiveTexelsPerMeter,
|
|
701
|
+
maxAtlasPages: options.bake?.maxAtlasPages,
|
|
702
|
+
sdfRadiusPx: options.bake?.sdfRadiusPx,
|
|
703
|
+
spatialChunkSize: options.bake?.spatialChunkSize,
|
|
704
|
+
effectiveSpatialChunkSize: progress.effectiveSpatialChunkSize,
|
|
705
|
+
targetChunkCount: options.bake?.targetChunkCount,
|
|
706
|
+
bakedChunkCount: progress.bakedChunkCount,
|
|
707
|
+
reusedChunkCount: progress.reusedChunkCount,
|
|
708
|
+
...(progress.currentChunkId ? { currentChunkId: progress.currentChunkId } : {}),
|
|
709
|
+
},
|
|
710
|
+
};
|
|
711
|
+
}
|
|
712
|
+
function createStaticShadowArtifactStatsDetails(artifact) {
|
|
713
|
+
const isV2 = artifact.version === 2;
|
|
714
|
+
const pageCount = isV2 ? artifact.pages.length : undefined;
|
|
715
|
+
return {
|
|
716
|
+
phase: 'complete',
|
|
717
|
+
sourceRootCount: artifact.stats?.sourceRootCount ?? 0,
|
|
718
|
+
sourceMeshCount: artifact.stats?.sourceMeshCount ?? 0,
|
|
719
|
+
attemptedChunkCount: artifact.stats?.attemptedChunkCount ?? artifact.chunks.length,
|
|
720
|
+
chunkCount: artifact.stats?.chunkCount ?? artifact.chunks.length,
|
|
721
|
+
textureCount: artifact.stats?.textureCount ?? pageCount ?? artifact.chunks.length,
|
|
722
|
+
skippedChunkCount: artifact.stats?.skippedChunkCount ?? 0,
|
|
723
|
+
pageCount: artifact.stats?.pageCount ?? pageCount,
|
|
724
|
+
resolution: artifact.stats?.resolution,
|
|
725
|
+
chunkSize: artifact.stats?.chunkSize,
|
|
726
|
+
atlasSize: artifact.stats?.atlasSize,
|
|
727
|
+
atlasUsedPixels: artifact.stats?.atlasUsedPixels,
|
|
728
|
+
atlasAllocatedPixels: artifact.stats?.atlasAllocatedPixels,
|
|
729
|
+
atlasOccupancy: artifact.stats?.atlasOccupancy,
|
|
730
|
+
texelsPerMeter: artifact.stats?.texelsPerMeter,
|
|
731
|
+
effectiveTexelsPerMeter: artifact.stats?.effectiveTexelsPerMeter,
|
|
732
|
+
maxAtlasPages: artifact.stats?.maxAtlasPages,
|
|
733
|
+
sdfRadiusPx: artifact.stats?.sdfRadiusPx,
|
|
734
|
+
spatialChunkSize: artifact.stats?.spatialChunkSize,
|
|
735
|
+
effectiveSpatialChunkSize: artifact.stats?.effectiveSpatialChunkSize,
|
|
736
|
+
targetChunkCount: artifact.stats?.targetChunkCount,
|
|
737
|
+
bakedChunkCount: artifact.stats?.bakedChunkCount,
|
|
738
|
+
reusedChunkCount: artifact.stats?.reusedChunkCount,
|
|
739
|
+
durationMs: artifact.stats?.durationMs,
|
|
740
|
+
};
|
|
741
|
+
}
|
|
742
|
+
function formatStaticShadowBakeResultDetails(artifact) {
|
|
743
|
+
const stats = artifact.stats;
|
|
744
|
+
const sourceRootCount = stats?.sourceRootCount ?? 0;
|
|
745
|
+
const sourceMeshCount = stats?.sourceMeshCount ?? 0;
|
|
746
|
+
const chunkCount = stats?.chunkCount ?? artifact.chunks.length;
|
|
747
|
+
const atlasPageCount = stats?.pageCount ?? (artifact.version === 2 ? artifact.pages.length : stats?.textureCount ?? artifact.chunks.length);
|
|
748
|
+
const effectiveTexelsPerMeter = stats?.effectiveTexelsPerMeter;
|
|
749
|
+
const atlasSize = stats?.atlasSize;
|
|
750
|
+
const atlasOccupancy = stats?.atlasOccupancy;
|
|
751
|
+
const sdfRadiusPx = stats?.sdfRadiusPx;
|
|
752
|
+
const duration = typeof stats?.durationMs === 'number' ? `, ${Math.round(stats.durationMs)}ms` : '';
|
|
753
|
+
const parts = [
|
|
754
|
+
`Static casters: ${sourceRootCount}`,
|
|
755
|
+
`Bake meshes: ${sourceMeshCount}`,
|
|
756
|
+
`Chunks: ${chunkCount}`,
|
|
757
|
+
`Atlas pages: ${atlasPageCount}${duration}`,
|
|
758
|
+
];
|
|
759
|
+
if (typeof effectiveTexelsPerMeter === 'number')
|
|
760
|
+
parts.push(`Effective texels/m: ${formatNumberForStatus(effectiveTexelsPerMeter)}`);
|
|
761
|
+
if (typeof atlasSize === 'number')
|
|
762
|
+
parts.push(`Atlas: ${atlasSize}px`);
|
|
763
|
+
if (typeof atlasOccupancy === 'number')
|
|
764
|
+
parts.push(`Atlas occupancy: ${formatNumberForStatus(Math.max(0, Math.min(1, atlasOccupancy)) * 100)}%`);
|
|
765
|
+
if (typeof sdfRadiusPx === 'number')
|
|
766
|
+
parts.push(`SDF radius: ${formatNumberForStatus(sdfRadiusPx)}px`);
|
|
767
|
+
if (typeof stats?.bakedChunkCount === 'number' || typeof stats?.reusedChunkCount === 'number') {
|
|
768
|
+
parts.push(`Baked/reused: ${stats?.bakedChunkCount ?? 0}/${stats?.reusedChunkCount ?? 0}`);
|
|
769
|
+
}
|
|
770
|
+
return parts.join(' · ');
|
|
771
|
+
}
|
|
772
|
+
function formatNumberForStatus(value) {
|
|
773
|
+
return Number.isInteger(value) ? String(value) : value.toFixed(2).replace(/\.?0+$/, '');
|
|
774
|
+
}
|
|
331
775
|
function createPlayableBabylonRenderingResult(changed, input) {
|
|
332
776
|
return {
|
|
333
777
|
changed,
|
|
@@ -335,13 +779,123 @@ function createPlayableBabylonRenderingResult(changed, input) {
|
|
|
335
779
|
...(input.dirty === undefined ? {} : { dirty: input.dirty }),
|
|
336
780
|
status: input.status,
|
|
337
781
|
statusTone: input.statusTone,
|
|
782
|
+
...(input.statusDetails ? { statusDetails: input.statusDetails } : {}),
|
|
783
|
+
...(input.documentPatch === undefined ? {} : { documentPatch: input.documentPatch }),
|
|
784
|
+
};
|
|
785
|
+
}
|
|
786
|
+
function createPlayableBabylonRenderingProfileActionInput(actionId, input) {
|
|
787
|
+
const params = readRecord(input.params);
|
|
788
|
+
return {
|
|
789
|
+
actionId,
|
|
790
|
+
renderingGroupId: params.renderingGroupId ?? input.renderingGroupId,
|
|
791
|
+
presetIndex: params.presetIndex ?? input.presetIndex,
|
|
338
792
|
};
|
|
339
793
|
}
|
|
794
|
+
function readPlayableBabylonRenderingDocumentPatch(value) {
|
|
795
|
+
return value && typeof value === 'object' ? value.documentPatch : undefined;
|
|
796
|
+
}
|
|
797
|
+
function readRecord(value) {
|
|
798
|
+
return value && typeof value === 'object' && !Array.isArray(value)
|
|
799
|
+
? value
|
|
800
|
+
: {};
|
|
801
|
+
}
|
|
340
802
|
function resolvePlayableBabylonRenderingValue(value, context) {
|
|
341
803
|
return typeof value === 'function'
|
|
342
804
|
? value(context)
|
|
343
805
|
: value;
|
|
344
806
|
}
|
|
807
|
+
function readPlayableBabylonRenderingActionProgress(value) {
|
|
808
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
809
|
+
return null;
|
|
810
|
+
const record = value;
|
|
811
|
+
return {
|
|
812
|
+
...(typeof record.actionId === 'string' ? { actionId: record.actionId } : {}),
|
|
813
|
+
...(typeof record.label === 'string' ? { label: record.label } : {}),
|
|
814
|
+
...(typeof record.status === 'string' ? { status: record.status } : {}),
|
|
815
|
+
...(isEditorSceneRenderingStatusTone(record.statusTone) ? { statusTone: record.statusTone } : {}),
|
|
816
|
+
...(typeof record.statusDetails === 'string' ? { statusDetails: record.statusDetails } : {}),
|
|
817
|
+
...(typeof record.value === 'number' && Number.isFinite(record.value) ? { value: record.value } : {}),
|
|
818
|
+
...(typeof record.indeterminate === 'boolean' ? { indeterminate: record.indeterminate } : {}),
|
|
819
|
+
...(record.details && typeof record.details === 'object' && !Array.isArray(record.details)
|
|
820
|
+
? { details: record.details }
|
|
821
|
+
: {}),
|
|
822
|
+
};
|
|
823
|
+
}
|
|
824
|
+
function isEditorSceneRenderingStatusTone(value) {
|
|
825
|
+
return value === 'default' || value === 'success' || value === 'warning' || value === 'error';
|
|
826
|
+
}
|
|
827
|
+
function readStaticShadowBakeStats(value) {
|
|
828
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
829
|
+
return null;
|
|
830
|
+
const record = value;
|
|
831
|
+
const stats = {};
|
|
832
|
+
if (typeof record.phase === 'string' && record.phase.trim()) {
|
|
833
|
+
stats.phase = record.phase.trim();
|
|
834
|
+
}
|
|
835
|
+
setOptionalNonNegativeNumber(stats, 'sourceRootCount', record.sourceRootCount);
|
|
836
|
+
setOptionalNonNegativeNumber(stats, 'sourceMeshCount', record.sourceMeshCount);
|
|
837
|
+
setOptionalNonNegativeNumber(stats, 'attemptedChunkCount', record.attemptedChunkCount);
|
|
838
|
+
setOptionalNonNegativeNumber(stats, 'chunkCount', record.chunkCount);
|
|
839
|
+
setOptionalNonNegativeNumber(stats, 'textureCount', record.textureCount);
|
|
840
|
+
setOptionalNonNegativeNumber(stats, 'skippedChunkCount', record.skippedChunkCount);
|
|
841
|
+
setOptionalNonNegativeNumber(stats, 'pageCount', record.pageCount);
|
|
842
|
+
setOptionalPositiveNumber(stats, 'resolution', record.resolution);
|
|
843
|
+
setOptionalPositiveNumber(stats, 'chunkSize', record.chunkSize);
|
|
844
|
+
setOptionalPositiveNumber(stats, 'atlasSize', record.atlasSize);
|
|
845
|
+
setOptionalNonNegativeNumber(stats, 'atlasUsedPixels', record.atlasUsedPixels);
|
|
846
|
+
setOptionalNonNegativeNumber(stats, 'atlasAllocatedPixels', record.atlasAllocatedPixels);
|
|
847
|
+
setOptionalRatio(stats, 'atlasOccupancy', record.atlasOccupancy);
|
|
848
|
+
setOptionalPositiveNumber(stats, 'texelsPerMeter', record.texelsPerMeter);
|
|
849
|
+
setOptionalPositiveNumber(stats, 'effectiveTexelsPerMeter', record.effectiveTexelsPerMeter);
|
|
850
|
+
setOptionalPositiveNumber(stats, 'maxAtlasPages', record.maxAtlasPages);
|
|
851
|
+
setOptionalNonNegativeNumber(stats, 'sdfRadiusPx', record.sdfRadiusPx);
|
|
852
|
+
setOptionalPositiveNumber(stats, 'spatialChunkSize', record.spatialChunkSize);
|
|
853
|
+
setOptionalPositiveNumber(stats, 'effectiveSpatialChunkSize', record.effectiveSpatialChunkSize);
|
|
854
|
+
setOptionalPositiveNumber(stats, 'targetChunkCount', record.targetChunkCount);
|
|
855
|
+
setOptionalNonNegativeNumber(stats, 'bakedChunkCount', record.bakedChunkCount);
|
|
856
|
+
setOptionalNonNegativeNumber(stats, 'reusedChunkCount', record.reusedChunkCount);
|
|
857
|
+
setOptionalNonNegativeNumber(stats, 'durationMs', record.durationMs);
|
|
858
|
+
if (typeof record.currentChunkId === 'string' && record.currentChunkId.trim()) {
|
|
859
|
+
stats.currentChunkId = record.currentChunkId.trim();
|
|
860
|
+
}
|
|
861
|
+
return Object.keys(stats).length > 0 ? stats : null;
|
|
862
|
+
}
|
|
863
|
+
function setOptionalNonNegativeNumber(target, key, value) {
|
|
864
|
+
if (typeof value === 'number' && Number.isFinite(value) && value >= 0) {
|
|
865
|
+
target[key] = value;
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
function setOptionalPositiveNumber(target, key, value) {
|
|
869
|
+
if (typeof value === 'number' && Number.isFinite(value) && value > 0) {
|
|
870
|
+
target[key] = value;
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
function setOptionalRatio(target, key, value) {
|
|
874
|
+
if (typeof value === 'number' && Number.isFinite(value) && value >= 0 && value <= 1) {
|
|
875
|
+
target[key] = value;
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
function readBabylonScene(value) {
|
|
879
|
+
return value && typeof value === 'object' && Array.isArray(value.meshes)
|
|
880
|
+
? value
|
|
881
|
+
: null;
|
|
882
|
+
}
|
|
883
|
+
function resolveBabylonDirectionalLight(projectionValue, directionalLightNodeId) {
|
|
884
|
+
if (!directionalLightNodeId)
|
|
885
|
+
return null;
|
|
886
|
+
const projection = projectionValue;
|
|
887
|
+
const projected = projection?.getProjectedNode?.(directionalLightNodeId);
|
|
888
|
+
const candidates = [
|
|
889
|
+
projected?.root,
|
|
890
|
+
...(Array.isArray(projected?.runtimeObjects) ? projected.runtimeObjects : []),
|
|
891
|
+
];
|
|
892
|
+
for (const candidate of candidates) {
|
|
893
|
+
if (candidate && typeof candidate === 'object' && candidate.getClassName?.() === 'DirectionalLight') {
|
|
894
|
+
return candidate;
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
return null;
|
|
898
|
+
}
|
|
345
899
|
function mergePlayableBabylonPlanarShadowPolicyInput(base, input) {
|
|
346
900
|
const merged = {
|
|
347
901
|
additionalCasterIncludePatterns: mergePlayableBabylonPlanarShadowPatterns(...(base.additionalCasterIncludePatterns ?? []), ...(input?.additionalCasterIncludePatterns ?? [])),
|