@babylonjs/core 7.37.0 → 7.37.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 (222) hide show
  1. package/Buffers/buffer.d.ts +3 -1
  2. package/Buffers/buffer.js +20 -122
  3. package/Buffers/buffer.js.map +1 -1
  4. package/Buffers/bufferUtils.d.ts +32 -1
  5. package/Buffers/bufferUtils.js +221 -10
  6. package/Buffers/bufferUtils.js.map +1 -1
  7. package/Cameras/arcRotateCamera.d.ts +3 -1
  8. package/Cameras/arcRotateCamera.js +14 -3
  9. package/Cameras/arcRotateCamera.js.map +1 -1
  10. package/Engines/abstractEngine.js +2 -2
  11. package/Engines/abstractEngine.js.map +1 -1
  12. package/Engines/engine.js +0 -4
  13. package/Engines/engine.js.map +1 -1
  14. package/Engines/thinEngine.js +2 -2
  15. package/Engines/thinEngine.js.map +1 -1
  16. package/FrameGraph/Node/nodeRenderGraphBlock.js +1 -0
  17. package/FrameGraph/Node/nodeRenderGraphBlock.js.map +1 -1
  18. package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.d.ts +2 -0
  19. package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js +3 -1
  20. package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js.map +1 -1
  21. package/Inputs/scene.inputManager.js +2 -0
  22. package/Inputs/scene.inputManager.js.map +1 -1
  23. package/Lights/IES/iesLoader.d.ts +19 -0
  24. package/Lights/IES/iesLoader.js +150 -0
  25. package/Lights/IES/iesLoader.js.map +1 -0
  26. package/Lights/index.d.ts +1 -0
  27. package/Lights/index.js +1 -0
  28. package/Lights/index.js.map +1 -1
  29. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js +12 -2
  30. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
  31. package/Materials/GreasedLine/greasedLineMaterialInterfaces.d.ts +5 -0
  32. package/Materials/GreasedLine/greasedLineMaterialInterfaces.js.map +1 -1
  33. package/Materials/GreasedLine/greasedLinePluginMaterial.d.ts +21 -5
  34. package/Materials/GreasedLine/greasedLinePluginMaterial.js +52 -176
  35. package/Materials/GreasedLine/greasedLinePluginMaterial.js.map +1 -1
  36. package/Materials/GreasedLine/greasedLinePluginMaterialShadersGLSL.d.ts +11 -0
  37. package/Materials/GreasedLine/greasedLinePluginMaterialShadersGLSL.js +158 -0
  38. package/Materials/GreasedLine/greasedLinePluginMaterialShadersGLSL.js.map +1 -0
  39. package/Materials/GreasedLine/greasedLinePluginMaterialShadersWGSL.d.ts +11 -0
  40. package/Materials/GreasedLine/greasedLinePluginMaterialShadersWGSL.js +177 -0
  41. package/Materials/GreasedLine/greasedLinePluginMaterialShadersWGSL.js.map +1 -0
  42. package/Materials/GreasedLine/greasedLineSimpleMaterial.d.ts +4 -2
  43. package/Materials/GreasedLine/greasedLineSimpleMaterial.js +45 -25
  44. package/Materials/GreasedLine/greasedLineSimpleMaterial.js.map +1 -1
  45. package/Materials/Node/Blocks/PBR/reflectionBlock.js +6 -0
  46. package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
  47. package/Materials/Node/Blocks/index.d.ts +1 -0
  48. package/Materials/Node/Blocks/index.js +1 -0
  49. package/Materials/Node/Blocks/index.js.map +1 -1
  50. package/Materials/Node/Blocks/matrixSplitterBlock.d.ts +56 -0
  51. package/Materials/Node/Blocks/matrixSplitterBlock.js +130 -0
  52. package/Materials/Node/Blocks/matrixSplitterBlock.js.map +1 -0
  53. package/Materials/Node/nodeMaterialBlock.js +1 -0
  54. package/Materials/Node/nodeMaterialBlock.js.map +1 -1
  55. package/Materials/Node/nodeMaterialBlockConnectionPoint.d.ts +2 -0
  56. package/Materials/Node/nodeMaterialBlockConnectionPoint.js +4 -1
  57. package/Materials/Node/nodeMaterialBlockConnectionPoint.js.map +1 -1
  58. package/Materials/PBR/pbrBaseMaterial.d.ts +1 -0
  59. package/Materials/PBR/pbrBaseMaterial.js +12 -0
  60. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  61. package/Materials/Textures/Loaders/iesTextureLoader.d.ts +23 -0
  62. package/Materials/Textures/Loaders/iesTextureLoader.js +40 -0
  63. package/Materials/Textures/Loaders/iesTextureLoader.js.map +1 -0
  64. package/Materials/Textures/Loaders/index.d.ts +1 -0
  65. package/Materials/Textures/Loaders/index.js +1 -0
  66. package/Materials/Textures/Loaders/index.js.map +1 -1
  67. package/Materials/Textures/Loaders/textureLoaderManager.js +3 -0
  68. package/Materials/Textures/Loaders/textureLoaderManager.js.map +1 -1
  69. package/Materials/effectRenderer.js +1 -1
  70. package/Materials/effectRenderer.js.map +1 -1
  71. package/Materials/index.d.ts +4 -0
  72. package/Materials/index.js +5 -0
  73. package/Materials/index.js.map +1 -1
  74. package/Maths/math.scalar.d.ts +0 -1
  75. package/Maths/math.scalar.js +1 -2
  76. package/Maths/math.scalar.js.map +1 -1
  77. package/Meshes/Builders/greasedLineBuilder.js +2 -2
  78. package/Meshes/Builders/greasedLineBuilder.js.map +1 -1
  79. package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +15 -2
  80. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +68 -20
  81. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
  82. package/Meshes/Node/Blocks/geometryInputBlock.d.ts +4 -0
  83. package/Meshes/Node/Blocks/geometryInputBlock.js +8 -0
  84. package/Meshes/Node/Blocks/geometryInputBlock.js.map +1 -1
  85. package/Meshes/Node/nodeGeometryBlock.js +1 -0
  86. package/Meshes/Node/nodeGeometryBlock.js.map +1 -1
  87. package/Meshes/Node/nodeGeometryBlockConnectionPoint.d.ts +2 -0
  88. package/Meshes/Node/nodeGeometryBlockConnectionPoint.js +3 -1
  89. package/Meshes/Node/nodeGeometryBlockConnectionPoint.js.map +1 -1
  90. package/Meshes/abstractMesh.hotSpot.d.ts +8 -1
  91. package/Meshes/abstractMesh.hotSpot.js +17 -0
  92. package/Meshes/abstractMesh.hotSpot.js.map +1 -1
  93. package/Meshes/linesMesh.js +1 -1
  94. package/Meshes/linesMesh.js.map +1 -1
  95. package/Misc/deepMerger.d.ts +6 -0
  96. package/Misc/deepMerger.js +26 -0
  97. package/Misc/deepMerger.js.map +1 -0
  98. package/Misc/index.d.ts +1 -0
  99. package/Misc/index.js +1 -0
  100. package/Misc/index.js.map +1 -1
  101. package/Misc/virtualJoystick.js +2 -0
  102. package/Misc/virtualJoystick.js.map +1 -1
  103. package/Rendering/IBLShadows/iblShadowsRenderPipeline.d.ts +3 -23
  104. package/Rendering/IBLShadows/iblShadowsRenderPipeline.js +30 -67
  105. package/Rendering/IBLShadows/iblShadowsRenderPipeline.js.map +1 -1
  106. package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.d.ts +1 -1
  107. package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js +8 -4
  108. package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js.map +1 -1
  109. package/Rendering/boundingBoxRenderer.d.ts +63 -1
  110. package/Rendering/boundingBoxRenderer.js +224 -3
  111. package/Rendering/boundingBoxRenderer.js.map +1 -1
  112. package/Rendering/edgesRenderer.js +4 -1
  113. package/Rendering/edgesRenderer.js.map +1 -1
  114. package/Rendering/{IBLShadows/iblShadowsImportanceSamplingRenderer.d.ts → iblCdfGenerator.d.ts} +15 -12
  115. package/Rendering/{IBLShadows/iblShadowsImportanceSamplingRenderer.js → iblCdfGenerator.js} +37 -27
  116. package/Rendering/iblCdfGenerator.js.map +1 -0
  117. package/Rendering/iblCdfGeneratorSceneComponent.d.ts +59 -0
  118. package/Rendering/iblCdfGeneratorSceneComponent.js +83 -0
  119. package/Rendering/iblCdfGeneratorSceneComponent.js.map +1 -0
  120. package/Rendering/index.d.ts +12 -10
  121. package/Rendering/index.js +12 -10
  122. package/Rendering/index.js.map +1 -1
  123. package/Shaders/ShadersInclude/gaussianSplatting.js +72 -2
  124. package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
  125. package/Shaders/ShadersInclude/gaussianSplattingVertexDeclaration.js +1 -1
  126. package/Shaders/ShadersInclude/gaussianSplattingVertexDeclaration.js.map +1 -1
  127. package/Shaders/ShadersInclude/hdrFilteringFunctions.js +29 -4
  128. package/Shaders/ShadersInclude/hdrFilteringFunctions.js.map +1 -1
  129. package/Shaders/ShadersInclude/pbrBlockReflection.js +9 -1
  130. package/Shaders/ShadersInclude/pbrBlockReflection.js.map +1 -1
  131. package/Shaders/ShadersInclude/pbrBlockSubSurface.js +9 -1
  132. package/Shaders/ShadersInclude/pbrBlockSubSurface.js.map +1 -1
  133. package/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.js +3 -0
  134. package/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.js.map +1 -1
  135. package/Shaders/boundingBoxRenderer.vertex.js +7 -0
  136. package/Shaders/boundingBoxRenderer.vertex.js.map +1 -1
  137. package/Shaders/gaussianSplatting.vertex.js +16 -2
  138. package/Shaders/gaussianSplatting.vertex.js.map +1 -1
  139. package/Shaders/{iblShadowsCdfy.fragment.d.ts → iblCdfx.fragment.d.ts} +1 -1
  140. package/Shaders/{iblShadowsCdfx.fragment.js → iblCdfx.fragment.js} +3 -3
  141. package/Shaders/iblCdfx.fragment.js.map +1 -0
  142. package/Shaders/{iblShadowsCdfx.fragment.d.ts → iblCdfy.fragment.d.ts} +1 -1
  143. package/Shaders/{iblShadowsCdfy.fragment.js → iblCdfy.fragment.js} +3 -3
  144. package/Shaders/iblCdfy.fragment.js.map +1 -0
  145. package/Shaders/{iblShadowsIcdfx.fragment.d.ts → iblIcdfx.fragment.d.ts} +1 -1
  146. package/Shaders/{iblShadowsIcdfx.fragment.js → iblIcdfx.fragment.js} +3 -3
  147. package/Shaders/iblIcdfx.fragment.js.map +1 -0
  148. package/Shaders/{iblShadowsIcdfy.fragment.d.ts → iblIcdfy.fragment.d.ts} +1 -1
  149. package/Shaders/{iblShadowsIcdfy.fragment.js → iblIcdfy.fragment.js} +3 -3
  150. package/Shaders/iblIcdfy.fragment.js.map +1 -0
  151. package/Shaders/importanceSamplingDebug.fragment.d.ts +5 -0
  152. package/Shaders/{iblShadowsImportanceSamplingDebug.fragment.js → importanceSamplingDebug.fragment.js} +3 -3
  153. package/Shaders/importanceSamplingDebug.fragment.js.map +1 -0
  154. package/Shaders/pbr.fragment.js +8 -0
  155. package/Shaders/pbr.fragment.js.map +1 -1
  156. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js +77 -1
  157. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js.map +1 -1
  158. package/ShadersWGSL/ShadersInclude/hdrFilteringFunctions.js +28 -4
  159. package/ShadersWGSL/ShadersInclude/hdrFilteringFunctions.js.map +1 -1
  160. package/ShadersWGSL/ShadersInclude/lightFragment.js +1 -1
  161. package/ShadersWGSL/ShadersInclude/lightFragment.js.map +1 -1
  162. package/ShadersWGSL/ShadersInclude/oitFragment.js +1 -1
  163. package/ShadersWGSL/ShadersInclude/oitFragment.js.map +1 -1
  164. package/ShadersWGSL/ShadersInclude/pbrBlockReflection.js +14 -1
  165. package/ShadersWGSL/ShadersInclude/pbrBlockReflection.js.map +1 -1
  166. package/ShadersWGSL/ShadersInclude/pbrBlockSubSurface.js +14 -1
  167. package/ShadersWGSL/ShadersInclude/pbrBlockSubSurface.js.map +1 -1
  168. package/ShadersWGSL/ShadersInclude/pbrFragmentSamplersDeclaration.js +3 -0
  169. package/ShadersWGSL/ShadersInclude/pbrFragmentSamplersDeclaration.js.map +1 -1
  170. package/ShadersWGSL/ShadersInclude/shadowsFragmentFunctions.js +1 -1
  171. package/ShadersWGSL/ShadersInclude/shadowsFragmentFunctions.js.map +1 -1
  172. package/ShadersWGSL/boundingBoxRenderer.vertex.js +9 -1
  173. package/ShadersWGSL/boundingBoxRenderer.vertex.js.map +1 -1
  174. package/ShadersWGSL/gaussianSplatting.vertex.js +18 -2
  175. package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
  176. package/ShadersWGSL/greasedLine.fragment.d.ts +5 -0
  177. package/ShadersWGSL/greasedLine.fragment.js +25 -0
  178. package/ShadersWGSL/greasedLine.fragment.js.map +1 -0
  179. package/ShadersWGSL/greasedLine.vertex.d.ts +9 -0
  180. package/ShadersWGSL/greasedLine.vertex.js +43 -0
  181. package/ShadersWGSL/greasedLine.vertex.js.map +1 -0
  182. package/ShadersWGSL/iblCdfx.fragment.d.ts +5 -0
  183. package/ShadersWGSL/{iblShadowsCdfx.fragment.js → iblCdfx.fragment.js} +3 -3
  184. package/ShadersWGSL/iblCdfx.fragment.js.map +1 -0
  185. package/ShadersWGSL/iblCdfy.fragment.d.ts +5 -0
  186. package/ShadersWGSL/{iblShadowsCdfy.fragment.js → iblCdfy.fragment.js} +3 -3
  187. package/ShadersWGSL/iblCdfy.fragment.js.map +1 -0
  188. package/ShadersWGSL/iblIcdfx.fragment.d.ts +5 -0
  189. package/ShadersWGSL/{iblShadowsIcdfx.fragment.js → iblIcdfx.fragment.js} +3 -3
  190. package/ShadersWGSL/iblIcdfx.fragment.js.map +1 -0
  191. package/ShadersWGSL/iblIcdfy.fragment.d.ts +5 -0
  192. package/ShadersWGSL/{iblShadowsIcdfy.fragment.js → iblIcdfy.fragment.js} +3 -3
  193. package/ShadersWGSL/iblIcdfy.fragment.js.map +1 -0
  194. package/ShadersWGSL/importanceSamplingDebug.fragment.d.ts +5 -0
  195. package/ShadersWGSL/{iblShadowsImportanceSamplingDebug.fragment.js → importanceSamplingDebug.fragment.js} +3 -3
  196. package/ShadersWGSL/importanceSamplingDebug.fragment.js.map +1 -0
  197. package/ShadersWGSL/pbr.fragment.js +12 -0
  198. package/ShadersWGSL/pbr.fragment.js.map +1 -1
  199. package/package.json +1 -1
  200. package/scene.d.ts +4 -0
  201. package/scene.js +6 -0
  202. package/scene.js.map +1 -1
  203. package/sceneComponent.d.ts +1 -1
  204. package/sceneComponent.js +1 -1
  205. package/sceneComponent.js.map +1 -1
  206. package/Rendering/IBLShadows/iblShadowsImportanceSamplingRenderer.js.map +0 -1
  207. package/Shaders/iblShadowsCdfx.fragment.js.map +0 -1
  208. package/Shaders/iblShadowsCdfy.fragment.js.map +0 -1
  209. package/Shaders/iblShadowsIcdfx.fragment.js.map +0 -1
  210. package/Shaders/iblShadowsIcdfy.fragment.js.map +0 -1
  211. package/Shaders/iblShadowsImportanceSamplingDebug.fragment.d.ts +0 -5
  212. package/Shaders/iblShadowsImportanceSamplingDebug.fragment.js.map +0 -1
  213. package/ShadersWGSL/iblShadowsCdfx.fragment.d.ts +0 -5
  214. package/ShadersWGSL/iblShadowsCdfx.fragment.js.map +0 -1
  215. package/ShadersWGSL/iblShadowsCdfy.fragment.d.ts +0 -5
  216. package/ShadersWGSL/iblShadowsCdfy.fragment.js.map +0 -1
  217. package/ShadersWGSL/iblShadowsIcdfx.fragment.d.ts +0 -5
  218. package/ShadersWGSL/iblShadowsIcdfx.fragment.js.map +0 -1
  219. package/ShadersWGSL/iblShadowsIcdfy.fragment.d.ts +0 -5
  220. package/ShadersWGSL/iblShadowsIcdfy.fragment.js.map +0 -1
  221. package/ShadersWGSL/iblShadowsImportanceSamplingDebug.fragment.d.ts +0 -5
  222. package/ShadersWGSL/iblShadowsImportanceSamplingDebug.fragment.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"greasedLineBuilder.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Builders/greasedLineBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,yBAAyB,EAAE,MAAM,uDAAuD,CAAC;AAClG,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAG/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAG7E,OAAO,EAAE,yB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;YACxF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBACrC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YAC/B,CAAC;QACL,CAAC;IACL,CAAC;SAAM,CAAC;QACJ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,EAAE,CAAC,EAAE,EAAE,CAAC;YAClC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/B,CAAC;IACL,CAAC;IAED,OAAO,UAAU,CAAC;AACtB,CAAC","sourcesContent":["import { StandardMaterial } from \"./../../Materials/standardMaterial\";\r\nimport { PBRMaterial } from \"../../Materials/PBR/pbrMaterial\";\r\nimport type { Nullable } from \"../../types\";\r\nimport { GreasedLineMesh } from \"../GreasedLine/greasedLineMesh\";\r\nimport type { Scene } from \"../../scene\";\r\nimport { EngineStore } from \"../../Engines/engineStore\";\r\nimport type { Color3 } from \"../../Maths/math.color\";\r\nimport { GreasedLineSimpleMaterial } from \"../../Materials/GreasedLine/greasedLineSimpleMaterial\";\r\nimport { GreasedLineTools } from \"../../Misc/greasedLineTools\";\r\nimport type { GreasedLineMeshOptions } from \"../GreasedLine/greasedLineBaseMesh\";\r\nimport { GreasedLineRibbonAutoDirectionMode, GreasedLineRibbonFacesMode, GreasedLineRibbonPointsMode } from \"../GreasedLine/greasedLineBaseMesh\";\r\nimport { GreasedLineRibbonMesh } from \"../GreasedLine/greasedLineRibbonMesh\";\r\nimport type { GreasedLineMaterialOptions } from \"../../Materials/GreasedLine/greasedLineMaterialInterfaces\";\r\nimport { GreasedLineMeshMaterialType } from \"../../Materials/GreasedLine/greasedLineMaterialInterfaces\";\r\nimport { GreasedLinePluginMaterial } from \"../../Materials/GreasedLine/greasedLinePluginMaterial\";\r\nimport { GreasedLineMaterialDefaults } from \"../../Materials/GreasedLine/greasedLineMaterialDefaults\";\r\n\r\n/**\r\n * How are the colors distributed along the color table\r\n * {@link https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param/greased_line#colors-and-colordistribution}\r\n */\r\nexport const enum GreasedLineMeshColorDistribution {\r\n /**\r\n * Do no modify the color table\r\n */\r\n COLOR_DISTRIBUTION_NONE = 0,\r\n /**\r\n * Repeat the colors until the color table is full\r\n */\r\n COLOR_DISTRIBUTION_REPEAT = 1,\r\n /**\r\n * Distribute the colors evenly through the color table\r\n */\r\n COLOR_DISTRIBUTION_EVEN = 2,\r\n /**\r\n * Put the colors to start of the color table a fill the rest with the default color\r\n */\r\n COLOR_DISTRIBUTION_START = 3,\r\n /**\r\n * Put the colors to the end of the color table and fill the rest with the default color\r\n */\r\n COLOR_DISTRIBUTION_END = 4,\r\n /**\r\n * Put the colors to start and to the end of the color table and fill the gap between with the default color\r\n */\r\n COLOR_DISTRIBUTION_START_END = 5,\r\n}\r\n\r\n/**\r\n * How are the widths distributed along the width table\r\n * {@link https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param/greased_line#widths-and-widthdistribution}\r\n */\r\nexport const enum GreasedLineMeshWidthDistribution {\r\n /**\r\n * Do no modify the width table\r\n */\r\n WIDTH_DISTRIBUTION_NONE = 0,\r\n /**\r\n * Repeat the widths until the width table is full\r\n */\r\n WIDTH_DISTRIBUTION_REPEAT = 1,\r\n /**\r\n * Distribute the widths evenly through the width table\r\n */\r\n WIDTH_DISTRIBUTION_EVEN = 2,\r\n /**\r\n * Put the widths to start of the width table a fill the rest with the default width\r\n */\r\n WIDTH_DISTRIBUTION_START = 3,\r\n /**\r\n * Put the widths to the end of the width table and fill the rest with the default width\r\n */\r\n WIDTH_DISTRIBUTION_END = 4,\r\n /**\r\n * Put the widths to start and to the end of the width table and fill the gap between with the default width\r\n */\r\n WIDTH_DISTRIBUTION_START_END = 5,\r\n}\r\n\r\n/**\r\n * Material options for GreasedLineBuilder\r\n */\r\nexport interface GreasedLineMaterialBuilderOptions extends GreasedLineMaterialOptions {\r\n /**\r\n * If set to true a new material will be created and a new material plugin will be attached\r\n * to the material. The material will be set on the mesh. If the instance option is specified in the mesh options,\r\n * no material will be created/assigned. Defaults to true.\r\n */\r\n createAndAssignMaterial?: boolean;\r\n /**\r\n * Distribution of the colors if the color table contains fewer entries than needed. Defaults to GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_START\r\n * @see CompleteGreasedLineColorTable\r\n */\r\n colorDistribution?: GreasedLineMeshColorDistribution;\r\n}\r\n\r\n/**\r\n * Line mesh options for GreasedLineBuilder\r\n */\r\nexport interface GreasedLineMeshBuilderOptions extends GreasedLineMeshOptions {\r\n /**\r\n * Distribution of the widths if the width table contains fewer entries than needed. Defaults to GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_START\r\n * @see CompleteGreasedLineWidthTable\r\n */\r\n widthDistribution?: GreasedLineMeshWidthDistribution;\r\n}\r\n\r\n/**\r\n * Builder functions for creating GreasedLineMeshes\r\n */\r\n\r\n/**\r\n * Creates a new @see GreasedLinePluginMaterial\r\n * @param name name of the material\r\n * @param options material options @see GreasedLineMaterialOptions\r\n * @param scene scene or null to use the last scene\r\n * @returns StandardMaterial or PBRMaterial with the @see GreasedLinePluginMaterial attached to it\r\n */\r\nexport function CreateGreasedLineMaterial(name: string, options: GreasedLineMaterialOptions, scene: Nullable<Scene>) {\r\n scene = <Scene>(scene ?? EngineStore.LastCreatedScene);\r\n\r\n let material;\r\n switch (options.materialType) {\r\n case GreasedLineMeshMaterialType.MATERIAL_TYPE_PBR:\r\n material = new PBRMaterial(name, scene, true); // Forcing glsl for now\r\n new GreasedLinePluginMaterial(material, scene, options);\r\n break;\r\n case GreasedLineMeshMaterialType.MATERIAL_TYPE_SIMPLE:\r\n material = new GreasedLineSimpleMaterial(name, scene, options);\r\n break;\r\n default:\r\n material = new StandardMaterial(name, scene, true); // Forcing glsl for now\r\n new GreasedLinePluginMaterial(material, scene, options);\r\n break;\r\n }\r\n\r\n return material;\r\n}\r\n\r\n/**\r\n * Creates a GreasedLine mesh\r\n * @param name name of the mesh\r\n * @param options options for the mesh\r\n * @param materialOptions material options for the mesh\r\n * @param scene scene where the mesh will be created\r\n * @returns instance of GreasedLineMesh\r\n */\r\nexport function CreateGreasedLine(name: string, options: GreasedLineMeshBuilderOptions, materialOptions?: Nullable<GreasedLineMaterialBuilderOptions>, scene?: Nullable<Scene>) {\r\n scene = <Scene>(scene ?? EngineStore.LastCreatedScene);\r\n\r\n let instance;\r\n const allPoints = GreasedLineTools.ConvertPoints(options.points, options.pointsOptions);\r\n\r\n options.widthDistribution = options.widthDistribution ?? GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_START;\r\n if (options.ribbonOptions) {\r\n options.ribbonOptions.facesMode = options.ribbonOptions.facesMode ?? GreasedLineRibbonFacesMode.FACES_MODE_SINGLE_SIDED_NO_BACKFACE_CULLING;\r\n options.ribbonOptions.pointsMode = options.ribbonOptions.pointsMode ?? GreasedLineRibbonPointsMode.POINTS_MODE_POINTS;\r\n options.ribbonOptions.directionsAutoMode =\r\n options.ribbonOptions.directionsAutoMode ??\r\n (options.ribbonOptions.directions ? GreasedLineRibbonAutoDirectionMode.AUTO_DIRECTIONS_NONE : GreasedLineRibbonAutoDirectionMode.AUTO_DIRECTIONS_FROM_FIRST_SEGMENT);\r\n }\r\n\r\n materialOptions = materialOptions ?? {\r\n color: GreasedLineMaterialDefaults.DEFAULT_COLOR,\r\n };\r\n materialOptions.createAndAssignMaterial = materialOptions.createAndAssignMaterial ?? true;\r\n materialOptions.colorDistribution = materialOptions?.colorDistribution ?? GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_START;\r\n materialOptions.materialType = materialOptions.materialType ?? GreasedLineMeshMaterialType.MATERIAL_TYPE_STANDARD;\r\n\r\n const pointsCount = GetPointsCount(allPoints);\r\n const widths = CompleteGreasedLineWidthTable(pointsCount, options.widths ?? [], options.widthDistribution);\r\n\r\n const colors = materialOptions?.colors\r\n ? CompleteGreasedLineColorTable(pointsCount, materialOptions.colors, materialOptions.colorDistribution, materialOptions.color ?? GreasedLineMaterialDefaults.DEFAULT_COLOR)\r\n : undefined;\r\n\r\n // create new mesh if instance is not defined\r\n const initialGreasedLineOptions: GreasedLineMeshOptions = {\r\n points: allPoints,\r\n updatable: options.updatable,\r\n widths,\r\n lazy: options.lazy,\r\n ribbonOptions: options.ribbonOptions,\r\n uvs: options.uvs,\r\n colorPointers: options.colorPointers,\r\n };\r\n\r\n if (initialGreasedLineOptions.ribbonOptions) {\r\n if (initialGreasedLineOptions.ribbonOptions.pointsMode === GreasedLineRibbonPointsMode.POINTS_MODE_POINTS) {\r\n initialGreasedLineOptions.ribbonOptions.width = materialOptions.width ?? initialGreasedLineOptions.ribbonOptions.width ?? GreasedLineMaterialDefaults.DEFAULT_WIDTH;\r\n }\r\n }\r\n\r\n if (!options.instance) {\r\n instance = initialGreasedLineOptions.ribbonOptions\r\n ? new GreasedLineRibbonMesh(name, scene, initialGreasedLineOptions)\r\n : new GreasedLineMesh(name, scene, initialGreasedLineOptions);\r\n\r\n if (materialOptions) {\r\n const initialMaterialOptions: GreasedLineMaterialOptions = {\r\n materialType: materialOptions.materialType,\r\n dashCount: materialOptions.dashCount,\r\n dashOffset: materialOptions.dashOffset,\r\n dashRatio: materialOptions.dashRatio,\r\n resolution: materialOptions.resolution,\r\n sizeAttenuation: materialOptions.sizeAttenuation,\r\n useColors: materialOptions.useColors,\r\n useDash: materialOptions.useDash,\r\n visibility: materialOptions.visibility,\r\n width: materialOptions.width,\r\n color: materialOptions.color,\r\n colorMode: materialOptions.colorMode,\r\n colorsSampling: materialOptions.colorsSampling,\r\n colorDistributionType: materialOptions.colorDistributionType,\r\n colors,\r\n cameraFacing: !options.ribbonOptions,\r\n colorsTexture: materialOptions.colorsTexture,\r\n };\r\n\r\n if (materialOptions.createAndAssignMaterial) {\r\n const material = CreateGreasedLineMaterial(name, initialMaterialOptions, scene);\r\n instance.material = material;\r\n\r\n if (options.ribbonOptions?.facesMode === GreasedLineRibbonFacesMode.FACES_MODE_SINGLE_SIDED_NO_BACKFACE_CULLING) {\r\n material.backFaceCulling = false;\r\n }\r\n }\r\n }\r\n } else {\r\n // update the data on the mesh instance\r\n instance = options.instance;\r\n if (instance instanceof GreasedLineRibbonMesh) {\r\n instance.addPoints(allPoints, initialGreasedLineOptions);\r\n } else {\r\n // add widths\r\n const currentWidths = instance.widths;\r\n if (currentWidths) {\r\n const newWidths = currentWidths.slice();\r\n for (const w of widths) {\r\n newWidths.push(w);\r\n }\r\n instance.widths = newWidths;\r\n } else {\r\n instance.widths = widths;\r\n }\r\n\r\n instance.addPoints(allPoints);\r\n\r\n // add UVs\r\n if (options.uvs) {\r\n const currentUVs = instance.uvs;\r\n if (currentUVs) {\r\n const newUVs = new Float32Array(currentUVs.length + options.uvs.length);\r\n newUVs.set(currentUVs, 0);\r\n newUVs.set(options.uvs, currentUVs.length);\r\n instance.uvs = newUVs;\r\n } else {\r\n instance.uvs = options.uvs;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // add colors\r\n // it will merge if any colors already on the instance\r\n if (colors && options.instance) {\r\n if (options.instance.greasedLineMaterial) {\r\n const currentColors = options.instance.greasedLineMaterial.colors;\r\n if (currentColors) {\r\n const newColors = currentColors.concat(colors);\r\n options.instance.greasedLineMaterial.setColors(newColors, instance.isLazy());\r\n }\r\n }\r\n }\r\n\r\n return instance;\r\n}\r\n\r\n/**\r\n * Counts the number of points\r\n * @param allPoints Array of points [[x, y, z], [x, y, z], ...] or Array of points [x, y, z, x, y, z, ...]\r\n * @returns total number of points\r\n */\r\nexport function GetPointsCount(allPoints: number[][]) {\r\n let pointCount = 0;\r\n for (const points of allPoints) {\r\n pointCount += (<number[]>points).length / 3;\r\n }\r\n return pointCount;\r\n}\r\n\r\n/**\r\n * Completes the width table/fills the missing entries. It means it creates a width entry for every point of the line mesh.\r\n * You can provide more points the widths when creating the mesh. This function will fill the empty entries.\r\n * The algorithm used to fill the empty entries can be\r\n * GreasedLineMeshWidthDistribution.REPEAT - the width table will be repeatedly copied to the empty values [wL, wU] = [wL, wU, wL, wU, wL, wU, wL, wU, ...]\r\n * GreasedLineMeshWidthDistribution.EVEN - the width table will be evenly copied to the empty values [wL, wU] = [wL, wL, wL, wL, wU, wU, wU, wU]\r\n * GreasedLineMeshWidthDistribution.START - the width table will be copied at the start of the empty values\r\n * and rest will be filled width the default width upper and default width lower values [wU, wL] = [wL, wU, dwL, dwU, dwL, dwU, dwL, dwU]\r\n * GreasedLineMeshWidthDistribution.END - the width table will be copied at the end of the empty values\r\n * and rest will be filled width the default values [wL, wU] = [wL, wU, dwL, dwU, dwL, dwU, wL, wU]\r\n * @param pointCount number of points of the line mesh\r\n * @param widths array of widths [widhtLower, widthUpper, widthLower, widthUpper ...]. Two widths (lower/upper) per point.\r\n * @param widthsDistribution how to distribute widths if the widths array has fewer entries than pointCount\r\n * @param defaultWidthUpper the default value which will be used to fill empty width entries - upper width\r\n * @param defaultWidthLower the default value which will be used to fill empty width entries - lower width\r\n * @returns completed width table.\r\n */\r\nexport function CompleteGreasedLineWidthTable(\r\n pointCount: number,\r\n widths: number[],\r\n widthsDistribution: GreasedLineMeshWidthDistribution,\r\n defaultWidthUpper = 1,\r\n defaultWidthLower = 1\r\n): number[] {\r\n const missingCount = pointCount - widths.length / 2;\r\n\r\n const widthsData: number[] = [];\r\n if (missingCount < 0) {\r\n return widths.slice(0, pointCount * 2);\r\n }\r\n\r\n // is the width table shorter than the point table?\r\n if (missingCount > 0) {\r\n if (widths.length % 2 != 0) {\r\n widths.push(defaultWidthUpper);\r\n }\r\n // it is, fill in the missing elements\r\n if (widthsDistribution === GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_START_END) {\r\n const halfCount = Math.floor(widths.length / 2);\r\n\r\n // start sector\r\n for (let i = 0, j = 0; i < halfCount - 1; i++) {\r\n widthsData.push(widths[j++]);\r\n widthsData.push(widths[j++]);\r\n }\r\n\r\n // middle sector\r\n const widthL = widths[halfCount / 2];\r\n const widthU = widths[halfCount / 2 + 1];\r\n for (let i = 0; i < missingCount; i++) {\r\n widthsData.push(widthU);\r\n widthsData.push(widthL);\r\n }\r\n\r\n // end sector\r\n for (let i = halfCount; i < widths.length; i += 2) {\r\n widthsData.push(widths[i]);\r\n widthsData.push(widths[i + 1]);\r\n }\r\n } else if (widthsDistribution === GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_START) {\r\n // start sector\r\n for (let i = 0; i < widths.length; i += 2) {\r\n widthsData.push(widths[i]);\r\n widthsData.push(widths[i + 1]);\r\n }\r\n\r\n // end sector\r\n for (let i = 0; i < missingCount; i++) {\r\n widthsData.push(defaultWidthUpper);\r\n widthsData.push(defaultWidthLower);\r\n }\r\n } else if (widthsDistribution === GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_END) {\r\n // start sector\r\n for (let i = 0; i < missingCount; i++) {\r\n widthsData.push(defaultWidthUpper);\r\n widthsData.push(defaultWidthLower);\r\n }\r\n\r\n // end sector\r\n for (let i = 0; i < widths.length; i += 2) {\r\n widthsData.push(widths[i]);\r\n widthsData.push(widths[i + 1]);\r\n }\r\n } else if (widthsDistribution === GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_REPEAT) {\r\n let i = 0;\r\n for (let x = 0; x < pointCount; x++) {\r\n widthsData.push(widths[i++]);\r\n widthsData.push(widths[i++]);\r\n\r\n if (i === widths.length) {\r\n i = 0;\r\n }\r\n }\r\n } else if (widthsDistribution === GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_EVEN) {\r\n let j = 0;\r\n const widthsectorLength = widths.length / ((pointCount - 1) * 2);\r\n for (let x = 0; x < pointCount; x++) {\r\n const i = Math.floor(j);\r\n\r\n widthsData.push(widths[i]);\r\n widthsData.push(widths[i + 1]);\r\n\r\n j += widthsectorLength;\r\n }\r\n }\r\n } else {\r\n for (let i = 0; i < widths.length; i++) {\r\n widthsData.push(widths[i]);\r\n }\r\n }\r\n\r\n return widthsData;\r\n}\r\n\r\n/**\r\n * Completes the color table/fill the missing color entries. It means it creates a color entry for every point of the line mesh.\r\n * You can provide more points the colors when creating the mesh. This function will fill the empty entries.\r\n * The algorithm used to fill the empty entries can be\r\n * GreasedLineMesColorhDistribution.REPEAT - the color table will be repeatedly copied to the empty values [c1, c2] = [c1, c2, c1, c2, c1, c2, c1, c2]\r\n * GreasedLineMesColorhDistribution.EVEN - the color table will be evenly copied to the empty values [c1, c2] = [c1, c1, c1, c1, c2, c2, c2, c2]\r\n * GreasedLineMesColorhDistribution.START - the color table will be copied at the start of the empty values\r\n * and rest will be filled color the default color value [c1, c2] = [c1, c2, dc, dc, dc, dc, dc, dc]\r\n * GreasedLineMesColorhDistribution.START_END - the color table will be copied at the start and the end of the empty values\r\n * and rest will be filled color the default color value [c1, c2] = [c1, c2, dc, dc, dc, dc, c1, c2]\r\n * @param pointCount number of points of the line mesh\r\n * @param colors array of Color3 for the color table\r\n * @param colorDistribution how to distribute colors if the colors array has fewer entries than pointCount\r\n * @param defaultColor default color to be used to fill empty entries in the color table\r\n * @returns completed array of Color3s\r\n */\r\nexport function CompleteGreasedLineColorTable(pointCount: number, colors: Color3[], colorDistribution: GreasedLineMeshColorDistribution, defaultColor: Color3): Color3[] {\r\n pointCount = Math.max(colors.length, pointCount);\r\n const missingCount = pointCount - colors.length;\r\n if (missingCount < 0) {\r\n return colors.slice(0, pointCount);\r\n }\r\n\r\n const colorsData: Color3[] = [];\r\n // is the color table shorter than the point table?\r\n if (missingCount > 0) {\r\n // it is, fill in the missing elements\r\n if (colorDistribution === GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_START_END) {\r\n const halfCount = Math.floor(colors.length / 2);\r\n\r\n // start sector\r\n for (let i = 0; i < halfCount; i++) {\r\n colorsData.push(colors[i]);\r\n }\r\n\r\n // middle sector\r\n for (let i = 0; i < missingCount - 1; i++) {\r\n colorsData.push(defaultColor);\r\n }\r\n\r\n // end sector\r\n for (let i = halfCount; i < colors.length; i++) {\r\n colorsData.push(colors[i]);\r\n }\r\n } else if (colorDistribution === GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_START) {\r\n // start sector\r\n for (let i = 0; i < colors.length; i++) {\r\n colorsData.push(colors[i]);\r\n }\r\n\r\n // end sector\r\n for (let i = 0; i < missingCount; i++) {\r\n colorsData.push(defaultColor);\r\n }\r\n } else if (colorDistribution === GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_END) {\r\n // start sector\r\n for (let i = 0; i < missingCount - 1; i++) {\r\n colorsData.push(defaultColor);\r\n }\r\n\r\n // end sector\r\n for (let i = 0; i < colors.length; i++) {\r\n colorsData.push(colors[i]);\r\n }\r\n } else if (colorDistribution === GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_REPEAT) {\r\n let i = 0;\r\n for (let x = 0; x < pointCount; x++) {\r\n colorsData.push(colors[i]);\r\n\r\n i++;\r\n\r\n if (i === colors.length) {\r\n i = 0;\r\n }\r\n }\r\n } else if (colorDistribution === GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_EVEN) {\r\n let j = 0;\r\n const colorSectorLength = colors.length / (pointCount - 1);\r\n for (let x = 0; x < pointCount - 1; x++) {\r\n const i = Math.floor(j);\r\n\r\n colorsData.push(colors[i]);\r\n\r\n j += colorSectorLength;\r\n }\r\n } else if (colorDistribution === GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_NONE) {\r\n for (let i = 0; i < colors.length; i++) {\r\n colorsData.push(colors[i]);\r\n }\r\n }\r\n } else {\r\n for (let i = 0; i < pointCount; i++) {\r\n colorsData.push(colors[i]);\r\n }\r\n }\r\n\r\n return colorsData;\r\n}\r\n"]}
1
+ {"version":3,"file":"greasedLineBuilder.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Builders/greasedLineBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AA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U,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;gBACtC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBAExB,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;gBAE3B,CAAC,IAAI,iBAAiB,CAAC;YAC3B,CAAC;QACL,CAAC;aAAM,IAAI,iBAAiB,qEAA6D,EAAE,CAAC;YACxF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBACrC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YAC/B,CAAC;QACL,CAAC;IACL,CAAC;SAAM,CAAC;QACJ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,EAAE,CAAC,EAAE,EAAE,CAAC;YAClC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/B,CAAC;IACL,CAAC;IAED,OAAO,UAAU,CAAC;AACtB,CAAC","sourcesContent":["import { StandardMaterial } from \"./../../Materials/standardMaterial\";\r\nimport { PBRMaterial } from \"../../Materials/PBR/pbrMaterial\";\r\nimport type { Nullable } from \"../../types\";\r\nimport { GreasedLineMesh } from \"../GreasedLine/greasedLineMesh\";\r\nimport type { Scene } from \"../../scene\";\r\nimport { EngineStore } from \"../../Engines/engineStore\";\r\nimport type { Color3 } from \"../../Maths/math.color\";\r\nimport { GreasedLineSimpleMaterial } from \"../../Materials/GreasedLine/greasedLineSimpleMaterial\";\r\nimport { GreasedLineTools } from \"../../Misc/greasedLineTools\";\r\nimport type { GreasedLineMeshOptions } from \"../GreasedLine/greasedLineBaseMesh\";\r\nimport { GreasedLineRibbonAutoDirectionMode, GreasedLineRibbonFacesMode, GreasedLineRibbonPointsMode } from \"../GreasedLine/greasedLineBaseMesh\";\r\nimport { GreasedLineRibbonMesh } from \"../GreasedLine/greasedLineRibbonMesh\";\r\nimport type { GreasedLineMaterialOptions } from \"../../Materials/GreasedLine/greasedLineMaterialInterfaces\";\r\nimport { GreasedLineMeshMaterialType } from \"../../Materials/GreasedLine/greasedLineMaterialInterfaces\";\r\nimport { GreasedLinePluginMaterial } from \"../../Materials/GreasedLine/greasedLinePluginMaterial\";\r\nimport { GreasedLineMaterialDefaults } from \"../../Materials/GreasedLine/greasedLineMaterialDefaults\";\r\n\r\n/**\r\n * How are the colors distributed along the color table\r\n * {@link https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param/greased_line#colors-and-colordistribution}\r\n */\r\nexport const enum GreasedLineMeshColorDistribution {\r\n /**\r\n * Do no modify the color table\r\n */\r\n COLOR_DISTRIBUTION_NONE = 0,\r\n /**\r\n * Repeat the colors until the color table is full\r\n */\r\n COLOR_DISTRIBUTION_REPEAT = 1,\r\n /**\r\n * Distribute the colors evenly through the color table\r\n */\r\n COLOR_DISTRIBUTION_EVEN = 2,\r\n /**\r\n * Put the colors to start of the color table a fill the rest with the default color\r\n */\r\n COLOR_DISTRIBUTION_START = 3,\r\n /**\r\n * Put the colors to the end of the color table and fill the rest with the default color\r\n */\r\n COLOR_DISTRIBUTION_END = 4,\r\n /**\r\n * Put the colors to start and to the end of the color table and fill the gap between with the default color\r\n */\r\n COLOR_DISTRIBUTION_START_END = 5,\r\n}\r\n\r\n/**\r\n * How are the widths distributed along the width table\r\n * {@link https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param/greased_line#widths-and-widthdistribution}\r\n */\r\nexport const enum GreasedLineMeshWidthDistribution {\r\n /**\r\n * Do no modify the width table\r\n */\r\n WIDTH_DISTRIBUTION_NONE = 0,\r\n /**\r\n * Repeat the widths until the width table is full\r\n */\r\n WIDTH_DISTRIBUTION_REPEAT = 1,\r\n /**\r\n * Distribute the widths evenly through the width table\r\n */\r\n WIDTH_DISTRIBUTION_EVEN = 2,\r\n /**\r\n * Put the widths to start of the width table a fill the rest with the default width\r\n */\r\n WIDTH_DISTRIBUTION_START = 3,\r\n /**\r\n * Put the widths to the end of the width table and fill the rest with the default width\r\n */\r\n WIDTH_DISTRIBUTION_END = 4,\r\n /**\r\n * Put the widths to start and to the end of the width table and fill the gap between with the default width\r\n */\r\n WIDTH_DISTRIBUTION_START_END = 5,\r\n}\r\n\r\n/**\r\n * Material options for GreasedLineBuilder\r\n */\r\nexport interface GreasedLineMaterialBuilderOptions extends GreasedLineMaterialOptions {\r\n /**\r\n * If set to true a new material will be created and a new material plugin will be attached\r\n * to the material. The material will be set on the mesh. If the instance option is specified in the mesh options,\r\n * no material will be created/assigned. Defaults to true.\r\n */\r\n createAndAssignMaterial?: boolean;\r\n /**\r\n * Distribution of the colors if the color table contains fewer entries than needed. Defaults to GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_START\r\n * @see CompleteGreasedLineColorTable\r\n */\r\n colorDistribution?: GreasedLineMeshColorDistribution;\r\n}\r\n\r\n/**\r\n * Line mesh options for GreasedLineBuilder\r\n */\r\nexport interface GreasedLineMeshBuilderOptions extends GreasedLineMeshOptions {\r\n /**\r\n * Distribution of the widths if the width table contains fewer entries than needed. Defaults to GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_START\r\n * @see CompleteGreasedLineWidthTable\r\n */\r\n widthDistribution?: GreasedLineMeshWidthDistribution;\r\n}\r\n\r\n/**\r\n * Builder functions for creating GreasedLineMeshes\r\n */\r\n\r\n/**\r\n * Creates a new @see GreasedLinePluginMaterial\r\n * @param name name of the material\r\n * @param options material options @see GreasedLineMaterialOptions\r\n * @param scene scene or null to use the last scene\r\n * @returns StandardMaterial or PBRMaterial with the @see GreasedLinePluginMaterial attached to it\r\n */\r\nexport function CreateGreasedLineMaterial(name: string, options: GreasedLineMaterialOptions, scene: Nullable<Scene>) {\r\n scene = <Scene>(scene ?? EngineStore.LastCreatedScene);\r\n\r\n let material;\r\n switch (options.materialType) {\r\n case GreasedLineMeshMaterialType.MATERIAL_TYPE_PBR:\r\n material = new PBRMaterial(name, scene, options.forceGLSL);\r\n new GreasedLinePluginMaterial(material, scene, options);\r\n break;\r\n case GreasedLineMeshMaterialType.MATERIAL_TYPE_SIMPLE:\r\n material = new GreasedLineSimpleMaterial(name, scene, options);\r\n break;\r\n default:\r\n material = new StandardMaterial(name, scene, options.forceGLSL);\r\n new GreasedLinePluginMaterial(material, scene, options);\r\n break;\r\n }\r\n\r\n return material;\r\n}\r\n\r\n/**\r\n * Creates a GreasedLine mesh\r\n * @param name name of the mesh\r\n * @param options options for the mesh\r\n * @param materialOptions material options for the mesh\r\n * @param scene scene where the mesh will be created\r\n * @returns instance of GreasedLineMesh\r\n */\r\nexport function CreateGreasedLine(name: string, options: GreasedLineMeshBuilderOptions, materialOptions?: Nullable<GreasedLineMaterialBuilderOptions>, scene?: Nullable<Scene>) {\r\n scene = <Scene>(scene ?? EngineStore.LastCreatedScene);\r\n\r\n let instance;\r\n const allPoints = GreasedLineTools.ConvertPoints(options.points, options.pointsOptions);\r\n\r\n options.widthDistribution = options.widthDistribution ?? GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_START;\r\n if (options.ribbonOptions) {\r\n options.ribbonOptions.facesMode = options.ribbonOptions.facesMode ?? GreasedLineRibbonFacesMode.FACES_MODE_SINGLE_SIDED_NO_BACKFACE_CULLING;\r\n options.ribbonOptions.pointsMode = options.ribbonOptions.pointsMode ?? GreasedLineRibbonPointsMode.POINTS_MODE_POINTS;\r\n options.ribbonOptions.directionsAutoMode =\r\n options.ribbonOptions.directionsAutoMode ??\r\n (options.ribbonOptions.directions ? GreasedLineRibbonAutoDirectionMode.AUTO_DIRECTIONS_NONE : GreasedLineRibbonAutoDirectionMode.AUTO_DIRECTIONS_FROM_FIRST_SEGMENT);\r\n }\r\n\r\n materialOptions = materialOptions ?? {\r\n color: GreasedLineMaterialDefaults.DEFAULT_COLOR,\r\n };\r\n materialOptions.createAndAssignMaterial = materialOptions.createAndAssignMaterial ?? true;\r\n materialOptions.colorDistribution = materialOptions?.colorDistribution ?? GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_START;\r\n materialOptions.materialType = materialOptions.materialType ?? GreasedLineMeshMaterialType.MATERIAL_TYPE_STANDARD;\r\n\r\n const pointsCount = GetPointsCount(allPoints);\r\n const widths = CompleteGreasedLineWidthTable(pointsCount, options.widths ?? [], options.widthDistribution);\r\n\r\n const colors = materialOptions?.colors\r\n ? CompleteGreasedLineColorTable(pointsCount, materialOptions.colors, materialOptions.colorDistribution, materialOptions.color ?? GreasedLineMaterialDefaults.DEFAULT_COLOR)\r\n : undefined;\r\n\r\n // create new mesh if instance is not defined\r\n const initialGreasedLineOptions: GreasedLineMeshOptions = {\r\n points: allPoints,\r\n updatable: options.updatable,\r\n widths,\r\n lazy: options.lazy,\r\n ribbonOptions: options.ribbonOptions,\r\n uvs: options.uvs,\r\n colorPointers: options.colorPointers,\r\n };\r\n\r\n if (initialGreasedLineOptions.ribbonOptions) {\r\n if (initialGreasedLineOptions.ribbonOptions.pointsMode === GreasedLineRibbonPointsMode.POINTS_MODE_POINTS) {\r\n initialGreasedLineOptions.ribbonOptions.width = materialOptions.width ?? initialGreasedLineOptions.ribbonOptions.width ?? GreasedLineMaterialDefaults.DEFAULT_WIDTH;\r\n }\r\n }\r\n\r\n if (!options.instance) {\r\n instance = initialGreasedLineOptions.ribbonOptions\r\n ? new GreasedLineRibbonMesh(name, scene, initialGreasedLineOptions)\r\n : new GreasedLineMesh(name, scene, initialGreasedLineOptions);\r\n\r\n if (materialOptions) {\r\n const initialMaterialOptions: GreasedLineMaterialOptions = {\r\n materialType: materialOptions.materialType,\r\n dashCount: materialOptions.dashCount,\r\n dashOffset: materialOptions.dashOffset,\r\n dashRatio: materialOptions.dashRatio,\r\n resolution: materialOptions.resolution,\r\n sizeAttenuation: materialOptions.sizeAttenuation,\r\n useColors: materialOptions.useColors,\r\n useDash: materialOptions.useDash,\r\n visibility: materialOptions.visibility,\r\n width: materialOptions.width,\r\n color: materialOptions.color,\r\n colorMode: materialOptions.colorMode,\r\n colorsSampling: materialOptions.colorsSampling,\r\n colorDistributionType: materialOptions.colorDistributionType,\r\n colors,\r\n cameraFacing: !options.ribbonOptions,\r\n colorsTexture: materialOptions.colorsTexture,\r\n };\r\n\r\n if (materialOptions.createAndAssignMaterial) {\r\n const material = CreateGreasedLineMaterial(name, initialMaterialOptions, scene);\r\n instance.material = material;\r\n\r\n if (options.ribbonOptions?.facesMode === GreasedLineRibbonFacesMode.FACES_MODE_SINGLE_SIDED_NO_BACKFACE_CULLING) {\r\n material.backFaceCulling = false;\r\n }\r\n }\r\n }\r\n } else {\r\n // update the data on the mesh instance\r\n instance = options.instance;\r\n if (instance instanceof GreasedLineRibbonMesh) {\r\n instance.addPoints(allPoints, initialGreasedLineOptions);\r\n } else {\r\n // add widths\r\n const currentWidths = instance.widths;\r\n if (currentWidths) {\r\n const newWidths = currentWidths.slice();\r\n for (const w of widths) {\r\n newWidths.push(w);\r\n }\r\n instance.widths = newWidths;\r\n } else {\r\n instance.widths = widths;\r\n }\r\n\r\n instance.addPoints(allPoints);\r\n\r\n // add UVs\r\n if (options.uvs) {\r\n const currentUVs = instance.uvs;\r\n if (currentUVs) {\r\n const newUVs = new Float32Array(currentUVs.length + options.uvs.length);\r\n newUVs.set(currentUVs, 0);\r\n newUVs.set(options.uvs, currentUVs.length);\r\n instance.uvs = newUVs;\r\n } else {\r\n instance.uvs = options.uvs;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // add colors\r\n // it will merge if any colors already on the instance\r\n if (colors && options.instance) {\r\n if (options.instance.greasedLineMaterial) {\r\n const currentColors = options.instance.greasedLineMaterial.colors;\r\n if (currentColors) {\r\n const newColors = currentColors.concat(colors);\r\n options.instance.greasedLineMaterial.setColors(newColors, instance.isLazy());\r\n }\r\n }\r\n }\r\n\r\n return instance;\r\n}\r\n\r\n/**\r\n * Counts the number of points\r\n * @param allPoints Array of points [[x, y, z], [x, y, z], ...] or Array of points [x, y, z, x, y, z, ...]\r\n * @returns total number of points\r\n */\r\nexport function GetPointsCount(allPoints: number[][]) {\r\n let pointCount = 0;\r\n for (const points of allPoints) {\r\n pointCount += (<number[]>points).length / 3;\r\n }\r\n return pointCount;\r\n}\r\n\r\n/**\r\n * Completes the width table/fills the missing entries. It means it creates a width entry for every point of the line mesh.\r\n * You can provide more points the widths when creating the mesh. This function will fill the empty entries.\r\n * The algorithm used to fill the empty entries can be\r\n * GreasedLineMeshWidthDistribution.REPEAT - the width table will be repeatedly copied to the empty values [wL, wU] = [wL, wU, wL, wU, wL, wU, wL, wU, ...]\r\n * GreasedLineMeshWidthDistribution.EVEN - the width table will be evenly copied to the empty values [wL, wU] = [wL, wL, wL, wL, wU, wU, wU, wU]\r\n * GreasedLineMeshWidthDistribution.START - the width table will be copied at the start of the empty values\r\n * and rest will be filled width the default width upper and default width lower values [wU, wL] = [wL, wU, dwL, dwU, dwL, dwU, dwL, dwU]\r\n * GreasedLineMeshWidthDistribution.END - the width table will be copied at the end of the empty values\r\n * and rest will be filled width the default values [wL, wU] = [wL, wU, dwL, dwU, dwL, dwU, wL, wU]\r\n * @param pointCount number of points of the line mesh\r\n * @param widths array of widths [widhtLower, widthUpper, widthLower, widthUpper ...]. Two widths (lower/upper) per point.\r\n * @param widthsDistribution how to distribute widths if the widths array has fewer entries than pointCount\r\n * @param defaultWidthUpper the default value which will be used to fill empty width entries - upper width\r\n * @param defaultWidthLower the default value which will be used to fill empty width entries - lower width\r\n * @returns completed width table.\r\n */\r\nexport function CompleteGreasedLineWidthTable(\r\n pointCount: number,\r\n widths: number[],\r\n widthsDistribution: GreasedLineMeshWidthDistribution,\r\n defaultWidthUpper = 1,\r\n defaultWidthLower = 1\r\n): number[] {\r\n const missingCount = pointCount - widths.length / 2;\r\n\r\n const widthsData: number[] = [];\r\n if (missingCount < 0) {\r\n return widths.slice(0, pointCount * 2);\r\n }\r\n\r\n // is the width table shorter than the point table?\r\n if (missingCount > 0) {\r\n if (widths.length % 2 != 0) {\r\n widths.push(defaultWidthUpper);\r\n }\r\n // it is, fill in the missing elements\r\n if (widthsDistribution === GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_START_END) {\r\n const halfCount = Math.floor(widths.length / 2);\r\n\r\n // start sector\r\n for (let i = 0, j = 0; i < halfCount - 1; i++) {\r\n widthsData.push(widths[j++]);\r\n widthsData.push(widths[j++]);\r\n }\r\n\r\n // middle sector\r\n const widthL = widths[halfCount / 2];\r\n const widthU = widths[halfCount / 2 + 1];\r\n for (let i = 0; i < missingCount; i++) {\r\n widthsData.push(widthU);\r\n widthsData.push(widthL);\r\n }\r\n\r\n // end sector\r\n for (let i = halfCount; i < widths.length; i += 2) {\r\n widthsData.push(widths[i]);\r\n widthsData.push(widths[i + 1]);\r\n }\r\n } else if (widthsDistribution === GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_START) {\r\n // start sector\r\n for (let i = 0; i < widths.length; i += 2) {\r\n widthsData.push(widths[i]);\r\n widthsData.push(widths[i + 1]);\r\n }\r\n\r\n // end sector\r\n for (let i = 0; i < missingCount; i++) {\r\n widthsData.push(defaultWidthUpper);\r\n widthsData.push(defaultWidthLower);\r\n }\r\n } else if (widthsDistribution === GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_END) {\r\n // start sector\r\n for (let i = 0; i < missingCount; i++) {\r\n widthsData.push(defaultWidthUpper);\r\n widthsData.push(defaultWidthLower);\r\n }\r\n\r\n // end sector\r\n for (let i = 0; i < widths.length; i += 2) {\r\n widthsData.push(widths[i]);\r\n widthsData.push(widths[i + 1]);\r\n }\r\n } else if (widthsDistribution === GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_REPEAT) {\r\n let i = 0;\r\n for (let x = 0; x < pointCount; x++) {\r\n widthsData.push(widths[i++]);\r\n widthsData.push(widths[i++]);\r\n\r\n if (i === widths.length) {\r\n i = 0;\r\n }\r\n }\r\n } else if (widthsDistribution === GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_EVEN) {\r\n let j = 0;\r\n const widthsectorLength = widths.length / ((pointCount - 1) * 2);\r\n for (let x = 0; x < pointCount; x++) {\r\n const i = Math.floor(j);\r\n\r\n widthsData.push(widths[i]);\r\n widthsData.push(widths[i + 1]);\r\n\r\n j += widthsectorLength;\r\n }\r\n }\r\n } else {\r\n for (let i = 0; i < widths.length; i++) {\r\n widthsData.push(widths[i]);\r\n }\r\n }\r\n\r\n return widthsData;\r\n}\r\n\r\n/**\r\n * Completes the color table/fill the missing color entries. It means it creates a color entry for every point of the line mesh.\r\n * You can provide more points the colors when creating the mesh. This function will fill the empty entries.\r\n * The algorithm used to fill the empty entries can be\r\n * GreasedLineMesColorhDistribution.REPEAT - the color table will be repeatedly copied to the empty values [c1, c2] = [c1, c2, c1, c2, c1, c2, c1, c2]\r\n * GreasedLineMesColorhDistribution.EVEN - the color table will be evenly copied to the empty values [c1, c2] = [c1, c1, c1, c1, c2, c2, c2, c2]\r\n * GreasedLineMesColorhDistribution.START - the color table will be copied at the start of the empty values\r\n * and rest will be filled color the default color value [c1, c2] = [c1, c2, dc, dc, dc, dc, dc, dc]\r\n * GreasedLineMesColorhDistribution.START_END - the color table will be copied at the start and the end of the empty values\r\n * and rest will be filled color the default color value [c1, c2] = [c1, c2, dc, dc, dc, dc, c1, c2]\r\n * @param pointCount number of points of the line mesh\r\n * @param colors array of Color3 for the color table\r\n * @param colorDistribution how to distribute colors if the colors array has fewer entries than pointCount\r\n * @param defaultColor default color to be used to fill empty entries in the color table\r\n * @returns completed array of Color3s\r\n */\r\nexport function CompleteGreasedLineColorTable(pointCount: number, colors: Color3[], colorDistribution: GreasedLineMeshColorDistribution, defaultColor: Color3): Color3[] {\r\n pointCount = Math.max(colors.length, pointCount);\r\n const missingCount = pointCount - colors.length;\r\n if (missingCount < 0) {\r\n return colors.slice(0, pointCount);\r\n }\r\n\r\n const colorsData: Color3[] = [];\r\n // is the color table shorter than the point table?\r\n if (missingCount > 0) {\r\n // it is, fill in the missing elements\r\n if (colorDistribution === GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_START_END) {\r\n const halfCount = Math.floor(colors.length / 2);\r\n\r\n // start sector\r\n for (let i = 0; i < halfCount; i++) {\r\n colorsData.push(colors[i]);\r\n }\r\n\r\n // middle sector\r\n for (let i = 0; i < missingCount - 1; i++) {\r\n colorsData.push(defaultColor);\r\n }\r\n\r\n // end sector\r\n for (let i = halfCount; i < colors.length; i++) {\r\n colorsData.push(colors[i]);\r\n }\r\n } else if (colorDistribution === GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_START) {\r\n // start sector\r\n for (let i = 0; i < colors.length; i++) {\r\n colorsData.push(colors[i]);\r\n }\r\n\r\n // end sector\r\n for (let i = 0; i < missingCount; i++) {\r\n colorsData.push(defaultColor);\r\n }\r\n } else if (colorDistribution === GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_END) {\r\n // start sector\r\n for (let i = 0; i < missingCount - 1; i++) {\r\n colorsData.push(defaultColor);\r\n }\r\n\r\n // end sector\r\n for (let i = 0; i < colors.length; i++) {\r\n colorsData.push(colors[i]);\r\n }\r\n } else if (colorDistribution === GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_REPEAT) {\r\n let i = 0;\r\n for (let x = 0; x < pointCount; x++) {\r\n colorsData.push(colors[i]);\r\n\r\n i++;\r\n\r\n if (i === colors.length) {\r\n i = 0;\r\n }\r\n }\r\n } else if (colorDistribution === GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_EVEN) {\r\n let j = 0;\r\n const colorSectorLength = colors.length / (pointCount - 1);\r\n for (let x = 0; x < pointCount - 1; x++) {\r\n const i = Math.floor(j);\r\n\r\n colorsData.push(colors[i]);\r\n\r\n j += colorSectorLength;\r\n }\r\n } else if (colorDistribution === GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_NONE) {\r\n for (let i = 0; i < colors.length; i++) {\r\n colorsData.push(colors[i]);\r\n }\r\n }\r\n } else {\r\n for (let i = 0; i < pointCount; i++) {\r\n colorsData.push(colors[i]);\r\n }\r\n }\r\n\r\n return colorsData;\r\n}\r\n"]}
@@ -128,9 +128,11 @@ export declare class GaussianSplattingMesh extends Mesh {
128
128
  private _colorsTexture;
129
129
  private _splatPositions;
130
130
  private _splatIndex;
131
+ private _shTextures;
131
132
  private _covariancesA;
132
133
  private _covariancesB;
133
134
  private _colors;
135
+ private _sh;
134
136
  private readonly _keepInRam;
135
137
  private _delayedTextureUpdate;
136
138
  private _oldDirection;
@@ -142,6 +144,11 @@ export declare class GaussianSplattingMesh extends Mesh {
142
144
  private static _SH_C0;
143
145
  private static _SplatBatchSize;
144
146
  private static _PlyConversionBatchSize;
147
+ private _shDegree;
148
+ /**
149
+ * SH degree. 0 = no sh (default). 1 = 3 parameters. 2 = 8 parameters. 3 = 15 parameters.
150
+ */
151
+ get shDegree(): number;
145
152
  /**
146
153
  * Set the number of batch (a batch is 16384 splats) after which a display update is performed
147
154
  * A value of 0 (default) means display update will not happens before splat is ready.
@@ -163,6 +170,10 @@ export declare class GaussianSplattingMesh extends Mesh {
163
170
  * Gets the colors texture
164
171
  */
165
172
  get colorsTexture(): Nullable<BaseTexture>;
173
+ /**
174
+ * Gets the SH textures
175
+ */
176
+ get shTextures(): Nullable<BaseTexture[]>;
166
177
  /**
167
178
  * set rendering material
168
179
  */
@@ -262,15 +273,17 @@ export declare class GaussianSplattingMesh extends Mesh {
262
273
  /**
263
274
  * Update asynchronously the buffer
264
275
  * @param data array buffer containing center, color, orientation and scale of splats
276
+ * @param sh optional array of uint8 array for SH data
265
277
  * @returns a promise
266
278
  */
267
- updateDataAsync(data: ArrayBuffer): Promise<void>;
279
+ updateDataAsync(data: ArrayBuffer, sh?: Uint8Array[]): Promise<void>;
268
280
  /**
269
281
  * @experimental
270
282
  * Update data from GS (position, orientation, color, scaling)
271
283
  * @param data array that contain all the datas
284
+ * @param sh optional array of uint8 array for SH data
272
285
  */
273
- updateData(data: ArrayBuffer): void;
286
+ updateData(data: ArrayBuffer, sh?: Uint8Array[]): void;
274
287
  private _updateSplatIndexBuffer;
275
288
  private _updateSubTextures;
276
289
  private _instanciateWorker;
@@ -109,6 +109,12 @@ var PLYValue;
109
109
  * Class used to render a gaussian splatting mesh
110
110
  */
111
111
  export class GaussianSplattingMesh extends Mesh {
112
+ /**
113
+ * SH degree. 0 = no sh (default). 1 = 3 parameters. 2 = 8 parameters. 3 = 15 parameters.
114
+ */
115
+ get shDegree() {
116
+ return this._shDegree;
117
+ }
112
118
  /**
113
119
  * Gets the covariancesA texture
114
120
  */
@@ -133,6 +139,12 @@ export class GaussianSplattingMesh extends Mesh {
133
139
  get colorsTexture() {
134
140
  return this._colorsTexture;
135
141
  }
142
+ /**
143
+ * Gets the SH textures
144
+ */
145
+ get shTextures() {
146
+ return this._shTextures;
147
+ }
136
148
  /**
137
149
  * set rendering material
138
150
  */
@@ -169,12 +181,14 @@ export class GaussianSplattingMesh extends Mesh {
169
181
  this._colorsTexture = null;
170
182
  this._splatPositions = null;
171
183
  this._splatIndex = null;
184
+ this._shTextures = null;
172
185
  //@ts-expect-error
173
186
  this._covariancesA = null;
174
187
  //@ts-expect-error
175
188
  this._covariancesB = null;
176
189
  //@ts-expect-error
177
190
  this._colors = null;
191
+ this._sh = null;
178
192
  this._keepInRam = false;
179
193
  this._delayedTextureUpdate = null;
180
194
  this._oldDirection = new Vector3();
@@ -182,6 +196,7 @@ export class GaussianSplattingMesh extends Mesh {
182
196
  this._material = null;
183
197
  this._tmpCovariances = [0, 0, 0, 0, 0, 0];
184
198
  this._sortIsDirty = false;
199
+ this._shDegree = 0;
185
200
  const vertexData = new VertexData();
186
201
  // Use an intanced quad or triangle. Triangle might be a bit faster because of less shader invocation but I didn't see any difference.
187
202
  // Keeping both and use triangle for now.
@@ -694,10 +709,16 @@ export class GaussianSplattingMesh extends Mesh {
694
709
  this._covariancesBTexture?.dispose();
695
710
  this._centersTexture?.dispose();
696
711
  this._colorsTexture?.dispose();
712
+ if (this._shTextures) {
713
+ this._shTextures.forEach((shTexture) => {
714
+ shTexture.dispose();
715
+ });
716
+ }
697
717
  this._covariancesATexture = null;
698
718
  this._covariancesBTexture = null;
699
719
  this._centersTexture = null;
700
720
  this._colorsTexture = null;
721
+ this._shTextures = null;
701
722
  this._worker?.terminate();
702
723
  this._worker = null;
703
724
  super.dispose(doNotRecurse, true);
@@ -707,6 +728,12 @@ export class GaussianSplattingMesh extends Mesh {
707
728
  this._covariancesBTexture = source.covariancesBTexture?.clone();
708
729
  this._centersTexture = source.centersTexture?.clone();
709
730
  this._colorsTexture = source.colorsTexture?.clone();
731
+ if (source._shTextures) {
732
+ this._shTextures = [];
733
+ this._shTextures.forEach((shTexture) => {
734
+ this._shTextures?.push(shTexture.clone());
735
+ });
736
+ }
710
737
  }
711
738
  /**
712
739
  * Returns a new Mesh object generated from the current mesh properties.
@@ -772,7 +799,7 @@ export class GaussianSplattingMesh extends Mesh {
772
799
  colorArray[destinationIndex * 4 + 2] = uBuffer[32 * sourceIndex + 24 + 2];
773
800
  colorArray[destinationIndex * 4 + 3] = uBuffer[32 * sourceIndex + 24 + 3];
774
801
  }
775
- _updateTextures(covA, covB, colorArray) {
802
+ _updateTextures(covA, covB, colorArray, sh) {
776
803
  const textureSize = this._getTextureSize(this._vertexCount);
777
804
  // Update the textures
778
805
  const createTextureFromData = (data, width, height, format) => {
@@ -781,6 +808,9 @@ export class GaussianSplattingMesh extends Mesh {
781
808
  const createTextureFromDataU8 = (data, width, height, format) => {
782
809
  return new RawTexture(data, width, height, format, this._scene, false, false, 2, 0);
783
810
  };
811
+ const createTextureFromDataU32 = (data, width, height, format) => {
812
+ return new RawTexture(data, width, height, format, this._scene, false, false, 1, 7);
813
+ };
784
814
  const createTextureFromDataF16 = (data, width, height, format) => {
785
815
  return new RawTexture(data, width, height, format, this._scene, false, false, 2, 2);
786
816
  };
@@ -788,9 +818,12 @@ export class GaussianSplattingMesh extends Mesh {
788
818
  this._covariancesA = covA;
789
819
  this._covariancesB = covB;
790
820
  this._colors = colorArray;
821
+ if (sh) {
822
+ this._sh = sh;
823
+ }
791
824
  }
792
825
  if (this._covariancesATexture) {
793
- this._delayedTextureUpdate = { covA: covA, covB: covB, colors: colorArray, centers: this._splatPositions };
826
+ this._delayedTextureUpdate = { covA: covA, covB: covB, colors: colorArray, centers: this._splatPositions, sh: sh };
794
827
  const positions = Float32Array.from(this._splatPositions);
795
828
  const vertexCount = this._vertexCount;
796
829
  this._worker.postMessage({ positions, vertexCount }, [positions.buffer]);
@@ -801,10 +834,20 @@ export class GaussianSplattingMesh extends Mesh {
801
834
  this._covariancesBTexture = createTextureFromDataF16(covB, textureSize.x, textureSize.y, this._useRGBACovariants ? 5 : 7);
802
835
  this._centersTexture = createTextureFromData(this._splatPositions, textureSize.x, textureSize.y, 5);
803
836
  this._colorsTexture = createTextureFromDataU8(colorArray, textureSize.x, textureSize.y, 5);
837
+ if (sh) {
838
+ this._shTextures = [];
839
+ sh.forEach((shData) => {
840
+ const buffer = new Uint32Array(shData.buffer);
841
+ const shTexture = createTextureFromDataU32(buffer, textureSize.x, textureSize.y, 11);
842
+ shTexture.wrapU = 0;
843
+ shTexture.wrapV = 0;
844
+ this._shTextures.push(shTexture);
845
+ });
846
+ }
804
847
  this._instanciateWorker();
805
848
  }
806
849
  }
807
- *_updateData(data, isAsync) {
850
+ *_updateData(data, isAsync, sh) {
808
851
  // if a covariance texture is present, then it's not a creation but an update
809
852
  if (!this._covariancesATexture) {
810
853
  this._readyToDisplay = false;
@@ -817,6 +860,8 @@ export class GaussianSplattingMesh extends Mesh {
817
860
  this._updateSplatIndexBuffer(vertexCount);
818
861
  }
819
862
  this._vertexCount = vertexCount;
863
+ // degree == 1 for 1 texture (3 terms), 2 for 2 textures(8 terms) and 3 for 3 textures (15 terms)
864
+ this._shDegree = sh ? sh.length : 0;
820
865
  const textureSize = this._getTextureSize(vertexCount);
821
866
  const textureLength = textureSize.x * textureSize.y;
822
867
  const lineCountUpdate = GaussianSplattingMesh.ProgressiveUpdateAmount ?? textureSize.y;
@@ -829,7 +874,7 @@ export class GaussianSplattingMesh extends Mesh {
829
874
  const maximum = new Vector3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
830
875
  if (GaussianSplattingMesh.ProgressiveUpdateAmount) {
831
876
  // create textures with not filled-yet array, then update directly portions of it
832
- this._updateTextures(covA, covB, colorArray);
877
+ this._updateTextures(covA, covB, colorArray, sh);
833
878
  this.setEnabled(true);
834
879
  const partCount = Math.ceil(textureSize.y / lineCountUpdate);
835
880
  for (let partIndex = 0; partIndex < partCount; partIndex++) {
@@ -859,7 +904,7 @@ export class GaussianSplattingMesh extends Mesh {
859
904
  }
860
905
  }
861
906
  // textures
862
- this._updateTextures(covA, covB, colorArray);
907
+ this._updateTextures(covA, covB, colorArray, sh);
863
908
  // Update the binfo
864
909
  this.getBoundingInfo().reConstruct(minimum, maximum, this.getWorldMatrix());
865
910
  this.setEnabled(true);
@@ -869,18 +914,20 @@ export class GaussianSplattingMesh extends Mesh {
869
914
  /**
870
915
  * Update asynchronously the buffer
871
916
  * @param data array buffer containing center, color, orientation and scale of splats
917
+ * @param sh optional array of uint8 array for SH data
872
918
  * @returns a promise
873
919
  */
874
- async updateDataAsync(data) {
875
- return runCoroutineAsync(this._updateData(data, true), createYieldingScheduler());
920
+ async updateDataAsync(data, sh) {
921
+ return runCoroutineAsync(this._updateData(data, true, sh), createYieldingScheduler());
876
922
  }
877
923
  /**
878
924
  * @experimental
879
925
  * Update data from GS (position, orientation, color, scaling)
880
926
  * @param data array that contain all the datas
927
+ * @param sh optional array of uint8 array for SH data
881
928
  */
882
- updateData(data) {
883
- runCoroutineSync(this._updateData(data, false));
929
+ updateData(data, sh) {
930
+ runCoroutineSync(this._updateData(data, false, sh));
884
931
  }
885
932
  // in case size is different
886
933
  _updateSplatIndexBuffer(vertexCount) {
@@ -890,16 +937,10 @@ export class GaussianSplattingMesh extends Mesh {
890
937
  }
891
938
  this.forcedInstanceCount = vertexCount;
892
939
  }
893
- _updateSubTextures(centers, covA, covB, colors, lineStart, lineCount) {
940
+ _updateSubTextures(centers, covA, covB, colors, lineStart, lineCount, sh) {
894
941
  const updateTextureFromData = (texture, data, width, lineStart, lineCount) => {
895
942
  this.getEngine().updateTextureData(texture.getInternalTexture(), data, 0, lineStart, width, lineCount, 0, 0, false);
896
943
  };
897
- const updateTextureFromDataU8 = (texture, data, width, lineStart, lineCount) => {
898
- this.getEngine().updateTextureData(texture.getInternalTexture(), data, 0, lineStart, width, lineCount, 0, 0, false);
899
- };
900
- const updateTextureFromDataF16 = (texture, data, width, lineStart, lineCount) => {
901
- this.getEngine().updateTextureData(texture.getInternalTexture(), data, 0, lineStart, width, lineCount, 0, 0, false);
902
- };
903
944
  const textureSize = this._getTextureSize(this._vertexCount);
904
945
  const covBSItemSize = this._useRGBACovariants ? 4 : 2;
905
946
  const texelStart = lineStart * textureSize.x;
@@ -908,10 +949,17 @@ export class GaussianSplattingMesh extends Mesh {
908
949
  const covBView = new Uint16Array(covB.buffer, texelStart * covBSItemSize * Uint16Array.BYTES_PER_ELEMENT, texelCount * covBSItemSize);
909
950
  const colorsView = new Uint8Array(colors.buffer, texelStart * 4, texelCount * 4);
910
951
  const centersView = new Float32Array(centers.buffer, texelStart * 4 * Float32Array.BYTES_PER_ELEMENT, texelCount * 4);
911
- updateTextureFromDataF16(this._covariancesATexture, covAView, textureSize.x, lineStart, lineCount);
912
- updateTextureFromDataF16(this._covariancesBTexture, covBView, textureSize.x, lineStart, lineCount);
952
+ updateTextureFromData(this._covariancesATexture, covAView, textureSize.x, lineStart, lineCount);
953
+ updateTextureFromData(this._covariancesBTexture, covBView, textureSize.x, lineStart, lineCount);
913
954
  updateTextureFromData(this._centersTexture, centersView, textureSize.x, lineStart, lineCount);
914
- updateTextureFromDataU8(this._colorsTexture, colorsView, textureSize.x, lineStart, lineCount);
955
+ updateTextureFromData(this._colorsTexture, colorsView, textureSize.x, lineStart, lineCount);
956
+ if (sh) {
957
+ for (let i = 0; i < sh.length; i++) {
958
+ const componentCount = 4;
959
+ const shView = new Uint8Array(this._sh[i].buffer, texelStart * componentCount, texelCount * componentCount);
960
+ updateTextureFromData(this._shTextures[i], shView, textureSize.x, lineStart, lineCount);
961
+ }
962
+ }
915
963
  }
916
964
  _instanciateWorker() {
917
965
  if (!this._vertexCount) {
@@ -937,7 +985,7 @@ export class GaussianSplattingMesh extends Mesh {
937
985
  }
938
986
  if (this._delayedTextureUpdate) {
939
987
  const textureSize = this._getTextureSize(vertexCount);
940
- this._updateSubTextures(this._delayedTextureUpdate.centers, this._delayedTextureUpdate.covA, this._delayedTextureUpdate.covB, this._delayedTextureUpdate.colors, 0, textureSize.y);
988
+ this._updateSubTextures(this._delayedTextureUpdate.centers, this._delayedTextureUpdate.covA, this._delayedTextureUpdate.covB, this._delayedTextureUpdate.colors, 0, textureSize.y, this._delayedTextureUpdate.sh);
941
989
  this._delayedTextureUpdate = null;
942
990
  }
943
991
  this.thinInstanceBufferUpdated("splatIndex");