@onerjs/core 8.56.4 → 9.0.0

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 (482) hide show
  1. package/Animations/animatable.core.js +36 -0
  2. package/Animations/animatable.core.js.map +1 -1
  3. package/Animations/animationGroup.pure.d.ts +61 -1
  4. package/Animations/animationGroup.pure.js +191 -2
  5. package/Animations/animationGroup.pure.js.map +1 -1
  6. package/Animations/index.d.ts +1 -0
  7. package/Animations/index.js +1 -0
  8. package/Animations/index.js.map +1 -1
  9. package/Animations/pure.d.ts +1 -0
  10. package/Animations/pure.js +1 -0
  11. package/Animations/pure.js.map +1 -1
  12. package/Animations/rootMotion.d.ts +560 -0
  13. package/Animations/rootMotion.js +1709 -0
  14. package/Animations/rootMotion.js.map +1 -0
  15. package/Animations/runtimeAnimation.d.ts +57 -0
  16. package/Animations/runtimeAnimation.js +127 -3
  17. package/Animations/runtimeAnimation.js.map +1 -1
  18. package/Cameras/arcRotateCamera.pure.d.ts +2 -0
  19. package/Cameras/arcRotateCamera.pure.js +2 -0
  20. package/Cameras/arcRotateCamera.pure.js.map +1 -1
  21. package/Cameras/targetCamera.pure.d.ts +2 -0
  22. package/Cameras/targetCamera.pure.js +7 -1
  23. package/Cameras/targetCamera.pure.js.map +1 -1
  24. package/Collisions/gpuPicker.js +5 -5
  25. package/Collisions/gpuPicker.js.map +1 -1
  26. package/Engines/AbstractEngine/abstractEngine.query.pure.js +4 -2
  27. package/Engines/AbstractEngine/abstractEngine.query.pure.js.map +1 -1
  28. package/Engines/AbstractEngine/abstractEngine.query.types.d.ts +11 -2
  29. package/Engines/AbstractEngine/abstractEngine.query.types.js.map +1 -1
  30. package/Engines/AbstractEngine/abstractEngine.renderPass.pure.js +1 -0
  31. package/Engines/AbstractEngine/abstractEngine.renderPass.pure.js.map +1 -1
  32. package/Engines/Extensions/engine.multiRender.pure.js +63 -0
  33. package/Engines/Extensions/engine.multiRender.pure.js.map +1 -1
  34. package/Engines/Extensions/engine.multiRender.types.d.ts +13 -0
  35. package/Engines/Extensions/engine.multiRender.types.js.map +1 -1
  36. package/Engines/Extensions/engine.prefilteredCubeTexture.pure.js +2 -2
  37. package/Engines/Extensions/engine.prefilteredCubeTexture.pure.js.map +1 -1
  38. package/Engines/Extensions/engine.prefilteredCubeTexture.types.d.ts +2 -1
  39. package/Engines/Extensions/engine.prefilteredCubeTexture.types.js.map +1 -1
  40. package/Engines/Extensions/index.d.ts +1 -0
  41. package/Engines/Extensions/index.js +1 -0
  42. package/Engines/Extensions/index.js.map +1 -1
  43. package/Engines/Extensions/pure.d.ts +1 -1
  44. package/Engines/Extensions/pure.js +1 -1
  45. package/Engines/Extensions/pure.js.map +1 -1
  46. package/Engines/Native/Extensions/nativeEngine.cubeTexture.pure.js +88 -39
  47. package/Engines/Native/Extensions/nativeEngine.cubeTexture.pure.js.map +1 -1
  48. package/Engines/Native/Extensions/nativeEngine.cubeTexture.types.d.ts +20 -2
  49. package/Engines/Native/Extensions/nativeEngine.cubeTexture.types.js.map +1 -1
  50. package/Engines/WebGPU/Extensions/engine.multiRender.pure.js +4 -0
  51. package/Engines/WebGPU/Extensions/engine.multiRender.pure.js.map +1 -1
  52. package/Engines/WebGPU/Extensions/engine.multiRender.types.d.ts +13 -0
  53. package/Engines/WebGPU/Extensions/engine.multiRender.types.js.map +1 -1
  54. package/Engines/WebGPU/Extensions/engine.query.pure.js +11 -3
  55. package/Engines/WebGPU/Extensions/engine.query.pure.js.map +1 -1
  56. package/Engines/WebGPU/Extensions/index.d.ts +1 -0
  57. package/Engines/WebGPU/Extensions/index.js +1 -0
  58. package/Engines/WebGPU/Extensions/index.js.map +1 -1
  59. package/Engines/WebGPU/Extensions/pure.d.ts +1 -1
  60. package/Engines/WebGPU/Extensions/pure.js +1 -1
  61. package/Engines/WebGPU/Extensions/pure.js.map +1 -1
  62. package/Engines/WebGPU/webgpuBundleList.d.ts +2 -0
  63. package/Engines/WebGPU/webgpuBundleList.js +4 -0
  64. package/Engines/WebGPU/webgpuBundleList.js.map +1 -1
  65. package/Engines/WebGPU/webgpuCacheRenderPipeline.js +5 -2
  66. package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
  67. package/Engines/WebGPU/webgpuHardwareTexture.js +3 -1
  68. package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
  69. package/Engines/WebGPU/webgpuOcclusionQuery.js +1 -1
  70. package/Engines/WebGPU/webgpuOcclusionQuery.js.map +1 -1
  71. package/Engines/WebGPU/webgpuSnapshotRendering.d.ts +4 -0
  72. package/Engines/WebGPU/webgpuSnapshotRendering.js +40 -7
  73. package/Engines/WebGPU/webgpuSnapshotRendering.js.map +1 -1
  74. package/Engines/WebGPU/webgpuTextureHelper.d.ts +1 -1
  75. package/Engines/WebGPU/webgpuTextureHelper.js +2 -2
  76. package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
  77. package/Engines/WebGPU/webgpuTextureManager.d.ts +2 -0
  78. package/Engines/WebGPU/webgpuTextureManager.js +286 -13
  79. package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
  80. package/Engines/abstractEngine.pure.d.ts +2 -0
  81. package/Engines/abstractEngine.pure.js +7 -3
  82. package/Engines/abstractEngine.pure.js.map +1 -1
  83. package/Engines/constants.d.ts +4 -0
  84. package/Engines/constants.js +4 -0
  85. package/Engines/constants.js.map +1 -1
  86. package/Engines/thinEngine.pure.d.ts +14 -0
  87. package/Engines/thinEngine.pure.js +48 -12
  88. package/Engines/thinEngine.pure.js.map +1 -1
  89. package/Engines/thinNativeEngine.pure.d.ts +1 -0
  90. package/Engines/thinNativeEngine.pure.js +7 -1
  91. package/Engines/thinNativeEngine.pure.js.map +1 -1
  92. package/Engines/thinWebGPUEngine.d.ts +4 -0
  93. package/Engines/thinWebGPUEngine.js +10 -1
  94. package/Engines/thinWebGPUEngine.js.map +1 -1
  95. package/Engines/webgpuEngine.pure.d.ts +5 -2
  96. package/Engines/webgpuEngine.pure.js +48 -13
  97. package/Engines/webgpuEngine.pure.js.map +1 -1
  98. package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.pure.js +2 -2
  99. package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.pure.js.map +1 -1
  100. package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.pure.d.ts +11 -2
  101. package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.pure.js +1 -1
  102. package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.pure.js.map +1 -1
  103. package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.pure.d.ts +9 -1
  104. package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.pure.js +6 -8
  105. package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.pure.js.map +1 -1
  106. package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.pure.d.ts +2 -0
  107. package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.pure.js +5 -1
  108. package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.pure.js.map +1 -1
  109. package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.pure.d.ts +2 -0
  110. package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.pure.js +5 -1
  111. package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.pure.js.map +1 -1
  112. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.pure.d.ts +9 -0
  113. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.pure.js +34 -9
  114. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.pure.js.map +1 -1
  115. package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.pure.d.ts +2 -0
  116. package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.pure.js +4 -0
  117. package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.pure.js.map +1 -1
  118. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.d.ts +2 -0
  119. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.js +4 -0
  120. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.js.map +1 -1
  121. package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.pure.js +19 -7
  122. package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.pure.js.map +1 -1
  123. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.d.ts +20 -2
  124. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.js +53 -10
  125. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.js.map +1 -1
  126. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.pure.d.ts +16 -1
  127. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.pure.js +64 -14
  128. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.pure.js.map +1 -1
  129. package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.pure.js +64 -16
  130. package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.pure.js.map +1 -1
  131. package/FlowGraph/flowGraph.d.ts +4 -0
  132. package/FlowGraph/flowGraph.js +38 -7
  133. package/FlowGraph/flowGraph.js.map +1 -1
  134. package/FlowGraph/flowGraphBlock.js +3 -0
  135. package/FlowGraph/flowGraphBlock.js.map +1 -1
  136. package/FlowGraph/flowGraphConnection.d.ts +7 -0
  137. package/FlowGraph/flowGraphConnection.js +7 -0
  138. package/FlowGraph/flowGraphConnection.js.map +1 -1
  139. package/FlowGraph/flowGraphContext.d.ts +2 -1
  140. package/FlowGraph/flowGraphContext.js +4 -3
  141. package/FlowGraph/flowGraphContext.js.map +1 -1
  142. package/FlowGraph/flowGraphCoordinator.d.ts +15 -1
  143. package/FlowGraph/flowGraphCoordinator.js +47 -16
  144. package/FlowGraph/flowGraphCoordinator.js.map +1 -1
  145. package/FlowGraph/flowGraphEventBlock.d.ts +5 -0
  146. package/FlowGraph/flowGraphEventBlock.js +7 -0
  147. package/FlowGraph/flowGraphEventBlock.js.map +1 -1
  148. package/FlowGraph/flowGraphHostResolver.d.ts +2 -1
  149. package/FlowGraph/flowGraphHostResolver.js.map +1 -1
  150. package/FlowGraph/flowGraphParser.js +60 -2
  151. package/FlowGraph/flowGraphParser.js.map +1 -1
  152. package/FlowGraph/serialization.d.ts +2 -0
  153. package/FlowGraph/serialization.js +10 -22
  154. package/FlowGraph/serialization.js.map +1 -1
  155. package/FlowGraph/typeDefinitions.d.ts +8 -0
  156. package/FlowGraph/typeDefinitions.js.map +1 -1
  157. package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.d.ts +5 -0
  158. package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.js +8 -0
  159. package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.js.map +1 -0
  160. package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.pure.d.ts +87 -0
  161. package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.pure.js +295 -0
  162. package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.pure.js.map +1 -0
  163. package/FrameGraph/Node/Blocks/PostProcesses/pure.d.ts +1 -0
  164. package/FrameGraph/Node/Blocks/PostProcesses/pure.js +1 -0
  165. package/FrameGraph/Node/Blocks/PostProcesses/pure.js.map +1 -1
  166. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +4 -4
  167. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
  168. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.d.ts +5 -1
  169. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.js +13 -1
  170. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.js.map +1 -1
  171. package/FrameGraph/Node/Blocks/allBlocks.pure.js +2 -0
  172. package/FrameGraph/Node/Blocks/allBlocks.pure.js.map +1 -1
  173. package/FrameGraph/Node/Blocks/index.d.ts +1 -0
  174. package/FrameGraph/Node/Blocks/index.js +1 -0
  175. package/FrameGraph/Node/Blocks/index.js.map +1 -1
  176. package/FrameGraph/Node/Blocks/inputBlock.pure.js +20 -1
  177. package/FrameGraph/Node/Blocks/inputBlock.pure.js.map +1 -1
  178. package/FrameGraph/Node/Blocks/pure.d.ts +1 -0
  179. package/FrameGraph/Node/Blocks/pure.js +1 -0
  180. package/FrameGraph/Node/Blocks/pure.js.map +1 -1
  181. package/FrameGraph/Node/Types/nodeRenderGraphTypes.d.ts +4 -2
  182. package/FrameGraph/Node/Types/nodeRenderGraphTypes.js +4 -2
  183. package/FrameGraph/Node/Types/nodeRenderGraphTypes.js.map +1 -1
  184. package/FrameGraph/Node/nodeRenderGraph.js +1 -1
  185. package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
  186. package/FrameGraph/Tasks/Layers/selectionOutlineTask.js +1 -0
  187. package/FrameGraph/Tasks/Layers/selectionOutlineTask.js.map +1 -1
  188. package/FrameGraph/Tasks/Misc/cullObjectsTask.js +5 -1
  189. package/FrameGraph/Tasks/Misc/cullObjectsTask.js.map +1 -1
  190. package/FrameGraph/Tasks/Misc/lightingVolumeTask.js +1 -0
  191. package/FrameGraph/Tasks/Misc/lightingVolumeTask.js.map +1 -1
  192. package/FrameGraph/Tasks/PostProcesses/meshBlendingTask.d.ts +69 -0
  193. package/FrameGraph/Tasks/PostProcesses/meshBlendingTask.js +223 -0
  194. package/FrameGraph/Tasks/PostProcesses/meshBlendingTask.js.map +1 -0
  195. package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +25 -3
  196. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +69 -33
  197. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
  198. package/FrameGraph/Tasks/Rendering/objectRendererTask.js +3 -1
  199. package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
  200. package/FrameGraph/frameGraphObjectList.d.ts +6 -1
  201. package/FrameGraph/frameGraphObjectList.js.map +1 -1
  202. package/FrameGraph/frameGraphRenderContext.d.ts +3 -1
  203. package/FrameGraph/frameGraphRenderContext.js +5 -5
  204. package/FrameGraph/frameGraphRenderContext.js.map +1 -1
  205. package/FrameGraph/index.d.ts +1 -0
  206. package/FrameGraph/index.js +1 -0
  207. package/FrameGraph/index.js.map +1 -1
  208. package/FrameGraph/pure.d.ts +1 -0
  209. package/FrameGraph/pure.js +1 -0
  210. package/FrameGraph/pure.js.map +1 -1
  211. package/Inputs/scene.inputManager.d.ts +4 -0
  212. package/Inputs/scene.inputManager.js +50 -8
  213. package/Inputs/scene.inputManager.js.map +1 -1
  214. package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js +5 -5
  215. package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js.map +1 -1
  216. package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js +5 -5
  217. package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js.map +1 -1
  218. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.d.ts +26 -1
  219. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js +151 -47
  220. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js.map +1 -1
  221. package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.pure.js +5 -5
  222. package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.pure.js.map +1 -1
  223. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.pure.js +11 -1
  224. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.pure.js.map +1 -1
  225. package/Materials/Node/Blocks/Fragment/prePassOutputBlock.pure.js +17 -2
  226. package/Materials/Node/Blocks/Fragment/prePassOutputBlock.pure.js.map +1 -1
  227. package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.pure.js +2 -2
  228. package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.pure.js.map +1 -1
  229. package/Materials/Node/nodeMaterial.pure.d.ts +4 -0
  230. package/Materials/Node/nodeMaterial.pure.js +4 -0
  231. package/Materials/Node/nodeMaterial.pure.js.map +1 -1
  232. package/Materials/Node/nodeMaterialBuildState.d.ts +1 -1
  233. package/Materials/Node/nodeMaterialBuildState.js +25 -3
  234. package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
  235. package/Materials/PBR/openpbrMaterial.pure.d.ts +2 -0
  236. package/Materials/PBR/pbrBaseMaterial.pure.d.ts +2 -0
  237. package/Materials/Textures/Procedurals/proceduralTexture.pure.d.ts +13 -14
  238. package/Materials/Textures/Procedurals/proceduralTexture.pure.js +6 -6
  239. package/Materials/Textures/Procedurals/proceduralTexture.pure.js.map +1 -1
  240. package/Materials/Textures/baseTexture.pure.js +3 -0
  241. package/Materials/Textures/baseTexture.pure.js.map +1 -1
  242. package/Materials/Textures/cubeTexture.pure.js +1 -1
  243. package/Materials/Textures/cubeTexture.pure.js.map +1 -1
  244. package/Materials/Textures/internalTexture.d.ts +8 -1
  245. package/Materials/Textures/internalTexture.js +9 -2
  246. package/Materials/Textures/internalTexture.js.map +1 -1
  247. package/Materials/Textures/rawTexture2DArray.functions.d.ts +3 -3
  248. package/Materials/Textures/rawTexture2DArray.functions.js.map +1 -1
  249. package/Materials/Textures/rawTexture3D.d.ts +1 -1
  250. package/Materials/Textures/rawTexture3D.js +1 -1
  251. package/Materials/Textures/rawTexture3D.js.map +1 -1
  252. package/Materials/Textures/textureHelper.functions.d.ts +14 -0
  253. package/Materials/Textures/textureHelper.functions.js +24 -0
  254. package/Materials/Textures/textureHelper.functions.js.map +1 -1
  255. package/Materials/ditheredTileFadeMaterialPlugin.d.ts +210 -0
  256. package/Materials/ditheredTileFadeMaterialPlugin.js +509 -0
  257. package/Materials/ditheredTileFadeMaterialPlugin.js.map +1 -0
  258. package/Materials/index.d.ts +1 -0
  259. package/Materials/index.js +1 -0
  260. package/Materials/index.js.map +1 -1
  261. package/Materials/materialHelper.geometryrendering.d.ts +46 -1
  262. package/Materials/materialHelper.geometryrendering.js +105 -8
  263. package/Materials/materialHelper.geometryrendering.js.map +1 -1
  264. package/Materials/prepass.defines.d.ts +2 -0
  265. package/Materials/prepass.defines.js +2 -0
  266. package/Materials/prepass.defines.js.map +1 -1
  267. package/Materials/pure.d.ts +1 -0
  268. package/Materials/pure.js +1 -0
  269. package/Materials/pure.js.map +1 -1
  270. package/Materials/standardMaterial.pure.d.ts +2 -0
  271. package/Materials/standardMaterial.pure.js +6 -3
  272. package/Materials/standardMaterial.pure.js.map +1 -1
  273. package/Meshes/Builders/polygonBuilder.pure.d.ts +4 -0
  274. package/Meshes/Builders/polygonBuilder.pure.js +4 -1
  275. package/Meshes/Builders/polygonBuilder.pure.js.map +1 -1
  276. package/Meshes/GaussianSplatting/gaussianSplatting.functions.d.ts +19 -0
  277. package/Meshes/GaussianSplatting/gaussianSplatting.functions.js +23 -0
  278. package/Meshes/GaussianSplatting/gaussianSplatting.functions.js.map +1 -0
  279. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.d.ts +3 -14
  280. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js +20 -24
  281. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js.map +1 -1
  282. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +2 -0
  283. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +11 -4
  284. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
  285. package/Meshes/abstractMesh.pure.d.ts +18 -0
  286. package/Meshes/abstractMesh.pure.js +22 -0
  287. package/Meshes/abstractMesh.pure.js.map +1 -1
  288. package/Meshes/index.d.ts +1 -0
  289. package/Meshes/index.js +1 -0
  290. package/Meshes/index.js.map +1 -1
  291. package/Meshes/instancedMesh.pure.d.ts +5 -0
  292. package/Meshes/instancedMesh.pure.js +12 -0
  293. package/Meshes/instancedMesh.pure.js.map +1 -1
  294. package/Meshes/mesh.pure.js +23 -8
  295. package/Meshes/mesh.pure.js.map +1 -1
  296. package/Meshes/meshBlendingTag.d.ts +47 -0
  297. package/Meshes/meshBlendingTag.js +64 -0
  298. package/Meshes/meshBlendingTag.js.map +1 -0
  299. package/Meshes/polygonMesh.js +2 -2
  300. package/Meshes/polygonMesh.js.map +1 -1
  301. package/Meshes/pure.d.ts +1 -0
  302. package/Meshes/pure.js +1 -0
  303. package/Meshes/pure.js.map +1 -1
  304. package/Misc/fileTools.pure.js +21 -0
  305. package/Misc/fileTools.pure.js.map +1 -1
  306. package/Misc/snapshotRenderingHelper.js +2 -2
  307. package/Misc/snapshotRenderingHelper.js.map +1 -1
  308. package/Misc/tools.pure.js +1 -1
  309. package/Misc/tools.pure.js.map +1 -1
  310. package/Particles/gpuParticleSystem.pure.d.ts +2 -0
  311. package/Particles/gpuParticleSystem.pure.js +89 -28
  312. package/Particles/gpuParticleSystem.pure.js.map +1 -1
  313. package/Particles/thinParticleSystem.pure.d.ts +2 -0
  314. package/Particles/thinParticleSystem.pure.js +84 -19
  315. package/Particles/thinParticleSystem.pure.js.map +1 -1
  316. package/Particles/webgl2ParticleSystem.pure.d.ts +1 -0
  317. package/Particles/webgl2ParticleSystem.pure.js +12 -4
  318. package/Particles/webgl2ParticleSystem.pure.js.map +1 -1
  319. package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.pure.js +7 -0
  320. package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.pure.js.map +1 -1
  321. package/PostProcesses/index.d.ts +2 -0
  322. package/PostProcesses/index.js +2 -0
  323. package/PostProcesses/index.js.map +1 -1
  324. package/PostProcesses/meshBlendingBlueNoise.d.ts +15 -0
  325. package/PostProcesses/meshBlendingBlueNoise.js +77 -0
  326. package/PostProcesses/meshBlendingBlueNoise.js.map +1 -0
  327. package/PostProcesses/meshBlendingPostProcess.d.ts +131 -0
  328. package/PostProcesses/meshBlendingPostProcess.js +315 -0
  329. package/PostProcesses/meshBlendingPostProcess.js.map +1 -0
  330. package/PostProcesses/pure.d.ts +2 -0
  331. package/PostProcesses/pure.js +2 -0
  332. package/PostProcesses/pure.js.map +1 -1
  333. package/PostProcesses/thinMeshBlendingPostProcess.d.ts +339 -0
  334. package/PostProcesses/thinMeshBlendingPostProcess.js +771 -0
  335. package/PostProcesses/thinMeshBlendingPostProcess.js.map +1 -0
  336. package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js +6 -6
  337. package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js.map +1 -1
  338. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js +8 -8
  339. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js.map +1 -1
  340. package/Rendering/boundingBoxRenderer.pure.js +2 -1
  341. package/Rendering/boundingBoxRenderer.pure.js.map +1 -1
  342. package/Rendering/depthRenderer.pure.js +3 -4
  343. package/Rendering/depthRenderer.pure.js.map +1 -1
  344. package/Rendering/edgesRenderer.pure.d.ts +4 -2
  345. package/Rendering/edgesRenderer.pure.js +11 -2
  346. package/Rendering/edgesRenderer.pure.js.map +1 -1
  347. package/Rendering/fluidRenderer/fluidRenderingObject.d.ts +10 -0
  348. package/Rendering/fluidRenderer/fluidRenderingObject.js +20 -0
  349. package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
  350. package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.d.ts +9 -3
  351. package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js +14 -9
  352. package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js.map +1 -1
  353. package/Rendering/geometryBufferRenderer.pure.d.ts +38 -4
  354. package/Rendering/geometryBufferRenderer.pure.js +126 -17
  355. package/Rendering/geometryBufferRenderer.pure.js.map +1 -1
  356. package/Rendering/objectRenderer.d.ts +7 -1
  357. package/Rendering/objectRenderer.js +45 -7
  358. package/Rendering/objectRenderer.js.map +1 -1
  359. package/Rendering/outlineRenderer.pure.js +6 -2
  360. package/Rendering/outlineRenderer.pure.js.map +1 -1
  361. package/Rendering/renderingManager.d.ts +1 -1
  362. package/Rendering/renderingManager.js +5 -4
  363. package/Rendering/renderingManager.js.map +1 -1
  364. package/Shaders/ShadersInclude/defaultFragmentAlpha.d.ts +5 -0
  365. package/Shaders/ShadersInclude/defaultFragmentAlpha.js +34 -0
  366. package/Shaders/ShadersInclude/defaultFragmentAlpha.js.map +1 -0
  367. package/Shaders/ShadersInclude/gaussianSplattingVertexDeclaration.js +5 -1
  368. package/Shaders/ShadersInclude/gaussianSplattingVertexDeclaration.js.map +1 -1
  369. package/Shaders/ShadersInclude/geometryRenderingFragment.d.ts +5 -0
  370. package/Shaders/ShadersInclude/geometryRenderingFragment.js +74 -0
  371. package/Shaders/ShadersInclude/geometryRenderingFragment.js.map +1 -0
  372. package/Shaders/ShadersInclude/mrtFragmentDeclaration.js +89 -0
  373. package/Shaders/ShadersInclude/mrtFragmentDeclaration.js.map +1 -1
  374. package/Shaders/ShadersInclude/openpbrBlockPrePass.js +24 -17
  375. package/Shaders/ShadersInclude/openpbrBlockPrePass.js.map +1 -1
  376. package/Shaders/ShadersInclude/pbrBlockPrePass.js +27 -20
  377. package/Shaders/ShadersInclude/pbrBlockPrePass.js.map +1 -1
  378. package/Shaders/ShadersInclude/pbrDebug.js +6 -2
  379. package/Shaders/ShadersInclude/pbrDebug.js.map +1 -1
  380. package/Shaders/ShadersInclude/prePassDeclaration.js +95 -2
  381. package/Shaders/ShadersInclude/prePassDeclaration.js.map +1 -1
  382. package/Shaders/default.fragment.js +31 -40
  383. package/Shaders/default.fragment.js.map +1 -1
  384. package/Shaders/depthOfField.fragment.js +13 -9
  385. package/Shaders/depthOfField.fragment.js.map +1 -1
  386. package/Shaders/fluidRenderingParticleDepth.vertex.js +16 -1
  387. package/Shaders/fluidRenderingParticleDepth.vertex.js.map +1 -1
  388. package/Shaders/fluidRenderingParticleThickness.vertex.js +16 -1
  389. package/Shaders/fluidRenderingParticleThickness.vertex.js.map +1 -1
  390. package/Shaders/gaussianSplatting.fragment.js +63 -3
  391. package/Shaders/gaussianSplatting.fragment.js.map +1 -1
  392. package/Shaders/gaussianSplatting.vertex.js +80 -0
  393. package/Shaders/gaussianSplatting.vertex.js.map +1 -1
  394. package/Shaders/geometry.fragment.js +17 -11
  395. package/Shaders/geometry.fragment.js.map +1 -1
  396. package/Shaders/gpuRenderParticles.fragment.js +43 -1
  397. package/Shaders/gpuRenderParticles.fragment.js.map +1 -1
  398. package/Shaders/gpuRenderParticles.vertex.js +96 -16
  399. package/Shaders/gpuRenderParticles.vertex.js.map +1 -1
  400. package/Shaders/meshBlending.fragment.d.ts +5 -0
  401. package/Shaders/meshBlending.fragment.js +519 -0
  402. package/Shaders/meshBlending.fragment.js.map +1 -0
  403. package/Shaders/particles.fragment.js +43 -1
  404. package/Shaders/particles.fragment.js.map +1 -1
  405. package/Shaders/particles.vertex.js +84 -3
  406. package/Shaders/particles.vertex.js.map +1 -1
  407. package/Shaders/sprites.fragment.js +52 -2
  408. package/Shaders/sprites.fragment.js.map +1 -1
  409. package/Shaders/sprites.vertex.js +62 -1
  410. package/Shaders/sprites.vertex.js.map +1 -1
  411. package/ShadersWGSL/ShadersInclude/defaultFragmentAlpha.d.ts +5 -0
  412. package/ShadersWGSL/ShadersInclude/defaultFragmentAlpha.js +33 -0
  413. package/ShadersWGSL/ShadersInclude/defaultFragmentAlpha.js.map +1 -0
  414. package/ShadersWGSL/ShadersInclude/geometryRenderingFragment.d.ts +6 -0
  415. package/ShadersWGSL/ShadersInclude/geometryRenderingFragment.js +76 -0
  416. package/ShadersWGSL/ShadersInclude/geometryRenderingFragment.js.map +1 -0
  417. package/ShadersWGSL/ShadersInclude/lightFragment.js +1 -1
  418. package/ShadersWGSL/ShadersInclude/lightFragment.js.map +1 -1
  419. package/ShadersWGSL/ShadersInclude/meshBlendTagFragmentOutput.d.ts +5 -0
  420. package/ShadersWGSL/ShadersInclude/meshBlendTagFragmentOutput.js +18 -0
  421. package/ShadersWGSL/ShadersInclude/meshBlendTagFragmentOutput.js.map +1 -0
  422. package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.d.ts +1 -0
  423. package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.js +11 -25
  424. package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.js.map +1 -1
  425. package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.d.ts +1 -0
  426. package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js +11 -25
  427. package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js.map +1 -1
  428. package/ShadersWGSL/ShadersInclude/pbrDebug.js +5 -1
  429. package/ShadersWGSL/ShadersInclude/pbrDebug.js.map +1 -1
  430. package/ShadersWGSL/ShadersInclude/prePassDeclaration.js +6 -1
  431. package/ShadersWGSL/ShadersInclude/prePassDeclaration.js.map +1 -1
  432. package/ShadersWGSL/default.fragment.js +17 -48
  433. package/ShadersWGSL/default.fragment.js.map +1 -1
  434. package/ShadersWGSL/fluidRenderingParticleDepth.vertex.js +15 -2
  435. package/ShadersWGSL/fluidRenderingParticleDepth.vertex.js.map +1 -1
  436. package/ShadersWGSL/fluidRenderingParticleThickness.vertex.js +15 -2
  437. package/ShadersWGSL/fluidRenderingParticleThickness.vertex.js.map +1 -1
  438. package/ShadersWGSL/gaussianSplatting.fragment.js +63 -2
  439. package/ShadersWGSL/gaussianSplatting.fragment.js.map +1 -1
  440. package/ShadersWGSL/gaussianSplatting.vertex.js +80 -0
  441. package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
  442. package/ShadersWGSL/geometry.fragment.js +37 -2
  443. package/ShadersWGSL/geometry.fragment.js.map +1 -1
  444. package/ShadersWGSL/gpuRenderParticles.fragment.js +47 -2
  445. package/ShadersWGSL/gpuRenderParticles.fragment.js.map +1 -1
  446. package/ShadersWGSL/gpuRenderParticles.vertex.js +110 -7
  447. package/ShadersWGSL/gpuRenderParticles.vertex.js.map +1 -1
  448. package/ShadersWGSL/meshBlending.fragment.d.ts +5 -0
  449. package/ShadersWGSL/meshBlending.fragment.js +576 -0
  450. package/ShadersWGSL/meshBlending.fragment.js.map +1 -0
  451. package/ShadersWGSL/openpbr.fragment.js +2 -1
  452. package/ShadersWGSL/openpbr.fragment.js.map +1 -1
  453. package/ShadersWGSL/particles.fragment.js +45 -1
  454. package/ShadersWGSL/particles.fragment.js.map +1 -1
  455. package/ShadersWGSL/particles.vertex.js +86 -4
  456. package/ShadersWGSL/particles.vertex.js.map +1 -1
  457. package/ShadersWGSL/pbr.fragment.js +2 -1
  458. package/ShadersWGSL/pbr.fragment.js.map +1 -1
  459. package/ShadersWGSL/sprites.fragment.js +56 -2
  460. package/ShadersWGSL/sprites.fragment.js.map +1 -1
  461. package/ShadersWGSL/sprites.vertex.js +62 -1
  462. package/ShadersWGSL/sprites.vertex.js.map +1 -1
  463. package/Sprites/spriteManager.d.ts +13 -0
  464. package/Sprites/spriteManager.js +15 -0
  465. package/Sprites/spriteManager.js.map +1 -1
  466. package/Sprites/spriteRenderer.d.ts +24 -1
  467. package/Sprites/spriteRenderer.js +368 -50
  468. package/Sprites/spriteRenderer.js.map +1 -1
  469. package/Sprites/thinSprite.d.ts +4 -0
  470. package/Sprites/thinSprite.js +4 -0
  471. package/Sprites/thinSprite.js.map +1 -1
  472. package/States/alphaCullingState.d.ts +3 -1
  473. package/States/alphaCullingState.js +18 -3
  474. package/States/alphaCullingState.js.map +1 -1
  475. package/XR/webXRDefaultExperience.d.ts +5 -1
  476. package/XR/webXRDefaultExperience.js.map +1 -1
  477. package/XR/webXREnterExitUI.d.ts +2 -1
  478. package/XR/webXREnterExitUI.js.map +1 -1
  479. package/package.json +1 -1
  480. package/scene.pure.d.ts +23 -0
  481. package/scene.pure.js +35 -0
  482. package/scene.pure.js.map +1 -1
@@ -26,6 +26,7 @@ export declare function CreatePolygonVertexData(polygon: Mesh, sideOrientation:
26
26
  * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
27
27
  * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4)
28
28
  * * Remember you can only change the shape positions, not their number when updating a polygon
29
+ * * The `smoothingThreshold` option defines the dot product threshold for smoothing the normals of adjacent side faces. The default value of 2 disables smoothing
29
30
  * @param name defines the name of the mesh
30
31
  * @param options defines the options used to create the mesh
31
32
  * @param scene defines the hosting scene
@@ -49,7 +50,9 @@ export declare function CreatePolygon(name: string, options: {
49
50
  /**
50
51
  * Creates an extruded polygon mesh, with depth in the Y direction.
51
52
  * * You can set different colors and different images to the top, bottom and extruded side by using the parameters `faceColors` (an array of 3 Color3 elements) and `faceUV` (an array of 3 Vector4 elements)
53
+ * * The `smoothingThreshold` option defines the dot product threshold for smoothing the normals of adjacent side faces. The default value of 2 disables smoothing
52
54
  * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/texturePerBoxFace
55
+ * @see https://playground.babylonjs.com/#TJLZLN#0
53
56
  * @param name defines the name of the mesh
54
57
  * @param options defines the options used to create the mesh
55
58
  * @param scene defines the hosting scene
@@ -60,6 +63,7 @@ export declare function ExtrudePolygon(name: string, options: {
60
63
  shape: Vector3[];
61
64
  holes?: Vector3[][];
62
65
  depth?: number;
66
+ smoothingThreshold?: number;
63
67
  faceUV?: Vector4[];
64
68
  faceColors?: Color4[];
65
69
  updatable?: boolean;
@@ -128,6 +128,7 @@ export function CreatePolygonVertexData(polygon, sideOrientation, fUV, fColors,
128
128
  * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
129
129
  * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4)
130
130
  * * Remember you can only change the shape positions, not their number when updating a polygon
131
+ * * The `smoothingThreshold` option defines the dot product threshold for smoothing the normals of adjacent side faces. The default value of 2 disables smoothing
131
132
  * @param name defines the name of the mesh
132
133
  * @param options defines the options used to create the mesh
133
134
  * @param scene defines the hosting scene
@@ -139,7 +140,7 @@ export function CreatePolygon(name, options, scene = null, earcutInjection = ear
139
140
  const shape = options.shape;
140
141
  const holes = options.holes || [];
141
142
  const depth = options.depth || 0;
142
- const smoothingThreshold = options.smoothingThreshold || 2;
143
+ const smoothingThreshold = options.smoothingThreshold ?? 2;
143
144
  if (options.instance) {
144
145
  const vertexData = CreatePolygonVertexData(options.instance, options.sideOrientation, options.faceUV, options.faceColors, options.frontUVs, options.backUVs, options.wrap);
145
146
  vertexData.applyToMesh(options.instance, options.updatable);
@@ -174,7 +175,9 @@ export function CreatePolygon(name, options, scene = null, earcutInjection = ear
174
175
  /**
175
176
  * Creates an extruded polygon mesh, with depth in the Y direction.
176
177
  * * You can set different colors and different images to the top, bottom and extruded side by using the parameters `faceColors` (an array of 3 Color3 elements) and `faceUV` (an array of 3 Vector4 elements)
178
+ * * The `smoothingThreshold` option defines the dot product threshold for smoothing the normals of adjacent side faces. The default value of 2 disables smoothing
177
179
  * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/texturePerBoxFace
180
+ * @see https://playground.babylonjs.com/#TJLZLN#0
178
181
  * @param name defines the name of the mesh
179
182
  * @param options defines the options used to create the mesh
180
183
  * @param scene defines the hosting scene
@@ -1 +1 @@
1
- {"version":3,"file":"polygonBuilder.pure.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Builders/polygonBuilder.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAgB,MAAM,8BAA8B,CAAC;AAE9E,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,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This file must only contain pure code and pure imports */\r\n\r\nimport { Vector2, Vector4, type Vector3 } from \"../../Maths/math.vector.pure\";\r\n\r\nimport { Color4 } from \"../../Maths/math.color.pure\";\r\nimport { Mesh } from \"../mesh.pure\";\r\nimport { VertexData } from \"../mesh.vertexData\";\r\nimport { PolygonMeshBuilder } from \"../polygonMesh\";\r\nimport { type FloatArray, type IndicesArray, type Nullable } from \"../../types\";\r\nimport { VertexBuffer } from \"../../Buffers/buffer.pure\";\r\nimport { EngineStore } from \"../../Engines/engineStore\";\r\nimport { useOpenGLOrientationForUV } from \"../../Compat/compatibilityOptions\";\r\nimport { type Scene } from \"../../scene.pure\";\r\n\r\n/* eslint-disable @typescript-eslint/naming-convention */\r\n\r\ndeclare let earcut: any;\r\n\r\n/**\r\n * Creates the VertexData for an irregular Polygon in the XoZ plane using a mesh built by polygonTriangulation.build()\r\n * All parameters are provided by CreatePolygon as needed\r\n * @param polygon a mesh built from polygonTriangulation.build()\r\n * @param sideOrientation takes the values Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE\r\n * @param fUV an array of Vector4 elements used to set different images to the top, rings and bottom respectively\r\n * @param fColors an array of Color3 elements used to set different colors to the top, rings and bottom respectively\r\n * @param frontUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)\r\n * @param backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)\r\n * @param wrp a boolean, default false, when true and fUVs used texture is wrapped around all sides, when false texture is applied side\r\n * @returns the VertexData of the Polygon\r\n */\r\nexport function CreatePolygonVertexData(polygon: Mesh, sideOrientation: number, fUV?: Vector4[], fColors?: Color4[], frontUVs?: Vector4, backUVs?: Vector4, wrp?: boolean) {\r\n const faceUV: Vector4[] = fUV || new Array<Vector4>(3);\r\n const faceColors = fColors;\r\n const colors = [];\r\n const wrap: boolean = wrp || false;\r\n\r\n // default face colors and UV if undefined\r\n for (let f = 0; f < 3; f++) {\r\n if (faceUV[f] === undefined) {\r\n faceUV[f] = new Vector4(0, 0, 1, 1);\r\n }\r\n if (faceColors && faceColors[f] === undefined) {\r\n faceColors[f] = new Color4(1, 1, 1, 1);\r\n }\r\n }\r\n\r\n const positions = <FloatArray>polygon.getVerticesData(VertexBuffer.PositionKind);\r\n const normals = <FloatArray>polygon.getVerticesData(VertexBuffer.NormalKind);\r\n const uvs = <FloatArray>polygon.getVerticesData(VertexBuffer.UVKind);\r\n const indices = <IndicesArray>polygon.getIndices();\r\n const startIndex = positions.length / 9;\r\n let disp: number;\r\n let distX: number;\r\n let distZ: number;\r\n let dist: number;\r\n let totalLen = 0;\r\n const cumulate = [0];\r\n if (wrap) {\r\n for (let idx = startIndex; idx < positions.length / 3; idx += 4) {\r\n distX = positions[3 * (idx + 2)] - positions[3 * idx];\r\n distZ = positions[3 * (idx + 2) + 2] - positions[3 * idx + 2];\r\n dist = Math.sqrt(distX * distX + distZ * distZ);\r\n totalLen += dist;\r\n cumulate.push(totalLen);\r\n }\r\n }\r\n // set face colours and textures\r\n let idx: number;\r\n let face: number = 0;\r\n for (let index = 0; index < normals.length; index += 3) {\r\n //Edge Face no. 1\r\n if (Math.abs(normals[index + 1]) < 0.001) {\r\n face = 1;\r\n }\r\n //Top Face no. 0\r\n if (Math.abs(normals[index + 1] - 1) < 0.001) {\r\n face = 0;\r\n }\r\n //Bottom Face no. 2\r\n if (Math.abs(normals[index + 1] + 1) < 0.001) {\r\n face = 2;\r\n }\r\n idx = index / 3;\r\n if (face === 1) {\r\n disp = idx - startIndex;\r\n if (disp % 4 < 1.5) {\r\n if (wrap) {\r\n uvs[2 * idx] = faceUV[face].x + ((faceUV[face].z - faceUV[face].x) * cumulate[Math.floor(disp / 4)]) / totalLen;\r\n } else {\r\n uvs[2 * idx] = faceUV[face].x;\r\n }\r\n } else {\r\n if (wrap) {\r\n uvs[2 * idx] = faceUV[face].x + ((faceUV[face].z - faceUV[face].x) * cumulate[Math.floor(disp / 4) + 1]) / totalLen;\r\n } else {\r\n uvs[2 * idx] = faceUV[face].z;\r\n }\r\n }\r\n if (disp % 2 === 0) {\r\n uvs[2 * idx + 1] = useOpenGLOrientationForUV ? 1.0 - faceUV[face].w : faceUV[face].w;\r\n } else {\r\n uvs[2 * idx + 1] = useOpenGLOrientationForUV ? 1.0 - faceUV[face].y : faceUV[face].y;\r\n }\r\n } else {\r\n uvs[2 * idx] = (1 - uvs[2 * idx]) * faceUV[face].x + uvs[2 * idx] * faceUV[face].z;\r\n uvs[2 * idx + 1] = (1 - uvs[2 * idx + 1]) * faceUV[face].y + uvs[2 * idx + 1] * faceUV[face].w;\r\n\r\n if (useOpenGLOrientationForUV) {\r\n uvs[2 * idx + 1] = 1.0 - uvs[2 * idx + 1];\r\n }\r\n }\r\n if (faceColors) {\r\n colors.push(faceColors[face].r, faceColors[face].g, faceColors[face].b, faceColors[face].a);\r\n }\r\n }\r\n\r\n // sides\r\n VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs, frontUVs, backUVs);\r\n\r\n // Result\r\n const vertexData = new VertexData();\r\n vertexData.indices = indices;\r\n vertexData.positions = positions;\r\n vertexData.normals = normals;\r\n vertexData.uvs = uvs;\r\n\r\n if (faceColors) {\r\n const totalColors = sideOrientation === VertexData.DOUBLESIDE ? colors.concat(colors) : colors;\r\n vertexData.colors = totalColors;\r\n }\r\n\r\n return vertexData;\r\n}\r\n\r\n/**\r\n * Creates a polygon mesh\r\n * The polygon's shape will depend on the input parameters and is constructed parallel to a ground mesh\r\n * * The parameter `shape` is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors\r\n * * You can set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE\r\n * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created\r\n * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4)\r\n * * Remember you can only change the shape positions, not their number when updating a polygon\r\n * @param name defines the name of the mesh\r\n * @param options defines the options used to create the mesh\r\n * @param scene defines the hosting scene\r\n * @param earcutInjection can be used to inject your own earcut reference\r\n * @returns the polygon mesh\r\n */\r\nexport function CreatePolygon(\r\n name: string,\r\n options: {\r\n shape: Vector3[];\r\n holes?: Vector3[][];\r\n depth?: number;\r\n smoothingThreshold?: number;\r\n faceUV?: Vector4[];\r\n faceColors?: Color4[];\r\n updatable?: boolean;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n wrap?: boolean;\r\n instance?: Mesh;\r\n },\r\n scene: Nullable<Scene> = null,\r\n earcutInjection = earcut\r\n): Mesh {\r\n options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation);\r\n const shape = options.shape;\r\n const holes = options.holes || [];\r\n const depth = options.depth || 0;\r\n const smoothingThreshold = options.smoothingThreshold || 2;\r\n if (options.instance) {\r\n const vertexData = CreatePolygonVertexData(options.instance, options.sideOrientation, options.faceUV, options.faceColors, options.frontUVs, options.backUVs, options.wrap);\r\n vertexData.applyToMesh(options.instance, options.updatable);\r\n return options.instance;\r\n } else {\r\n const contours: Array<Vector2> = [];\r\n let hole: Array<Vector2>;\r\n\r\n for (let i = 0; i < shape.length; i++) {\r\n contours[i] = new Vector2(shape[i].x, shape[i].z);\r\n }\r\n const epsilon = 0.00000001;\r\n if (contours[0].equalsWithEpsilon(contours[contours.length - 1], epsilon)) {\r\n contours.pop();\r\n }\r\n\r\n const polygonTriangulation = new PolygonMeshBuilder(name, contours, scene || EngineStore.LastCreatedScene!, earcutInjection);\r\n for (let hNb = 0; hNb < holes.length; hNb++) {\r\n hole = [];\r\n for (let hPoint = 0; hPoint < holes[hNb].length; hPoint++) {\r\n hole.push(new Vector2(holes[hNb][hPoint].x, holes[hNb][hPoint].z));\r\n }\r\n polygonTriangulation.addHole(hole);\r\n }\r\n //updatability is set during applyToMesh; setting to true in triangulation build produces errors\r\n const polygon = polygonTriangulation.build(false, depth, smoothingThreshold);\r\n polygon._originalBuilderSideOrientation = options.sideOrientation;\r\n const vertexData = CreatePolygonVertexData(polygon, options.sideOrientation, options.faceUV, options.faceColors, options.frontUVs, options.backUVs, options.wrap);\r\n vertexData.applyToMesh(polygon, options.updatable);\r\n return polygon;\r\n }\r\n}\r\n\r\n/**\r\n * Creates an extruded polygon mesh, with depth in the Y direction.\r\n * * You can set different colors and different images to the top, bottom and extruded side by using the parameters `faceColors` (an array of 3 Color3 elements) and `faceUV` (an array of 3 Vector4 elements)\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/texturePerBoxFace\r\n * @param name defines the name of the mesh\r\n * @param options defines the options used to create the mesh\r\n * @param scene defines the hosting scene\r\n * @param earcutInjection can be used to inject your own earcut reference\r\n * @returns the polygon mesh\r\n */\r\nexport function ExtrudePolygon(\r\n name: string,\r\n options: {\r\n shape: Vector3[];\r\n holes?: Vector3[][];\r\n depth?: number;\r\n faceUV?: Vector4[];\r\n faceColors?: Color4[];\r\n updatable?: boolean;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n wrap?: boolean;\r\n },\r\n scene: Nullable<Scene> = null,\r\n earcutInjection = earcut\r\n): Mesh {\r\n return CreatePolygon(name, options, scene, earcutInjection);\r\n}\r\n/**\r\n * Class containing static functions to help procedurally build meshes\r\n * @deprecated use the functions directly from the module\r\n */\r\nexport const PolygonBuilder = {\r\n ExtrudePolygon,\r\n CreatePolygon,\r\n};\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for polygonBuilder.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterPolygonBuilder(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n VertexData.CreatePolygon = CreatePolygonVertexData;\r\n\r\n Mesh.CreatePolygon = (name: string, shape: Vector3[], scene: Scene, holes?: Vector3[][], updatable?: boolean, sideOrientation?: number, earcutInjection = earcut): Mesh => {\r\n const options = {\r\n shape: shape,\r\n holes: holes,\r\n updatable: updatable,\r\n sideOrientation: sideOrientation,\r\n };\r\n return CreatePolygon(name, options, scene, earcutInjection);\r\n };\r\n\r\n Mesh.ExtrudePolygon = (\r\n name: string,\r\n shape: Vector3[],\r\n depth: number,\r\n scene: Scene,\r\n holes?: Vector3[][],\r\n updatable?: boolean,\r\n sideOrientation?: number,\r\n earcutInjection = earcut\r\n ): Mesh => {\r\n const options = {\r\n shape: shape,\r\n holes: holes,\r\n depth: depth,\r\n updatable: updatable,\r\n sideOrientation: sideOrientation,\r\n };\r\n return ExtrudePolygon(name, options, scene, earcutInjection);\r\n };\r\n}\r\n"]}
1
+ {"version":3,"file":"polygonBuilder.pure.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Builders/polygonBuilder.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAgB,MAAM,8BAA8B,CAAC;AAE9E,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAO9E;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAAa,EAAE,eAAuB,EAAE,GAAe,EAAE,OAAkB,EAAE,QAAkB,EAAE,OAAiB,EAAE,GAAa;IACrK,MAAM,MAAM,GAAc,GAAG,IAAI,IAAI,KAAK,CAAU,CAAC,CAAC,CAAC;IACvD,MAAM,UAAU,GAA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,aAAa,GAAG,uBAAuB,CAAC;IAEnD,IAAI,CAAC,aAAa,GAAG,CAAC,IAAY,EAAE,KAAgB,EAAE,KAAY,EAAE,KAAmB,EAAE,SAAmB,EAAE,eAAwB,EAAE,eAAe,GAAG,MAAM,EAAQ,EAAE;QACtK,MAAM,OAAO,GAAG;YACZ,KAAK,EAAE,KAAK;YACZ,KAAK,EAAE,KAAK;YACZ,SAAS,EAAE,SAAS;YACpB,eAAe,EAAE,eAAe;SACnC,CAAC;QACF,OAAO,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC;IAChE,CAAC,CAAC;IAEF,IAAI,CAAC,cAAc,GAAG,CAClB,IAAY,EACZ,KAAgB,EAChB,KAAa,EACb,KAAY,EACZ,KAAmB,EACnB,SAAmB,EACnB,eAAwB,EACxB,eAAe,GAAG,MAAM,EACpB,EAAE;QACN,MAAM,OAAO,GAAG;YACZ,KAAK,EAAE,KAAK;YACZ,KAAK,EAAE,KAAK;YACZ,KAAK,EAAE,KAAK;YACZ,SAAS,EAAE,SAAS;YACpB,eAAe,EAAE,eAAe;SACnC,CAAC;QACF,OAAO,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC;IACjE,CAAC,CAAC;AACN,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { Vector2, Vector4, type Vector3 } from \"../../Maths/math.vector.pure\";\r\n\r\nimport { Color4 } from \"../../Maths/math.color.pure\";\r\nimport { Mesh } from \"../mesh.pure\";\r\nimport { VertexData } from \"../mesh.vertexData\";\r\nimport { PolygonMeshBuilder } from \"../polygonMesh\";\r\nimport { type FloatArray, type IndicesArray, type Nullable } from \"../../types\";\r\nimport { VertexBuffer } from \"../../Buffers/buffer.pure\";\r\nimport { EngineStore } from \"../../Engines/engineStore\";\r\nimport { useOpenGLOrientationForUV } from \"../../Compat/compatibilityOptions\";\r\nimport { type Scene } from \"../../scene.pure\";\r\n\r\n/* eslint-disable @typescript-eslint/naming-convention */\r\n\r\ndeclare let earcut: any;\r\n\r\n/**\r\n * Creates the VertexData for an irregular Polygon in the XoZ plane using a mesh built by polygonTriangulation.build()\r\n * All parameters are provided by CreatePolygon as needed\r\n * @param polygon a mesh built from polygonTriangulation.build()\r\n * @param sideOrientation takes the values Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE\r\n * @param fUV an array of Vector4 elements used to set different images to the top, rings and bottom respectively\r\n * @param fColors an array of Color3 elements used to set different colors to the top, rings and bottom respectively\r\n * @param frontUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)\r\n * @param backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)\r\n * @param wrp a boolean, default false, when true and fUVs used texture is wrapped around all sides, when false texture is applied side\r\n * @returns the VertexData of the Polygon\r\n */\r\nexport function CreatePolygonVertexData(polygon: Mesh, sideOrientation: number, fUV?: Vector4[], fColors?: Color4[], frontUVs?: Vector4, backUVs?: Vector4, wrp?: boolean) {\r\n const faceUV: Vector4[] = fUV || new Array<Vector4>(3);\r\n const faceColors = fColors;\r\n const colors = [];\r\n const wrap: boolean = wrp || false;\r\n\r\n // default face colors and UV if undefined\r\n for (let f = 0; f < 3; f++) {\r\n if (faceUV[f] === undefined) {\r\n faceUV[f] = new Vector4(0, 0, 1, 1);\r\n }\r\n if (faceColors && faceColors[f] === undefined) {\r\n faceColors[f] = new Color4(1, 1, 1, 1);\r\n }\r\n }\r\n\r\n const positions = <FloatArray>polygon.getVerticesData(VertexBuffer.PositionKind);\r\n const normals = <FloatArray>polygon.getVerticesData(VertexBuffer.NormalKind);\r\n const uvs = <FloatArray>polygon.getVerticesData(VertexBuffer.UVKind);\r\n const indices = <IndicesArray>polygon.getIndices();\r\n const startIndex = positions.length / 9;\r\n let disp: number;\r\n let distX: number;\r\n let distZ: number;\r\n let dist: number;\r\n let totalLen = 0;\r\n const cumulate = [0];\r\n if (wrap) {\r\n for (let idx = startIndex; idx < positions.length / 3; idx += 4) {\r\n distX = positions[3 * (idx + 2)] - positions[3 * idx];\r\n distZ = positions[3 * (idx + 2) + 2] - positions[3 * idx + 2];\r\n dist = Math.sqrt(distX * distX + distZ * distZ);\r\n totalLen += dist;\r\n cumulate.push(totalLen);\r\n }\r\n }\r\n // set face colours and textures\r\n let idx: number;\r\n let face: number = 0;\r\n for (let index = 0; index < normals.length; index += 3) {\r\n //Edge Face no. 1\r\n if (Math.abs(normals[index + 1]) < 0.001) {\r\n face = 1;\r\n }\r\n //Top Face no. 0\r\n if (Math.abs(normals[index + 1] - 1) < 0.001) {\r\n face = 0;\r\n }\r\n //Bottom Face no. 2\r\n if (Math.abs(normals[index + 1] + 1) < 0.001) {\r\n face = 2;\r\n }\r\n idx = index / 3;\r\n if (face === 1) {\r\n disp = idx - startIndex;\r\n if (disp % 4 < 1.5) {\r\n if (wrap) {\r\n uvs[2 * idx] = faceUV[face].x + ((faceUV[face].z - faceUV[face].x) * cumulate[Math.floor(disp / 4)]) / totalLen;\r\n } else {\r\n uvs[2 * idx] = faceUV[face].x;\r\n }\r\n } else {\r\n if (wrap) {\r\n uvs[2 * idx] = faceUV[face].x + ((faceUV[face].z - faceUV[face].x) * cumulate[Math.floor(disp / 4) + 1]) / totalLen;\r\n } else {\r\n uvs[2 * idx] = faceUV[face].z;\r\n }\r\n }\r\n if (disp % 2 === 0) {\r\n uvs[2 * idx + 1] = useOpenGLOrientationForUV ? 1.0 - faceUV[face].w : faceUV[face].w;\r\n } else {\r\n uvs[2 * idx + 1] = useOpenGLOrientationForUV ? 1.0 - faceUV[face].y : faceUV[face].y;\r\n }\r\n } else {\r\n uvs[2 * idx] = (1 - uvs[2 * idx]) * faceUV[face].x + uvs[2 * idx] * faceUV[face].z;\r\n uvs[2 * idx + 1] = (1 - uvs[2 * idx + 1]) * faceUV[face].y + uvs[2 * idx + 1] * faceUV[face].w;\r\n\r\n if (useOpenGLOrientationForUV) {\r\n uvs[2 * idx + 1] = 1.0 - uvs[2 * idx + 1];\r\n }\r\n }\r\n if (faceColors) {\r\n colors.push(faceColors[face].r, faceColors[face].g, faceColors[face].b, faceColors[face].a);\r\n }\r\n }\r\n\r\n // sides\r\n VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs, frontUVs, backUVs);\r\n\r\n // Result\r\n const vertexData = new VertexData();\r\n vertexData.indices = indices;\r\n vertexData.positions = positions;\r\n vertexData.normals = normals;\r\n vertexData.uvs = uvs;\r\n\r\n if (faceColors) {\r\n const totalColors = sideOrientation === VertexData.DOUBLESIDE ? colors.concat(colors) : colors;\r\n vertexData.colors = totalColors;\r\n }\r\n\r\n return vertexData;\r\n}\r\n\r\n/**\r\n * Creates a polygon mesh\r\n * The polygon's shape will depend on the input parameters and is constructed parallel to a ground mesh\r\n * * The parameter `shape` is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors\r\n * * You can set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE\r\n * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created\r\n * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4)\r\n * * Remember you can only change the shape positions, not their number when updating a polygon\r\n * * The `smoothingThreshold` option defines the dot product threshold for smoothing the normals of adjacent side faces. The default value of 2 disables smoothing\r\n * @param name defines the name of the mesh\r\n * @param options defines the options used to create the mesh\r\n * @param scene defines the hosting scene\r\n * @param earcutInjection can be used to inject your own earcut reference\r\n * @returns the polygon mesh\r\n */\r\nexport function CreatePolygon(\r\n name: string,\r\n options: {\r\n shape: Vector3[];\r\n holes?: Vector3[][];\r\n depth?: number;\r\n smoothingThreshold?: number;\r\n faceUV?: Vector4[];\r\n faceColors?: Color4[];\r\n updatable?: boolean;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n wrap?: boolean;\r\n instance?: Mesh;\r\n },\r\n scene: Nullable<Scene> = null,\r\n earcutInjection = earcut\r\n): Mesh {\r\n options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation);\r\n const shape = options.shape;\r\n const holes = options.holes || [];\r\n const depth = options.depth || 0;\r\n const smoothingThreshold = options.smoothingThreshold ?? 2;\r\n if (options.instance) {\r\n const vertexData = CreatePolygonVertexData(options.instance, options.sideOrientation, options.faceUV, options.faceColors, options.frontUVs, options.backUVs, options.wrap);\r\n vertexData.applyToMesh(options.instance, options.updatable);\r\n return options.instance;\r\n } else {\r\n const contours: Array<Vector2> = [];\r\n let hole: Array<Vector2>;\r\n\r\n for (let i = 0; i < shape.length; i++) {\r\n contours[i] = new Vector2(shape[i].x, shape[i].z);\r\n }\r\n const epsilon = 0.00000001;\r\n if (contours[0].equalsWithEpsilon(contours[contours.length - 1], epsilon)) {\r\n contours.pop();\r\n }\r\n\r\n const polygonTriangulation = new PolygonMeshBuilder(name, contours, scene || EngineStore.LastCreatedScene!, earcutInjection);\r\n for (let hNb = 0; hNb < holes.length; hNb++) {\r\n hole = [];\r\n for (let hPoint = 0; hPoint < holes[hNb].length; hPoint++) {\r\n hole.push(new Vector2(holes[hNb][hPoint].x, holes[hNb][hPoint].z));\r\n }\r\n polygonTriangulation.addHole(hole);\r\n }\r\n //updatability is set during applyToMesh; setting to true in triangulation build produces errors\r\n const polygon = polygonTriangulation.build(false, depth, smoothingThreshold);\r\n polygon._originalBuilderSideOrientation = options.sideOrientation;\r\n const vertexData = CreatePolygonVertexData(polygon, options.sideOrientation, options.faceUV, options.faceColors, options.frontUVs, options.backUVs, options.wrap);\r\n vertexData.applyToMesh(polygon, options.updatable);\r\n return polygon;\r\n }\r\n}\r\n\r\n/**\r\n * Creates an extruded polygon mesh, with depth in the Y direction.\r\n * * You can set different colors and different images to the top, bottom and extruded side by using the parameters `faceColors` (an array of 3 Color3 elements) and `faceUV` (an array of 3 Vector4 elements)\r\n * * The `smoothingThreshold` option defines the dot product threshold for smoothing the normals of adjacent side faces. The default value of 2 disables smoothing\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/texturePerBoxFace\r\n * @see https://playground.babylonjs.com/#TJLZLN#0\r\n * @param name defines the name of the mesh\r\n * @param options defines the options used to create the mesh\r\n * @param scene defines the hosting scene\r\n * @param earcutInjection can be used to inject your own earcut reference\r\n * @returns the polygon mesh\r\n */\r\nexport function ExtrudePolygon(\r\n name: string,\r\n options: {\r\n shape: Vector3[];\r\n holes?: Vector3[][];\r\n depth?: number;\r\n smoothingThreshold?: number;\r\n faceUV?: Vector4[];\r\n faceColors?: Color4[];\r\n updatable?: boolean;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n wrap?: boolean;\r\n },\r\n scene: Nullable<Scene> = null,\r\n earcutInjection = earcut\r\n): Mesh {\r\n return CreatePolygon(name, options, scene, earcutInjection);\r\n}\r\n/**\r\n * Class containing static functions to help procedurally build meshes\r\n * @deprecated use the functions directly from the module\r\n */\r\nexport const PolygonBuilder = {\r\n ExtrudePolygon,\r\n CreatePolygon,\r\n};\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for polygonBuilder.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterPolygonBuilder(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n VertexData.CreatePolygon = CreatePolygonVertexData;\r\n\r\n Mesh.CreatePolygon = (name: string, shape: Vector3[], scene: Scene, holes?: Vector3[][], updatable?: boolean, sideOrientation?: number, earcutInjection = earcut): Mesh => {\r\n const options = {\r\n shape: shape,\r\n holes: holes,\r\n updatable: updatable,\r\n sideOrientation: sideOrientation,\r\n };\r\n return CreatePolygon(name, options, scene, earcutInjection);\r\n };\r\n\r\n Mesh.ExtrudePolygon = (\r\n name: string,\r\n shape: Vector3[],\r\n depth: number,\r\n scene: Scene,\r\n holes?: Vector3[][],\r\n updatable?: boolean,\r\n sideOrientation?: number,\r\n earcutInjection = earcut\r\n ): Mesh => {\r\n const options = {\r\n shape: shape,\r\n holes: holes,\r\n depth: depth,\r\n updatable: updatable,\r\n sideOrientation: sideOrientation,\r\n };\r\n return ExtrudePolygon(name, options, scene, earcutInjection);\r\n };\r\n}\r\n"]}
@@ -0,0 +1,19 @@
1
+ import { type AbstractMesh } from "../abstractMesh.pure.js";
2
+ /**
3
+ * True when `className` (from `AbstractMesh.getClassName()`) identifies a Gaussian Splatting mesh whose
4
+ * `position.z` vertex attribute encodes a splat index rather than world-space Z: `"GaussianSplattingMesh"`
5
+ * (also returned by `GaussianSplattingCompoundMesh`) or `"GaussianSplattingStream"`.
6
+ *
7
+ * This function is retained for backward compatibility. Internal code should prefer
8
+ * {@link _IsGaussianSplattingMesh}, which also recognizes the inherited Gaussian Splatting capability.
9
+ * @param className the mesh class name to test, e.g. from `AbstractMesh.getClassName()`
10
+ * @returns true if the class name identifies a Gaussian Splatting mesh
11
+ */
12
+ export declare function IsGaussianSplattingClassName(className: string): boolean;
13
+ /**
14
+ * Tests whether a mesh uses Gaussian Splatting rendering behavior.
15
+ * @param mesh the mesh to test
16
+ * @returns true if the mesh is a Gaussian Splatting mesh
17
+ * @internal
18
+ */
19
+ export declare function _IsGaussianSplattingMesh(mesh: AbstractMesh): boolean;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * True when `className` (from `AbstractMesh.getClassName()`) identifies a Gaussian Splatting mesh whose
3
+ * `position.z` vertex attribute encodes a splat index rather than world-space Z: `"GaussianSplattingMesh"`
4
+ * (also returned by `GaussianSplattingCompoundMesh`) or `"GaussianSplattingStream"`.
5
+ *
6
+ * This function is retained for backward compatibility. Internal code should prefer
7
+ * {@link _IsGaussianSplattingMesh}, which also recognizes the inherited Gaussian Splatting capability.
8
+ * @param className the mesh class name to test, e.g. from `AbstractMesh.getClassName()`
9
+ * @returns true if the class name identifies a Gaussian Splatting mesh
10
+ */
11
+ export function IsGaussianSplattingClassName(className) {
12
+ return className === "GaussianSplattingMesh" || className === "GaussianSplattingStream";
13
+ }
14
+ /**
15
+ * Tests whether a mesh uses Gaussian Splatting rendering behavior.
16
+ * @param mesh the mesh to test
17
+ * @returns true if the mesh is a Gaussian Splatting mesh
18
+ * @internal
19
+ */
20
+ export function _IsGaussianSplattingMesh(mesh) {
21
+ return mesh._isGaussianSplatting || IsGaussianSplattingClassName(mesh.getClassName());
22
+ }
23
+ //# sourceMappingURL=gaussianSplatting.functions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gaussianSplatting.functions.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/GaussianSplatting/gaussianSplatting.functions.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,MAAM,UAAU,4BAA4B,CAAC,SAAiB;IAC1D,OAAO,SAAS,KAAK,uBAAuB,IAAI,SAAS,KAAK,yBAAyB,CAAC;AAC5F,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,IAAkB;IACvD,OAAO,IAAI,CAAC,oBAAoB,IAAI,4BAA4B,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;AAC1F,CAAC","sourcesContent":["import { type AbstractMesh } from \"../abstractMesh.pure\";\r\n\r\n/**\r\n * True when `className` (from `AbstractMesh.getClassName()`) identifies a Gaussian Splatting mesh whose\r\n * `position.z` vertex attribute encodes a splat index rather than world-space Z: `\"GaussianSplattingMesh\"`\r\n * (also returned by `GaussianSplattingCompoundMesh`) or `\"GaussianSplattingStream\"`.\r\n *\r\n * This function is retained for backward compatibility. Internal code should prefer\r\n * {@link _IsGaussianSplattingMesh}, which also recognizes the inherited Gaussian Splatting capability.\r\n * @param className the mesh class name to test, e.g. from `AbstractMesh.getClassName()`\r\n * @returns true if the class name identifies a Gaussian Splatting mesh\r\n */\r\nexport function IsGaussianSplattingClassName(className: string): boolean {\r\n return className === \"GaussianSplattingMesh\" || className === \"GaussianSplattingStream\";\r\n}\r\n\r\n/**\r\n * Tests whether a mesh uses Gaussian Splatting rendering behavior.\r\n * @param mesh the mesh to test\r\n * @returns true if the mesh is a Gaussian Splatting mesh\r\n * @internal\r\n */\r\nexport function _IsGaussianSplattingMesh(mesh: AbstractMesh): boolean {\r\n return mesh._isGaussianSplatting || IsGaussianSplattingClassName(mesh.getClassName());\r\n}\r\n"]}
@@ -10,6 +10,7 @@ import { GaussianSplattingPartProxyMesh } from "./gaussianSplattingPartProxyMesh
10
10
  import { BoundingInfo } from "../../Culling/boundingInfo.js";
11
11
  import { type BaseTexture } from "../../Materials/Textures/baseTexture.pure.js";
12
12
  import { type AbstractMesh } from "../abstractMesh.pure.js";
13
+ export { IsGaussianSplattingClassName } from "./gaussianSplatting.functions.js";
13
14
  interface IGaussianSplattingPartSource {
14
15
  name: string;
15
16
  _vertexCount: number;
@@ -203,6 +204,8 @@ export declare class GaussianSplattingMesh extends GaussianSplattingMeshBase {
203
204
  private _tombstonedPartIndices;
204
205
  private _partIndicesTexture;
205
206
  private _partIndices;
207
+ private _partWorldData;
208
+ private readonly _partVisibilityData;
206
209
  /** Gets the part indices texture used for compound rendering */
207
210
  get partIndicesTexture(): Nullable<BaseTexture>;
208
211
  /**
@@ -545,22 +548,8 @@ export declare class GaussianSplattingMesh extends GaussianSplattingMeshBase {
545
548
  */
546
549
  static Parse(parsedMesh: any, scene: Scene): GaussianSplattingMesh;
547
550
  }
548
- /**
549
- * True when `className` (from `AbstractMesh.getClassName()`) identifies a Gaussian Splatting mesh whose
550
- * `position.z` vertex attribute encodes a splat index rather than world-space Z: `"GaussianSplattingMesh"`
551
- * (also returned by {@link GaussianSplattingCompoundMesh}, which deliberately does not override
552
- * `getClassName()`) and `"GaussianSplattingStream"` (which does override it, to remain distinguishable for
553
- * other purposes). Rendering-pipeline code that must treat any Gaussian Splatting mesh differently from an
554
- * ordinary mesh (geometry buffer, depth pre-pass, GPU picking, IBL voxelization, snapshot rendering, ...)
555
- * should use this instead of a literal string comparison, so a future splat mesh subclass only needs to be
556
- * added here once.
557
- * @param className the mesh class name to test, e.g. from `AbstractMesh.getClassName()`
558
- * @returns true if the class name identifies a Gaussian Splatting mesh
559
- */
560
- export declare function IsGaussianSplattingClassName(className: string): boolean;
561
551
  /**
562
552
  * Register side effects for gaussianSplattingMesh.
563
553
  * Safe to call multiple times; only the first call has an effect.
564
554
  */
565
555
  export declare function RegisterGaussianSplattingMesh(): void;
566
- export {};
@@ -9,6 +9,7 @@ import { DecodeBase64ToBinary, EncodeArrayBufferToBase64 } from "../../Misc/stri
9
9
  import { Mesh } from "../mesh.pure.js";
10
10
  import { GaussianSplattingPartProxyMesh } from "./gaussianSplattingPartProxyMesh.pure.js";
11
11
  import { BoundingInfo } from "../../Culling/boundingInfo.js";
12
+ export { IsGaussianSplattingClassName } from "./gaussianSplatting.functions.js";
12
13
  const _GaussianSplattingBytesPerSplat = 32;
13
14
  const _GaussianSplattingBytesPerShTexel = 16;
14
15
  /**
@@ -135,6 +136,8 @@ export class GaussianSplattingMesh extends GaussianSplattingMeshBase {
135
136
  this._tombstonedPartIndices = new Set();
136
137
  this._partIndicesTexture = null;
137
138
  this._partIndices = null;
139
+ this._partWorldData = new Float32Array(0);
140
+ this._partVisibilityData = [];
138
141
  // Ensure _splatsData is retained once compound mode is entered — addPart/addParts need
139
142
  // the source data for full-texture rebuilds. Set after super() so it is visible to
140
143
  // _updateData when the async load completes.
@@ -366,14 +369,19 @@ export class GaussianSplattingMesh extends GaussianSplattingMeshBase {
366
369
  return;
367
370
  }
368
371
  effect.setTexture("partIndicesTexture", this._partIndicesTexture);
369
- const partWorldData = new Float32Array(this.partCount * 16);
372
+ const partWorldDataLength = this.partCount * 16;
373
+ if (this._partWorldData.length !== partWorldDataLength) {
374
+ this._partWorldData = new Float32Array(partWorldDataLength);
375
+ }
376
+ const partWorldData = this._partWorldData;
370
377
  for (let i = 0; i < this.partCount; i++) {
371
378
  this._partMatrices[i].toArray(partWorldData, i * 16);
372
379
  }
373
380
  effect.setMatrices("partWorld", partWorldData);
374
- const partVisibilityData = [];
381
+ const partVisibilityData = this._partVisibilityData;
382
+ partVisibilityData.length = this.partCount;
375
383
  for (let i = 0; i < this.partCount; i++) {
376
- partVisibilityData.push(this._partVisibility[i] ?? 1.0);
384
+ partVisibilityData[i] = this._partVisibility[i] ?? 1.0;
377
385
  }
378
386
  effect.setArray("partVisibility", partVisibilityData);
379
387
  }
@@ -685,7 +693,7 @@ export class GaussianSplattingMesh extends GaussianSplattingMeshBase {
685
693
  }
686
694
  _onUpdateTextures(textureSize) {
687
695
  const createTextureFromDataU8 = (data, width, height, format) => {
688
- return new RawTexture(data, width, height, format, this._scene, false, false, 2, 0);
696
+ return new RawTexture(data, width, height, format, this._scene, false, false, 1, 0);
689
697
  };
690
698
  // Keep the part indices texture in sync with _partIndices whenever textures are rebuilt.
691
699
  // The old "only create if absent" logic left the texture stale after a second addPart/addParts
@@ -741,7 +749,7 @@ export class GaussianSplattingMesh extends GaussianSplattingMeshBase {
741
749
  return;
742
750
  }
743
751
  const buffer = new Uint8Array(this._partIndices);
744
- this._partIndicesTexture = new RawTexture(buffer, textureSize.x, textureSize.y, 6, this._scene, false, false, 2, 0);
752
+ this._partIndicesTexture = new RawTexture(buffer, textureSize.x, textureSize.y, 6, this._scene, false, false, 1, 0);
745
753
  this._partIndicesTexture.wrapU = 0;
746
754
  this._partIndicesTexture.wrapV = 0;
747
755
  if (this._worker) {
@@ -785,11 +793,14 @@ export class GaussianSplattingMesh extends GaussianSplattingMeshBase {
785
793
  splatByteOffset += existingVertexCount * _GaussianSplattingBytesPerSplat;
786
794
  }
787
795
  for (const other of others) {
788
- if (!other._splatsData) {
789
- continue;
790
- }
796
+ // A reserved-empty streaming source carries no CPU data but still owns its slot in the atlas (its
797
+ // GPU rows are decoded later). Advance past that slot regardless of data so a real source appended
798
+ // after it lands at the offset its proxy's _splatsDataOffset points to — matching the unconditional
799
+ // GPU dstOffset advance in _addPartsInternal (and the SH loop below).
791
800
  const splatByteLength = other._vertexCount * _GaussianSplattingBytesPerSplat;
792
- mergedSplatsData.set(GaussianSplattingMeshBase._GetSplatDataBytes(other._splatsData).subarray(0, splatByteLength), splatByteOffset);
801
+ if (other._splatsData) {
802
+ mergedSplatsData.set(GaussianSplattingMeshBase._GetSplatDataBytes(other._splatsData).subarray(0, splatByteLength), splatByteOffset);
803
+ }
793
804
  splatByteOffset += splatByteLength;
794
805
  }
795
806
  this._splatsData = mergedSplatsData.buffer;
@@ -1991,21 +2002,6 @@ export class GaussianSplattingMesh extends GaussianSplattingMeshBase {
1991
2002
  return GaussianSplattingMesh._ParseInternal(parsedMesh, scene, GaussianSplattingMesh);
1992
2003
  }
1993
2004
  }
1994
- /**
1995
- * True when `className` (from `AbstractMesh.getClassName()`) identifies a Gaussian Splatting mesh whose
1996
- * `position.z` vertex attribute encodes a splat index rather than world-space Z: `"GaussianSplattingMesh"`
1997
- * (also returned by {@link GaussianSplattingCompoundMesh}, which deliberately does not override
1998
- * `getClassName()`) and `"GaussianSplattingStream"` (which does override it, to remain distinguishable for
1999
- * other purposes). Rendering-pipeline code that must treat any Gaussian Splatting mesh differently from an
2000
- * ordinary mesh (geometry buffer, depth pre-pass, GPU picking, IBL voxelization, snapshot rendering, ...)
2001
- * should use this instead of a literal string comparison, so a future splat mesh subclass only needs to be
2002
- * added here once.
2003
- * @param className the mesh class name to test, e.g. from `AbstractMesh.getClassName()`
2004
- * @returns true if the class name identifies a Gaussian Splatting mesh
2005
- */
2006
- export function IsGaussianSplattingClassName(className) {
2007
- return className === "GaussianSplattingMesh" || className === "GaussianSplattingStream";
2008
- }
2009
2005
  let _Registered = false;
2010
2006
  /**
2011
2007
  * Register side effects for gaussianSplattingMesh.