@onerjs/core 9.0.0 → 9.0.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 (353) hide show
  1. package/Animations/animationGroup.pure.js.map +1 -1
  2. package/Cameras/targetCamera.pure.js +6 -1
  3. package/Cameras/targetCamera.pure.js.map +1 -1
  4. package/Engines/Native/nativeHardwareTexture.d.ts +8 -1
  5. package/Engines/Native/nativeHardwareTexture.js +7 -0
  6. package/Engines/Native/nativeHardwareTexture.js.map +1 -1
  7. package/Engines/Native/nativeHelpers.js +56 -1
  8. package/Engines/Native/nativeHelpers.js.map +1 -1
  9. package/Engines/Native/nativeInterfaces.d.ts +37 -8
  10. package/Engines/Native/nativeInterfaces.js.map +1 -1
  11. package/Engines/Native/nativeRenderTargetWrapper.d.ts +40 -0
  12. package/Engines/Native/nativeRenderTargetWrapper.js +265 -5
  13. package/Engines/Native/nativeRenderTargetWrapper.js.map +1 -1
  14. package/Engines/Processors/shaderCodeCursor.d.ts +1 -0
  15. package/Engines/Processors/shaderCodeCursor.js +40 -3
  16. package/Engines/Processors/shaderCodeCursor.js.map +1 -1
  17. package/Engines/WebGPU/Extensions/engine.renderTarget.pure.js +1 -0
  18. package/Engines/WebGPU/Extensions/engine.renderTarget.pure.js.map +1 -1
  19. package/Engines/abstractEngine.pure.d.ts +15 -1
  20. package/Engines/abstractEngine.pure.js +12 -4
  21. package/Engines/abstractEngine.pure.js.map +1 -1
  22. package/Engines/engine.pure.d.ts +0 -1
  23. package/Engines/engine.pure.js +0 -7
  24. package/Engines/engine.pure.js.map +1 -1
  25. package/Engines/nativeEngine.pure.js +1 -1
  26. package/Engines/nativeEngine.pure.js.map +1 -1
  27. package/Engines/thinEngine.pure.d.ts +1 -0
  28. package/Engines/thinEngine.pure.js +13 -2
  29. package/Engines/thinEngine.pure.js.map +1 -1
  30. package/Engines/thinNativeEngine.pure.d.ts +217 -17
  31. package/Engines/thinNativeEngine.pure.js +1431 -164
  32. package/Engines/thinNativeEngine.pure.js.map +1 -1
  33. package/Engines/thinWebGPUEngine.js +6 -1
  34. package/Engines/thinWebGPUEngine.js.map +1 -1
  35. package/Engines/webgpuEngine.pure.d.ts +12 -1
  36. package/Engines/webgpuEngine.pure.js +8 -0
  37. package/Engines/webgpuEngine.pure.js.map +1 -1
  38. package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.pure.d.ts +10 -0
  39. package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.pure.js +24 -12
  40. package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.pure.js.map +1 -1
  41. package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.pure.d.ts +7 -0
  42. package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.pure.js +43 -0
  43. package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.pure.js.map +1 -1
  44. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.d.ts +16 -4
  45. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.js +20 -6
  46. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.js.map +1 -1
  47. package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.pure.js +3 -3
  48. package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.pure.js.map +1 -1
  49. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.d.ts +7 -7
  50. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.js +52 -35
  51. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.js.map +1 -1
  52. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.pure.d.ts +12 -1
  53. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.pure.js +8 -0
  54. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.pure.js.map +1 -1
  55. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.pure.js +4 -1
  56. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.pure.js.map +1 -1
  57. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.pure.d.ts +12 -1
  58. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.pure.js +5 -1
  59. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.pure.js.map +1 -1
  60. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.pure.d.ts +2 -0
  61. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.pure.js +14 -2
  62. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.pure.js.map +1 -1
  63. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.pure.d.ts +5 -1
  64. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.pure.js +23 -8
  65. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.pure.js.map +1 -1
  66. package/FlowGraph/CustomTypes/flowGraphInteger.pure.d.ts +5 -0
  67. package/FlowGraph/CustomTypes/flowGraphInteger.pure.js +7 -0
  68. package/FlowGraph/CustomTypes/flowGraphInteger.pure.js.map +1 -1
  69. package/FlowGraph/CustomTypes/flowGraphMatrix.d.ts +10 -0
  70. package/FlowGraph/CustomTypes/flowGraphMatrix.js +14 -0
  71. package/FlowGraph/CustomTypes/flowGraphMatrix.js.map +1 -1
  72. package/FlowGraph/flowGraph.d.ts +2 -1
  73. package/FlowGraph/flowGraph.js +3 -2
  74. package/FlowGraph/flowGraph.js.map +1 -1
  75. package/FlowGraph/flowGraphAnimationHelpers.d.ts +24 -0
  76. package/FlowGraph/flowGraphAnimationHelpers.js +21 -0
  77. package/FlowGraph/flowGraphAnimationHelpers.js.map +1 -0
  78. package/FlowGraph/flowGraphContext.js +1 -0
  79. package/FlowGraph/flowGraphContext.js.map +1 -1
  80. package/FlowGraph/flowGraphValidator.js +0 -4
  81. package/FlowGraph/flowGraphValidator.js.map +1 -1
  82. package/FlowGraph/index.d.ts +2 -0
  83. package/FlowGraph/index.js +2 -0
  84. package/FlowGraph/index.js.map +1 -1
  85. package/FlowGraph/pure.d.ts +2 -0
  86. package/FlowGraph/pure.js +2 -0
  87. package/FlowGraph/pure.js.map +1 -1
  88. package/FlowGraph/serialization.d.ts +2 -2
  89. package/FlowGraph/serialization.js +2 -2
  90. package/FlowGraph/serialization.js.map +1 -1
  91. package/FlowGraph/typeDefinitions.d.ts +1 -1
  92. package/FlowGraph/typeDefinitions.js.map +1 -1
  93. package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.d.ts +1 -0
  94. package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.js +4 -0
  95. package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.js.map +1 -0
  96. package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.pure.d.ts +54 -0
  97. package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.pure.js +155 -0
  98. package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.pure.js.map +1 -0
  99. package/FrameGraph/Node/Blocks/Textures/pure.d.ts +1 -0
  100. package/FrameGraph/Node/Blocks/Textures/pure.js +1 -0
  101. package/FrameGraph/Node/Blocks/Textures/pure.js.map +1 -1
  102. package/FrameGraph/Node/Blocks/allBlocks.pure.js +2 -0
  103. package/FrameGraph/Node/Blocks/allBlocks.pure.js.map +1 -1
  104. package/FrameGraph/Node/Blocks/index.d.ts +1 -0
  105. package/FrameGraph/Node/Blocks/index.js +1 -0
  106. package/FrameGraph/Node/Blocks/index.js.map +1 -1
  107. package/FrameGraph/Node/Blocks/pure.d.ts +1 -0
  108. package/FrameGraph/Node/Blocks/pure.js +1 -0
  109. package/FrameGraph/Node/Blocks/pure.js.map +1 -1
  110. package/FrameGraph/Tasks/Misc/minMaxReducerTask.d.ts +62 -0
  111. package/FrameGraph/Tasks/Misc/minMaxReducerTask.js +159 -0
  112. package/FrameGraph/Tasks/Misc/minMaxReducerTask.js.map +1 -0
  113. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +3 -1
  114. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
  115. package/FrameGraph/frameGraph.d.ts +4 -0
  116. package/FrameGraph/frameGraph.js +14 -0
  117. package/FrameGraph/frameGraph.js.map +1 -1
  118. package/FrameGraph/index.d.ts +1 -0
  119. package/FrameGraph/index.js +1 -0
  120. package/FrameGraph/index.js.map +1 -1
  121. package/FrameGraph/pure.d.ts +1 -0
  122. package/FrameGraph/pure.js +1 -0
  123. package/FrameGraph/pure.js.map +1 -1
  124. package/Inputs/scene.inputManager.js +1 -1
  125. package/Inputs/scene.inputManager.js.map +1 -1
  126. package/Lights/Clustered/clusteredLightingSceneComponent.pure.d.ts +5 -0
  127. package/Lights/Clustered/clusteredLightingSceneComponent.pure.js +22 -1
  128. package/Lights/Clustered/clusteredLightingSceneComponent.pure.js.map +1 -1
  129. package/Lights/Shadows/cascadedShadowGenerator.pure.js +7 -3
  130. package/Lights/Shadows/cascadedShadowGenerator.pure.js.map +1 -1
  131. package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.d.ts +7 -0
  132. package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.js +8 -0
  133. package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.js.map +1 -0
  134. package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.pure.d.ts +54 -0
  135. package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.pure.js +81 -0
  136. package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.pure.js.map +1 -0
  137. package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.d.ts +7 -0
  138. package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.js +8 -0
  139. package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.js.map +1 -0
  140. package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.pure.d.ts +60 -0
  141. package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.pure.js +90 -0
  142. package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.pure.js.map +1 -0
  143. package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.d.ts +31 -0
  144. package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js +98 -0
  145. package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js.map +1 -1
  146. package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js +1 -1
  147. package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js.map +1 -1
  148. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js +2 -2
  149. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js.map +1 -1
  150. package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.d.ts +1 -0
  151. package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.js +4 -0
  152. package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.js.map +1 -0
  153. package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.pure.d.ts +83 -0
  154. package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.pure.js +191 -0
  155. package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.pure.js.map +1 -0
  156. package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.d.ts +1 -0
  157. package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.js +4 -0
  158. package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.js.map +1 -0
  159. package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.pure.d.ts +62 -0
  160. package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.pure.js +125 -0
  161. package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.pure.js.map +1 -0
  162. package/Materials/GaussianSplatting/pure.d.ts +4 -0
  163. package/Materials/GaussianSplatting/pure.js +4 -0
  164. package/Materials/GaussianSplatting/pure.js.map +1 -1
  165. package/Materials/Node/Blocks/Dual/imageSourceBlock.pure.d.ts +1 -0
  166. package/Materials/Node/Blocks/Dual/imageSourceBlock.pure.js +12 -0
  167. package/Materials/Node/Blocks/Dual/imageSourceBlock.pure.js.map +1 -1
  168. package/Materials/Textures/Procedurals/proceduralTexture.pure.d.ts +1 -0
  169. package/Materials/Textures/Procedurals/proceduralTexture.pure.js +31 -7
  170. package/Materials/Textures/Procedurals/proceduralTexture.pure.js.map +1 -1
  171. package/Materials/Textures/mirrorTexture.pure.js +3 -1
  172. package/Materials/Textures/mirrorTexture.pure.js.map +1 -1
  173. package/Materials/Textures/texture.pure.js +8 -2
  174. package/Materials/Textures/texture.pure.js.map +1 -1
  175. package/Materials/effectRenderer.pure.d.ts +4 -0
  176. package/Materials/effectRenderer.pure.js +3 -2
  177. package/Materials/effectRenderer.pure.js.map +1 -1
  178. package/Materials/index.d.ts +4 -0
  179. package/Materials/index.js +4 -0
  180. package/Materials/index.js.map +1 -1
  181. package/Materials/material.pure.js +25 -12
  182. package/Materials/material.pure.js.map +1 -1
  183. package/Materials/pure.d.ts +4 -0
  184. package/Materials/pure.js +4 -0
  185. package/Materials/pure.js.map +1 -1
  186. package/Materials/standardMaterial.pure.d.ts +8 -0
  187. package/Materials/standardMaterial.pure.js +24 -2
  188. package/Materials/standardMaterial.pure.js.map +1 -1
  189. package/Meshes/Builders/polygonBuilder.pure.js +1 -1
  190. package/Meshes/Builders/polygonBuilder.pure.js.map +1 -1
  191. package/Meshes/GaussianSplatting/gaussianPointSplattingController.d.ts +8 -0
  192. package/Meshes/GaussianSplatting/gaussianPointSplattingController.js +11 -0
  193. package/Meshes/GaussianSplatting/gaussianPointSplattingController.js.map +1 -0
  194. package/Meshes/GaussianSplatting/gaussianPointSplattingController.pure.d.ts +231 -0
  195. package/Meshes/GaussianSplatting/gaussianPointSplattingController.pure.js +1212 -0
  196. package/Meshes/GaussianSplatting/gaussianPointSplattingController.pure.js.map +1 -0
  197. package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.d.ts +14 -0
  198. package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.js +15 -0
  199. package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.js.map +1 -0
  200. package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.pure.d.ts +285 -0
  201. package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.pure.js +812 -0
  202. package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.pure.js.map +1 -0
  203. package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +1 -0
  204. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +2 -0
  205. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
  206. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.d.ts +160 -0
  207. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js +219 -0
  208. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js.map +1 -1
  209. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +32 -4
  210. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +114 -21
  211. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
  212. package/Meshes/GaussianSplatting/pure.d.ts +2 -0
  213. package/Meshes/GaussianSplatting/pure.js +2 -0
  214. package/Meshes/GaussianSplatting/pure.js.map +1 -1
  215. package/Meshes/Node/Blocks/booleanGeometryBlock.pure.js +25 -11
  216. package/Meshes/Node/Blocks/booleanGeometryBlock.pure.js.map +1 -1
  217. package/Meshes/abstractMesh.pure.d.ts +12 -0
  218. package/Meshes/abstractMesh.pure.js +32 -0
  219. package/Meshes/abstractMesh.pure.js.map +1 -1
  220. package/Meshes/index.d.ts +1 -0
  221. package/Meshes/index.js +1 -0
  222. package/Meshes/index.js.map +1 -1
  223. package/Meshes/pure.d.ts +1 -0
  224. package/Meshes/pure.js +1 -0
  225. package/Meshes/pure.js.map +1 -1
  226. package/Meshes/subMesh.pure.d.ts +11 -2
  227. package/Meshes/subMesh.pure.js +20 -5
  228. package/Meshes/subMesh.pure.js.map +1 -1
  229. package/Meshes/thinInstanceMesh.pure.js +1 -0
  230. package/Meshes/thinInstanceMesh.pure.js.map +1 -1
  231. package/Misc/andOrNotEvaluator.js +4 -0
  232. package/Misc/andOrNotEvaluator.js.map +1 -1
  233. package/Misc/minMaxReducer.pure.d.ts +6 -0
  234. package/Misc/minMaxReducer.pure.js +10 -0
  235. package/Misc/minMaxReducer.pure.js.map +1 -1
  236. package/Misc/thinMinMaxReducer.d.ts +19 -2
  237. package/Misc/thinMinMaxReducer.js +74 -21
  238. package/Misc/thinMinMaxReducer.js.map +1 -1
  239. package/Misc/tools.pure.js +1 -1
  240. package/Misc/tools.pure.js.map +1 -1
  241. package/Particles/Node/Blocks/Update/updateNoiseBlock.pure.js +19 -7
  242. package/Particles/Node/Blocks/Update/updateNoiseBlock.pure.js.map +1 -1
  243. package/Particles/Node/Blocks/particleSourceTextureBlock.pure.js +3 -2
  244. package/Particles/Node/Blocks/particleSourceTextureBlock.pure.js.map +1 -1
  245. package/Particles/gpuParticleSystem.pure.d.ts +2 -0
  246. package/Particles/gpuParticleSystem.pure.js +12 -4
  247. package/Particles/gpuParticleSystem.pure.js.map +1 -1
  248. package/Particles/particle.js +3 -2
  249. package/Particles/particle.js.map +1 -1
  250. package/Particles/solidParticleSystem.js +7 -1
  251. package/Particles/solidParticleSystem.js.map +1 -1
  252. package/Particles/thinParticleSystem.function.d.ts +6 -0
  253. package/Particles/thinParticleSystem.function.js +144 -88
  254. package/Particles/thinParticleSystem.function.js.map +1 -1
  255. package/Particles/thinParticleSystem.pure.d.ts +6 -0
  256. package/Particles/thinParticleSystem.pure.js +70 -9
  257. package/Particles/thinParticleSystem.pure.js.map +1 -1
  258. package/Physics/v2/ragdoll.d.ts +2 -4
  259. package/Physics/v2/ragdoll.js +11 -4
  260. package/Physics/v2/ragdoll.js.map +1 -1
  261. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.d.ts +12 -0
  262. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js +43 -18
  263. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js.map +1 -1
  264. package/Rendering/depthRenderer.pure.d.ts +9 -0
  265. package/Rendering/depthRenderer.pure.js +12 -0
  266. package/Rendering/depthRenderer.pure.js.map +1 -1
  267. package/Rendering/fluidRenderer/fluidRenderingObject.d.ts +4 -0
  268. package/Rendering/fluidRenderer/fluidRenderingObject.js +6 -0
  269. package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
  270. package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.d.ts +4 -0
  271. package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js +8 -0
  272. package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js.map +1 -1
  273. package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js +3 -0
  274. package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js.map +1 -1
  275. package/Rendering/geometryBufferRenderer.pure.js +4 -1
  276. package/Rendering/geometryBufferRenderer.pure.js.map +1 -1
  277. package/Rendering/objectRenderer.js.map +1 -1
  278. package/Rendering/prePassRenderer.pure.js +3 -3
  279. package/Rendering/prePassRenderer.pure.js.map +1 -1
  280. package/Shaders/ShadersInclude/gaussianSplatting.js +3 -1
  281. package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
  282. package/Shaders/ShadersInclude/lightsFragmentFunctions.js +27 -3
  283. package/Shaders/ShadersInclude/lightsFragmentFunctions.js.map +1 -1
  284. package/Shaders/ShadersInclude/oitDeclaration.js +1 -1
  285. package/Shaders/ShadersInclude/oitDeclaration.js.map +1 -1
  286. package/Shaders/minmaxRedux.fragment.js +6 -1
  287. package/Shaders/minmaxRedux.fragment.js.map +1 -1
  288. package/ShadersWGSL/ShadersInclude/gaussianPointSplatting.d.ts +5 -0
  289. package/ShadersWGSL/ShadersInclude/gaussianPointSplatting.js +65 -0
  290. package/ShadersWGSL/ShadersInclude/gaussianPointSplatting.js.map +1 -0
  291. package/ShadersWGSL/ShadersInclude/gaussianPointSplattingScan.d.ts +5 -0
  292. package/ShadersWGSL/ShadersInclude/gaussianPointSplattingScan.js +17 -0
  293. package/ShadersWGSL/ShadersInclude/gaussianPointSplattingScan.js.map +1 -0
  294. package/ShadersWGSL/ShadersInclude/gaussianSplatting.d.ts +1 -0
  295. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js +6 -78
  296. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js.map +1 -1
  297. package/ShadersWGSL/ShadersInclude/gaussianSplattingFragmentDeclaration.js +2 -2
  298. package/ShadersWGSL/ShadersInclude/gaussianSplattingFragmentDeclaration.js.map +1 -1
  299. package/ShadersWGSL/ShadersInclude/gaussianSplattingShared.d.ts +5 -0
  300. package/ShadersWGSL/ShadersInclude/gaussianSplattingShared.js +79 -0
  301. package/ShadersWGSL/ShadersInclude/gaussianSplattingShared.js.map +1 -0
  302. package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js +27 -3
  303. package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js.map +1 -1
  304. package/ShadersWGSL/gaussianPointSplattingBlit.fragment.d.ts +5 -0
  305. package/ShadersWGSL/gaussianPointSplattingBlit.fragment.js +22 -0
  306. package/ShadersWGSL/gaussianPointSplattingBlit.fragment.js.map +1 -0
  307. package/ShadersWGSL/gaussianPointSplattingBlit.vertex.d.ts +5 -0
  308. package/ShadersWGSL/gaussianPointSplattingBlit.vertex.js +19 -0
  309. package/ShadersWGSL/gaussianPointSplattingBlit.vertex.js.map +1 -0
  310. package/ShadersWGSL/gaussianPointSplattingDepthBlit.fragment.d.ts +5 -0
  311. package/ShadersWGSL/gaussianPointSplattingDepthBlit.fragment.js +21 -0
  312. package/ShadersWGSL/gaussianPointSplattingDepthBlit.fragment.js.map +1 -0
  313. package/ShadersWGSL/gaussianSplatting.vertex.js +2 -1
  314. package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
  315. package/ShadersWGSL/gaussianSplattingDepth.vertex.js +2 -1
  316. package/ShadersWGSL/gaussianSplattingDepth.vertex.js.map +1 -1
  317. package/ShadersWGSL/gaussianSplattingVoxel.vertex.js +2 -1
  318. package/ShadersWGSL/gaussianSplattingVoxel.vertex.js.map +1 -1
  319. package/ShadersWGSL/gpsHiZBuild.compute.d.ts +5 -0
  320. package/ShadersWGSL/gpsHiZBuild.compute.js +16 -0
  321. package/ShadersWGSL/gpsHiZBuild.compute.js.map +1 -0
  322. package/ShadersWGSL/gpsPartition.compute.d.ts +5 -0
  323. package/ShadersWGSL/gpsPartition.compute.js +27 -0
  324. package/ShadersWGSL/gpsPartition.compute.js.map +1 -0
  325. package/ShadersWGSL/gpsPreprocess.compute.d.ts +5 -0
  326. package/ShadersWGSL/gpsPreprocess.compute.js +86 -0
  327. package/ShadersWGSL/gpsPreprocess.compute.js.map +1 -0
  328. package/ShadersWGSL/gpsResolve.compute.d.ts +5 -0
  329. package/ShadersWGSL/gpsResolve.compute.js +41 -0
  330. package/ShadersWGSL/gpsResolve.compute.js.map +1 -0
  331. package/ShadersWGSL/gpsScanAdd.compute.d.ts +5 -0
  332. package/ShadersWGSL/gpsScanAdd.compute.js +22 -0
  333. package/ShadersWGSL/gpsScanAdd.compute.js.map +1 -0
  334. package/ShadersWGSL/gpsScanBlocks.compute.d.ts +5 -0
  335. package/ShadersWGSL/gpsScanBlocks.compute.js +23 -0
  336. package/ShadersWGSL/gpsScanBlocks.compute.js.map +1 -0
  337. package/ShadersWGSL/gpsScanSums.compute.d.ts +5 -0
  338. package/ShadersWGSL/gpsScanSums.compute.js +30 -0
  339. package/ShadersWGSL/gpsScanSums.compute.js.map +1 -0
  340. package/ShadersWGSL/gpsSplat.compute.d.ts +5 -0
  341. package/ShadersWGSL/gpsSplat.compute.js +37 -0
  342. package/ShadersWGSL/gpsSplat.compute.js.map +1 -0
  343. package/ShadersWGSL/minmaxRedux.fragment.js +20 -3
  344. package/ShadersWGSL/minmaxRedux.fragment.js.map +1 -1
  345. package/XR/features/WebXRSpaceWarp.pure.js +2 -1
  346. package/XR/features/WebXRSpaceWarp.pure.js.map +1 -1
  347. package/assetContainer.d.ts +1 -0
  348. package/assetContainer.js +5 -1
  349. package/assetContainer.js.map +1 -1
  350. package/package.json +1 -1
  351. package/scene.pure.d.ts +13 -2
  352. package/scene.pure.js +28 -4
  353. package/scene.pure.js.map +1 -1
@@ -1,4 +1,6 @@
1
1
  /** Pure barrel — re-exports only side-effect-free modules */
2
+ export * from "./gaussianPointSplattingController.pure.js";
3
+ export * from "./gaussianPointSplattingRenderer.pure.js";
2
4
  export * from "./gaussianSplattingCompoundMesh.pure.js";
3
5
  export * from "./gaussianSplattingDebugger.pure.js";
4
6
  export * from "./gaussianSplattingMesh.pure.js";
@@ -1,4 +1,6 @@
1
1
  /** Pure barrel — re-exports only side-effect-free modules */
2
+ export * from "./gaussianPointSplattingController.pure.js";
3
+ export * from "./gaussianPointSplattingRenderer.pure.js";
2
4
  export * from "./gaussianSplattingCompoundMesh.pure.js";
3
5
  export * from "./gaussianSplattingDebugger.pure.js";
4
6
  export * from "./gaussianSplattingMesh.pure.js";
@@ -1 +1 @@
1
- {"version":3,"file":"pure.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/GaussianSplatting/pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,uCAAuC,CAAC","sourcesContent":["/** Pure barrel — re-exports only side-effect-free modules */\nexport * from \"./gaussianSplattingCompoundMesh.pure\";\nexport * from \"./gaussianSplattingDebugger.pure\";\nexport * from \"./gaussianSplattingMesh.pure\";\nexport * from \"./gaussianSplattingMeshBase.pure\";\nexport * from \"./gaussianSplattingPartProxyMesh.pure\";\n"]}
1
+ {"version":3,"file":"pure.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/GaussianSplatting/pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,cAAc,yCAAyC,CAAC;AACxD,cAAc,uCAAuC,CAAC;AACtD,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,uCAAuC,CAAC","sourcesContent":["/** Pure barrel — re-exports only side-effect-free modules */\nexport * from \"./gaussianPointSplattingController.pure\";\nexport * from \"./gaussianPointSplattingRenderer.pure\";\nexport * from \"./gaussianSplattingCompoundMesh.pure\";\nexport * from \"./gaussianSplattingDebugger.pure\";\nexport * from \"./gaussianSplattingMesh.pure\";\nexport * from \"./gaussianSplattingMeshBase.pure\";\nexport * from \"./gaussianSplattingPartProxyMesh.pure\";\n"]}
@@ -2,6 +2,7 @@
2
2
  import { __esDecorate, __runInitializers } from "../../../tslib.es6.js";
3
3
  import { NodeGeometryBlock } from "../nodeGeometryBlock.js";
4
4
  import { NodeGeometryBlockConnectionPointTypes } from "../Enums/nodeGeometryConnectionPointTypes.js";
5
+ import { VertexData } from "../../mesh.vertexData.js";
5
6
  import { editableInPropertyPage } from "../../../Decorators/nodeDecorator.js";
6
7
  import { CSG2, InitializeCSG2Async, IsCSG2Ready } from "../../csg2.js";
7
8
  import { CSG } from "../../csg.js";
@@ -103,25 +104,38 @@ let BooleanGeometryBlock = (() => {
103
104
  if (!vertexData0 || !vertexData1) {
104
105
  return null;
105
106
  }
106
- const vertexCount = vertexData0.positions.length / 3;
107
- // Ensure that all the fields are filled to avoid problems later on in the graph
107
+ // Make both operands expose the same attributes, since CSG2 refuses mismatched vertex layouts.
108
+ // Missing normals are computed from the geometry, missing colors default to white (as VertexData.merge does)
109
+ // and missing UVs to zero. Every pad is sized to its own operand.
110
+ const pad = (length, value) => new Array(length).fill(value);
111
+ const computeNormals = (geometry) => {
112
+ const normals = [];
113
+ VertexData.ComputeNormals(geometry.positions, geometry.indices, normals);
114
+ return normals;
115
+ };
116
+ const vertexCount0 = vertexData0.positions.length / 3;
117
+ const vertexCount1 = vertexData1.positions.length / 3;
108
118
  if (!vertexData0.normals && vertexData1.normals) {
109
- vertexData0.normals = new Array(vertexData0.positions.length);
119
+ vertexData0.normals = computeNormals(vertexData0);
110
120
  }
111
121
  if (!vertexData1.normals && vertexData0.normals) {
112
- vertexData1.normals = new Array(vertexData1.positions.length);
122
+ vertexData1.normals = computeNormals(vertexData1);
113
123
  }
114
- if (!vertexData0.uvs && vertexData1.uvs) {
115
- vertexData0.uvs = new Array(vertexCount * 2);
116
- }
117
- if (!vertexData1.uvs && vertexData0.uvs) {
118
- vertexData1.uvs = new Array(vertexCount * 2);
124
+ // The legacy engine only reads the first UV set; CSG2 counts every set present.
125
+ const uvSets = this.useOldCSGEngine ? ["uvs"] : ["uvs", "uvs2", "uvs3", "uvs4", "uvs5", "uvs6"];
126
+ for (const key of uvSets) {
127
+ if (!vertexData0[key] && vertexData1[key]) {
128
+ vertexData0[key] = pad(vertexCount0 * 2, 0);
129
+ }
130
+ if (!vertexData1[key] && vertexData0[key]) {
131
+ vertexData1[key] = pad(vertexCount1 * 2, 0);
132
+ }
119
133
  }
120
134
  if (!vertexData0.colors && vertexData1.colors) {
121
- vertexData0.colors = new Array(vertexCount * 4);
135
+ vertexData0.colors = pad(vertexCount0 * 4, 1);
122
136
  }
123
137
  if (!vertexData1.colors && vertexData0.colors) {
124
- vertexData1.colors = new Array(vertexCount * 4);
138
+ vertexData1.colors = pad(vertexCount1 * 4, 1);
125
139
  }
126
140
  let boolCSG;
127
141
  if (this.useOldCSGEngine) {
@@ -1 +1 @@
1
- {"version":3,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AE,EAAE,OAAO,EAAE,IAAI,EAAE;oBAC5B,QAAQ,EAAE,IAAI;oBACd,OAAO,EAAE;wBACL,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,yBAAyB,CAAC,SAAS,EAAE;wBAClE,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,yBAAyB,CAAC,QAAQ,EAAE;wBAChE,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,yBAAyB,CAAC,KAAK,EAAE;qBAC7D;iBACJ,CAAC;2CAOD,sBAAsB,CAAC,oBAAoB,0CAAkC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;YApB3I,+LAAO,eAAe,6BAAf,eAAe,yGAAS;YAc/B,6KAAO,SAAS,6BAAT,SAAS,6FAAuC;YAOvD,+LAAO,eAAe,6BAAf,eAAe,yGAAS;;;;;SA3BtB,oBAAoB;AAkMjC,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB;;;GAGG;AACH,MAAM,UAAU,4BAA4B;IACxC,IAAI,WAAW,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,aAAa,CAAC,8BAA8B,EAAE,oBAAoB,CAAC,CAAC;AACxE,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport { type NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { type VertexData } from \"../../mesh.vertexData\";\r\nimport { type NodeGeometryBuildState } from \"../nodeGeometryBuildState\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../Decorators/nodeDecorator\";\r\nimport { CSG2, InitializeCSG2Async, IsCSG2Ready } from \"core/Meshes/csg2\";\r\nimport { type Nullable } from \"core/types\";\r\nimport { CSG } from \"core/Meshes/csg\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n\r\n/**\r\n * Operations supported by the boolean block\r\n */\r\nexport enum BooleanGeometryOperations {\r\n /** Intersect */\r\n Intersect,\r\n /** Subtract */\r\n Subtract,\r\n /** Union */\r\n Union,\r\n}\r\n\r\n/**\r\n * Block used to apply a boolean operation between 2 geometries\r\n */\r\nexport class BooleanGeometryBlock extends NodeGeometryBlock {\r\n /**\r\n * Gets or sets a boolean indicating that this block can evaluate context\r\n * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change\r\n */\r\n @editableInPropertyPage(\"Evaluate context\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true } })\r\n public evaluateContext = false;\r\n\r\n /**\r\n * Gets or sets the operation applied by the block\r\n */\r\n @editableInPropertyPage(\"Operation\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { rebuild: true },\r\n embedded: true,\r\n options: [\r\n { label: \"Intersect\", value: BooleanGeometryOperations.Intersect },\r\n { label: \"Subtract\", value: BooleanGeometryOperations.Subtract },\r\n { label: \"Union\", value: BooleanGeometryOperations.Union },\r\n ],\r\n })\r\n public operation = BooleanGeometryOperations.Intersect;\r\n\r\n /**\r\n * Gets or sets a boolean indicating that this block can evaluate context\r\n * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change\r\n */\r\n @editableInPropertyPage(\"Use old CSG engine\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true } })\r\n public useOldCSGEngine = false;\r\n\r\n private _csg2LoadingPromise: Promise<void>;\r\n /**\r\n * @internal\r\n */\r\n public override get _isReadyState(): Nullable<Promise<void>> {\r\n if (IsCSG2Ready()) {\r\n return null;\r\n }\r\n\r\n if (!this._csg2LoadingPromise) {\r\n this._csg2LoadingPromise = InitializeCSG2Async();\r\n }\r\n\r\n return this._csg2LoadingPromise;\r\n }\r\n\r\n /**\r\n * Create a new BooleanGeometryBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"geometry0\", NodeGeometryBlockConnectionPointTypes.Geometry);\r\n this.registerInput(\"geometry1\", NodeGeometryBlockConnectionPointTypes.Geometry);\r\n\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.Geometry);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"BooleanGeometryBlock\";\r\n }\r\n\r\n /**\r\n * Gets the geometry0 input component\r\n */\r\n public get geometry0(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the geometry1 input component\r\n */\r\n public get geometry1(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the geometry output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock(state: NodeGeometryBuildState) {\r\n const func = (state: NodeGeometryBuildState) => {\r\n const vertexData0 = this.geometry0.getConnectedValue(state) as VertexData;\r\n const vertexData1 = this.geometry1.getConnectedValue(state) as VertexData;\r\n\r\n if (!vertexData0 || !vertexData1) {\r\n return null;\r\n }\r\n\r\n const vertexCount = vertexData0.positions!.length / 3;\r\n // Ensure that all the fields are filled to avoid problems later on in the graph\r\n if (!vertexData0.normals && vertexData1.normals) {\r\n vertexData0.normals = new Array<number>(vertexData0.positions!.length);\r\n }\r\n if (!vertexData1.normals && vertexData0.normals) {\r\n vertexData1.normals = new Array<number>(vertexData1.positions!.length);\r\n }\r\n if (!vertexData0.uvs && vertexData1.uvs) {\r\n vertexData0.uvs = new Array<number>(vertexCount * 2);\r\n }\r\n if (!vertexData1.uvs && vertexData0.uvs) {\r\n vertexData1.uvs = new Array<number>(vertexCount * 2);\r\n }\r\n if (!vertexData0.colors && vertexData1.colors) {\r\n vertexData0.colors = new Array<number>(vertexCount * 4);\r\n }\r\n if (!vertexData1.colors && vertexData0.colors) {\r\n vertexData1.colors = new Array<number>(vertexCount * 4);\r\n }\r\n\r\n let boolCSG: CSG | CSG2;\r\n\r\n if (this.useOldCSGEngine) {\r\n const csg0 = CSG.FromVertexData(vertexData0);\r\n const csg1 = CSG.FromVertexData(vertexData1);\r\n switch (this.operation) {\r\n case BooleanGeometryOperations.Intersect:\r\n boolCSG = csg0.intersect(csg1);\r\n break;\r\n case BooleanGeometryOperations.Subtract:\r\n boolCSG = csg0.subtract(csg1);\r\n break;\r\n case BooleanGeometryOperations.Union:\r\n boolCSG = csg0.union(csg1);\r\n break;\r\n }\r\n } else {\r\n const csg0 = CSG2.FromVertexData(vertexData0);\r\n const csg1 = CSG2.FromVertexData(vertexData1);\r\n switch (this.operation) {\r\n case BooleanGeometryOperations.Intersect:\r\n boolCSG = csg0.intersect(csg1);\r\n break;\r\n case BooleanGeometryOperations.Subtract:\r\n boolCSG = csg0.subtract(csg1);\r\n break;\r\n case BooleanGeometryOperations.Union:\r\n boolCSG = csg0.add(csg1);\r\n break;\r\n }\r\n }\r\n\r\n return boolCSG.toVertexData();\r\n };\r\n\r\n if (this.evaluateContext) {\r\n this.output._storedFunction = func;\r\n } else {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = func(state);\r\n }\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n let codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? \"true\" : \"false\"};\\n`;\r\n codeString += `${this._codeVariableName}.operation = BABYLON.BooleanGeometryOperations.${BooleanGeometryOperations[this.operation]};\\n`;\r\n codeString += `${this._codeVariableName}.useOldCSGEngine = ${this.useOldCSGEngine ? \"true\" : \"false\"};\\n`;\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.evaluateContext = this.evaluateContext;\r\n serializationObject.operation = this.operation;\r\n serializationObject.useOldCSGEngine = this.useOldCSGEngine;\r\n\r\n return serializationObject;\r\n }\r\n\r\n /** @internal */\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.evaluateContext = serializationObject.evaluateContext;\r\n if (serializationObject.operation) {\r\n this.operation = serializationObject.operation;\r\n }\r\n\r\n this.useOldCSGEngine = !!serializationObject.useOldCSGEngine;\r\n }\r\n}\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for booleanGeometryBlock.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterBooleanGeometryBlock(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n RegisterClass(\"BABYLON.BooleanGeometryBlock\", BooleanGeometryBlock);\r\n}\r\n"]}
1
+ {"version":3,"file":"booleanGeometryBlock.pure.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/booleanGeometryBlock.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;;AAE7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAClG,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAA0B,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AACnG,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE1E,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD;;GAEG;AACH,MAAM,CAAN,IAAY,yBAOX;AAPD,WAAY,yBAAyB;IACjC,gBAAgB;IAChB,mFAAS,CAAA;IACT,eAAe;IACf,iFAAQ,CAAA;IACR,YAAY;IACZ,2EAAK,CAAA;AACT,CA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O,EAAE,IAAI,EAAE,EAAE,CAAC;qCAMxI,sBAAsB,CAAC,WAAW,uCAA+B,UAAU,EAAE;oBAC1E,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;oBAC5B,QAAQ,EAAE,IAAI;oBACd,OAAO,EAAE;wBACL,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,yBAAyB,CAAC,SAAS,EAAE;wBAClE,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,yBAAyB,CAAC,QAAQ,EAAE;wBAChE,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,yBAAyB,CAAC,KAAK,EAAE;qBAC7D;iBACJ,CAAC;2CAOD,sBAAsB,CAAC,oBAAoB,0CAAkC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;YApB3I,+LAAO,eAAe,6BAAf,eAAe,yGAAS;YAc/B,6KAAO,SAAS,6BAAT,SAAS,6FAAuC;YAOvD,+LAAO,eAAe,6BAAf,eAAe,yGAAS;;;;;SA3BtB,oBAAoB;AA+MjC,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB;;;GAGG;AACH,MAAM,UAAU,4BAA4B;IACxC,IAAI,WAAW,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,aAAa,CAAC,8BAA8B,EAAE,oBAAoB,CAAC,CAAC;AACxE,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport { type NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { VertexData } from \"../../mesh.vertexData\";\r\nimport { type NodeGeometryBuildState } from \"../nodeGeometryBuildState\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../Decorators/nodeDecorator\";\r\nimport { CSG2, InitializeCSG2Async, IsCSG2Ready } from \"core/Meshes/csg2\";\r\nimport { type Nullable } from \"core/types\";\r\nimport { CSG } from \"core/Meshes/csg\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n\r\n/**\r\n * Operations supported by the boolean block\r\n */\r\nexport enum BooleanGeometryOperations {\r\n /** Intersect */\r\n Intersect,\r\n /** Subtract */\r\n Subtract,\r\n /** Union */\r\n Union,\r\n}\r\n\r\n/**\r\n * Block used to apply a boolean operation between 2 geometries\r\n */\r\nexport class BooleanGeometryBlock extends NodeGeometryBlock {\r\n /**\r\n * Gets or sets a boolean indicating that this block can evaluate context\r\n * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change\r\n */\r\n @editableInPropertyPage(\"Evaluate context\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true } })\r\n public evaluateContext = false;\r\n\r\n /**\r\n * Gets or sets the operation applied by the block\r\n */\r\n @editableInPropertyPage(\"Operation\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { rebuild: true },\r\n embedded: true,\r\n options: [\r\n { label: \"Intersect\", value: BooleanGeometryOperations.Intersect },\r\n { label: \"Subtract\", value: BooleanGeometryOperations.Subtract },\r\n { label: \"Union\", value: BooleanGeometryOperations.Union },\r\n ],\r\n })\r\n public operation = BooleanGeometryOperations.Intersect;\r\n\r\n /**\r\n * Gets or sets a boolean indicating that this block can evaluate context\r\n * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change\r\n */\r\n @editableInPropertyPage(\"Use old CSG engine\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true } })\r\n public useOldCSGEngine = false;\r\n\r\n private _csg2LoadingPromise: Promise<void>;\r\n /**\r\n * @internal\r\n */\r\n public override get _isReadyState(): Nullable<Promise<void>> {\r\n if (IsCSG2Ready()) {\r\n return null;\r\n }\r\n\r\n if (!this._csg2LoadingPromise) {\r\n this._csg2LoadingPromise = InitializeCSG2Async();\r\n }\r\n\r\n return this._csg2LoadingPromise;\r\n }\r\n\r\n /**\r\n * Create a new BooleanGeometryBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"geometry0\", NodeGeometryBlockConnectionPointTypes.Geometry);\r\n this.registerInput(\"geometry1\", NodeGeometryBlockConnectionPointTypes.Geometry);\r\n\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.Geometry);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"BooleanGeometryBlock\";\r\n }\r\n\r\n /**\r\n * Gets the geometry0 input component\r\n */\r\n public get geometry0(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the geometry1 input component\r\n */\r\n public get geometry1(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the geometry output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock(state: NodeGeometryBuildState) {\r\n const func = (state: NodeGeometryBuildState) => {\r\n const vertexData0 = this.geometry0.getConnectedValue(state) as VertexData;\r\n const vertexData1 = this.geometry1.getConnectedValue(state) as VertexData;\r\n\r\n if (!vertexData0 || !vertexData1) {\r\n return null;\r\n }\r\n\r\n // Make both operands expose the same attributes, since CSG2 refuses mismatched vertex layouts.\r\n // Missing normals are computed from the geometry, missing colors default to white (as VertexData.merge does)\r\n // and missing UVs to zero. Every pad is sized to its own operand.\r\n const pad = (length: number, value: number) => new Array<number>(length).fill(value);\r\n const computeNormals = (geometry: VertexData) => {\r\n const normals: number[] = [];\r\n VertexData.ComputeNormals(geometry.positions, geometry.indices, normals);\r\n return normals;\r\n };\r\n const vertexCount0 = vertexData0.positions!.length / 3;\r\n const vertexCount1 = vertexData1.positions!.length / 3;\r\n if (!vertexData0.normals && vertexData1.normals) {\r\n vertexData0.normals = computeNormals(vertexData0);\r\n }\r\n if (!vertexData1.normals && vertexData0.normals) {\r\n vertexData1.normals = computeNormals(vertexData1);\r\n }\r\n // The legacy engine only reads the first UV set; CSG2 counts every set present.\r\n const uvSets = this.useOldCSGEngine ? ([\"uvs\"] as const) : ([\"uvs\", \"uvs2\", \"uvs3\", \"uvs4\", \"uvs5\", \"uvs6\"] as const);\r\n for (const key of uvSets) {\r\n if (!vertexData0[key] && vertexData1[key]) {\r\n vertexData0[key] = pad(vertexCount0 * 2, 0);\r\n }\r\n if (!vertexData1[key] && vertexData0[key]) {\r\n vertexData1[key] = pad(vertexCount1 * 2, 0);\r\n }\r\n }\r\n if (!vertexData0.colors && vertexData1.colors) {\r\n vertexData0.colors = pad(vertexCount0 * 4, 1);\r\n }\r\n if (!vertexData1.colors && vertexData0.colors) {\r\n vertexData1.colors = pad(vertexCount1 * 4, 1);\r\n }\r\n\r\n let boolCSG: CSG | CSG2;\r\n\r\n if (this.useOldCSGEngine) {\r\n const csg0 = CSG.FromVertexData(vertexData0);\r\n const csg1 = CSG.FromVertexData(vertexData1);\r\n switch (this.operation) {\r\n case BooleanGeometryOperations.Intersect:\r\n boolCSG = csg0.intersect(csg1);\r\n break;\r\n case BooleanGeometryOperations.Subtract:\r\n boolCSG = csg0.subtract(csg1);\r\n break;\r\n case BooleanGeometryOperations.Union:\r\n boolCSG = csg0.union(csg1);\r\n break;\r\n }\r\n } else {\r\n const csg0 = CSG2.FromVertexData(vertexData0);\r\n const csg1 = CSG2.FromVertexData(vertexData1);\r\n switch (this.operation) {\r\n case BooleanGeometryOperations.Intersect:\r\n boolCSG = csg0.intersect(csg1);\r\n break;\r\n case BooleanGeometryOperations.Subtract:\r\n boolCSG = csg0.subtract(csg1);\r\n break;\r\n case BooleanGeometryOperations.Union:\r\n boolCSG = csg0.add(csg1);\r\n break;\r\n }\r\n }\r\n\r\n return boolCSG.toVertexData();\r\n };\r\n\r\n if (this.evaluateContext) {\r\n this.output._storedFunction = func;\r\n } else {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = func(state);\r\n }\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n let codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? \"true\" : \"false\"};\\n`;\r\n codeString += `${this._codeVariableName}.operation = BABYLON.BooleanGeometryOperations.${BooleanGeometryOperations[this.operation]};\\n`;\r\n codeString += `${this._codeVariableName}.useOldCSGEngine = ${this.useOldCSGEngine ? \"true\" : \"false\"};\\n`;\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.evaluateContext = this.evaluateContext;\r\n serializationObject.operation = this.operation;\r\n serializationObject.useOldCSGEngine = this.useOldCSGEngine;\r\n\r\n return serializationObject;\r\n }\r\n\r\n /** @internal */\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.evaluateContext = serializationObject.evaluateContext;\r\n if (serializationObject.operation) {\r\n this.operation = serializationObject.operation;\r\n }\r\n\r\n this.useOldCSGEngine = !!serializationObject.useOldCSGEngine;\r\n }\r\n}\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for booleanGeometryBlock.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterBooleanGeometryBlock(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n RegisterClass(\"BABYLON.BooleanGeometryBlock\", BooleanGeometryBlock);\r\n}\r\n"]}
@@ -12,6 +12,7 @@ import { type SubMesh } from "../Meshes/subMesh.pure.js";
12
12
  import { PickingInfo } from "../Collisions/pickingInfo.js";
13
13
  import { type ICullable, BoundingInfo } from "../Culling/boundingInfo.js";
14
14
  import { type Material } from "../Materials/material.pure.js";
15
+ import { type DrawWrapper } from "../Materials/drawWrapper.js";
15
16
  import { type Light } from "../Lights/light.js";
16
17
  import { type Skeleton } from "../Bones/skeleton.js";
17
18
  import { type MorphTargetManager } from "../Morph/morphTargetManager.js";
@@ -418,6 +419,17 @@ export declare abstract class AbstractMesh extends TransformNode implements IDis
418
419
  * @param material material to use for this render pass. If undefined is passed, no specific material will be used for this render pass but the regular material will be used instead (mesh.material)
419
420
  */
420
421
  setMaterialForRenderPass(renderPassId: number, material?: Material): void;
422
+ /**
423
+ * Checks whether a submesh rendered by this mesh can resolve to the given material in a render pass it has a draw wrapper for.
424
+ * SubMesh.getMaterial resolves a pass to the mesh's material for that pass (or its material), the scene's default material when
425
+ * there is none, or a sub-material of a multi-material: any other material can never resolve to the given one. A mesh that
426
+ * customizes getMaterialForRenderPass is always a candidate.
427
+ * @param material defines the material to check
428
+ * @param drawWrappers defines the draw wrappers of the submesh, indexed by render pass id
429
+ * @returns false when no render pass with a draw wrapper can resolve to the material
430
+ * @internal
431
+ */
432
+ _mayRenderWithMaterial(material: Material, drawWrappers: Array<DrawWrapper>): boolean;
421
433
  /**
422
434
  * Gets or sets a boolean indicating that this mesh can receive realtime shadows
423
435
  * @see https://doc.babylonjs.com/features/featuresDeepDive/lights/shadows
@@ -533,6 +533,38 @@ let AbstractMesh = (() => {
533
533
  material.meshMap[this.uniqueId] = this;
534
534
  }
535
535
  }
536
+ /**
537
+ * Checks whether a submesh rendered by this mesh can resolve to the given material in a render pass it has a draw wrapper for.
538
+ * SubMesh.getMaterial resolves a pass to the mesh's material for that pass (or its material), the scene's default material when
539
+ * there is none, or a sub-material of a multi-material: any other material can never resolve to the given one. A mesh that
540
+ * customizes getMaterialForRenderPass is always a candidate.
541
+ * @param material defines the material to check
542
+ * @param drawWrappers defines the draw wrappers of the submesh, indexed by render pass id
543
+ * @returns false when no render pass with a draw wrapper can resolve to the material
544
+ * @internal
545
+ */
546
+ _mayRenderWithMaterial(material, drawWrappers) {
547
+ if (this.getMaterialForRenderPass !== _a.prototype.getMaterialForRenderPass) {
548
+ return true;
549
+ }
550
+ const meshMaterial = this.material;
551
+ if (meshMaterial === material || !meshMaterial || meshMaterial.getSubMaterial !== undefined) {
552
+ return true;
553
+ }
554
+ const materialForRenderPass = this._internalAbstractMeshDataInfo._materialForRenderPass;
555
+ if (materialForRenderPass) {
556
+ // The array is indexed by render pass id and keeps its length when an override is removed: only the passes with a draw
557
+ // wrapper matter
558
+ const passCount = Math.min(drawWrappers.length, materialForRenderPass.length);
559
+ for (let passId = 0; passId < passCount; passId++) {
560
+ const passMaterial = materialForRenderPass[passId];
561
+ if (passMaterial && drawWrappers[passId] && (passMaterial === material || passMaterial.getSubMaterial !== undefined)) {
562
+ return true;
563
+ }
564
+ }
565
+ }
566
+ return false;
567
+ }
536
568
  /**
537
569
  * Gets or sets a boolean indicating that this mesh can receive realtime shadows
538
570
  * @see https://doc.babylonjs.com/features/featuresDeepDive/lights/shadows