@fps-games/editor 0.1.6-beta.1 → 0.1.7-beta.2

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