@onerjs/core 9.0.0 → 9.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (353) hide show
  1. package/Animations/animationGroup.pure.js.map +1 -1
  2. package/Cameras/targetCamera.pure.js +6 -1
  3. package/Cameras/targetCamera.pure.js.map +1 -1
  4. package/Engines/Native/nativeHardwareTexture.d.ts +8 -1
  5. package/Engines/Native/nativeHardwareTexture.js +7 -0
  6. package/Engines/Native/nativeHardwareTexture.js.map +1 -1
  7. package/Engines/Native/nativeHelpers.js +56 -1
  8. package/Engines/Native/nativeHelpers.js.map +1 -1
  9. package/Engines/Native/nativeInterfaces.d.ts +37 -8
  10. package/Engines/Native/nativeInterfaces.js.map +1 -1
  11. package/Engines/Native/nativeRenderTargetWrapper.d.ts +40 -0
  12. package/Engines/Native/nativeRenderTargetWrapper.js +265 -5
  13. package/Engines/Native/nativeRenderTargetWrapper.js.map +1 -1
  14. package/Engines/Processors/shaderCodeCursor.d.ts +1 -0
  15. package/Engines/Processors/shaderCodeCursor.js +40 -3
  16. package/Engines/Processors/shaderCodeCursor.js.map +1 -1
  17. package/Engines/WebGPU/Extensions/engine.renderTarget.pure.js +1 -0
  18. package/Engines/WebGPU/Extensions/engine.renderTarget.pure.js.map +1 -1
  19. package/Engines/abstractEngine.pure.d.ts +15 -1
  20. package/Engines/abstractEngine.pure.js +12 -4
  21. package/Engines/abstractEngine.pure.js.map +1 -1
  22. package/Engines/engine.pure.d.ts +0 -1
  23. package/Engines/engine.pure.js +0 -7
  24. package/Engines/engine.pure.js.map +1 -1
  25. package/Engines/nativeEngine.pure.js +1 -1
  26. package/Engines/nativeEngine.pure.js.map +1 -1
  27. package/Engines/thinEngine.pure.d.ts +1 -0
  28. package/Engines/thinEngine.pure.js +13 -2
  29. package/Engines/thinEngine.pure.js.map +1 -1
  30. package/Engines/thinNativeEngine.pure.d.ts +217 -17
  31. package/Engines/thinNativeEngine.pure.js +1431 -164
  32. package/Engines/thinNativeEngine.pure.js.map +1 -1
  33. package/Engines/thinWebGPUEngine.js +6 -1
  34. package/Engines/thinWebGPUEngine.js.map +1 -1
  35. package/Engines/webgpuEngine.pure.d.ts +12 -1
  36. package/Engines/webgpuEngine.pure.js +8 -0
  37. package/Engines/webgpuEngine.pure.js.map +1 -1
  38. package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.pure.d.ts +10 -0
  39. package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.pure.js +24 -12
  40. package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.pure.js.map +1 -1
  41. package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.pure.d.ts +7 -0
  42. package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.pure.js +43 -0
  43. package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.pure.js.map +1 -1
  44. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.d.ts +16 -4
  45. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.js +20 -6
  46. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.js.map +1 -1
  47. package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.pure.js +3 -3
  48. package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.pure.js.map +1 -1
  49. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.d.ts +7 -7
  50. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.js +52 -35
  51. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.js.map +1 -1
  52. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.pure.d.ts +12 -1
  53. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.pure.js +8 -0
  54. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.pure.js.map +1 -1
  55. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.pure.js +4 -1
  56. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.pure.js.map +1 -1
  57. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.pure.d.ts +12 -1
  58. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.pure.js +5 -1
  59. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.pure.js.map +1 -1
  60. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.pure.d.ts +2 -0
  61. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.pure.js +14 -2
  62. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.pure.js.map +1 -1
  63. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.pure.d.ts +5 -1
  64. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.pure.js +23 -8
  65. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.pure.js.map +1 -1
  66. package/FlowGraph/CustomTypes/flowGraphInteger.pure.d.ts +5 -0
  67. package/FlowGraph/CustomTypes/flowGraphInteger.pure.js +7 -0
  68. package/FlowGraph/CustomTypes/flowGraphInteger.pure.js.map +1 -1
  69. package/FlowGraph/CustomTypes/flowGraphMatrix.d.ts +10 -0
  70. package/FlowGraph/CustomTypes/flowGraphMatrix.js +14 -0
  71. package/FlowGraph/CustomTypes/flowGraphMatrix.js.map +1 -1
  72. package/FlowGraph/flowGraph.d.ts +2 -1
  73. package/FlowGraph/flowGraph.js +3 -2
  74. package/FlowGraph/flowGraph.js.map +1 -1
  75. package/FlowGraph/flowGraphAnimationHelpers.d.ts +24 -0
  76. package/FlowGraph/flowGraphAnimationHelpers.js +21 -0
  77. package/FlowGraph/flowGraphAnimationHelpers.js.map +1 -0
  78. package/FlowGraph/flowGraphContext.js +1 -0
  79. package/FlowGraph/flowGraphContext.js.map +1 -1
  80. package/FlowGraph/flowGraphValidator.js +0 -4
  81. package/FlowGraph/flowGraphValidator.js.map +1 -1
  82. package/FlowGraph/index.d.ts +2 -0
  83. package/FlowGraph/index.js +2 -0
  84. package/FlowGraph/index.js.map +1 -1
  85. package/FlowGraph/pure.d.ts +2 -0
  86. package/FlowGraph/pure.js +2 -0
  87. package/FlowGraph/pure.js.map +1 -1
  88. package/FlowGraph/serialization.d.ts +2 -2
  89. package/FlowGraph/serialization.js +2 -2
  90. package/FlowGraph/serialization.js.map +1 -1
  91. package/FlowGraph/typeDefinitions.d.ts +1 -1
  92. package/FlowGraph/typeDefinitions.js.map +1 -1
  93. package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.d.ts +1 -0
  94. package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.js +4 -0
  95. package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.js.map +1 -0
  96. package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.pure.d.ts +54 -0
  97. package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.pure.js +155 -0
  98. package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.pure.js.map +1 -0
  99. package/FrameGraph/Node/Blocks/Textures/pure.d.ts +1 -0
  100. package/FrameGraph/Node/Blocks/Textures/pure.js +1 -0
  101. package/FrameGraph/Node/Blocks/Textures/pure.js.map +1 -1
  102. package/FrameGraph/Node/Blocks/allBlocks.pure.js +2 -0
  103. package/FrameGraph/Node/Blocks/allBlocks.pure.js.map +1 -1
  104. package/FrameGraph/Node/Blocks/index.d.ts +1 -0
  105. package/FrameGraph/Node/Blocks/index.js +1 -0
  106. package/FrameGraph/Node/Blocks/index.js.map +1 -1
  107. package/FrameGraph/Node/Blocks/pure.d.ts +1 -0
  108. package/FrameGraph/Node/Blocks/pure.js +1 -0
  109. package/FrameGraph/Node/Blocks/pure.js.map +1 -1
  110. package/FrameGraph/Tasks/Misc/minMaxReducerTask.d.ts +62 -0
  111. package/FrameGraph/Tasks/Misc/minMaxReducerTask.js +159 -0
  112. package/FrameGraph/Tasks/Misc/minMaxReducerTask.js.map +1 -0
  113. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +3 -1
  114. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
  115. package/FrameGraph/frameGraph.d.ts +4 -0
  116. package/FrameGraph/frameGraph.js +14 -0
  117. package/FrameGraph/frameGraph.js.map +1 -1
  118. package/FrameGraph/index.d.ts +1 -0
  119. package/FrameGraph/index.js +1 -0
  120. package/FrameGraph/index.js.map +1 -1
  121. package/FrameGraph/pure.d.ts +1 -0
  122. package/FrameGraph/pure.js +1 -0
  123. package/FrameGraph/pure.js.map +1 -1
  124. package/Inputs/scene.inputManager.js +1 -1
  125. package/Inputs/scene.inputManager.js.map +1 -1
  126. package/Lights/Clustered/clusteredLightingSceneComponent.pure.d.ts +5 -0
  127. package/Lights/Clustered/clusteredLightingSceneComponent.pure.js +22 -1
  128. package/Lights/Clustered/clusteredLightingSceneComponent.pure.js.map +1 -1
  129. package/Lights/Shadows/cascadedShadowGenerator.pure.js +7 -3
  130. package/Lights/Shadows/cascadedShadowGenerator.pure.js.map +1 -1
  131. package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.d.ts +7 -0
  132. package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.js +8 -0
  133. package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.js.map +1 -0
  134. package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.pure.d.ts +54 -0
  135. package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.pure.js +81 -0
  136. package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.pure.js.map +1 -0
  137. package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.d.ts +7 -0
  138. package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.js +8 -0
  139. package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.js.map +1 -0
  140. package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.pure.d.ts +60 -0
  141. package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.pure.js +90 -0
  142. package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.pure.js.map +1 -0
  143. package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.d.ts +31 -0
  144. package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js +98 -0
  145. package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js.map +1 -1
  146. package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js +1 -1
  147. package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js.map +1 -1
  148. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js +2 -2
  149. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js.map +1 -1
  150. package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.d.ts +1 -0
  151. package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.js +4 -0
  152. package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.js.map +1 -0
  153. package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.pure.d.ts +83 -0
  154. package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.pure.js +191 -0
  155. package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.pure.js.map +1 -0
  156. package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.d.ts +1 -0
  157. package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.js +4 -0
  158. package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.js.map +1 -0
  159. package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.pure.d.ts +62 -0
  160. package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.pure.js +125 -0
  161. package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.pure.js.map +1 -0
  162. package/Materials/GaussianSplatting/pure.d.ts +4 -0
  163. package/Materials/GaussianSplatting/pure.js +4 -0
  164. package/Materials/GaussianSplatting/pure.js.map +1 -1
  165. package/Materials/Node/Blocks/Dual/imageSourceBlock.pure.d.ts +1 -0
  166. package/Materials/Node/Blocks/Dual/imageSourceBlock.pure.js +12 -0
  167. package/Materials/Node/Blocks/Dual/imageSourceBlock.pure.js.map +1 -1
  168. package/Materials/Textures/Procedurals/proceduralTexture.pure.d.ts +1 -0
  169. package/Materials/Textures/Procedurals/proceduralTexture.pure.js +31 -7
  170. package/Materials/Textures/Procedurals/proceduralTexture.pure.js.map +1 -1
  171. package/Materials/Textures/mirrorTexture.pure.js +3 -1
  172. package/Materials/Textures/mirrorTexture.pure.js.map +1 -1
  173. package/Materials/Textures/texture.pure.js +8 -2
  174. package/Materials/Textures/texture.pure.js.map +1 -1
  175. package/Materials/effectRenderer.pure.d.ts +4 -0
  176. package/Materials/effectRenderer.pure.js +3 -2
  177. package/Materials/effectRenderer.pure.js.map +1 -1
  178. package/Materials/index.d.ts +4 -0
  179. package/Materials/index.js +4 -0
  180. package/Materials/index.js.map +1 -1
  181. package/Materials/material.pure.js +25 -12
  182. package/Materials/material.pure.js.map +1 -1
  183. package/Materials/pure.d.ts +4 -0
  184. package/Materials/pure.js +4 -0
  185. package/Materials/pure.js.map +1 -1
  186. package/Materials/standardMaterial.pure.d.ts +8 -0
  187. package/Materials/standardMaterial.pure.js +24 -2
  188. package/Materials/standardMaterial.pure.js.map +1 -1
  189. package/Meshes/Builders/polygonBuilder.pure.js +1 -1
  190. package/Meshes/Builders/polygonBuilder.pure.js.map +1 -1
  191. package/Meshes/GaussianSplatting/gaussianPointSplattingController.d.ts +8 -0
  192. package/Meshes/GaussianSplatting/gaussianPointSplattingController.js +11 -0
  193. package/Meshes/GaussianSplatting/gaussianPointSplattingController.js.map +1 -0
  194. package/Meshes/GaussianSplatting/gaussianPointSplattingController.pure.d.ts +231 -0
  195. package/Meshes/GaussianSplatting/gaussianPointSplattingController.pure.js +1212 -0
  196. package/Meshes/GaussianSplatting/gaussianPointSplattingController.pure.js.map +1 -0
  197. package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.d.ts +14 -0
  198. package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.js +15 -0
  199. package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.js.map +1 -0
  200. package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.pure.d.ts +285 -0
  201. package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.pure.js +812 -0
  202. package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.pure.js.map +1 -0
  203. package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +1 -0
  204. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +2 -0
  205. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
  206. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.d.ts +160 -0
  207. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js +219 -0
  208. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js.map +1 -1
  209. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +32 -4
  210. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +114 -21
  211. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
  212. package/Meshes/GaussianSplatting/pure.d.ts +2 -0
  213. package/Meshes/GaussianSplatting/pure.js +2 -0
  214. package/Meshes/GaussianSplatting/pure.js.map +1 -1
  215. package/Meshes/Node/Blocks/booleanGeometryBlock.pure.js +25 -11
  216. package/Meshes/Node/Blocks/booleanGeometryBlock.pure.js.map +1 -1
  217. package/Meshes/abstractMesh.pure.d.ts +12 -0
  218. package/Meshes/abstractMesh.pure.js +32 -0
  219. package/Meshes/abstractMesh.pure.js.map +1 -1
  220. package/Meshes/index.d.ts +1 -0
  221. package/Meshes/index.js +1 -0
  222. package/Meshes/index.js.map +1 -1
  223. package/Meshes/pure.d.ts +1 -0
  224. package/Meshes/pure.js +1 -0
  225. package/Meshes/pure.js.map +1 -1
  226. package/Meshes/subMesh.pure.d.ts +11 -2
  227. package/Meshes/subMesh.pure.js +20 -5
  228. package/Meshes/subMesh.pure.js.map +1 -1
  229. package/Meshes/thinInstanceMesh.pure.js +1 -0
  230. package/Meshes/thinInstanceMesh.pure.js.map +1 -1
  231. package/Misc/andOrNotEvaluator.js +4 -0
  232. package/Misc/andOrNotEvaluator.js.map +1 -1
  233. package/Misc/minMaxReducer.pure.d.ts +6 -0
  234. package/Misc/minMaxReducer.pure.js +10 -0
  235. package/Misc/minMaxReducer.pure.js.map +1 -1
  236. package/Misc/thinMinMaxReducer.d.ts +19 -2
  237. package/Misc/thinMinMaxReducer.js +74 -21
  238. package/Misc/thinMinMaxReducer.js.map +1 -1
  239. package/Misc/tools.pure.js +1 -1
  240. package/Misc/tools.pure.js.map +1 -1
  241. package/Particles/Node/Blocks/Update/updateNoiseBlock.pure.js +19 -7
  242. package/Particles/Node/Blocks/Update/updateNoiseBlock.pure.js.map +1 -1
  243. package/Particles/Node/Blocks/particleSourceTextureBlock.pure.js +3 -2
  244. package/Particles/Node/Blocks/particleSourceTextureBlock.pure.js.map +1 -1
  245. package/Particles/gpuParticleSystem.pure.d.ts +2 -0
  246. package/Particles/gpuParticleSystem.pure.js +12 -4
  247. package/Particles/gpuParticleSystem.pure.js.map +1 -1
  248. package/Particles/particle.js +3 -2
  249. package/Particles/particle.js.map +1 -1
  250. package/Particles/solidParticleSystem.js +7 -1
  251. package/Particles/solidParticleSystem.js.map +1 -1
  252. package/Particles/thinParticleSystem.function.d.ts +6 -0
  253. package/Particles/thinParticleSystem.function.js +144 -88
  254. package/Particles/thinParticleSystem.function.js.map +1 -1
  255. package/Particles/thinParticleSystem.pure.d.ts +6 -0
  256. package/Particles/thinParticleSystem.pure.js +70 -9
  257. package/Particles/thinParticleSystem.pure.js.map +1 -1
  258. package/Physics/v2/ragdoll.d.ts +2 -4
  259. package/Physics/v2/ragdoll.js +11 -4
  260. package/Physics/v2/ragdoll.js.map +1 -1
  261. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.d.ts +12 -0
  262. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js +43 -18
  263. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js.map +1 -1
  264. package/Rendering/depthRenderer.pure.d.ts +9 -0
  265. package/Rendering/depthRenderer.pure.js +12 -0
  266. package/Rendering/depthRenderer.pure.js.map +1 -1
  267. package/Rendering/fluidRenderer/fluidRenderingObject.d.ts +4 -0
  268. package/Rendering/fluidRenderer/fluidRenderingObject.js +6 -0
  269. package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
  270. package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.d.ts +4 -0
  271. package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js +8 -0
  272. package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js.map +1 -1
  273. package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js +3 -0
  274. package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js.map +1 -1
  275. package/Rendering/geometryBufferRenderer.pure.js +4 -1
  276. package/Rendering/geometryBufferRenderer.pure.js.map +1 -1
  277. package/Rendering/objectRenderer.js.map +1 -1
  278. package/Rendering/prePassRenderer.pure.js +3 -3
  279. package/Rendering/prePassRenderer.pure.js.map +1 -1
  280. package/Shaders/ShadersInclude/gaussianSplatting.js +3 -1
  281. package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
  282. package/Shaders/ShadersInclude/lightsFragmentFunctions.js +27 -3
  283. package/Shaders/ShadersInclude/lightsFragmentFunctions.js.map +1 -1
  284. package/Shaders/ShadersInclude/oitDeclaration.js +1 -1
  285. package/Shaders/ShadersInclude/oitDeclaration.js.map +1 -1
  286. package/Shaders/minmaxRedux.fragment.js +6 -1
  287. package/Shaders/minmaxRedux.fragment.js.map +1 -1
  288. package/ShadersWGSL/ShadersInclude/gaussianPointSplatting.d.ts +5 -0
  289. package/ShadersWGSL/ShadersInclude/gaussianPointSplatting.js +65 -0
  290. package/ShadersWGSL/ShadersInclude/gaussianPointSplatting.js.map +1 -0
  291. package/ShadersWGSL/ShadersInclude/gaussianPointSplattingScan.d.ts +5 -0
  292. package/ShadersWGSL/ShadersInclude/gaussianPointSplattingScan.js +17 -0
  293. package/ShadersWGSL/ShadersInclude/gaussianPointSplattingScan.js.map +1 -0
  294. package/ShadersWGSL/ShadersInclude/gaussianSplatting.d.ts +1 -0
  295. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js +6 -78
  296. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js.map +1 -1
  297. package/ShadersWGSL/ShadersInclude/gaussianSplattingFragmentDeclaration.js +2 -2
  298. package/ShadersWGSL/ShadersInclude/gaussianSplattingFragmentDeclaration.js.map +1 -1
  299. package/ShadersWGSL/ShadersInclude/gaussianSplattingShared.d.ts +5 -0
  300. package/ShadersWGSL/ShadersInclude/gaussianSplattingShared.js +79 -0
  301. package/ShadersWGSL/ShadersInclude/gaussianSplattingShared.js.map +1 -0
  302. package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js +27 -3
  303. package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js.map +1 -1
  304. package/ShadersWGSL/gaussianPointSplattingBlit.fragment.d.ts +5 -0
  305. package/ShadersWGSL/gaussianPointSplattingBlit.fragment.js +22 -0
  306. package/ShadersWGSL/gaussianPointSplattingBlit.fragment.js.map +1 -0
  307. package/ShadersWGSL/gaussianPointSplattingBlit.vertex.d.ts +5 -0
  308. package/ShadersWGSL/gaussianPointSplattingBlit.vertex.js +19 -0
  309. package/ShadersWGSL/gaussianPointSplattingBlit.vertex.js.map +1 -0
  310. package/ShadersWGSL/gaussianPointSplattingDepthBlit.fragment.d.ts +5 -0
  311. package/ShadersWGSL/gaussianPointSplattingDepthBlit.fragment.js +21 -0
  312. package/ShadersWGSL/gaussianPointSplattingDepthBlit.fragment.js.map +1 -0
  313. package/ShadersWGSL/gaussianSplatting.vertex.js +2 -1
  314. package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
  315. package/ShadersWGSL/gaussianSplattingDepth.vertex.js +2 -1
  316. package/ShadersWGSL/gaussianSplattingDepth.vertex.js.map +1 -1
  317. package/ShadersWGSL/gaussianSplattingVoxel.vertex.js +2 -1
  318. package/ShadersWGSL/gaussianSplattingVoxel.vertex.js.map +1 -1
  319. package/ShadersWGSL/gpsHiZBuild.compute.d.ts +5 -0
  320. package/ShadersWGSL/gpsHiZBuild.compute.js +16 -0
  321. package/ShadersWGSL/gpsHiZBuild.compute.js.map +1 -0
  322. package/ShadersWGSL/gpsPartition.compute.d.ts +5 -0
  323. package/ShadersWGSL/gpsPartition.compute.js +27 -0
  324. package/ShadersWGSL/gpsPartition.compute.js.map +1 -0
  325. package/ShadersWGSL/gpsPreprocess.compute.d.ts +5 -0
  326. package/ShadersWGSL/gpsPreprocess.compute.js +86 -0
  327. package/ShadersWGSL/gpsPreprocess.compute.js.map +1 -0
  328. package/ShadersWGSL/gpsResolve.compute.d.ts +5 -0
  329. package/ShadersWGSL/gpsResolve.compute.js +41 -0
  330. package/ShadersWGSL/gpsResolve.compute.js.map +1 -0
  331. package/ShadersWGSL/gpsScanAdd.compute.d.ts +5 -0
  332. package/ShadersWGSL/gpsScanAdd.compute.js +22 -0
  333. package/ShadersWGSL/gpsScanAdd.compute.js.map +1 -0
  334. package/ShadersWGSL/gpsScanBlocks.compute.d.ts +5 -0
  335. package/ShadersWGSL/gpsScanBlocks.compute.js +23 -0
  336. package/ShadersWGSL/gpsScanBlocks.compute.js.map +1 -0
  337. package/ShadersWGSL/gpsScanSums.compute.d.ts +5 -0
  338. package/ShadersWGSL/gpsScanSums.compute.js +30 -0
  339. package/ShadersWGSL/gpsScanSums.compute.js.map +1 -0
  340. package/ShadersWGSL/gpsSplat.compute.d.ts +5 -0
  341. package/ShadersWGSL/gpsSplat.compute.js +37 -0
  342. package/ShadersWGSL/gpsSplat.compute.js.map +1 -0
  343. package/ShadersWGSL/minmaxRedux.fragment.js +20 -3
  344. package/ShadersWGSL/minmaxRedux.fragment.js.map +1 -1
  345. package/XR/features/WebXRSpaceWarp.pure.js +2 -1
  346. package/XR/features/WebXRSpaceWarp.pure.js.map +1 -1
  347. package/assetContainer.d.ts +1 -0
  348. package/assetContainer.js +5 -1
  349. package/assetContainer.js.map +1 -1
  350. package/package.json +1 -1
  351. package/scene.pure.d.ts +13 -2
  352. package/scene.pure.js +28 -4
  353. package/scene.pure.js.map +1 -1
@@ -0,0 +1,812 @@
1
+ /** This file must only contain pure code and pure imports */
2
+
3
+ import { ComputeShader } from "../../Compute/computeShader.pure.js";
4
+ import { StorageBuffer } from "../../Buffers/storageBuffer.js";
5
+ import { UniformBuffer } from "../../Materials/uniformBuffer.js";
6
+ const WorkgroupSize = 256;
7
+ const ScanBlockSize = 512;
8
+ const MaxDispatchGroupsPerDimension = 65535;
9
+ const DepthClearSentinel = 0xffffffff;
10
+ // Must match GPS_PARTITION_BUCKETS in the shaders.
11
+ const PartitionBuckets = 65536;
12
+ /**
13
+ * Whether projected depth depends on view-space x/y.
14
+ * @param projection the camera projection
15
+ * @returns whether depth must be evaluated separately at each sampled pixel
16
+ * @internal
17
+ */
18
+ export function _HasGaussianPointSplattingProjectedDepth(projection) {
19
+ const m = projection.m;
20
+ return m[2] !== 0 || m[6] !== 0 || m[3] !== 0 || m[7] !== 0;
21
+ }
22
+ /**
23
+ * Bytes per Gaussian of the u32-packed 8-bit SH coefficients for an SH degree.
24
+ * @param shDegree spherical-harmonics degree (0-4)
25
+ * @returns packed SH bytes per Gaussian (0 at degree 0)
26
+ * @internal
27
+ */
28
+ export function _GetPackedShBytesPerSplat(shDegree) {
29
+ if (shDegree < 1) {
30
+ return 0;
31
+ }
32
+ const shDim = shDegree === 1 ? 3 : shDegree === 2 ? 8 : shDegree === 3 ? 15 : 24;
33
+ return Math.ceil((shDim * 3) / 4) * 4;
34
+ }
35
+ /**
36
+ * Owns the WebGPU compute pipeline and GPU buffers for Gaussian Point Splatting (the stochastic,
37
+ * sort-free point-splatting technique). Engine-focused: it knows nothing about the scene graph
38
+ * beyond the camera matrices and viewport size handed to it.
39
+ *
40
+ * Per-frame pipeline (dispatched before the render pass):
41
+ * preprocess (1 thread/Gaussian: transform, cull, cache screen state, emit a point weight)
42
+ * scan (Blelloch prefix sum of the weights into a CDF + GPU-written indirect dispatch args)
43
+ * partition (bucketed point-to-Gaussian table that narrows the splat search)
44
+ * splat (indirect, 1 thread/point: find its Gaussian in the CDF, atomicMin its sample)
45
+ * resolve (accumulate the packed image buffer into the full-float buffer, reset it)
46
+ * hi-Z build (max-reduce this frame's depth into next frame's occlusion pyramid)
47
+ *
48
+ */
49
+ export class GaussianPointSplattingRenderer {
50
+ /**
51
+ * Largest storage buffer this device can allocate and bind, in bytes. Both the per-Gaussian screen
52
+ * data and the accumulation buffers scale linearly with the workload and can exceed it.
53
+ * @returns the effective storage buffer size limit in bytes
54
+ */
55
+ _getMaxStorageBufferSize() {
56
+ // WebGPU's guaranteed minimum, used when the engine does not expose its device limits.
57
+ const defaultLimit = 134217728;
58
+ const limits = this._engine.currentLimits;
59
+ if (!limits) {
60
+ return defaultLimit;
61
+ }
62
+ return Math.min(limits.maxStorageBufferBindingSize || defaultLimit, limits.maxBufferSize || defaultLimit);
63
+ }
64
+ /**
65
+ * True when the storage buffers required by the given workload fit in the device limits. Callers must
66
+ * fall back to another renderer when it is false, otherwise buffer creation raises a validation error.
67
+ * @param gaussianCount number of Gaussians to render
68
+ * @param shDegree spherical-harmonics degree of the data (0-4)
69
+ * @param outWidth output (full) width in pixels
70
+ * @param outHeight output (full) height in pixels
71
+ * @returns whether the workload can be allocated on this device
72
+ */
73
+ supportsWorkload(gaussianCount, shDegree, outWidth, outHeight) {
74
+ const limit = this._getMaxStorageBufferSize();
75
+ // Largest per-Gaussian buffer: sizeof(GpsScreen), or the packed SH bytes.
76
+ const perGaussian = Math.max(64, _GetPackedShBytesPerSplat(shDegree));
77
+ return gaussianCount * perGaussian <= limit && outWidth * outHeight * 4 * Float32Array.BYTES_PER_ELEMENT <= limit;
78
+ }
79
+ /**
80
+ * Creates a new Gaussian Point Splatting renderer.
81
+ * @param engine the (WebGPU) engine to allocate compute resources on
82
+ */
83
+ constructor(engine) {
84
+ this._preprocessShDegree = -1;
85
+ this._means = null;
86
+ this._colorOpacity = null;
87
+ this._cov3d = null;
88
+ this._sh = null;
89
+ this._shDegree = 0;
90
+ this._weights = null;
91
+ this._gsData = null;
92
+ this._cdf = null;
93
+ this._blockSums = null;
94
+ this._gaussianCount = 0;
95
+ this._numBlocks = 0;
96
+ /** Sample-density multiplier on the (importance-calibrated) point count. Keep at 1 for exact
97
+ * coverage = opacity*gaussian; other values trade noise for cost but bias the alpha. */
98
+ this.pointScale = 1.0;
99
+ /** Low-pass antialiasing dilation, in the classic material's `kernelSize` units. */
100
+ this.kernelSize = 0.3;
101
+ /** Classic material's `minPixelSize`: splats whose projected diameter is below this many output pixels are skipped (0 = off). */
102
+ this.minPixelSize = 0;
103
+ /** Whether view-space forward is negative (right-handed scenes). */
104
+ this.rightHandedSystem = false;
105
+ /** 1 when any per-part debug knob is active (drives the preprocess debug branch); 0 otherwise. */
106
+ this.debugActive = 0;
107
+ /** Whether the active camera is orthographic (selects the ortho Jacobian in computeCov2D). */
108
+ this.isOrthographic = false;
109
+ /** Whether the source material enables antialiasing opacity compensation (classic COMPENSATION). */
110
+ this.compensation = false;
111
+ /**
112
+ * Hi-Z occlusion culling: skip Gaussians fully behind the previous frame's nearest samples. Off by default
113
+ * because those stochastic samples may be semi-transparent, so culling biases the converged image.
114
+ * The depth pyramid is allocated only while enabled.
115
+ */
116
+ this.occlusionCulling = false;
117
+ // imageBuffer and hiZ are at render resolution; accum* are at output resolution.
118
+ this._imageBuffer = null;
119
+ this._accumBuffer = null;
120
+ this._accumDepth = null;
121
+ // Per output pixel: (generation << 16) | sample count.
122
+ this._accumCount = null;
123
+ // All max-view-z mip levels concatenated; level 0 = render resolution.
124
+ this._hiZ = null;
125
+ this._hiZLevels = [];
126
+ // One buffer per level: all level dispatches share one command encoder, so a single buffer updated
127
+ // in the loop would leave every dispatch reading the last level's values.
128
+ this._hiZBuildParams = [];
129
+ this._boundHiZParams = null;
130
+ this._width = 0;
131
+ this._height = 0;
132
+ this._outWidth = 0;
133
+ this._outHeight = 0;
134
+ this._upsampleN = 1;
135
+ this._jitterX = 0;
136
+ this._jitterY = 0;
137
+ this._view = null;
138
+ this._viewProjection = null;
139
+ this._projection = null;
140
+ this._inverseProjection = null;
141
+ this._projectedDepth = false;
142
+ this._reverseDepth = false;
143
+ this._projectedDepthSpan = new Float32Array([0, 1]);
144
+ this._near = 0.1;
145
+ this._far = 1000;
146
+ this._focalX = 1000;
147
+ this._focalY = 1000;
148
+ this._camX = 0;
149
+ this._camY = 0;
150
+ this._camZ = 0;
151
+ // The 16-bit depth key is normalized over the model's view-depth span.
152
+ this._viewZMin = 0.1;
153
+ this._viewZMax = 1000;
154
+ this._projZ = new Float32Array([0, 1, 0, 0]);
155
+ this._frameIndex = 0;
156
+ this._parts = null;
157
+ // Queue writes land before the frame's commands run, so a slot used this frame is never rewritten in it.
158
+ this._partBuffers = [];
159
+ this._partUseFrames = [];
160
+ this._partSlot = 0;
161
+ this._partCount = 0;
162
+ this._prevPartData = new Float32Array(0);
163
+ // Bumped on reset; invalidates the per-pixel counts in _accumCount without clearing it.
164
+ this._accumGeneration = 0;
165
+ this._lastRenderedGeneration = -1;
166
+ this._prevVp = new Float32Array(16);
167
+ this._hasPrevVp = false;
168
+ /** Cap on each output pixel's accumulated sample count (clamped to 1..65535). Past the cap later
169
+ * samples blend in at 1/(cap+1), so the image keeps refreshing instead of freezing. */
170
+ this.maxAccumFrames = 255;
171
+ this._engine = engine;
172
+ this._preprocessBindings = {
173
+ means: { group: 0, binding: 0 },
174
+ colorOpacity: { group: 0, binding: 1 },
175
+ weights: { group: 0, binding: 2 },
176
+ gsData: { group: 0, binding: 3 },
177
+ uniforms: { group: 0, binding: 4 },
178
+ cov3d: { group: 0, binding: 5 },
179
+ sh: { group: 0, binding: 6 },
180
+ parts: { group: 0, binding: 7 },
181
+ hiZ: { group: 0, binding: 8 },
182
+ };
183
+ this._scanBlocksCs = new ComputeShader("gpsScanBlocks", engine, "gpsScanBlocks", {
184
+ bindingsMapping: { weights: { group: 0, binding: 0 }, cdf: { group: 0, binding: 1 }, blockSums: { group: 0, binding: 2 } },
185
+ });
186
+ this._scanSumsCs = new ComputeShader("gpsScanSums", engine, "gpsScanSums", {
187
+ bindingsMapping: { blockSums: { group: 0, binding: 0 }, pointCount: { group: 0, binding: 1 }, indirectArgs: { group: 0, binding: 2 } },
188
+ });
189
+ this._scanAddCs = new ComputeShader("gpsScanAdd", engine, "gpsScanAdd", {
190
+ bindingsMapping: { cdf: { group: 0, binding: 0 }, blockSums: { group: 0, binding: 1 } },
191
+ });
192
+ this._partitionCs = new ComputeShader("gpsPartition", engine, "gpsPartition", {
193
+ bindingsMapping: { cdf: { group: 0, binding: 0 }, pointCount: { group: 0, binding: 1 }, partTable: { group: 0, binding: 2 } },
194
+ });
195
+ this._hiZBuildCs = new ComputeShader("gpsHiZBuild", engine, "gpsHiZBuild", {
196
+ bindingsMapping: { hiZ: { group: 0, binding: 0 }, params: { group: 0, binding: 1 } },
197
+ });
198
+ const splatBindings = {
199
+ cdf: { group: 0, binding: 0 },
200
+ gsData: { group: 0, binding: 1 },
201
+ imageBuffer: { group: 0, binding: 2 },
202
+ uniforms: { group: 0, binding: 3 },
203
+ pointCount: { group: 0, binding: 4 },
204
+ partTable: { group: 0, binding: 5 },
205
+ };
206
+ this._splatCs = new ComputeShader("gpsSplat", engine, "gpsSplat", { bindingsMapping: splatBindings });
207
+ const resolveBindings = {
208
+ accumBuffer: { group: 0, binding: 0 },
209
+ params: { group: 0, binding: 1 },
210
+ imageBuffer: { group: 0, binding: 2 },
211
+ accumDepth: { group: 0, binding: 3 },
212
+ hiZ: { group: 0, binding: 4 },
213
+ accumCount: { group: 0, binding: 5 },
214
+ };
215
+ this._resolveCs = new ComputeShader("gpsResolve", engine, "gpsResolve", { bindingsMapping: resolveBindings });
216
+ this._uniforms = new UniformBuffer(engine);
217
+ this._uniforms.addUniform("view", 16);
218
+ this._uniforms.addUniform("viewProjection", 16);
219
+ this._uniforms.addUniform("resNearFar", 4);
220
+ this._uniforms.addUniform("params0", 4);
221
+ this._uniforms.addUniform("focal", 4);
222
+ this._uniforms.addUniform("camPosDeg", 4);
223
+ this._uniforms.addUniform("depthNorm", 4);
224
+ this._uniforms.addUniform("hiZInfo", 4);
225
+ this._uniforms.addUniform("misc", 4); // x = N, y = minPixelSize, z = color tie-break mask
226
+ this._uniforms.addUniform("pixelMap", 4); // NDC -> render-pixel scale (xy) and jittered offset (zw)
227
+ this._uniforms.addUniform("projection", 16);
228
+ this._uniforms.addUniform("inverseProjection", 16);
229
+ this._uniforms.addUniform("projectedDepth", 4);
230
+ this._resolveParams = new UniformBuffer(engine);
231
+ this._resolveParams.addUniform("resolution", 2);
232
+ this._resolveParams.addUniform("outResolution", 2);
233
+ this._resolveParams.addUniform("depthNorm", 2);
234
+ this._resolveParams.addUniform("colorMask", 2); // x = color tie-break mask
235
+ this._resolveParams.addUniform("upsample", 4); // N, jitterX, jitterY, generation
236
+ this._resolveParams.addUniform("misc2", 4); // x = maxAccum, y = moving flag
237
+ this._resolveParams.addUniform("projZ", 4);
238
+ this._resolveParams.addUniform("inverseProjection", 16);
239
+ this._resolveParams.addUniform("occlusion", 4);
240
+ this._pointCount = new StorageBuffer(engine, 4 * Uint32Array.BYTES_PER_ELEMENT);
241
+ // WRITE (CopyDst) makes the initial zero-fill valid.
242
+ this._indirectArgs = new StorageBuffer(engine, 3 * Uint32Array.BYTES_PER_ELEMENT, 32 | 64 | 2);
243
+ this._partition = new StorageBuffer(engine, (PartitionBuckets + 1) * Uint32Array.BYTES_PER_ELEMENT);
244
+ // Keep binding records so dispatch can track native uniform-buffer replacements without rebuilding unchanged bind groups.
245
+ this._createPreprocessCs(0);
246
+ this._splatCs.setUniformBuffer("uniforms", this._uniforms);
247
+ this._resolveCs.setUniformBuffer("params", this._resolveParams);
248
+ this._scanSumsCs.setStorageBuffer("pointCount", this._pointCount);
249
+ this._scanSumsCs.setStorageBuffer("indirectArgs", this._indirectArgs);
250
+ this._partitionCs.setStorageBuffer("pointCount", this._pointCount);
251
+ this._partitionCs.setStorageBuffer("partTable", this._partition);
252
+ this._splatCs.setStorageBuffer("pointCount", this._pointCount);
253
+ this._splatCs.setStorageBuffer("partTable", this._partition);
254
+ }
255
+ /**
256
+ * (Re)creates the preprocess shader so only the asset's SH bands are compiled.
257
+ * @param shDegree the asset's SH degree
258
+ */
259
+ _createPreprocessCs(shDegree) {
260
+ this._preprocessShDegree = shDegree;
261
+ // SH_DEGREE 0 compiles out the sh binding.
262
+ const bindings = { ...this._preprocessBindings };
263
+ if (shDegree <= 0) {
264
+ delete bindings.sh;
265
+ }
266
+ this._preprocessCs = new ComputeShader("gpsPreprocess", this._engine, "gpsPreprocess", {
267
+ bindingsMapping: bindings,
268
+ defines: ["#define SH_DEGREE " + shDegree],
269
+ });
270
+ this._preprocessCs.setUniformBuffer("uniforms", this._uniforms);
271
+ if (this._parts) {
272
+ this._preprocessCs.setStorageBuffer("parts", this._parts);
273
+ }
274
+ if (this._hiZ) {
275
+ this._preprocessCs.setStorageBuffer("hiZ", this._hiZ);
276
+ }
277
+ }
278
+ /**
279
+ * The resolved, full-float accumulation buffer (`array<vec4f>`, row-major, y * width + x). Bound
280
+ * read-only by the blit material's fragment shader. Null until the first render.
281
+ */
282
+ get accumBuffer() {
283
+ return this._accumBuffer;
284
+ }
285
+ /**
286
+ * Per-pixel resolved surface depth (NDC z in the scene's convention), bound read-only by the blit
287
+ * material to write fragDepth for compositing. Null until the first render.
288
+ */
289
+ get accumDepthBuffer() {
290
+ return this._accumDepth;
291
+ }
292
+ /**
293
+ * Number of compute frames successfully dispatched since this renderer was created.
294
+ * This does not reset when accumulated samples are invalidated.
295
+ * @returns the lifetime successful-dispatch count
296
+ */
297
+ get renderedFrameCount() {
298
+ return this._frameIndex;
299
+ }
300
+ /**
301
+ * Changes whenever accumulated samples are invalidated (camera, parts, data, density or output size).
302
+ * A change of the upscale factor alone does not bump it; callers must reset accumulation. Wraps at 65536.
303
+ * @returns the current accumulation generation
304
+ */
305
+ get accumulationVersion() {
306
+ return this._accumGeneration;
307
+ }
308
+ /**
309
+ * Number of frames required to visit every output pixel once at the current render scale.
310
+ * @returns the current jitter-cycle length, `N * N`
311
+ */
312
+ get pixelCycleLength() {
313
+ return this._upsampleN * this._upsampleN;
314
+ }
315
+ /**
316
+ * Reads back the total emitted point count from the last dispatched frame (async GPU readback). Used by
317
+ * the budget-driven auto render-scale controller.
318
+ * @returns the emitted point count (0 if never dispatched)
319
+ */
320
+ async readPointCountAsync() {
321
+ const data = await this._pointCount.read(0, Uint32Array.BYTES_PER_ELEMENT);
322
+ return new Uint32Array(data.buffer, data.byteOffset, 1)[0];
323
+ }
324
+ /** Current internal render width, in pixels. */
325
+ get width() {
326
+ return this._width;
327
+ }
328
+ /** Current internal render height, in pixels. */
329
+ get height() {
330
+ return this._height;
331
+ }
332
+ /** Output (full) width the accumulation buffer is sized to (what the blit samples). */
333
+ get outputWidth() {
334
+ return this._outWidth;
335
+ }
336
+ /** Output (full) height the accumulation buffer is sized to. */
337
+ get outputHeight() {
338
+ return this._outHeight;
339
+ }
340
+ /** Number of Gaussians currently loaded. */
341
+ get gaussianCount() {
342
+ return this._gaussianCount;
343
+ }
344
+ /**
345
+ * Whether the whole compute pipeline is compiled and ready to dispatch.
346
+ * @returns true once every compute shader is ready
347
+ */
348
+ isReady() {
349
+ return (this._preprocessCs.isReady() &&
350
+ this._scanBlocksCs.isReady() &&
351
+ this._scanSumsCs.isReady() &&
352
+ this._scanAddCs.isReady() &&
353
+ this._partitionCs.isReady() &&
354
+ this._splatCs.isReady() &&
355
+ this._resolveCs.isReady() &&
356
+ (!this.occlusionCulling || this._hiZBuildCs.isReady()));
357
+ }
358
+ /**
359
+ * Uploads decoded splat data into per-Gaussian GPU buffers, replacing any previous data.
360
+ * @param means packed positions, 4 floats per Gaussian (x, y, z, unused)
361
+ * @param cov3d packed 3D covariance, 4 u32 per Gaussian (3 f16 pairs of Sigma/factor + f32 factor)
362
+ * @param colorOpacity packed RGBA8 base color + opacity, 1 u32 per Gaussian
363
+ * @param sh 8-bit-quantized SH coefficients packed 4 bytes/u32 (GPS_SH_WORDS per Gaussian), or null
364
+ * @param shDegree spherical-harmonics degree (0 = view-independent color)
365
+ * @param count number of Gaussians
366
+ */
367
+ updateSplats(means, cov3d, colorOpacity, sh, shDegree, count) {
368
+ this._disposeGaussianBuffers();
369
+ this._gaussianCount = count;
370
+ this._shDegree = sh ? shDegree : 0;
371
+ if (this._shDegree !== this._preprocessShDegree) {
372
+ this._createPreprocessCs(this._shDegree);
373
+ }
374
+ if (count === 0) {
375
+ return;
376
+ }
377
+ this._numBlocks = Math.ceil(count / ScanBlockSize);
378
+ const engine = this._engine;
379
+ this._means = new StorageBuffer(engine, count * 4 * Float32Array.BYTES_PER_ELEMENT);
380
+ this._means.update(means);
381
+ this._cov3d = new StorageBuffer(engine, count * 4 * Uint32Array.BYTES_PER_ELEMENT);
382
+ this._cov3d.update(cov3d);
383
+ // Placeholder keeps the binding valid at degree 0.
384
+ if (sh && this._shDegree > 0) {
385
+ this._sh = new StorageBuffer(engine, sh.byteLength);
386
+ this._sh.update(sh);
387
+ }
388
+ else {
389
+ this._sh = new StorageBuffer(engine, Float32Array.BYTES_PER_ELEMENT);
390
+ }
391
+ this._colorOpacity = new StorageBuffer(engine, count * Uint32Array.BYTES_PER_ELEMENT);
392
+ this._colorOpacity.update(colorOpacity);
393
+ this._weights = new StorageBuffer(engine, count * Uint32Array.BYTES_PER_ELEMENT);
394
+ this._cdf = new StorageBuffer(engine, count * Uint32Array.BYTES_PER_ELEMENT);
395
+ this._blockSums = new StorageBuffer(engine, this._numBlocks * Uint32Array.BYTES_PER_ELEMENT);
396
+ // sizeof(GpsScreen)
397
+ this._gsData = new StorageBuffer(engine, count * 64);
398
+ this._preprocessCs.setStorageBuffer("means", this._means);
399
+ this._preprocessCs.setStorageBuffer("colorOpacity", this._colorOpacity);
400
+ this._preprocessCs.setStorageBuffer("weights", this._weights);
401
+ this._preprocessCs.setStorageBuffer("gsData", this._gsData);
402
+ this._preprocessCs.setStorageBuffer("cov3d", this._cov3d);
403
+ if (this._shDegree > 0) {
404
+ this._preprocessCs.setStorageBuffer("sh", this._sh);
405
+ }
406
+ this._scanBlocksCs.setStorageBuffer("weights", this._weights);
407
+ this._scanBlocksCs.setStorageBuffer("cdf", this._cdf);
408
+ this._scanBlocksCs.setStorageBuffer("blockSums", this._blockSums);
409
+ this._scanSumsCs.setStorageBuffer("blockSums", this._blockSums);
410
+ this._scanAddCs.setStorageBuffer("cdf", this._cdf);
411
+ this._scanAddCs.setStorageBuffer("blockSums", this._blockSums);
412
+ this._partitionCs.setStorageBuffer("cdf", this._cdf);
413
+ this._splatCs.setStorageBuffer("cdf", this._cdf);
414
+ this._splatCs.setStorageBuffer("gsData", this._gsData);
415
+ this.resetAccumulation();
416
+ }
417
+ /** Restarts progressive accumulation; each output pixel is overwritten on its next visit. The cached
418
+ * view-projection is kept, otherwise the next {@link renderToBuffer} would detect a move and reset again. */
419
+ resetAccumulation() {
420
+ this._accumGeneration = (this._accumGeneration + 1) & 0xffff;
421
+ }
422
+ /**
423
+ * Sets the camera state used to project Gaussians on the next render.
424
+ * @param view world-to-view matrix
425
+ * @param viewProjection world-to-clip matrix
426
+ * @param near near plane distance
427
+ * @param far far plane distance
428
+ * @param focalX horizontal focal length in pixels
429
+ * @param focalY vertical focal length in pixels
430
+ * @param camX camera world position x
431
+ * @param camY camera world position y
432
+ * @param camZ camera world position z
433
+ * @param viewZMin the model's minimum view-space depth this frame (depth-key normalization range)
434
+ * @param viewZMax the model's maximum view-space depth this frame
435
+ */
436
+ setCamera(view, viewProjection, near, far, focalX, focalY, camX, camY, camZ, viewZMin, viewZMax) {
437
+ this._view = view;
438
+ this._viewProjection = viewProjection;
439
+ this._near = near;
440
+ this._far = far;
441
+ this._focalX = focalX;
442
+ this._focalY = focalY;
443
+ this._camX = camX;
444
+ this._camY = camY;
445
+ this._camZ = camZ;
446
+ this._viewZMin = viewZMin;
447
+ this._viewZMax = viewZMax;
448
+ }
449
+ /**
450
+ * Sets the projection matrix's z-row (column-major m10, m11, m14, m15), used by resolve to map the
451
+ * view-z depth key back to ndc.z for fragDepth (it encodes the reverse-Z / half-Z convention).
452
+ * @param m10 projection.m[10]
453
+ * @param m11 projection.m[11]
454
+ * @param m14 projection.m[14]
455
+ * @param m15 projection.m[15]
456
+ */
457
+ setProjectionZ(m10, m11, m14, m15) {
458
+ this._projZ[0] = m10;
459
+ this._projZ[1] = m11;
460
+ this._projZ[2] = m14;
461
+ this._projZ[3] = m15;
462
+ this._projection = null;
463
+ this._inverseProjection = null;
464
+ this._projectedDepth = false;
465
+ }
466
+ /**
467
+ * Sets the full projection for covariance, per-pixel depth and oblique clipping.
468
+ * @param projection camera projection matrix
469
+ * @param inverseProjection inverse of the projection matrix
470
+ * @param reverseDepth whether larger NDC depth values are nearer
471
+ */
472
+ setProjectionMatrix(projection, inverseProjection, reverseDepth = false) {
473
+ const m = projection.m;
474
+ this.setProjectionZ(m[10], m[11], m[14], m[15]);
475
+ this._projection = projection;
476
+ this._inverseProjection = inverseProjection;
477
+ this._projectedDepth = _HasGaussianPointSplattingProjectedDepth(projection);
478
+ this._reverseDepth = reverseDepth;
479
+ }
480
+ /** Bounds projected depth over the model's view-z interval and padded jitter grid, reusing the result.
481
+ * @param maxX maximum NDC x covered by the grid
482
+ * @param maxY maximum NDC y covered by the grid
483
+ * @returns the nearest-first projected depth range for quantization
484
+ */
485
+ _getProjectedDepthSpan(maxX = 1, maxY = 1) {
486
+ const m = this._inverseProjection.m;
487
+ const sign = this.rightHandedSystem ? -1 : 1;
488
+ const z0 = sign * this._viewZMin;
489
+ const z1 = sign * this._viewZMax;
490
+ const d0 = m[10] - z0 * m[11];
491
+ const d1 = m[10] - z1 * m[11];
492
+ // A horizon within the interval can cover the entire clipped depth range.
493
+ if (d0 * d1 <= 0) {
494
+ this._projectedDepthSpan[0] = 0;
495
+ this._projectedDepthSpan[1] = 1;
496
+ return this._projectedDepthSpan;
497
+ }
498
+ let min = 1;
499
+ let max = 0;
500
+ for (let corner = 0; corner < 8; corner++) {
501
+ const x = corner & 1 ? maxX : -1;
502
+ const y = corner & 2 ? maxY : -1;
503
+ const z = corner & 4 ? z1 : z0;
504
+ const depth = (z * (m[3] * x + m[7] * y + m[15]) - (m[2] * x + m[6] * y + m[14])) / (m[10] - z * m[11]);
505
+ const ordered = Math.max(0, Math.min(1, this._reverseDepth ? 1 - depth : depth));
506
+ min = Math.min(min, ordered);
507
+ max = Math.max(max, ordered);
508
+ }
509
+ this._projectedDepthSpan[0] = min;
510
+ this._projectedDepthSpan[1] = Math.max(min + 1e-6, max);
511
+ return this._projectedDepthSpan;
512
+ }
513
+ /**
514
+ * Checks part inputs without changing the current accumulation or dispatch buffers.
515
+ * @param packed packed part records
516
+ * @param count number of parts
517
+ * @returns whether these inputs match the current renderer state
518
+ * @internal
519
+ */
520
+ _matchesPartData(packed, count) {
521
+ const floats = count * 40;
522
+ if (!this._parts || this._partCount !== count || this._prevPartData.length !== floats) {
523
+ return false;
524
+ }
525
+ for (let i = 0; i < floats; i++) {
526
+ if (this._prevPartData[i] !== packed[i]) {
527
+ return false;
528
+ }
529
+ }
530
+ return true;
531
+ }
532
+ /**
533
+ * Uploads the per-part records (see GpsPart) and restarts accumulation when they changed.
534
+ * @param packed part records, `count * 40` floats (world matrix + visibility + 5 debug rows per part)
535
+ * @param count number of parts (at least 1)
536
+ */
537
+ setPartData(packed, count) {
538
+ const engine = this._engine;
539
+ const floats = count * 40;
540
+ const changed = !this._matchesPartData(packed, count);
541
+ if (this._partCount !== count) {
542
+ this._disposePartBuffers();
543
+ this._partCount = count;
544
+ }
545
+ const frameId = engine.frameId;
546
+ // The current slot already holds unchanged data; the upcoming dispatch binds it.
547
+ if (!changed) {
548
+ if (this._parts) {
549
+ this._partUseFrames[this._partSlot] = frameId;
550
+ }
551
+ return;
552
+ }
553
+ if (this._prevPartData.length !== floats) {
554
+ this._prevPartData = new Float32Array(floats);
555
+ }
556
+ this._prevPartData.set(packed);
557
+ this.resetAccumulation();
558
+ // A slot used this frame may be bound by a dispatch that has not been submitted yet.
559
+ if (!this._parts || this._partUseFrames[this._partSlot] === frameId) {
560
+ let slot = 0;
561
+ while (slot < this._partBuffers.length && this._partUseFrames[slot] === frameId) {
562
+ slot++;
563
+ }
564
+ if (slot === this._partBuffers.length) {
565
+ this._partBuffers.push(new StorageBuffer(engine, floats * Float32Array.BYTES_PER_ELEMENT));
566
+ this._partUseFrames.push(-1);
567
+ }
568
+ this._partSlot = slot;
569
+ this._parts = this._partBuffers[slot];
570
+ this._preprocessCs.setStorageBuffer("parts", this._parts);
571
+ }
572
+ this._partUseFrames[this._partSlot] = frameId;
573
+ this._parts.update(packed);
574
+ }
575
+ _disposePartBuffers() {
576
+ for (const buffer of this._partBuffers) {
577
+ buffer.dispose();
578
+ }
579
+ this._partBuffers.length = 0;
580
+ this._partUseFrames.length = 0;
581
+ this._partSlot = 0;
582
+ this._parts = null;
583
+ }
584
+ _ensurePixelBuffers(width, height, outWidth, outHeight) {
585
+ const engine = this._engine;
586
+ const renderChanged = width !== this._width || height !== this._height || !this._imageBuffer;
587
+ const outChanged = outWidth !== this._outWidth || outHeight !== this._outHeight || !this._accumBuffer;
588
+ if (renderChanged) {
589
+ this._width = width;
590
+ this._height = height;
591
+ const pixelCount = width * height;
592
+ this._imageBuffer?.dispose();
593
+ this._imageBuffer = new StorageBuffer(engine, pixelCount * Uint32Array.BYTES_PER_ELEMENT);
594
+ // Resolve re-clears it after each frame.
595
+ const seed = new Uint32Array(pixelCount);
596
+ seed.fill(DepthClearSentinel);
597
+ this._imageBuffer.update(seed);
598
+ this._splatCs.setStorageBuffer("imageBuffer", this._imageBuffer);
599
+ this._resolveCs.setStorageBuffer("imageBuffer", this._imageBuffer);
600
+ }
601
+ if (!this._hiZ || this.occlusionCulling !== this._hiZLevels.length > 0 || (this.occlusionCulling && renderChanged)) {
602
+ this._hiZLevels = [];
603
+ // Both shaders require a valid storage binding even when their Hi-Z branches are disabled.
604
+ let hiZOffset = 1;
605
+ if (this.occlusionCulling) {
606
+ hiZOffset = 0;
607
+ const numLevels = Math.floor(Math.log2(Math.max(width, height))) + 1;
608
+ for (let l = 0; l < numLevels; l++) {
609
+ const lw = Math.max(1, width >> l);
610
+ const lh = Math.max(1, height >> l);
611
+ this._hiZLevels.push({ offset: hiZOffset, w: lw, h: lh });
612
+ hiZOffset += lw * lh;
613
+ }
614
+ }
615
+ this._hiZ?.dispose();
616
+ this._hiZ = new StorageBuffer(engine, hiZOffset * Float32Array.BYTES_PER_ELEMENT);
617
+ this._hiZ.update(new Float32Array(hiZOffset).fill(1e30));
618
+ this._preprocessCs.setStorageBuffer("hiZ", this._hiZ);
619
+ this._resolveCs.setStorageBuffer("hiZ", this._hiZ);
620
+ this._hiZBuildCs.setStorageBuffer("hiZ", this._hiZ);
621
+ for (const ub of this._hiZBuildParams) {
622
+ ub.dispose();
623
+ }
624
+ this._hiZBuildParams = [];
625
+ this._boundHiZParams = null;
626
+ for (let l = 1; l < this._hiZLevels.length; l++) {
627
+ const src = this._hiZLevels[l - 1];
628
+ const dst = this._hiZLevels[l];
629
+ const ub = new UniformBuffer(engine);
630
+ ub.addUniform("src", 4);
631
+ ub.addUniform("dst", 4);
632
+ ub.updateUInt4("src", src.offset, src.w, src.h, 0);
633
+ ub.updateUInt4("dst", dst.offset, dst.w, dst.h, 0);
634
+ ub.update();
635
+ this._hiZBuildParams.push(ub);
636
+ }
637
+ }
638
+ if (outChanged) {
639
+ this._outWidth = outWidth;
640
+ this._outHeight = outHeight;
641
+ const outCount = outWidth * outHeight;
642
+ // Premultiplied color + coverage.
643
+ this._accumBuffer?.dispose();
644
+ this._accumBuffer = new StorageBuffer(engine, outCount * 4 * Float32Array.BYTES_PER_ELEMENT);
645
+ this._accumDepth?.dispose();
646
+ this._accumDepth = new StorageBuffer(engine, outCount * Float32Array.BYTES_PER_ELEMENT);
647
+ this._accumCount?.dispose();
648
+ this._accumCount = new StorageBuffer(engine, outCount * Uint32Array.BYTES_PER_ELEMENT);
649
+ this._resolveCs.setStorageBuffer("accumBuffer", this._accumBuffer);
650
+ this._resolveCs.setStorageBuffer("accumDepth", this._accumDepth);
651
+ this._resolveCs.setStorageBuffer("accumCount", this._accumCount);
652
+ this.resetAccumulation();
653
+ }
654
+ }
655
+ /**
656
+ * Runs the per-frame GPS compute pipeline for the given viewport, leaving the result in
657
+ * {@link accumBuffer}. Allocates/resizes buffers on demand.
658
+ * @param width internal render (low) width in pixels; must be `ceil(outWidth / upsampleN)`
659
+ * @param height internal render (low) height in pixels; must be `ceil(outHeight / upsampleN)`
660
+ * @param outWidth output (full) width the accumulation is reconstructed at
661
+ * @param outHeight output (full) height
662
+ * @param upsampleN integer upscale factor; 1 = no upsampling
663
+ * @param jitterX this frame's sub-cell offset x in [0, N)
664
+ * @param jitterY this frame's sub-cell offset y in [0, N)
665
+ * @returns true if the pipeline dispatched, false if it was not ready / had nothing to draw
666
+ */
667
+ renderToBuffer(width, height, outWidth = width, outHeight = height, upsampleN = 1, jitterX = 0, jitterY = 0) {
668
+ if (width <= 0 || height <= 0 || outWidth <= 0 || outHeight <= 0) {
669
+ return false;
670
+ }
671
+ this._upsampleN = Math.max(1, Math.round(upsampleN));
672
+ this._jitterX = jitterX;
673
+ this._jitterY = jitterY;
674
+ this._ensurePixelBuffers(width, height, outWidth, outHeight);
675
+ if (this._gaussianCount === 0 || !this._parts || !this._view || !this._viewProjection || !this.isReady()) {
676
+ return false;
677
+ }
678
+ const vp = this._viewProjection.m;
679
+ let moved = !this._hasPrevVp;
680
+ for (let k = 0; k < 16; k++) {
681
+ if (Math.abs(vp[k] - this._prevVp[k]) > 1e-5) {
682
+ moved = true;
683
+ break;
684
+ }
685
+ }
686
+ if (moved) {
687
+ this.resetAccumulation();
688
+ this._prevVp.set(vp);
689
+ this._hasPrevVp = true;
690
+ }
691
+ // On a reset frame resolve fills every output pixel, so unvisited pixels cannot trail.
692
+ const moving = this._accumGeneration !== this._lastRenderedGeneration;
693
+ this._lastRenderedGeneration = this._accumGeneration;
694
+ // Render pixel (lx,ly) samples output pixel (lx*N+jitterX, ly*N+jitterY); resolve crops the padding.
695
+ const n = this._upsampleN;
696
+ const pixelOffsetX = (n / 2 - this._jitterX - 0.5) / n;
697
+ const pixelOffsetY = (n / 2 - this._jitterY - 0.5) / n;
698
+ // XORed into packed colors so equal-depth ties do not favor low RGB values.
699
+ const colorMask = (Math.imul(this._frameIndex + 1, 0x9e3779b1) >>> 16) & 0xffff;
700
+ // Quantized degree-4 SH has 24 coefficients in [-1,1]; the addition theorem bounds radiance below 8.
701
+ const colorRange = this._shDegree > 0 ? 8 : 1;
702
+ this._uniforms.updateMatrix("view", this._view);
703
+ this._uniforms.updateMatrix("viewProjection", this._viewProjection);
704
+ this._uniforms.updateFloat4("resNearFar", width, height, this._near, this._far);
705
+ // The classic kernel applies to a 4x covariance in output pixels; preprocess uses physical render pixels.
706
+ this._uniforms.updateFloat4("params0", this._gaussianCount, (this.kernelSize * 0.25) / (n * n), this.pointScale, this._frameIndex % 65536);
707
+ this._uniforms.updateFloat4("focal", this._focalX, this._focalY, this.rightHandedSystem ? 1 : 0, this.isOrthographic ? 1 : 0);
708
+ this._uniforms.updateFloat4("camPosDeg", this._camX, this._camY, this._camZ, this._shDegree);
709
+ this._uniforms.updateFloat4("depthNorm", this._viewZMin, this._viewZMax, this.debugActive, this.compensation ? 1 : 0);
710
+ this._uniforms.updateFloat4("hiZInfo", width, height, this._hiZLevels.length, this.occlusionCulling && !moving ? 1 : 0);
711
+ const projectionMode = (this._projection ? 1 : 0) | (this._projectedDepth ? 2 : 0) | (this._reverseDepth ? 4 : 0);
712
+ const depthSpan = this._projectedDepth
713
+ ? this._getProjectedDepthSpan(Math.max(1, (2 * width * n) / this._outWidth - 1), Math.max(1, (2 * height * n) / this._outHeight - 1))
714
+ : null;
715
+ this._uniforms.updateFloat4("misc", n, this.minPixelSize, colorMask, projectionMode);
716
+ this._uniforms.updateFloat4("pixelMap", this._outWidth / n, this._outHeight / n, pixelOffsetX, pixelOffsetY);
717
+ if (this._projection && this._inverseProjection) {
718
+ this._uniforms.updateMatrix("projection", this._projection);
719
+ this._uniforms.updateMatrix("inverseProjection", this._inverseProjection);
720
+ }
721
+ this._uniforms.updateFloat4("projectedDepth", depthSpan?.[0] ?? 0, depthSpan?.[1] ?? 1, colorRange, 0);
722
+ this._uniforms.update();
723
+ this._resolveParams.updateFloat2("resolution", width, height);
724
+ this._resolveParams.updateFloat2("outResolution", this._outWidth, this._outHeight);
725
+ this._resolveParams.updateFloat2("depthNorm", depthSpan?.[0] ?? this._viewZMin, depthSpan?.[1] ?? this._viewZMax);
726
+ this._resolveParams.updateFloat2("colorMask", colorMask, colorRange);
727
+ this._resolveParams.updateFloat4("upsample", n, this._jitterX, this._jitterY, this._accumGeneration);
728
+ this._resolveParams.updateFloat4("misc2", Math.max(1, Math.min(65535, Math.floor(this.maxAccumFrames))), moving ? 1 : 0, this._reverseDepth ? 1 : 0, this._projectedDepth ? 1 : 0);
729
+ const zSign = this.rightHandedSystem ? -1 : 1;
730
+ this._resolveParams.updateFloat4("projZ", this._projZ[0] * zSign, this._projZ[1] * zSign, this._projZ[2], this._projZ[3]);
731
+ if (this._inverseProjection) {
732
+ this._resolveParams.updateMatrix("inverseProjection", this._inverseProjection);
733
+ }
734
+ this._resolveParams.updateFloat4("occlusion", this.occlusionCulling ? 1 : 0, 0, 0, 0);
735
+ this._resolveParams.update();
736
+ const groupsG = Math.ceil(this._gaussianCount / WorkgroupSize);
737
+ this._partUseFrames[this._partSlot] = this._engine.frameId;
738
+ this._preprocessCs.dispatch(Math.min(groupsG, MaxDispatchGroupsPerDimension), Math.ceil(groupsG / MaxDispatchGroupsPerDimension), 1);
739
+ this._scanBlocksCs.dispatch(Math.min(this._numBlocks, MaxDispatchGroupsPerDimension), Math.ceil(this._numBlocks / MaxDispatchGroupsPerDimension), 1);
740
+ this._scanSumsCs.dispatch(1, 1, 1);
741
+ this._scanAddCs.dispatch(Math.min(groupsG, MaxDispatchGroupsPerDimension), Math.ceil(groupsG / MaxDispatchGroupsPerDimension), 1);
742
+ this._partitionCs.dispatch(Math.ceil((PartitionBuckets + 1) / WorkgroupSize), 1, 1);
743
+ this._splatCs.dispatchIndirect(this._indirectArgs);
744
+ this._resolveCs.dispatch(Math.ceil(width / 8), Math.ceil(height / 8), 1);
745
+ // Level 0 is written by resolve; max-reduce the rest for next frame's cull.
746
+ if (this.occlusionCulling) {
747
+ for (let l = 1; l < this._hiZLevels.length; l++) {
748
+ const dst = this._hiZLevels[l];
749
+ const params = this._hiZBuildParams[l - 1];
750
+ if (params !== this._boundHiZParams) {
751
+ this._hiZBuildCs.setUniformBuffer("params", params);
752
+ this._boundHiZParams = params;
753
+ }
754
+ this._hiZBuildCs.dispatch(Math.ceil(dst.w / 8), Math.ceil(dst.h / 8), 1);
755
+ }
756
+ }
757
+ this._frameIndex++;
758
+ return true;
759
+ }
760
+ _disposeGaussianBuffers() {
761
+ this._means?.dispose();
762
+ this._colorOpacity?.dispose();
763
+ this._cov3d?.dispose();
764
+ this._sh?.dispose();
765
+ this._weights?.dispose();
766
+ this._gsData?.dispose();
767
+ this._cdf?.dispose();
768
+ this._blockSums?.dispose();
769
+ this._means = null;
770
+ this._colorOpacity = null;
771
+ this._cov3d = null;
772
+ this._sh = null;
773
+ this._weights = null;
774
+ this._gsData = null;
775
+ this._cdf = null;
776
+ this._blockSums = null;
777
+ this._gaussianCount = 0;
778
+ this._numBlocks = 0;
779
+ }
780
+ /** Releases all GPU resources owned by the renderer. */
781
+ dispose() {
782
+ this._disposeGaussianBuffers();
783
+ this._imageBuffer?.dispose();
784
+ this._accumBuffer?.dispose();
785
+ this._accumDepth?.dispose();
786
+ this._accumCount?.dispose();
787
+ this._accumDepth = null;
788
+ this._imageBuffer = null;
789
+ this._accumBuffer = null;
790
+ this._accumCount = null;
791
+ this._hiZ?.dispose();
792
+ this._hiZ = null;
793
+ this._hiZLevels = [];
794
+ for (const ub of this._hiZBuildParams) {
795
+ ub.dispose();
796
+ }
797
+ this._hiZBuildParams = [];
798
+ this._boundHiZParams = null;
799
+ this._disposePartBuffers();
800
+ this._partCount = 0;
801
+ this._pointCount.dispose();
802
+ this._indirectArgs.dispose();
803
+ this._partition.dispose();
804
+ this._uniforms.dispose();
805
+ this._resolveParams.dispose();
806
+ this._width = 0;
807
+ this._height = 0;
808
+ this._outWidth = 0;
809
+ this._outHeight = 0;
810
+ }
811
+ }
812
+ //# sourceMappingURL=gaussianPointSplattingRenderer.pure.js.map