@onerjs/core 9.0.0 → 9.0.1

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 (352) 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 +1 -1
  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/prePassRenderer.pure.js +3 -3
  278. package/Rendering/prePassRenderer.pure.js.map +1 -1
  279. package/Shaders/ShadersInclude/gaussianSplatting.js +3 -1
  280. package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
  281. package/Shaders/ShadersInclude/lightsFragmentFunctions.js +27 -3
  282. package/Shaders/ShadersInclude/lightsFragmentFunctions.js.map +1 -1
  283. package/Shaders/ShadersInclude/oitDeclaration.js +1 -1
  284. package/Shaders/ShadersInclude/oitDeclaration.js.map +1 -1
  285. package/Shaders/minmaxRedux.fragment.js +6 -1
  286. package/Shaders/minmaxRedux.fragment.js.map +1 -1
  287. package/ShadersWGSL/ShadersInclude/gaussianPointSplatting.d.ts +5 -0
  288. package/ShadersWGSL/ShadersInclude/gaussianPointSplatting.js +65 -0
  289. package/ShadersWGSL/ShadersInclude/gaussianPointSplatting.js.map +1 -0
  290. package/ShadersWGSL/ShadersInclude/gaussianPointSplattingScan.d.ts +5 -0
  291. package/ShadersWGSL/ShadersInclude/gaussianPointSplattingScan.js +17 -0
  292. package/ShadersWGSL/ShadersInclude/gaussianPointSplattingScan.js.map +1 -0
  293. package/ShadersWGSL/ShadersInclude/gaussianSplatting.d.ts +1 -0
  294. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js +6 -78
  295. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js.map +1 -1
  296. package/ShadersWGSL/ShadersInclude/gaussianSplattingFragmentDeclaration.js +2 -2
  297. package/ShadersWGSL/ShadersInclude/gaussianSplattingFragmentDeclaration.js.map +1 -1
  298. package/ShadersWGSL/ShadersInclude/gaussianSplattingShared.d.ts +5 -0
  299. package/ShadersWGSL/ShadersInclude/gaussianSplattingShared.js +79 -0
  300. package/ShadersWGSL/ShadersInclude/gaussianSplattingShared.js.map +1 -0
  301. package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js +27 -3
  302. package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js.map +1 -1
  303. package/ShadersWGSL/gaussianPointSplattingBlit.fragment.d.ts +5 -0
  304. package/ShadersWGSL/gaussianPointSplattingBlit.fragment.js +22 -0
  305. package/ShadersWGSL/gaussianPointSplattingBlit.fragment.js.map +1 -0
  306. package/ShadersWGSL/gaussianPointSplattingBlit.vertex.d.ts +5 -0
  307. package/ShadersWGSL/gaussianPointSplattingBlit.vertex.js +19 -0
  308. package/ShadersWGSL/gaussianPointSplattingBlit.vertex.js.map +1 -0
  309. package/ShadersWGSL/gaussianPointSplattingDepthBlit.fragment.d.ts +5 -0
  310. package/ShadersWGSL/gaussianPointSplattingDepthBlit.fragment.js +21 -0
  311. package/ShadersWGSL/gaussianPointSplattingDepthBlit.fragment.js.map +1 -0
  312. package/ShadersWGSL/gaussianSplatting.vertex.js +2 -1
  313. package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
  314. package/ShadersWGSL/gaussianSplattingDepth.vertex.js +2 -1
  315. package/ShadersWGSL/gaussianSplattingDepth.vertex.js.map +1 -1
  316. package/ShadersWGSL/gaussianSplattingVoxel.vertex.js +2 -1
  317. package/ShadersWGSL/gaussianSplattingVoxel.vertex.js.map +1 -1
  318. package/ShadersWGSL/gpsHiZBuild.compute.d.ts +5 -0
  319. package/ShadersWGSL/gpsHiZBuild.compute.js +16 -0
  320. package/ShadersWGSL/gpsHiZBuild.compute.js.map +1 -0
  321. package/ShadersWGSL/gpsPartition.compute.d.ts +5 -0
  322. package/ShadersWGSL/gpsPartition.compute.js +27 -0
  323. package/ShadersWGSL/gpsPartition.compute.js.map +1 -0
  324. package/ShadersWGSL/gpsPreprocess.compute.d.ts +5 -0
  325. package/ShadersWGSL/gpsPreprocess.compute.js +86 -0
  326. package/ShadersWGSL/gpsPreprocess.compute.js.map +1 -0
  327. package/ShadersWGSL/gpsResolve.compute.d.ts +5 -0
  328. package/ShadersWGSL/gpsResolve.compute.js +41 -0
  329. package/ShadersWGSL/gpsResolve.compute.js.map +1 -0
  330. package/ShadersWGSL/gpsScanAdd.compute.d.ts +5 -0
  331. package/ShadersWGSL/gpsScanAdd.compute.js +22 -0
  332. package/ShadersWGSL/gpsScanAdd.compute.js.map +1 -0
  333. package/ShadersWGSL/gpsScanBlocks.compute.d.ts +5 -0
  334. package/ShadersWGSL/gpsScanBlocks.compute.js +23 -0
  335. package/ShadersWGSL/gpsScanBlocks.compute.js.map +1 -0
  336. package/ShadersWGSL/gpsScanSums.compute.d.ts +5 -0
  337. package/ShadersWGSL/gpsScanSums.compute.js +30 -0
  338. package/ShadersWGSL/gpsScanSums.compute.js.map +1 -0
  339. package/ShadersWGSL/gpsSplat.compute.d.ts +5 -0
  340. package/ShadersWGSL/gpsSplat.compute.js +37 -0
  341. package/ShadersWGSL/gpsSplat.compute.js.map +1 -0
  342. package/ShadersWGSL/minmaxRedux.fragment.js +20 -3
  343. package/ShadersWGSL/minmaxRedux.fragment.js.map +1 -1
  344. package/XR/features/WebXRSpaceWarp.pure.js +2 -1
  345. package/XR/features/WebXRSpaceWarp.pure.js.map +1 -1
  346. package/assetContainer.d.ts +1 -0
  347. package/assetContainer.js +5 -1
  348. package/assetContainer.js.map +1 -1
  349. package/package.json +1 -1
  350. package/scene.pure.d.ts +13 -2
  351. package/scene.pure.js +28 -4
  352. package/scene.pure.js.map +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gaussianPointSplattingDepthBlit.fragment.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/gaussianPointSplattingDepthBlit.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,IAAI,GAAG,4CAA4C,CAAC;AAC1D,MAAM,MAAM,GAAG;;;;;;;;;;CAUd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IACtC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,8CAA8C,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\n\nconst name = \"gaussianPointSplattingDepthBlitPixelShader\";\nconst shader = `uniform resolution: vec2f;uniform depthValues: vec2f;uniform projZ: vec4f;uniform inverseProjection: mat4x4f;uniform useInverseProjection: f32;uniform reverseDepth: f32;varying vScreenUv: vec2f;var<storage,read> accumBuffer : array<vec4f>;var<storage,read> accumDepth : array<f32>;\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nlet res=uniforms.resolution;let uv=clamp(fragmentInputs.vScreenUv,vec2f(0.0,0.0),vec2f(0.99999,0.99999));let pixel=vec2u(uv*res);let idx=pixel.y*u32(res.x)+pixel.x;if (accumBuffer[idx].w<0.0015) {discard;}\nlet ndc=accumDepth[idx];var clipZ : f32;if (uniforms.useInverseProjection>0.5) {let ndcXY=(vec2f(pixel)+0.5)/res*2.0-1.0;let unprojected=uniforms.inverseProjection*vec4f(ndcXY,ndc,1.0);clipZ=ndc/unprojected.w;} else {let denom=uniforms.projZ.x-ndc*uniforms.projZ.y;let vz=(ndc*uniforms.projZ.w-uniforms.projZ.z)/denom;clipZ=uniforms.projZ.x*vz+uniforms.projZ.z;}\nlet signedClipZ=select(clipZ,-clipZ,uniforms.reverseDepth>0.5);let metric=(signedClipZ+uniforms.depthValues.x)/uniforms.depthValues.y;fragmentOutputs.color=vec4f(metric,0.0,0.0,1.0);fragmentOutputs.fragDepth=ndc;\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\n\n/** @internal */\nexport const gaussianPointSplattingDepthBlitPixelShaderWGSL = { name, shader };\n"]}
@@ -6,6 +6,7 @@ import { helperFunctionsWGSL } from "./ShadersInclude/helperFunctions.js";
6
6
  import { clipPlaneVertexDeclarationWGSL } from "./ShadersInclude/clipPlaneVertexDeclaration.js";
7
7
  import { fogVertexDeclarationWGSL } from "./ShadersInclude/fogVertexDeclaration.js";
8
8
  import { logDepthDeclarationWGSL } from "./ShadersInclude/logDepthDeclaration.js";
9
+ import { gaussianSplattingSharedWGSL } from "./ShadersInclude/gaussianSplattingShared.js";
9
10
  import { gaussianSplattingWGSL } from "./ShadersInclude/gaussianSplatting.js";
10
11
  import { clipPlaneVertexWGSL } from "./ShadersInclude/clipPlaneVertex.js";
11
12
  import { fogVertexWGSL } from "./ShadersInclude/fogVertex.js";
@@ -181,7 +182,7 @@ vertexOutputs.vGeometryPreviousPosition=uniforms.previousViewProjection*uniforms
181
182
  if (!ShaderStore.ShadersStoreWGSL[name]) {
182
183
  ShaderStore.ShadersStoreWGSL[name] = shader;
183
184
  }
184
- const includes = [sceneUboDeclarationWGSL, meshUboDeclarationWGSL, helperFunctionsWGSL, clipPlaneVertexDeclarationWGSL, fogVertexDeclarationWGSL, logDepthDeclarationWGSL, gaussianSplattingWGSL, clipPlaneVertexWGSL, fogVertexWGSL, logDepthVertexWGSL];
185
+ const includes = [sceneUboDeclarationWGSL, meshUboDeclarationWGSL, helperFunctionsWGSL, clipPlaneVertexDeclarationWGSL, fogVertexDeclarationWGSL, logDepthDeclarationWGSL, gaussianSplattingSharedWGSL, gaussianSplattingWGSL, clipPlaneVertexWGSL, fogVertexWGSL, logDepthVertexWGSL];
185
186
  for (const inc of includes) {
186
187
  if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {
187
188
  ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;
@@ -1 +1 @@
1
- {"version":3,"file":"gaussianSplatting.vertex.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/gaussianSplatting.vertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,8BAA8B,EAAE,MAAM,6CAA6C,CAAC;AAC7F,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,MAAM,IAAI,GAAG,+BAA+B,CAAC;AAC7C,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqKd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IACtC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,CAAC;AACD,MAAM,QAAQ,GAAG,CAAC,uBAAuB,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,aAAa,EAAE,kBAAkB,CAAC,CAAC;AAC1P,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;IACzB,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAClD,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC;IAChE,CAAC;AACL,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,iCAAiC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport { sceneUboDeclarationWGSL } from \"./ShadersInclude/sceneUboDeclaration\";\nimport { meshUboDeclarationWGSL } from \"./ShadersInclude/meshUboDeclaration\";\nimport { helperFunctionsWGSL } from \"./ShadersInclude/helperFunctions\";\nimport { clipPlaneVertexDeclarationWGSL } from \"./ShadersInclude/clipPlaneVertexDeclaration\";\nimport { fogVertexDeclarationWGSL } from \"./ShadersInclude/fogVertexDeclaration\";\nimport { logDepthDeclarationWGSL } from \"./ShadersInclude/logDepthDeclaration\";\nimport { gaussianSplattingWGSL } from \"./ShadersInclude/gaussianSplatting\";\nimport { clipPlaneVertexWGSL } from \"./ShadersInclude/clipPlaneVertex\";\nimport { fogVertexWGSL } from \"./ShadersInclude/fogVertex\";\nimport { logDepthVertexWGSL } from \"./ShadersInclude/logDepthVertex\";\n\nconst name = \"gaussianSplattingVertexShader\";\nconst shader = `#include<sceneUboDeclaration>\n#include<meshUboDeclaration>\n#include<helperFunctions>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<logDepthDeclaration>\nattribute splatIndex0: vec4f;attribute splatIndex1: vec4f;attribute splatIndex2: vec4f;attribute splatIndex3: vec4f;attribute position: vec3f;uniform invViewport: vec2f;uniform dataTextureSize: vec2f;uniform focal: vec2f;uniform kernelSize: f32;uniform minPixelSize: f32;uniform eyePosition: vec3f;uniform alpha: f32;\n#ifdef PREPASS\n#if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)\nuniform previousWorld: mat4x4f;uniform previousViewProjection: mat4x4f;\n#if IS_COMPOUND\nuniform previousPartWorld: array<mat4x4<f32>,MAX_PART_COUNT>;\n#endif\n#endif\n#ifdef PREPASS_NORMALIZED_VIEW_DEPTH\nuniform geometryDepthRange: vec2f;\n#endif\n#endif\n#if IS_COMPOUND\nuniform partWorld: array<mat4x4<f32>,MAX_PART_COUNT>;uniform partVisibility: array<f32,MAX_PART_COUNT>;\n#endif\nvar covariancesATexture: texture_2d<f32>;var covariancesBTexture: texture_2d<f32>;var centersTexture: texture_2d<f32>;var colorsTexture: texture_2d<f32>;\n#ifdef USE_SOG\nvar sogQuatsTexture: texture_2d<f32>;uniform sogMeansMin: vec3f;uniform sogMeansMax: vec3f;\n#ifdef USE_SOG_V2\nvar sogCodebookTexture: texture_2d<f32>;\n#else\nuniform sogScalesMin: vec3f;uniform sogScalesMax: vec3f;uniform sogSh0Min: vec4f;uniform sogSh0Max: vec4f;uniform sogShnMin: f32;uniform sogShnMax: f32;\n#endif\n#if SH_DEGREE>0\nvar sogShNCentroidsTexture: texture_2d<f32>;var sogShNLabelsTexture: texture_2d<f32>;uniform sogShCoeffCount: f32;\n#endif\n#endif\n#if SH_DEGREE>0 && !defined(USE_SOG)\nvar shTexture0: texture_2d<u32>;\n#endif\n#if SH_DEGREE>1 && !defined(USE_SOG)\nvar shTexture1: texture_2d<u32>;\n#endif\n#if SH_DEGREE>2 && !defined(USE_SOG)\nvar shTexture2: texture_2d<u32>;\n#endif\n#if SH_DEGREE>3 && !defined(USE_SOG)\nvar shTexture3: texture_2d<u32>;var shTexture4: texture_2d<u32>;\n#endif\n#if IS_COMPOUND\nvar partIndicesTexture: texture_2d<f32>;\n#endif\nvarying vColor: vec4f;varying vPosition: vec2f;\n#ifdef PREPASS\n#ifdef PREPASS_POSITION\nvarying vGeometryPositionW: vec3f;\n#endif\n#ifdef PREPASS_LOCAL_POSITION\nvarying vGeometryPositionL: vec3f;\n#endif\n#ifdef PREPASS_DEPTH\nvarying vGeometryViewDepth: f32;\n#endif\n#ifdef PREPASS_NORMALIZED_VIEW_DEPTH\nvarying vGeometryNormalizedViewDepth: f32;\n#endif\n#ifdef PREPASS_NORMAL\nvarying vGeometryNormalV: vec3f;\n#endif\n#ifdef PREPASS_WORLD_NORMAL\nvarying vGeometryNormalW: vec3f;\n#endif\n#if defined(PREPASS_ALBEDO) || defined(PREPASS_ALBEDO_SQRT)\nvarying vGeometryAlbedo: vec3f;\n#endif\n#if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)\nvarying vGeometryCurrentPosition: vec4f;varying vGeometryPreviousPosition: vec4f;\n#endif\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n#include<gaussianSplatting>\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nlet splatIndex: f32=getSplatIndex(i32(vertexInputs.position.z+0.5),vertexInputs.splatIndex0,vertexInputs.splatIndex1,vertexInputs.splatIndex2,vertexInputs.splatIndex3);var splat: Splat=readSplat(splatIndex,uniforms.dataTextureSize);var covA: vec3f=splat.covA.xyz;var covB: vec3f=vec3f(splat.covA.w,splat.covB.xy);\n#if IS_COMPOUND\nlet splatWorld: mat4x4f=getPartWorld(splat.partIndex);\n#else\nlet splatWorld: mat4x4f=mesh.world;\n#endif\nlet worldPos: vec4f=splatWorld*vec4f(splat.center.xyz,1.0);vertexOutputs.vPosition=vertexInputs.position.xy;\n#if defined(PREPASS_ALBEDO) || defined(PREPASS_ALBEDO_SQRT)\nvertexOutputs.vGeometryAlbedo=splat.color.xyz;\n#endif\n#if SH_DEGREE>0\nlet worldRot: mat3x3f= mat3x3f(splatWorld[0].xyz,splatWorld[1].xyz,splatWorld[2].xyz);let normWorldRot: mat3x3f=inverseMat3(worldRot);var eyeToSplatLocalSpace: vec3f=normalize(normWorldRot*(worldPos.xyz-uniforms.eyePosition.xyz));\n#if defined(GS_DBG_ENABLED) && IS_COMPOUND\n{let _row3=textureLoad(dbgPartData,vec2i(i32(splat.partIndex),3),0);\n#if SH_DEGREE>3\nlet _so4=textureLoad(dbgPartData,vec2i(i32(splat.partIndex),4),0).x;\n#else\nlet _so4: f32=1.0;\n#endif\nvertexOutputs.vColor=vec4f(_row3.x*splat.color.xyz+computeSHWeighted(splat,eyeToSplatLocalSpace,_row3.y,_row3.z,_row3.w,_so4),splat.color.w*uniforms.alpha);}\n#elif defined(GS_DBG_ENABLED) && GS_DBG_SH_DC==0\nvertexOutputs.vColor=vec4f(computeSH(splat,eyeToSplatLocalSpace),splat.color.w*uniforms.alpha);\n#else\nvertexOutputs.vColor=vec4f(splat.color.xyz+computeSH(splat,eyeToSplatLocalSpace),splat.color.w*uniforms.alpha);\n#endif\n#else\n#if defined(GS_DBG_ENABLED) && IS_COMPOUND\n{let _shDc=textureLoad(dbgPartData,vec2i(i32(splat.partIndex),3),0).x;vertexOutputs.vColor=vec4f(_shDc*splat.color.xyz,splat.color.w*uniforms.alpha);}\n#elif defined(GS_DBG_ENABLED) && GS_DBG_SH_DC==0\nvertexOutputs.vColor=vec4f(0.0,0.0,0.0,splat.color.w*uniforms.alpha);\n#else\nvertexOutputs.vColor=vec4f(splat.color.xyz,splat.color.w*uniforms.alpha);\n#endif\n#endif\n#if IS_COMPOUND\nvertexOutputs.vColor.w*=uniforms.partVisibility[splat.partIndex];\n#endif\nvar scale: vec2f=vec2f(1.,1.);\n#define CUSTOM_VERTEX_UPDATE\nvertexOutputs.position=gaussianSplatting(vertexInputs.position.xy,worldPos.xyz,scale,covA,covB,splatWorld,scene.view,scene.projection,uniforms.focal,uniforms.invViewport,uniforms.kernelSize,uniforms.minPixelSize);\n#ifdef PREPASS\n#if defined(PREPASS_POSITION) || defined(PREPASS_LOCAL_POSITION) || defined(PREPASS_DEPTH) || defined(PREPASS_NORMALIZED_VIEW_DEPTH) || defined(PREPASS_NORMAL) || defined(PREPASS_WORLD_NORMAL) || defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)\nlet geometrySplatViewPosition=(scene.view*worldPos).xyz;let viewRotation=mat3x3f(scene.view[0].xyz,scene.view[1].xyz,scene.view[2].xyz);\n#endif\n#if defined(PREPASS_POSITION) || defined(PREPASS_LOCAL_POSITION) || defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)\nvar geometryPlaneViewPosition=scene.inverseProjection*vertexOutputs.position;geometryPlaneViewPosition/=geometryPlaneViewPosition.w;let geometryPlanePositionW=worldPos.xyz+transpose(viewRotation)*(geometryPlaneViewPosition.xyz-geometrySplatViewPosition);\n#if defined(PREPASS_LOCAL_POSITION) || defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)\nlet splatWorldRotation=mat3x3f(splatWorld[0].xyz,splatWorld[1].xyz,splatWorld[2].xyz);let geometryPlanePositionL=splat.center.xyz+inverseMat3(splatWorldRotation)*(geometryPlanePositionW-worldPos.xyz);\n#endif\n#endif\n#ifdef PREPASS_POSITION\nvertexOutputs.vGeometryPositionW=geometryPlanePositionW;\n#endif\n#ifdef PREPASS_LOCAL_POSITION\nvertexOutputs.vGeometryPositionL=geometryPlanePositionL;\n#endif\n#ifdef PREPASS_DEPTH\nvertexOutputs.vGeometryViewDepth=geometrySplatViewPosition.z;\n#endif\n#ifdef PREPASS_NORMALIZED_VIEW_DEPTH\nvertexOutputs.vGeometryNormalizedViewDepth=(geometrySplatViewPosition.z-uniforms.geometryDepthRange.x)/(uniforms.geometryDepthRange.y-uniforms.geometryDepthRange.x);\n#endif\n#if defined(PREPASS_NORMAL) || defined(PREPASS_WORLD_NORMAL)\nlet geometryNormalV=vec3f(0.0,0.0,select(-1.0,1.0,geometrySplatViewPosition.z<0.0));let geometryNormalW=normalize(transpose(viewRotation)*geometryNormalV);\n#ifdef PREPASS_NORMAL\nvertexOutputs.vGeometryNormalV=geometryNormalV;\n#endif\n#ifdef PREPASS_WORLD_NORMAL\nvertexOutputs.vGeometryNormalW=geometryNormalW;\n#endif\n#endif\n#if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)\nvertexOutputs.vGeometryCurrentPosition=vertexOutputs.position;\n#if IS_COMPOUND\nvertexOutputs.vGeometryPreviousPosition=uniforms.previousViewProjection*uniforms.previousPartWorld[splat.partIndex]*vec4f(geometryPlanePositionL,1.0);\n#else\nvertexOutputs.vGeometryPreviousPosition=uniforms.previousViewProjection*uniforms.previousWorld*vec4f(geometryPlanePositionL,1.0);\n#endif\n#endif\n#endif\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\nconst includes = [sceneUboDeclarationWGSL, meshUboDeclarationWGSL, helperFunctionsWGSL, clipPlaneVertexDeclarationWGSL, fogVertexDeclarationWGSL, logDepthDeclarationWGSL, gaussianSplattingWGSL, clipPlaneVertexWGSL, fogVertexWGSL, logDepthVertexWGSL];\nfor (const inc of includes) {\n if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {\n ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;\n }\n}\n\n/** @internal */\nexport const gaussianSplattingVertexShaderWGSL = { name, shader };\n"]}
1
+ {"version":3,"file":"gaussianSplatting.vertex.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/gaussianSplatting.vertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,8BAA8B,EAAE,MAAM,6CAA6C,CAAC;AAC7F,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AACvF,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,MAAM,IAAI,GAAG,+BAA+B,CAAC;AAC7C,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqKd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IACtC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,CAAC;AACD,MAAM,QAAQ,GAAG,CAAC,uBAAuB,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,aAAa,EAAE,kBAAkB,CAAC,CAAC;AACvR,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;IACzB,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAClD,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC;IAChE,CAAC;AACL,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,iCAAiC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport { sceneUboDeclarationWGSL } from \"./ShadersInclude/sceneUboDeclaration\";\nimport { meshUboDeclarationWGSL } from \"./ShadersInclude/meshUboDeclaration\";\nimport { helperFunctionsWGSL } from \"./ShadersInclude/helperFunctions\";\nimport { clipPlaneVertexDeclarationWGSL } from \"./ShadersInclude/clipPlaneVertexDeclaration\";\nimport { fogVertexDeclarationWGSL } from \"./ShadersInclude/fogVertexDeclaration\";\nimport { logDepthDeclarationWGSL } from \"./ShadersInclude/logDepthDeclaration\";\nimport { gaussianSplattingSharedWGSL } from \"./ShadersInclude/gaussianSplattingShared\";\nimport { gaussianSplattingWGSL } from \"./ShadersInclude/gaussianSplatting\";\nimport { clipPlaneVertexWGSL } from \"./ShadersInclude/clipPlaneVertex\";\nimport { fogVertexWGSL } from \"./ShadersInclude/fogVertex\";\nimport { logDepthVertexWGSL } from \"./ShadersInclude/logDepthVertex\";\n\nconst name = \"gaussianSplattingVertexShader\";\nconst shader = `#include<sceneUboDeclaration>\n#include<meshUboDeclaration>\n#include<helperFunctions>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<logDepthDeclaration>\nattribute splatIndex0: vec4f;attribute splatIndex1: vec4f;attribute splatIndex2: vec4f;attribute splatIndex3: vec4f;attribute position: vec3f;uniform invViewport: vec2f;uniform dataTextureSize: vec2f;uniform focal: vec2f;uniform kernelSize: f32;uniform minPixelSize: f32;uniform eyePosition: vec3f;uniform alpha: f32;\n#ifdef PREPASS\n#if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)\nuniform previousWorld: mat4x4f;uniform previousViewProjection: mat4x4f;\n#if IS_COMPOUND\nuniform previousPartWorld: array<mat4x4<f32>,MAX_PART_COUNT>;\n#endif\n#endif\n#ifdef PREPASS_NORMALIZED_VIEW_DEPTH\nuniform geometryDepthRange: vec2f;\n#endif\n#endif\n#if IS_COMPOUND\nuniform partWorld: array<mat4x4<f32>,MAX_PART_COUNT>;uniform partVisibility: array<f32,MAX_PART_COUNT>;\n#endif\nvar covariancesATexture: texture_2d<f32>;var covariancesBTexture: texture_2d<f32>;var centersTexture: texture_2d<f32>;var colorsTexture: texture_2d<f32>;\n#ifdef USE_SOG\nvar sogQuatsTexture: texture_2d<f32>;uniform sogMeansMin: vec3f;uniform sogMeansMax: vec3f;\n#ifdef USE_SOG_V2\nvar sogCodebookTexture: texture_2d<f32>;\n#else\nuniform sogScalesMin: vec3f;uniform sogScalesMax: vec3f;uniform sogSh0Min: vec4f;uniform sogSh0Max: vec4f;uniform sogShnMin: f32;uniform sogShnMax: f32;\n#endif\n#if SH_DEGREE>0\nvar sogShNCentroidsTexture: texture_2d<f32>;var sogShNLabelsTexture: texture_2d<f32>;uniform sogShCoeffCount: f32;\n#endif\n#endif\n#if SH_DEGREE>0 && !defined(USE_SOG)\nvar shTexture0: texture_2d<u32>;\n#endif\n#if SH_DEGREE>1 && !defined(USE_SOG)\nvar shTexture1: texture_2d<u32>;\n#endif\n#if SH_DEGREE>2 && !defined(USE_SOG)\nvar shTexture2: texture_2d<u32>;\n#endif\n#if SH_DEGREE>3 && !defined(USE_SOG)\nvar shTexture3: texture_2d<u32>;var shTexture4: texture_2d<u32>;\n#endif\n#if IS_COMPOUND\nvar partIndicesTexture: texture_2d<f32>;\n#endif\nvarying vColor: vec4f;varying vPosition: vec2f;\n#ifdef PREPASS\n#ifdef PREPASS_POSITION\nvarying vGeometryPositionW: vec3f;\n#endif\n#ifdef PREPASS_LOCAL_POSITION\nvarying vGeometryPositionL: vec3f;\n#endif\n#ifdef PREPASS_DEPTH\nvarying vGeometryViewDepth: f32;\n#endif\n#ifdef PREPASS_NORMALIZED_VIEW_DEPTH\nvarying vGeometryNormalizedViewDepth: f32;\n#endif\n#ifdef PREPASS_NORMAL\nvarying vGeometryNormalV: vec3f;\n#endif\n#ifdef PREPASS_WORLD_NORMAL\nvarying vGeometryNormalW: vec3f;\n#endif\n#if defined(PREPASS_ALBEDO) || defined(PREPASS_ALBEDO_SQRT)\nvarying vGeometryAlbedo: vec3f;\n#endif\n#if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)\nvarying vGeometryCurrentPosition: vec4f;varying vGeometryPreviousPosition: vec4f;\n#endif\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n#include<gaussianSplatting>\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nlet splatIndex: f32=getSplatIndex(i32(vertexInputs.position.z+0.5),vertexInputs.splatIndex0,vertexInputs.splatIndex1,vertexInputs.splatIndex2,vertexInputs.splatIndex3);var splat: Splat=readSplat(splatIndex,uniforms.dataTextureSize);var covA: vec3f=splat.covA.xyz;var covB: vec3f=vec3f(splat.covA.w,splat.covB.xy);\n#if IS_COMPOUND\nlet splatWorld: mat4x4f=getPartWorld(splat.partIndex);\n#else\nlet splatWorld: mat4x4f=mesh.world;\n#endif\nlet worldPos: vec4f=splatWorld*vec4f(splat.center.xyz,1.0);vertexOutputs.vPosition=vertexInputs.position.xy;\n#if defined(PREPASS_ALBEDO) || defined(PREPASS_ALBEDO_SQRT)\nvertexOutputs.vGeometryAlbedo=splat.color.xyz;\n#endif\n#if SH_DEGREE>0\nlet worldRot: mat3x3f= mat3x3f(splatWorld[0].xyz,splatWorld[1].xyz,splatWorld[2].xyz);let normWorldRot: mat3x3f=inverseMat3(worldRot);var eyeToSplatLocalSpace: vec3f=normalize(normWorldRot*(worldPos.xyz-uniforms.eyePosition.xyz));\n#if defined(GS_DBG_ENABLED) && IS_COMPOUND\n{let _row3=textureLoad(dbgPartData,vec2i(i32(splat.partIndex),3),0);\n#if SH_DEGREE>3\nlet _so4=textureLoad(dbgPartData,vec2i(i32(splat.partIndex),4),0).x;\n#else\nlet _so4: f32=1.0;\n#endif\nvertexOutputs.vColor=vec4f(_row3.x*splat.color.xyz+computeSHWeighted(splat,eyeToSplatLocalSpace,_row3.y,_row3.z,_row3.w,_so4),splat.color.w*uniforms.alpha);}\n#elif defined(GS_DBG_ENABLED) && GS_DBG_SH_DC==0\nvertexOutputs.vColor=vec4f(computeSH(splat,eyeToSplatLocalSpace),splat.color.w*uniforms.alpha);\n#else\nvertexOutputs.vColor=vec4f(splat.color.xyz+computeSH(splat,eyeToSplatLocalSpace),splat.color.w*uniforms.alpha);\n#endif\n#else\n#if defined(GS_DBG_ENABLED) && IS_COMPOUND\n{let _shDc=textureLoad(dbgPartData,vec2i(i32(splat.partIndex),3),0).x;vertexOutputs.vColor=vec4f(_shDc*splat.color.xyz,splat.color.w*uniforms.alpha);}\n#elif defined(GS_DBG_ENABLED) && GS_DBG_SH_DC==0\nvertexOutputs.vColor=vec4f(0.0,0.0,0.0,splat.color.w*uniforms.alpha);\n#else\nvertexOutputs.vColor=vec4f(splat.color.xyz,splat.color.w*uniforms.alpha);\n#endif\n#endif\n#if IS_COMPOUND\nvertexOutputs.vColor.w*=uniforms.partVisibility[splat.partIndex];\n#endif\nvar scale: vec2f=vec2f(1.,1.);\n#define CUSTOM_VERTEX_UPDATE\nvertexOutputs.position=gaussianSplatting(vertexInputs.position.xy,worldPos.xyz,scale,covA,covB,splatWorld,scene.view,scene.projection,uniforms.focal,uniforms.invViewport,uniforms.kernelSize,uniforms.minPixelSize);\n#ifdef PREPASS\n#if defined(PREPASS_POSITION) || defined(PREPASS_LOCAL_POSITION) || defined(PREPASS_DEPTH) || defined(PREPASS_NORMALIZED_VIEW_DEPTH) || defined(PREPASS_NORMAL) || defined(PREPASS_WORLD_NORMAL) || defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)\nlet geometrySplatViewPosition=(scene.view*worldPos).xyz;let viewRotation=mat3x3f(scene.view[0].xyz,scene.view[1].xyz,scene.view[2].xyz);\n#endif\n#if defined(PREPASS_POSITION) || defined(PREPASS_LOCAL_POSITION) || defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)\nvar geometryPlaneViewPosition=scene.inverseProjection*vertexOutputs.position;geometryPlaneViewPosition/=geometryPlaneViewPosition.w;let geometryPlanePositionW=worldPos.xyz+transpose(viewRotation)*(geometryPlaneViewPosition.xyz-geometrySplatViewPosition);\n#if defined(PREPASS_LOCAL_POSITION) || defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)\nlet splatWorldRotation=mat3x3f(splatWorld[0].xyz,splatWorld[1].xyz,splatWorld[2].xyz);let geometryPlanePositionL=splat.center.xyz+inverseMat3(splatWorldRotation)*(geometryPlanePositionW-worldPos.xyz);\n#endif\n#endif\n#ifdef PREPASS_POSITION\nvertexOutputs.vGeometryPositionW=geometryPlanePositionW;\n#endif\n#ifdef PREPASS_LOCAL_POSITION\nvertexOutputs.vGeometryPositionL=geometryPlanePositionL;\n#endif\n#ifdef PREPASS_DEPTH\nvertexOutputs.vGeometryViewDepth=geometrySplatViewPosition.z;\n#endif\n#ifdef PREPASS_NORMALIZED_VIEW_DEPTH\nvertexOutputs.vGeometryNormalizedViewDepth=(geometrySplatViewPosition.z-uniforms.geometryDepthRange.x)/(uniforms.geometryDepthRange.y-uniforms.geometryDepthRange.x);\n#endif\n#if defined(PREPASS_NORMAL) || defined(PREPASS_WORLD_NORMAL)\nlet geometryNormalV=vec3f(0.0,0.0,select(-1.0,1.0,geometrySplatViewPosition.z<0.0));let geometryNormalW=normalize(transpose(viewRotation)*geometryNormalV);\n#ifdef PREPASS_NORMAL\nvertexOutputs.vGeometryNormalV=geometryNormalV;\n#endif\n#ifdef PREPASS_WORLD_NORMAL\nvertexOutputs.vGeometryNormalW=geometryNormalW;\n#endif\n#endif\n#if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)\nvertexOutputs.vGeometryCurrentPosition=vertexOutputs.position;\n#if IS_COMPOUND\nvertexOutputs.vGeometryPreviousPosition=uniforms.previousViewProjection*uniforms.previousPartWorld[splat.partIndex]*vec4f(geometryPlanePositionL,1.0);\n#else\nvertexOutputs.vGeometryPreviousPosition=uniforms.previousViewProjection*uniforms.previousWorld*vec4f(geometryPlanePositionL,1.0);\n#endif\n#endif\n#endif\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\nconst includes = [sceneUboDeclarationWGSL, meshUboDeclarationWGSL, helperFunctionsWGSL, clipPlaneVertexDeclarationWGSL, fogVertexDeclarationWGSL, logDepthDeclarationWGSL, gaussianSplattingSharedWGSL, gaussianSplattingWGSL, clipPlaneVertexWGSL, fogVertexWGSL, logDepthVertexWGSL];\nfor (const inc of includes) {\n if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {\n ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;\n }\n}\n\n/** @internal */\nexport const gaussianSplattingVertexShaderWGSL = { name, shader };\n"]}
@@ -2,6 +2,7 @@
2
2
  import { ShaderStore } from "../Engines/shaderStore.js";
3
3
  import { sceneUboDeclarationWGSL } from "./ShadersInclude/sceneUboDeclaration.js";
4
4
  import { meshUboDeclarationWGSL } from "./ShadersInclude/meshUboDeclaration.js";
5
+ import { gaussianSplattingSharedWGSL } from "./ShadersInclude/gaussianSplattingShared.js";
5
6
  import { gaussianSplattingWGSL } from "./ShadersInclude/gaussianSplatting.js";
6
7
  const name = "gaussianSplattingDepthVertexShader";
7
8
  const shader = `#include<sceneUboDeclaration>
@@ -39,7 +40,7 @@ vertexOutputs.vDepthMetric=((vertexOutputs.position.z+uniforms.depthValues.x)/(u
39
40
  if (!ShaderStore.ShadersStoreWGSL[name]) {
40
41
  ShaderStore.ShadersStoreWGSL[name] = shader;
41
42
  }
42
- const includes = [sceneUboDeclarationWGSL, meshUboDeclarationWGSL, gaussianSplattingWGSL];
43
+ const includes = [sceneUboDeclarationWGSL, meshUboDeclarationWGSL, gaussianSplattingSharedWGSL, gaussianSplattingWGSL];
43
44
  for (const inc of includes) {
44
45
  if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {
45
46
  ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;
@@ -1 +1 @@
1
- {"version":3,"file":"gaussianSplattingDepth.vertex.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/gaussianSplattingDepth.vertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAE3E,MAAM,IAAI,GAAG,oCAAoC,CAAC;AAClD,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8Bb,CAAC;AACH,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IACtC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,CAAC;AACD,MAAM,QAAQ,GAAG,CAAC,uBAAuB,EAAE,sBAAsB,EAAE,qBAAqB,CAAC,CAAC;AAC1F,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;IACzB,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAClD,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC;IAChE,CAAC;AACL,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,sCAAsC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport { sceneUboDeclarationWGSL } from \"./ShadersInclude/sceneUboDeclaration\";\nimport { meshUboDeclarationWGSL } from \"./ShadersInclude/meshUboDeclaration\";\nimport { gaussianSplattingWGSL } from \"./ShadersInclude/gaussianSplatting\";\n\nconst name = \"gaussianSplattingDepthVertexShader\";\nconst shader = `#include<sceneUboDeclaration>\n#include<meshUboDeclaration>\nattribute splatIndex0: vec4f;attribute splatIndex1: vec4f;attribute splatIndex2: vec4f;attribute splatIndex3: vec4f;attribute position: vec3f;uniform invViewport: vec2f;uniform dataTextureSize: vec2f;uniform focal: vec2f;uniform kernelSize: f32;uniform minPixelSize: f32;uniform alpha: f32;var covariancesATexture: texture_2d<f32>;var covariancesBTexture: texture_2d<f32>;var centersTexture: texture_2d<f32>;var colorsTexture: texture_2d<f32>;\n#if IS_COMPOUND\nuniform partWorld: array<mat4x4<f32>,MAX_PART_COUNT>;uniform partVisibility: array<f32,MAX_PART_COUNT>;var partIndicesTexture: texture_2d<f32>;\n#endif\nvarying vPosition: vec2f;varying vColor: vec4f;\n#ifdef DEPTH_RENDER\nuniform depthValues: vec2f;varying vDepthMetric: f32;\n#endif\n#include<gaussianSplatting>\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {let splatIndex: f32=getSplatIndex(i32(vertexInputs.position.z+0.5),vertexInputs.splatIndex0,vertexInputs.splatIndex1,vertexInputs.splatIndex2,vertexInputs.splatIndex3);var splat: Splat=readSplat(splatIndex,uniforms.dataTextureSize);var covA: vec3f=splat.covA.xyz;var covB: vec3f=vec3f(splat.covA.w,splat.covB.xy);\n#if IS_COMPOUND\nlet splatWorld: mat4x4f=getPartWorld(splat.partIndex);\n#else\nlet splatWorld: mat4x4f=mesh.world;\n#endif\nlet worldPos: vec4f=splatWorld*vec4f(splat.center.xyz,1.0);vertexOutputs.vPosition=vertexInputs.position.xy;vertexOutputs.vColor=splat.color;vertexOutputs.vColor.w*=uniforms.alpha;\n#if IS_COMPOUND\nvertexOutputs.vColor.w*=uniforms.partVisibility[splat.partIndex];\n#endif\nvertexOutputs.position=gaussianSplatting(vertexInputs.position.xy,worldPos.xyz,vec2f(1.0,1.0),covA,covB,splatWorld,scene.view,scene.projection,uniforms.focal,uniforms.invViewport,uniforms.kernelSize,uniforms.minPixelSize);\n#ifdef DEPTH_RENDER\n#ifdef USE_REVERSE_DEPTHBUFFER\nvertexOutputs.vDepthMetric=((-vertexOutputs.position.z+uniforms.depthValues.x)/(uniforms.depthValues.y));\n#else\nvertexOutputs.vDepthMetric=((vertexOutputs.position.z+uniforms.depthValues.x)/(uniforms.depthValues.y));\n#endif\n#endif\n}`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\nconst includes = [sceneUboDeclarationWGSL, meshUboDeclarationWGSL, gaussianSplattingWGSL];\nfor (const inc of includes) {\n if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {\n ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;\n }\n}\n\n/** @internal */\nexport const gaussianSplattingDepthVertexShaderWGSL = { name, shader };\n"]}
1
+ {"version":3,"file":"gaussianSplattingDepth.vertex.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/gaussianSplattingDepth.vertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AACvF,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAE3E,MAAM,IAAI,GAAG,oCAAoC,CAAC;AAClD,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8Bb,CAAC;AACH,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IACtC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,CAAC;AACD,MAAM,QAAQ,GAAG,CAAC,uBAAuB,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,qBAAqB,CAAC,CAAC;AACvH,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;IACzB,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAClD,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC;IAChE,CAAC;AACL,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,sCAAsC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport { sceneUboDeclarationWGSL } from \"./ShadersInclude/sceneUboDeclaration\";\nimport { meshUboDeclarationWGSL } from \"./ShadersInclude/meshUboDeclaration\";\nimport { gaussianSplattingSharedWGSL } from \"./ShadersInclude/gaussianSplattingShared\";\nimport { gaussianSplattingWGSL } from \"./ShadersInclude/gaussianSplatting\";\n\nconst name = \"gaussianSplattingDepthVertexShader\";\nconst shader = `#include<sceneUboDeclaration>\n#include<meshUboDeclaration>\nattribute splatIndex0: vec4f;attribute splatIndex1: vec4f;attribute splatIndex2: vec4f;attribute splatIndex3: vec4f;attribute position: vec3f;uniform invViewport: vec2f;uniform dataTextureSize: vec2f;uniform focal: vec2f;uniform kernelSize: f32;uniform minPixelSize: f32;uniform alpha: f32;var covariancesATexture: texture_2d<f32>;var covariancesBTexture: texture_2d<f32>;var centersTexture: texture_2d<f32>;var colorsTexture: texture_2d<f32>;\n#if IS_COMPOUND\nuniform partWorld: array<mat4x4<f32>,MAX_PART_COUNT>;uniform partVisibility: array<f32,MAX_PART_COUNT>;var partIndicesTexture: texture_2d<f32>;\n#endif\nvarying vPosition: vec2f;varying vColor: vec4f;\n#ifdef DEPTH_RENDER\nuniform depthValues: vec2f;varying vDepthMetric: f32;\n#endif\n#include<gaussianSplatting>\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {let splatIndex: f32=getSplatIndex(i32(vertexInputs.position.z+0.5),vertexInputs.splatIndex0,vertexInputs.splatIndex1,vertexInputs.splatIndex2,vertexInputs.splatIndex3);var splat: Splat=readSplat(splatIndex,uniforms.dataTextureSize);var covA: vec3f=splat.covA.xyz;var covB: vec3f=vec3f(splat.covA.w,splat.covB.xy);\n#if IS_COMPOUND\nlet splatWorld: mat4x4f=getPartWorld(splat.partIndex);\n#else\nlet splatWorld: mat4x4f=mesh.world;\n#endif\nlet worldPos: vec4f=splatWorld*vec4f(splat.center.xyz,1.0);vertexOutputs.vPosition=vertexInputs.position.xy;vertexOutputs.vColor=splat.color;vertexOutputs.vColor.w*=uniforms.alpha;\n#if IS_COMPOUND\nvertexOutputs.vColor.w*=uniforms.partVisibility[splat.partIndex];\n#endif\nvertexOutputs.position=gaussianSplatting(vertexInputs.position.xy,worldPos.xyz,vec2f(1.0,1.0),covA,covB,splatWorld,scene.view,scene.projection,uniforms.focal,uniforms.invViewport,uniforms.kernelSize,uniforms.minPixelSize);\n#ifdef DEPTH_RENDER\n#ifdef USE_REVERSE_DEPTHBUFFER\nvertexOutputs.vDepthMetric=((-vertexOutputs.position.z+uniforms.depthValues.x)/(uniforms.depthValues.y));\n#else\nvertexOutputs.vDepthMetric=((vertexOutputs.position.z+uniforms.depthValues.x)/(uniforms.depthValues.y));\n#endif\n#endif\n}`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\nconst includes = [sceneUboDeclarationWGSL, meshUboDeclarationWGSL, gaussianSplattingSharedWGSL, gaussianSplattingWGSL];\nfor (const inc of includes) {\n if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {\n ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;\n }\n}\n\n/** @internal */\nexport const gaussianSplattingDepthVertexShaderWGSL = { name, shader };\n"]}
@@ -2,6 +2,7 @@
2
2
  import { ShaderStore } from "../Engines/shaderStore.js";
3
3
  import { sceneUboDeclarationWGSL } from "./ShadersInclude/sceneUboDeclaration.js";
4
4
  import { meshUboDeclarationWGSL } from "./ShadersInclude/meshUboDeclaration.js";
5
+ import { gaussianSplattingSharedWGSL } from "./ShadersInclude/gaussianSplattingShared.js";
5
6
  import { gaussianSplattingWGSL } from "./ShadersInclude/gaussianSplatting.js";
6
7
  const name = "gaussianSplattingVoxelVertexShader";
7
8
  const shader = `#include<sceneUboDeclaration>
@@ -38,7 +39,7 @@ vertexOutputs.vPatchPosition=quadPos;}
38
39
  if (!ShaderStore.ShadersStoreWGSL[name]) {
39
40
  ShaderStore.ShadersStoreWGSL[name] = shader;
40
41
  }
41
- const includes = [sceneUboDeclarationWGSL, meshUboDeclarationWGSL, gaussianSplattingWGSL];
42
+ const includes = [sceneUboDeclarationWGSL, meshUboDeclarationWGSL, gaussianSplattingSharedWGSL, gaussianSplattingWGSL];
42
43
  for (const inc of includes) {
43
44
  if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {
44
45
  ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;
@@ -1 +1 @@
1
- {"version":3,"file":"gaussianSplattingVoxel.vertex.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/gaussianSplattingVoxel.vertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAE3E,MAAM,IAAI,GAAG,oCAAoC,CAAC;AAClD,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6Bd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IACtC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,CAAC;AACD,MAAM,QAAQ,GAAG,CAAC,uBAAuB,EAAE,sBAAsB,EAAE,qBAAqB,CAAC,CAAC;AAC1F,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;IACzB,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAClD,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC;IAChE,CAAC;AACL,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,sCAAsC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport { sceneUboDeclarationWGSL } from \"./ShadersInclude/sceneUboDeclaration\";\nimport { meshUboDeclarationWGSL } from \"./ShadersInclude/meshUboDeclaration\";\nimport { gaussianSplattingWGSL } from \"./ShadersInclude/gaussianSplatting\";\n\nconst name = \"gaussianSplattingVoxelVertexShader\";\nconst shader = `#include<sceneUboDeclaration>\n#include<meshUboDeclaration>\nattribute splatIndex0: vec4f;attribute splatIndex1: vec4f;attribute splatIndex2: vec4f;attribute splatIndex3: vec4f;attribute position: vec3f;uniform dataTextureSize: vec2f;uniform alpha: f32;uniform invWorldScale: mat4x4f;uniform viewMatrix: mat4x4f;\n#if IS_COMPOUND\nuniform partWorld: array<mat4x4<f32>,MAX_PART_COUNT>;uniform partVisibility: array<f32,MAX_PART_COUNT>;\n#endif\nvar rotationsATexture: texture_2d<f32>;var rotationsBTexture: texture_2d<f32>;var rotationScaleTexture: texture_2d<f32>;var centersTexture: texture_2d<f32>;var colorsTexture: texture_2d<f32>;\n#if IS_COMPOUND\nvar partIndicesTexture: texture_2d<f32>;\n#endif\nvarying vNormalizedPosition: vec3f;varying vNormalizedCenterPosition: vec3f;varying vAlpha: f32;varying vPatchPosition: vec2f;\n#include<gaussianSplatting>\n@vertex\nfn main(input: VertexInputs)->FragmentInputs {let splatIndex: f32=getSplatIndex(\ni32(vertexInputs.position.z+0.5),\nvertexInputs.splatIndex0,vertexInputs.splatIndex1,\nvertexInputs.splatIndex2,vertexInputs.splatIndex3\n);var splat: Splat=readSplat(splatIndex,uniforms.dataTextureSize);\n#if IS_COMPOUND\nif (uniforms.partVisibility[splat.partIndex]==0.0) {vertexOutputs.position=vec4f(2.0,2.0,2.0,1.0);return vertexOutputs;}\nlet splatWorld: mat4x4f=getPartWorld(splat.partIndex);\n#else\nlet splatWorld: mat4x4f=mesh.world;\n#endif\nlet quadPos: vec2f=vertexInputs.position.xy;let worldPos: vec4f=computeVoxelSplatWorldPos(splat.rotationA,splat.rotationB,splat.rotationScale,splat.center.xyz,splatWorld,uniforms.viewMatrix,uniforms.invWorldScale,quadPos);vertexOutputs.vNormalizedPosition=(uniforms.invWorldScale*worldPos).xyz*0.5+0.5;let clipPos: vec4f=uniforms.viewMatrix*uniforms.invWorldScale*worldPos;vertexOutputs.position=vec4f(clipPos.x,clipPos.y,clipPos.z*0.5+0.5,1.0);vertexOutputs.vNormalizedCenterPosition=(uniforms.invWorldScale*splatWorld*vec4f(splat.center.xyz,1.0)).xyz*0.5+0.5;vertexOutputs.vAlpha=splat.color.w*uniforms.alpha;\n#if IS_COMPOUND\nvertexOutputs.vAlpha*=uniforms.partVisibility[splat.partIndex];\n#endif\nvertexOutputs.vPatchPosition=quadPos;}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\nconst includes = [sceneUboDeclarationWGSL, meshUboDeclarationWGSL, gaussianSplattingWGSL];\nfor (const inc of includes) {\n if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {\n ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;\n }\n}\n\n/** @internal */\nexport const gaussianSplattingVoxelVertexShaderWGSL = { name, shader };\n"]}
1
+ {"version":3,"file":"gaussianSplattingVoxel.vertex.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/gaussianSplattingVoxel.vertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AACvF,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAE3E,MAAM,IAAI,GAAG,oCAAoC,CAAC;AAClD,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6Bd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IACtC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,CAAC;AACD,MAAM,QAAQ,GAAG,CAAC,uBAAuB,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,qBAAqB,CAAC,CAAC;AACvH,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;IACzB,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAClD,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC;IAChE,CAAC;AACL,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,sCAAsC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport { sceneUboDeclarationWGSL } from \"./ShadersInclude/sceneUboDeclaration\";\nimport { meshUboDeclarationWGSL } from \"./ShadersInclude/meshUboDeclaration\";\nimport { gaussianSplattingSharedWGSL } from \"./ShadersInclude/gaussianSplattingShared\";\nimport { gaussianSplattingWGSL } from \"./ShadersInclude/gaussianSplatting\";\n\nconst name = \"gaussianSplattingVoxelVertexShader\";\nconst shader = `#include<sceneUboDeclaration>\n#include<meshUboDeclaration>\nattribute splatIndex0: vec4f;attribute splatIndex1: vec4f;attribute splatIndex2: vec4f;attribute splatIndex3: vec4f;attribute position: vec3f;uniform dataTextureSize: vec2f;uniform alpha: f32;uniform invWorldScale: mat4x4f;uniform viewMatrix: mat4x4f;\n#if IS_COMPOUND\nuniform partWorld: array<mat4x4<f32>,MAX_PART_COUNT>;uniform partVisibility: array<f32,MAX_PART_COUNT>;\n#endif\nvar rotationsATexture: texture_2d<f32>;var rotationsBTexture: texture_2d<f32>;var rotationScaleTexture: texture_2d<f32>;var centersTexture: texture_2d<f32>;var colorsTexture: texture_2d<f32>;\n#if IS_COMPOUND\nvar partIndicesTexture: texture_2d<f32>;\n#endif\nvarying vNormalizedPosition: vec3f;varying vNormalizedCenterPosition: vec3f;varying vAlpha: f32;varying vPatchPosition: vec2f;\n#include<gaussianSplatting>\n@vertex\nfn main(input: VertexInputs)->FragmentInputs {let splatIndex: f32=getSplatIndex(\ni32(vertexInputs.position.z+0.5),\nvertexInputs.splatIndex0,vertexInputs.splatIndex1,\nvertexInputs.splatIndex2,vertexInputs.splatIndex3\n);var splat: Splat=readSplat(splatIndex,uniforms.dataTextureSize);\n#if IS_COMPOUND\nif (uniforms.partVisibility[splat.partIndex]==0.0) {vertexOutputs.position=vec4f(2.0,2.0,2.0,1.0);return vertexOutputs;}\nlet splatWorld: mat4x4f=getPartWorld(splat.partIndex);\n#else\nlet splatWorld: mat4x4f=mesh.world;\n#endif\nlet quadPos: vec2f=vertexInputs.position.xy;let worldPos: vec4f=computeVoxelSplatWorldPos(splat.rotationA,splat.rotationB,splat.rotationScale,splat.center.xyz,splatWorld,uniforms.viewMatrix,uniforms.invWorldScale,quadPos);vertexOutputs.vNormalizedPosition=(uniforms.invWorldScale*worldPos).xyz*0.5+0.5;let clipPos: vec4f=uniforms.viewMatrix*uniforms.invWorldScale*worldPos;vertexOutputs.position=vec4f(clipPos.x,clipPos.y,clipPos.z*0.5+0.5,1.0);vertexOutputs.vNormalizedCenterPosition=(uniforms.invWorldScale*splatWorld*vec4f(splat.center.xyz,1.0)).xyz*0.5+0.5;vertexOutputs.vAlpha=splat.color.w*uniforms.alpha;\n#if IS_COMPOUND\nvertexOutputs.vAlpha*=uniforms.partVisibility[splat.partIndex];\n#endif\nvertexOutputs.vPatchPosition=quadPos;}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\nconst includes = [sceneUboDeclarationWGSL, meshUboDeclarationWGSL, gaussianSplattingSharedWGSL, gaussianSplattingWGSL];\nfor (const inc of includes) {\n if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {\n ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;\n }\n}\n\n/** @internal */\nexport const gaussianSplattingVoxelVertexShaderWGSL = { name, shader };\n"]}
@@ -0,0 +1,5 @@
1
+ /** @internal */
2
+ export declare const gpsHiZBuildComputeShaderWGSL: {
3
+ name: string;
4
+ shader: string;
5
+ };
@@ -0,0 +1,16 @@
1
+ // Do not edit.
2
+ import { ShaderStore } from "../Engines/shaderStore.js";
3
+ const name = "gpsHiZBuildComputeShader";
4
+ const shader = `struct GpsHiZParams {src : vec4u,
5
+ dst : vec4u,};@group(0) @binding(0) var<storage,read_write> hiZ : array<f32>;@group(0) @binding(1) var<uniform> params : GpsHiZParams;@compute @workgroup_size(8,8,1)
6
+ fn main(@builtin(global_invocation_id) gid : vec3u) {let dstW=params.dst.y;let dstH=params.dst.z;if (gid.x>=dstW || gid.y>=dstH) {return;}
7
+ let srcW=params.src.y;let srcH=params.src.z;let sx=gid.x*2u;let sy=gid.y*2u;let sxEnd=select(min(sx+1u,srcW-1u),srcW-1u,gid.x==dstW-1u);let syEnd=select(min(sy+1u,srcH-1u),srcH-1u,gid.y==dstH-1u);let base=params.src.x;var m=0.0;for (var y=sy; y<=syEnd; y=y+1u) {let row=base+y*srcW;for (var x=sx; x<=sxEnd; x=x+1u) {m=max(m,hiZ[row+x]);}}
8
+ hiZ[params.dst.x+gid.y*dstW+gid.x]=m;}
9
+ `;
10
+ // Sideeffect
11
+ if (!ShaderStore.ShadersStoreWGSL[name]) {
12
+ ShaderStore.ShadersStoreWGSL[name] = shader;
13
+ }
14
+ /** @internal */
15
+ export const gpsHiZBuildComputeShaderWGSL = { name, shader };
16
+ //# sourceMappingURL=gpsHiZBuild.compute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gpsHiZBuild.compute.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/gpsHiZBuild.compute.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,IAAI,GAAG,0BAA0B,CAAC;AACxC,MAAM,MAAM,GAAG;;;;;CAKd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IACtC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\n\nconst name = \"gpsHiZBuildComputeShader\";\nconst shader = `struct GpsHiZParams {src : vec4u,\ndst : vec4u,};@group(0) @binding(0) var<storage,read_write> hiZ : array<f32>;@group(0) @binding(1) var<uniform> params : GpsHiZParams;@compute @workgroup_size(8,8,1)\nfn main(@builtin(global_invocation_id) gid : vec3u) {let dstW=params.dst.y;let dstH=params.dst.z;if (gid.x>=dstW || gid.y>=dstH) {return;}\nlet srcW=params.src.y;let srcH=params.src.z;let sx=gid.x*2u;let sy=gid.y*2u;let sxEnd=select(min(sx+1u,srcW-1u),srcW-1u,gid.x==dstW-1u);let syEnd=select(min(sy+1u,srcH-1u),srcH-1u,gid.y==dstH-1u);let base=params.src.x;var m=0.0;for (var y=sy; y<=syEnd; y=y+1u) {let row=base+y*srcW;for (var x=sx; x<=sxEnd; x=x+1u) {m=max(m,hiZ[row+x]);}}\nhiZ[params.dst.x+gid.y*dstW+gid.x]=m;}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\n\n/** @internal */\nexport const gpsHiZBuildComputeShaderWGSL = { name, shader };\n"]}
@@ -0,0 +1,5 @@
1
+ /** @internal */
2
+ export declare const gpsPartitionComputeShaderWGSL: {
3
+ name: string;
4
+ shader: string;
5
+ };
@@ -0,0 +1,27 @@
1
+ // Do not edit.
2
+ import { ShaderStore } from "../Engines/shaderStore.js";
3
+ import { gaussianPointSplattingWGSL } from "./ShadersInclude/gaussianPointSplatting.js";
4
+ const name = "gpsPartitionComputeShader";
5
+ const shader = `#include<gaussianPointSplatting>
6
+ @group(0) @binding(0) var<storage,read> cdf : array<u32>;@group(0) @binding(1) var<storage,read> pointCount : array<u32>;@group(0) @binding(2) var<storage,read_write> partTable : array<u32>;fn gpsFindGaussian(p : u32,count : u32)->u32 {var lo=0u;var hi=count;loop {if (lo+1u>=hi) {break;}
7
+ let mid=(lo+hi)>>1u;if (cdf[mid]<=p) {lo=mid;} else {hi=mid;}}
8
+ return lo;}
9
+ @compute @workgroup_size(256,1,1)
10
+ fn main(@builtin(global_invocation_id) gid : vec3u) {let k=gid.x;if (k>GPS_PARTITION_BUCKETS) {return;}
11
+ let total=pointCount[0];let count=arrayLength(&cdf);if (total==0u || count==0u) {partTable[k]=0u;return;}
12
+ var pk=u32(f32(k)/f32(GPS_PARTITION_BUCKETS)*f32(total));if (pk>total-1u) {pk=total-1u;}
13
+ partTable[k]=gpsFindGaussian(pk,count);}
14
+ `;
15
+ // Sideeffect
16
+ if (!ShaderStore.ShadersStoreWGSL[name]) {
17
+ ShaderStore.ShadersStoreWGSL[name] = shader;
18
+ }
19
+ const includes = [gaussianPointSplattingWGSL];
20
+ for (const inc of includes) {
21
+ if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {
22
+ ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;
23
+ }
24
+ }
25
+ /** @internal */
26
+ export const gpsPartitionComputeShaderWGSL = { name, shader };
27
+ //# sourceMappingURL=gpsPartition.compute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gpsPartition.compute.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/gpsPartition.compute.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAErF,MAAM,IAAI,GAAG,2BAA2B,CAAC;AACzC,MAAM,MAAM,GAAG;;;;;;;;;CASd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IACtC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,CAAC;AACD,MAAM,QAAQ,GAAG,CAAC,0BAA0B,CAAC,CAAC;AAC9C,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;IACzB,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAClD,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC;IAChE,CAAC;AACL,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,6BAA6B,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport { gaussianPointSplattingWGSL } from \"./ShadersInclude/gaussianPointSplatting\";\n\nconst name = \"gpsPartitionComputeShader\";\nconst shader = `#include<gaussianPointSplatting>\n@group(0) @binding(0) var<storage,read> cdf : array<u32>;@group(0) @binding(1) var<storage,read> pointCount : array<u32>;@group(0) @binding(2) var<storage,read_write> partTable : array<u32>;fn gpsFindGaussian(p : u32,count : u32)->u32 {var lo=0u;var hi=count;loop {if (lo+1u>=hi) {break;}\nlet mid=(lo+hi)>>1u;if (cdf[mid]<=p) {lo=mid;} else {hi=mid;}}\nreturn lo;}\n@compute @workgroup_size(256,1,1)\nfn main(@builtin(global_invocation_id) gid : vec3u) {let k=gid.x;if (k>GPS_PARTITION_BUCKETS) {return;}\nlet total=pointCount[0];let count=arrayLength(&cdf);if (total==0u || count==0u) {partTable[k]=0u;return;}\nvar pk=u32(f32(k)/f32(GPS_PARTITION_BUCKETS)*f32(total));if (pk>total-1u) {pk=total-1u;}\npartTable[k]=gpsFindGaussian(pk,count);}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\nconst includes = [gaussianPointSplattingWGSL];\nfor (const inc of includes) {\n if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {\n ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;\n }\n}\n\n/** @internal */\nexport const gpsPartitionComputeShaderWGSL = { name, shader };\n"]}
@@ -0,0 +1,5 @@
1
+ /** @internal */
2
+ export declare const gpsPreprocessComputeShaderWGSL: {
3
+ name: string;
4
+ shader: string;
5
+ };
@@ -0,0 +1,86 @@
1
+ // Do not edit.
2
+ import { ShaderStore } from "../Engines/shaderStore.js";
3
+ import { gaussianPointSplattingWGSL } from "./ShadersInclude/gaussianPointSplatting.js";
4
+ import { gaussianSplattingSharedWGSL } from "./ShadersInclude/gaussianSplattingShared.js";
5
+ const name = "gpsPreprocessComputeShader";
6
+ const shader = `#include<gaussianPointSplatting>
7
+ #include<gaussianSplattingShared>
8
+ @group(0) @binding(0) var<storage,read> means : array<vec4f>;@group(0) @binding(1) var<storage,read> colorOpacity : array<u32>;@group(0) @binding(2) var<storage,read_write> weights : array<u32>;@group(0) @binding(3) var<storage,read_write> gsData : array<GpsScreen>;@group(0) @binding(4) var<uniform> uniforms : GpsUniforms;@group(0) @binding(5) var<storage,read> cov3d : array<u32>;
9
+ @group(0) @binding(6) var<storage,read> sh : array<u32>;
10
+ @group(0) @binding(7) var<storage,read> parts : array<GpsPart>;
11
+ @group(0) @binding(8) var<storage,read> hiZ : array<f32>;
12
+ fn gpsHiZLevelOffset(l : u32,baseW : u32,baseH : u32)->u32 {var off=0u;for (var i=0u; i<l; i=i+1u) {off+=max(1u,baseW>>i)*max(1u,baseH>>i);}
13
+ return off;}
14
+ fn gpsHiZOccluded(center : vec2f,footR : f32,viewDepth : f32)->bool {let baseW=u32(uniforms.hiZInfo.x);let baseH=u32(uniforms.hiZInfo.y);let numLevels=u32(uniforms.hiZInfo.z);let minx=i32(floor(center.x-footR));let maxx=i32(ceil(center.x+footR));let miny=i32(floor(center.y-footR));let maxy=i32(ceil(center.y+footR));let d=f32(max(maxx-minx,maxy-miny)+1);var lod=i32(ceil(log2(max(d,1.0)*0.5)));lod=clamp(lod,0,i32(numLevels)-1);let L=u32(lod);let lw=max(1u,baseW>>L);let lh=max(1u,baseH>>L);let tile=1u<<L;let off=gpsHiZLevelOffset(L,baseW,baseH);let tx0=min(u32(max(minx,0))/tile,lw-1u);let tx1=min(u32(max(maxx,0))/tile,lw-1u);let ty0=min(u32(max(miny,0))/tile,lh-1u);let ty1=min(u32(max(maxy,0))/tile,lh-1u);var zMax=0.0;for (var ty=ty0; ty<=ty1; ty=ty+1u) {let row=off+ty*lw;for (var tx=tx0; tx<=tx1; tx=tx+1u) {zMax=max(zMax,hiZ[row+tx]);}}
15
+ return zMax<viewDepth;}
16
+ #if SH_DEGREE>0
17
+ #if SH_DEGREE==1
18
+ const GPS_SH_WORDS : u32=3u;
19
+ #elif SH_DEGREE==2
20
+ const GPS_SH_WORDS : u32=6u;
21
+ #elif SH_DEGREE==3
22
+ const GPS_SH_WORDS : u32=12u;
23
+ #else
24
+ const GPS_SH_WORDS : u32=18u;
25
+ #endif
26
+ fn gpsShByte(baseWord : u32,s : u32)->f32 {let w=sh[baseWord+(s>>2u)];let b=(w>>(8u*(s & 3u))) & 0xFFu;return f32(b)*(2.0/255.0)-1.0;}
27
+ fn gpsShCoeff(baseWord : u32,j : u32)->vec3f {let s=j*3u;return vec3f(gpsShByte(baseWord,s),gpsShByte(baseWord,s+1u),gpsShByte(baseWord,s+2u));}
28
+ #if SH_DEGREE==1
29
+ const GPS_SH_DIM : u32=3u;
30
+ #elif SH_DEGREE==2
31
+ const GPS_SH_DIM : u32=8u;
32
+ #elif SH_DEGREE==3
33
+ const GPS_SH_DIM : u32=15u;
34
+ #else
35
+ const GPS_SH_DIM : u32=24u;
36
+ #endif
37
+ fn gpsEvalShDelta(g : u32,dir : vec3f,so1 : f32,so2 : f32,so3 : f32,so4 : f32)->vec3f {let base=g*GPS_SH_WORDS;var coeffs : array<vec3<f32>,25>;for (var j=0u; j<GPS_SH_DIM; j=j+1u) {coeffs[1u+j]=gpsShCoeff(base,j);}
38
+ return computeColorFromSHDegree(dir,coeffs,so1,so2,so3,so4);}
39
+ #endif
40
+ @compute @workgroup_size(256,1,1)
41
+ fn main(@builtin(global_invocation_id) gid : vec3u) {let g=gid.y*65535u*256u+gid.x;let count=u32(uniforms.params0.x);if (g>=count) {return;}
42
+ weights[g]=0u;let mean=means[g].xyz;let partIndex=u32(means[g].w);let pdata=parts[partIndex];let partWorld=pdata.world;let near=uniforms.resNearFar.z;let far=uniforms.resNearFar.w;let worldPos=(partWorld*vec4f(mean,1.0)).xyz;let camspace=uniforms.view*vec4f(worldPos,1.0);let clip=uniforms.viewProjection*vec4f(worldPos,1.0);if (clip.w<=0.0) {return;}
43
+ let viewDepth=select(camspace.z,-camspace.z,uniforms.focal.z>0.5);let projectedDepth=(u32(uniforms.misc.w) & 2u) != 0u;if (!projectedDepth && (viewDepth<=near || (far>0.0 && viewDepth>=far))) {return;}
44
+ let ndc=clip.xyz/clip.w;if (ndc.x<-1.3 || ndc.x>1.3 || ndc.y<-1.3 || ndc.y>1.3) {return;}
45
+ let px=(ndc.x*0.5+0.5)*uniforms.pixelMap.x+uniforms.pixelMap.z;let py=(ndc.y*0.5+0.5)*uniforms.pixelMap.y+uniforms.pixelMap.w;let covFactor=bitcast<f32>(cov3d[4u*g+3u]);let p0=unpack2x16float(cov3d[4u*g+0u])*covFactor;
46
+ let p1=unpack2x16float(cov3d[4u*g+1u])*covFactor;
47
+ let p2=unpack2x16float(cov3d[4u*g+2u])*covFactor;
48
+ let covA=vec3f(p0.x,p0.y,p1.x);
49
+ let covB=vec3f(p1.y,p2.x,p2.y);
50
+ let isOrtho=uniforms.focal.w>0.5;let modelView=uniforms.view*partWorld;var cov2d : mat3x3f;if ((u32(uniforms.misc.w) & 1u) != 0u) {cov2d=gpsCov2D(covA,covB,modelView,uniforms.projection,clip,uniforms.pixelMap.xy);} else {cov2d=computeCov2D(covA,covB,modelView,camspace.xyz,uniforms.focal.xy,isOrtho);}
51
+ cov2d=cov2d*0.25;let detOrig=cov2d[0][0]*cov2d[1][1]-cov2d[0][1]*cov2d[0][1];let kernelSize=uniforms.params0.y;cov2d[0][0]+=kernelSize;cov2d[1][1]+=kernelSize;let a=cov2d[0][0];let b=cov2d[0][1];let cc=cov2d[1][1];let det=a*cc-b*b;if (det<=0.0) {return;}
52
+ let lambda1=(a+cc)*0.5+length(vec2f((a-cc)*0.5,b));let minPixelSize=uniforms.misc.y;if (minPixelSize>0.0 && 4.0*uniforms.misc.x*sqrt(2.0*lambda1)<minPixelSize) {return;}
53
+ if (uniforms.hiZInfo.w>0.5) {let footR=3.0*sqrt(max(lambda1,0.0));
54
+ var nearestDepth=viewDepth;if (projectedDepth) {let low=((vec2f(px,py)-footR-uniforms.pixelMap.zw)/uniforms.pixelMap.xy)*2.0-1.0;let high=((vec2f(px,py)+footR-uniforms.pixelMap.zw)/uniforms.pixelMap.xy)*2.0-1.0;var depths=vec4f(
55
+ gpsProjectedDepth(uniforms.inverseProjection,low,camspace.z).x,
56
+ gpsProjectedDepth(uniforms.inverseProjection,high,camspace.z).x,
57
+ gpsProjectedDepth(uniforms.inverseProjection,vec2f(low.x,high.y),camspace.z).x,
58
+ gpsProjectedDepth(uniforms.inverseProjection,vec2f(high.x,low.y),camspace.z).x);if ((u32(uniforms.misc.w) & 4u) != 0u) {depths=vec4f(1.0)-depths;}
59
+ nearestDepth=min(min(depths.x,depths.y),min(depths.z,depths.w));}
60
+ if (gpsHiZOccluded(vec2f(px,py),footR,nearestDepth)) {return;}}
61
+ let compensation=select(1.0,sqrt(max(0.0,detOrig/det)),uniforms.depthNorm.w>0.5);let invDet=1.0/det;let conic=vec3f(cc*invDet,-b*invDet,a*invDet);let chol0=sqrt(a);let chol1=b/chol0;let chol2=sqrt(max(0.0,cc-chol1*chol1));let rgba=colorOpacity[g];let baseColor=vec3f(f32(rgba & 0xFFu),f32((rgba>>8u) & 0xFFu),f32((rgba>>16u) & 0xFFu))/255.0;let baseOpacity=f32((rgba>>24u) & 0xFFu)/255.0;if (baseOpacity==0.0) {return;}
62
+ if (uniforms.depthNorm.z>0.5) {let clipMin=pdata.dbg0.xyz;let clipMax=vec3f(pdata.dbg0.w,pdata.dbg1.x,pdata.dbg1.y);if (any(worldPos<clipMin) || any(worldPos>clipMax)) {return;}
63
+ if (baseOpacity<pdata.dbg1.z || baseOpacity>pdata.dbg1.w) {return;}
64
+ let det3d=p0.x*(p1.y*p2.y-p2.x*p2.x)-p0.y*(p0.y*p2.y-p2.x*p1.x)+p1.x*(p0.y*p2.x-p1.y*p1.x);let splatSize=pow(abs(det3d),1.0/6.0);if (splatSize<pdata.dbg2.x || splatSize>pdata.dbg2.y) {return;}}
65
+ var color=baseColor*pdata.dbg3.x;var opacity=clamp(baseOpacity*pdata.vis.x*pdata.dbg2.z*compensation,0.0,1.0);let saturate=pdata.dbg2.w>0.5;
66
+ #if SH_DEGREE>0
67
+ {let worldRot=mat3x3f(partWorld[0].xyz,partWorld[1].xyz,partWorld[2].xyz);let dir=normalize(gpsInverseMat3(worldRot)*(worldPos-uniforms.camPosDeg.xyz));color+=gpsEvalShDelta(g,dir,pdata.dbg3.y,pdata.dbg3.z,pdata.dbg3.w,pdata.dbg4.x);}
68
+ #endif
69
+ let lambdaMax=gpsPointIntensity(opacity);var importance : f32;if (saturate) {importance=4.0*GPS_TWO_PI*sqrt(det)*lambdaMax*uniforms.params0.z;} else {importance=GPS_TWO_PI*sqrt(det)*gpsDilog(opacity)*uniforms.params0.z;}
70
+ let res=uniforms.resNearFar.xy;let halfExtent=sqrt(8.0*vec2f(a,cc));let rectMin=clamp(floor(vec2f(px,py)-halfExtent),vec2f(0.0),res);let rectMax=clamp(ceil(vec2f(px,py)+halfExtent),vec2f(0.0),res);let rectSize=rectMax-rectMin;let rectImportance=lambdaMax*rectSize.x*rectSize.y*uniforms.params0.z;let useRect=rectImportance<importance;let chosen=select(importance,rectImportance,useRect);if (chosen<1e-4) {return;}
71
+ let seed=gpsHash2(g,u32(uniforms.params0.w));let numPoints=gpsPoisson(gpsPcg(seed),chosen);if (numPoints==0u) {return;}
72
+ var s : GpsScreen;s.pmConicXY=vec4f(px,py,conic.x,conic.y);s.conicZChol=vec4f(conic.z,chol0,chol1,chol2);s.colorOp=vec4f(color,opacity);let dmin=uniforms.depthNorm.x;let dmax=uniforms.depthNorm.y;let dord=clamp((viewDepth-dmin)/max(dmax-dmin,1e-6),0.0,1.0);let flags=select(0u,GPS_FLAG_SATURATE,saturate) | select(0u,GPS_FLAG_SCREEN_RECT,useRect);let rmin=vec2u(rectMin);let rmax=vec2u(rectMax);let depthKey=select(u32(dord*f32(GPS_DEPTH_MAX_CODE)),bitcast<u32>(camspace.z),projectedDepth);s.depth=vec4u(depthKey,flags,rmin.x | (rmin.y<<16u),rmax.x | (rmax.y<<16u));gsData[g]=s;weights[g]=numPoints;}
73
+ `;
74
+ // Sideeffect
75
+ if (!ShaderStore.ShadersStoreWGSL[name]) {
76
+ ShaderStore.ShadersStoreWGSL[name] = shader;
77
+ }
78
+ const includes = [gaussianPointSplattingWGSL, gaussianSplattingSharedWGSL];
79
+ for (const inc of includes) {
80
+ if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {
81
+ ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;
82
+ }
83
+ }
84
+ /** @internal */
85
+ export const gpsPreprocessComputeShaderWGSL = { name, shader };
86
+ //# sourceMappingURL=gpsPreprocess.compute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gpsPreprocess.compute.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/gpsPreprocess.compute.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AACrF,OAAO,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AAEvF,MAAM,IAAI,GAAG,4BAA4B,CAAC;AAC1C,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmEd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IACtC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,CAAC;AACD,MAAM,QAAQ,GAAG,CAAC,0BAA0B,EAAE,2BAA2B,CAAC,CAAC;AAC3E,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;IACzB,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAClD,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC;IAChE,CAAC;AACL,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,8BAA8B,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport { gaussianPointSplattingWGSL } from \"./ShadersInclude/gaussianPointSplatting\";\nimport { gaussianSplattingSharedWGSL } from \"./ShadersInclude/gaussianSplattingShared\";\n\nconst name = \"gpsPreprocessComputeShader\";\nconst shader = `#include<gaussianPointSplatting>\n#include<gaussianSplattingShared>\n@group(0) @binding(0) var<storage,read> means : array<vec4f>;@group(0) @binding(1) var<storage,read> colorOpacity : array<u32>;@group(0) @binding(2) var<storage,read_write> weights : array<u32>;@group(0) @binding(3) var<storage,read_write> gsData : array<GpsScreen>;@group(0) @binding(4) var<uniform> uniforms : GpsUniforms;@group(0) @binding(5) var<storage,read> cov3d : array<u32>; \n@group(0) @binding(6) var<storage,read> sh : array<u32>; \n@group(0) @binding(7) var<storage,read> parts : array<GpsPart>; \n@group(0) @binding(8) var<storage,read> hiZ : array<f32>; \nfn gpsHiZLevelOffset(l : u32,baseW : u32,baseH : u32)->u32 {var off=0u;for (var i=0u; i<l; i=i+1u) {off+=max(1u,baseW>>i)*max(1u,baseH>>i);}\nreturn off;}\nfn gpsHiZOccluded(center : vec2f,footR : f32,viewDepth : f32)->bool {let baseW=u32(uniforms.hiZInfo.x);let baseH=u32(uniforms.hiZInfo.y);let numLevels=u32(uniforms.hiZInfo.z);let minx=i32(floor(center.x-footR));let maxx=i32(ceil(center.x+footR));let miny=i32(floor(center.y-footR));let maxy=i32(ceil(center.y+footR));let d=f32(max(maxx-minx,maxy-miny)+1);var lod=i32(ceil(log2(max(d,1.0)*0.5)));lod=clamp(lod,0,i32(numLevels)-1);let L=u32(lod);let lw=max(1u,baseW>>L);let lh=max(1u,baseH>>L);let tile=1u<<L;let off=gpsHiZLevelOffset(L,baseW,baseH);let tx0=min(u32(max(minx,0))/tile,lw-1u);let tx1=min(u32(max(maxx,0))/tile,lw-1u);let ty0=min(u32(max(miny,0))/tile,lh-1u);let ty1=min(u32(max(maxy,0))/tile,lh-1u);var zMax=0.0;for (var ty=ty0; ty<=ty1; ty=ty+1u) {let row=off+ty*lw;for (var tx=tx0; tx<=tx1; tx=tx+1u) {zMax=max(zMax,hiZ[row+tx]);}}\nreturn zMax<viewDepth;}\n#if SH_DEGREE>0\n#if SH_DEGREE==1\nconst GPS_SH_WORDS : u32=3u; \n#elif SH_DEGREE==2\nconst GPS_SH_WORDS : u32=6u; \n#elif SH_DEGREE==3\nconst GPS_SH_WORDS : u32=12u; \n#else\nconst GPS_SH_WORDS : u32=18u; \n#endif\nfn gpsShByte(baseWord : u32,s : u32)->f32 {let w=sh[baseWord+(s>>2u)];let b=(w>>(8u*(s & 3u))) & 0xFFu;return f32(b)*(2.0/255.0)-1.0;}\nfn gpsShCoeff(baseWord : u32,j : u32)->vec3f {let s=j*3u;return vec3f(gpsShByte(baseWord,s),gpsShByte(baseWord,s+1u),gpsShByte(baseWord,s+2u));}\n#if SH_DEGREE==1\nconst GPS_SH_DIM : u32=3u;\n#elif SH_DEGREE==2\nconst GPS_SH_DIM : u32=8u;\n#elif SH_DEGREE==3\nconst GPS_SH_DIM : u32=15u;\n#else\nconst GPS_SH_DIM : u32=24u;\n#endif\nfn gpsEvalShDelta(g : u32,dir : vec3f,so1 : f32,so2 : f32,so3 : f32,so4 : f32)->vec3f {let base=g*GPS_SH_WORDS;var coeffs : array<vec3<f32>,25>;for (var j=0u; j<GPS_SH_DIM; j=j+1u) {coeffs[1u+j]=gpsShCoeff(base,j);}\nreturn computeColorFromSHDegree(dir,coeffs,so1,so2,so3,so4);}\n#endif\n@compute @workgroup_size(256,1,1)\nfn main(@builtin(global_invocation_id) gid : vec3u) {let g=gid.y*65535u*256u+gid.x;let count=u32(uniforms.params0.x);if (g>=count) {return;}\nweights[g]=0u;let mean=means[g].xyz;let partIndex=u32(means[g].w);let pdata=parts[partIndex];let partWorld=pdata.world;let near=uniforms.resNearFar.z;let far=uniforms.resNearFar.w;let worldPos=(partWorld*vec4f(mean,1.0)).xyz;let camspace=uniforms.view*vec4f(worldPos,1.0);let clip=uniforms.viewProjection*vec4f(worldPos,1.0);if (clip.w<=0.0) {return;}\nlet viewDepth=select(camspace.z,-camspace.z,uniforms.focal.z>0.5);let projectedDepth=(u32(uniforms.misc.w) & 2u) != 0u;if (!projectedDepth && (viewDepth<=near || (far>0.0 && viewDepth>=far))) {return;}\nlet ndc=clip.xyz/clip.w;if (ndc.x<-1.3 || ndc.x>1.3 || ndc.y<-1.3 || ndc.y>1.3) {return;}\nlet px=(ndc.x*0.5+0.5)*uniforms.pixelMap.x+uniforms.pixelMap.z;let py=(ndc.y*0.5+0.5)*uniforms.pixelMap.y+uniforms.pixelMap.w;let covFactor=bitcast<f32>(cov3d[4u*g+3u]);let p0=unpack2x16float(cov3d[4u*g+0u])*covFactor; \nlet p1=unpack2x16float(cov3d[4u*g+1u])*covFactor; \nlet p2=unpack2x16float(cov3d[4u*g+2u])*covFactor; \nlet covA=vec3f(p0.x,p0.y,p1.x); \nlet covB=vec3f(p1.y,p2.x,p2.y); \nlet isOrtho=uniforms.focal.w>0.5;let modelView=uniforms.view*partWorld;var cov2d : mat3x3f;if ((u32(uniforms.misc.w) & 1u) != 0u) {cov2d=gpsCov2D(covA,covB,modelView,uniforms.projection,clip,uniforms.pixelMap.xy);} else {cov2d=computeCov2D(covA,covB,modelView,camspace.xyz,uniforms.focal.xy,isOrtho);}\ncov2d=cov2d*0.25;let detOrig=cov2d[0][0]*cov2d[1][1]-cov2d[0][1]*cov2d[0][1];let kernelSize=uniforms.params0.y;cov2d[0][0]+=kernelSize;cov2d[1][1]+=kernelSize;let a=cov2d[0][0];let b=cov2d[0][1];let cc=cov2d[1][1];let det=a*cc-b*b;if (det<=0.0) {return;}\nlet lambda1=(a+cc)*0.5+length(vec2f((a-cc)*0.5,b));let minPixelSize=uniforms.misc.y;if (minPixelSize>0.0 && 4.0*uniforms.misc.x*sqrt(2.0*lambda1)<minPixelSize) {return;}\nif (uniforms.hiZInfo.w>0.5) {let footR=3.0*sqrt(max(lambda1,0.0)); \nvar nearestDepth=viewDepth;if (projectedDepth) {let low=((vec2f(px,py)-footR-uniforms.pixelMap.zw)/uniforms.pixelMap.xy)*2.0-1.0;let high=((vec2f(px,py)+footR-uniforms.pixelMap.zw)/uniforms.pixelMap.xy)*2.0-1.0;var depths=vec4f(\ngpsProjectedDepth(uniforms.inverseProjection,low,camspace.z).x,\ngpsProjectedDepth(uniforms.inverseProjection,high,camspace.z).x,\ngpsProjectedDepth(uniforms.inverseProjection,vec2f(low.x,high.y),camspace.z).x,\ngpsProjectedDepth(uniforms.inverseProjection,vec2f(high.x,low.y),camspace.z).x);if ((u32(uniforms.misc.w) & 4u) != 0u) {depths=vec4f(1.0)-depths;}\nnearestDepth=min(min(depths.x,depths.y),min(depths.z,depths.w));}\nif (gpsHiZOccluded(vec2f(px,py),footR,nearestDepth)) {return;}}\nlet compensation=select(1.0,sqrt(max(0.0,detOrig/det)),uniforms.depthNorm.w>0.5);let invDet=1.0/det;let conic=vec3f(cc*invDet,-b*invDet,a*invDet);let chol0=sqrt(a);let chol1=b/chol0;let chol2=sqrt(max(0.0,cc-chol1*chol1));let rgba=colorOpacity[g];let baseColor=vec3f(f32(rgba & 0xFFu),f32((rgba>>8u) & 0xFFu),f32((rgba>>16u) & 0xFFu))/255.0;let baseOpacity=f32((rgba>>24u) & 0xFFu)/255.0;if (baseOpacity==0.0) {return;}\nif (uniforms.depthNorm.z>0.5) {let clipMin=pdata.dbg0.xyz;let clipMax=vec3f(pdata.dbg0.w,pdata.dbg1.x,pdata.dbg1.y);if (any(worldPos<clipMin) || any(worldPos>clipMax)) {return;}\nif (baseOpacity<pdata.dbg1.z || baseOpacity>pdata.dbg1.w) {return;}\nlet det3d=p0.x*(p1.y*p2.y-p2.x*p2.x)-p0.y*(p0.y*p2.y-p2.x*p1.x)+p1.x*(p0.y*p2.x-p1.y*p1.x);let splatSize=pow(abs(det3d),1.0/6.0);if (splatSize<pdata.dbg2.x || splatSize>pdata.dbg2.y) {return;}}\nvar color=baseColor*pdata.dbg3.x;var opacity=clamp(baseOpacity*pdata.vis.x*pdata.dbg2.z*compensation,0.0,1.0);let saturate=pdata.dbg2.w>0.5;\n#if SH_DEGREE>0\n{let worldRot=mat3x3f(partWorld[0].xyz,partWorld[1].xyz,partWorld[2].xyz);let dir=normalize(gpsInverseMat3(worldRot)*(worldPos-uniforms.camPosDeg.xyz));color+=gpsEvalShDelta(g,dir,pdata.dbg3.y,pdata.dbg3.z,pdata.dbg3.w,pdata.dbg4.x);}\n#endif\nlet lambdaMax=gpsPointIntensity(opacity);var importance : f32;if (saturate) {importance=4.0*GPS_TWO_PI*sqrt(det)*lambdaMax*uniforms.params0.z;} else {importance=GPS_TWO_PI*sqrt(det)*gpsDilog(opacity)*uniforms.params0.z;}\nlet res=uniforms.resNearFar.xy;let halfExtent=sqrt(8.0*vec2f(a,cc));let rectMin=clamp(floor(vec2f(px,py)-halfExtent),vec2f(0.0),res);let rectMax=clamp(ceil(vec2f(px,py)+halfExtent),vec2f(0.0),res);let rectSize=rectMax-rectMin;let rectImportance=lambdaMax*rectSize.x*rectSize.y*uniforms.params0.z;let useRect=rectImportance<importance;let chosen=select(importance,rectImportance,useRect);if (chosen<1e-4) {return;}\nlet seed=gpsHash2(g,u32(uniforms.params0.w));let numPoints=gpsPoisson(gpsPcg(seed),chosen);if (numPoints==0u) {return;}\nvar s : GpsScreen;s.pmConicXY=vec4f(px,py,conic.x,conic.y);s.conicZChol=vec4f(conic.z,chol0,chol1,chol2);s.colorOp=vec4f(color,opacity);let dmin=uniforms.depthNorm.x;let dmax=uniforms.depthNorm.y;let dord=clamp((viewDepth-dmin)/max(dmax-dmin,1e-6),0.0,1.0);let flags=select(0u,GPS_FLAG_SATURATE,saturate) | select(0u,GPS_FLAG_SCREEN_RECT,useRect);let rmin=vec2u(rectMin);let rmax=vec2u(rectMax);let depthKey=select(u32(dord*f32(GPS_DEPTH_MAX_CODE)),bitcast<u32>(camspace.z),projectedDepth);s.depth=vec4u(depthKey,flags,rmin.x | (rmin.y<<16u),rmax.x | (rmax.y<<16u));gsData[g]=s;weights[g]=numPoints;}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\nconst includes = [gaussianPointSplattingWGSL, gaussianSplattingSharedWGSL];\nfor (const inc of includes) {\n if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {\n ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;\n }\n}\n\n/** @internal */\nexport const gpsPreprocessComputeShaderWGSL = { name, shader };\n"]}
@@ -0,0 +1,5 @@
1
+ /** @internal */
2
+ export declare const gpsResolveComputeShaderWGSL: {
3
+ name: string;
4
+ shader: string;
5
+ };
@@ -0,0 +1,41 @@
1
+ // Do not edit.
2
+ import { ShaderStore } from "../Engines/shaderStore.js";
3
+ import { gaussianPointSplattingWGSL } from "./ShadersInclude/gaussianPointSplatting.js";
4
+ const name = "gpsResolveComputeShader";
5
+ const shader = `#include<gaussianPointSplatting>
6
+ struct GpsResolveParams {resolution : vec2f,
7
+ outResolution : vec2f,
8
+ depthNorm : vec2f,
9
+ colorMask : vec2f,
10
+ upsample : vec4f,
11
+ misc2 : vec4f,
12
+ projZ : vec4f,
13
+ inverseProjection : mat4x4f,
14
+ occlusion : vec4f, };@group(0) @binding(0) var<storage,read_write> accumBuffer : array<vec4f>;@group(0) @binding(1) var<uniform> params : GpsResolveParams;@group(0) @binding(2) var<storage,read_write> imageBuffer : array<atomic<u32>>;@group(0) @binding(3) var<storage,read_write> accumDepth : array<f32>;@group(0) @binding(4) var<storage,read_write> hiZ : array<f32>;
15
+ @group(0) @binding(5) var<storage,read_write> accumCount : array<u32>;
16
+ const GPS_HIZ_FAR : f32=1e30;
17
+ @compute @workgroup_size(8,8,1)
18
+ fn main(@builtin(global_invocation_id) gid : vec3u) {let res=vec2u(params.resolution);
19
+ if (gid.x>=res.x || gid.y>=res.y) {return;}
20
+ let idx=gid.y*res.x+gid.x;
21
+ let raw=atomicLoad(&imageBuffer[idx]);var hitColor=vec3f(0.0,0.0,0.0);var hit=0.0;var depth=1.0;var occlVz=GPS_HIZ_FAR;var viewZ=0.0;if (raw != GPS_DEPTH_CLEAR) {hitColor=gpsKeyColor(raw,u32(params.colorMask.x))*params.colorMask.y;hit=1.0;let dq=f32(raw>>16u)/f32(GPS_DEPTH_MAX_CODE);let vz=params.depthNorm.x+dq*(params.depthNorm.y-params.depthNorm.x);occlVz=vz+(params.depthNorm.y-params.depthNorm.x)/f32(GPS_DEPTH_MAX_CODE);depth=(params.projZ.x*vz+params.projZ.z)/(params.projZ.y*vz+params.projZ.w);if (params.misc2.w>0.5) {depth=select(vz,1.0-vz,params.misc2.z>0.5);let outputPixel=vec2f(gid.xy)*params.upsample.x+params.upsample.yz+0.5;let ndcXY=outputPixel/params.outResolution*2.0-1.0;let unprojected=params.inverseProjection*vec4f(ndcXY,depth,1.0);viewZ=unprojected.z/unprojected.w;}}
22
+ if (params.occlusion.x>0.5) {hiZ[idx]=occlVz;}
23
+ atomicStore(&imageBuffer[idx],GPS_DEPTH_CLEAR);let n=u32(params.upsample.x);let outRes=vec2u(params.outResolution);let gen=u32(params.upsample.w);let premult=hitColor*hit;if (params.misc2.y>0.5) {for (var dy=0u; dy<n; dy=dy+1u) {for (var dx=0u; dx<n; dx=dx+1u) {let ox2=gid.x*n+dx;let oy2=gid.y*n+dy;if (ox2<outRes.x && oy2<outRes.y) {let oi=oy2*outRes.x+ox2;var outputDepth=depth;var outputHit=hit;if (params.misc2.w>0.5 && hit>0.5) {let ndcXY=(vec2f(f32(ox2),f32(oy2))+0.5)/params.outResolution*2.0-1.0;let projected=gpsProjectedDepth(params.inverseProjection,ndcXY,viewZ);outputDepth=projected.x;outputHit=select(0.0,hit,projected.x>=0.0 && projected.x<=1.0 && projected.y>0.0);}
24
+ accumBuffer[oi]=vec4f(hitColor*outputHit,outputHit);accumCount[oi]=(gen<<16u) | 1u;accumDepth[oi]=select(1.0,outputDepth,outputHit>0.5);}}}
25
+ return;}
26
+ let ox=select(0u,u32(params.upsample.y),n>1u);let oy=select(0u,u32(params.upsample.z),n>1u);let outX=gid.x*n+ox;let outY=gid.y*n+oy;if (outX>=outRes.x || outY>=outRes.y) {return;}
27
+ let outIdx=outY*outRes.x+outX;let packed=accumCount[outIdx];let count=select(0u,packed & 0xFFFFu,(packed>>16u)==gen);let t=select(1.0/(f32(count)+1.0),1.0,count==0u);let prev=accumBuffer[outIdx];let newRgb=mix(prev.rgb,premult,t);let newCov=mix(prev.w,hit,t);accumBuffer[outIdx]=vec4f(newRgb,newCov);accumCount[outIdx]=(gen<<16u) | min(count+1u,u32(params.misc2.x));if (hit>0.5) {accumDepth[outIdx]=depth;} else if (count==0u) {accumDepth[outIdx]=1.0;}}
28
+ `;
29
+ // Sideeffect
30
+ if (!ShaderStore.ShadersStoreWGSL[name]) {
31
+ ShaderStore.ShadersStoreWGSL[name] = shader;
32
+ }
33
+ const includes = [gaussianPointSplattingWGSL];
34
+ for (const inc of includes) {
35
+ if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {
36
+ ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;
37
+ }
38
+ }
39
+ /** @internal */
40
+ export const gpsResolveComputeShaderWGSL = { name, shader };
41
+ //# sourceMappingURL=gpsResolve.compute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gpsResolve.compute.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/gpsResolve.compute.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAErF,MAAM,IAAI,GAAG,yBAAyB,CAAC;AACvC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;CAuBd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IACtC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,CAAC;AACD,MAAM,QAAQ,GAAG,CAAC,0BAA0B,CAAC,CAAC;AAC9C,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;IACzB,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAClD,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC;IAChE,CAAC;AACL,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,2BAA2B,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport { gaussianPointSplattingWGSL } from \"./ShadersInclude/gaussianPointSplatting\";\n\nconst name = \"gpsResolveComputeShader\";\nconst shader = `#include<gaussianPointSplatting>\nstruct GpsResolveParams {resolution : vec2f, \noutResolution : vec2f,\ndepthNorm : vec2f, \ncolorMask : vec2f, \nupsample : vec4f, \nmisc2 : vec4f, \nprojZ : vec4f, \ninverseProjection : mat4x4f,\nocclusion : vec4f, };@group(0) @binding(0) var<storage,read_write> accumBuffer : array<vec4f>;@group(0) @binding(1) var<uniform> params : GpsResolveParams;@group(0) @binding(2) var<storage,read_write> imageBuffer : array<atomic<u32>>;@group(0) @binding(3) var<storage,read_write> accumDepth : array<f32>;@group(0) @binding(4) var<storage,read_write> hiZ : array<f32>; \n@group(0) @binding(5) var<storage,read_write> accumCount : array<u32>; \nconst GPS_HIZ_FAR : f32=1e30; \n@compute @workgroup_size(8,8,1)\nfn main(@builtin(global_invocation_id) gid : vec3u) {let res=vec2u(params.resolution); \nif (gid.x>=res.x || gid.y>=res.y) {return;}\nlet idx=gid.y*res.x+gid.x; \nlet raw=atomicLoad(&imageBuffer[idx]);var hitColor=vec3f(0.0,0.0,0.0);var hit=0.0;var depth=1.0;var occlVz=GPS_HIZ_FAR;var viewZ=0.0;if (raw != GPS_DEPTH_CLEAR) {hitColor=gpsKeyColor(raw,u32(params.colorMask.x))*params.colorMask.y;hit=1.0;let dq=f32(raw>>16u)/f32(GPS_DEPTH_MAX_CODE);let vz=params.depthNorm.x+dq*(params.depthNorm.y-params.depthNorm.x);occlVz=vz+(params.depthNorm.y-params.depthNorm.x)/f32(GPS_DEPTH_MAX_CODE);depth=(params.projZ.x*vz+params.projZ.z)/(params.projZ.y*vz+params.projZ.w);if (params.misc2.w>0.5) {depth=select(vz,1.0-vz,params.misc2.z>0.5);let outputPixel=vec2f(gid.xy)*params.upsample.x+params.upsample.yz+0.5;let ndcXY=outputPixel/params.outResolution*2.0-1.0;let unprojected=params.inverseProjection*vec4f(ndcXY,depth,1.0);viewZ=unprojected.z/unprojected.w;}}\nif (params.occlusion.x>0.5) {hiZ[idx]=occlVz;}\natomicStore(&imageBuffer[idx],GPS_DEPTH_CLEAR);let n=u32(params.upsample.x);let outRes=vec2u(params.outResolution);let gen=u32(params.upsample.w);let premult=hitColor*hit;if (params.misc2.y>0.5) {for (var dy=0u; dy<n; dy=dy+1u) {for (var dx=0u; dx<n; dx=dx+1u) {let ox2=gid.x*n+dx;let oy2=gid.y*n+dy;if (ox2<outRes.x && oy2<outRes.y) {let oi=oy2*outRes.x+ox2;var outputDepth=depth;var outputHit=hit;if (params.misc2.w>0.5 && hit>0.5) {let ndcXY=(vec2f(f32(ox2),f32(oy2))+0.5)/params.outResolution*2.0-1.0;let projected=gpsProjectedDepth(params.inverseProjection,ndcXY,viewZ);outputDepth=projected.x;outputHit=select(0.0,hit,projected.x>=0.0 && projected.x<=1.0 && projected.y>0.0);}\naccumBuffer[oi]=vec4f(hitColor*outputHit,outputHit);accumCount[oi]=(gen<<16u) | 1u;accumDepth[oi]=select(1.0,outputDepth,outputHit>0.5);}}}\nreturn;}\nlet ox=select(0u,u32(params.upsample.y),n>1u);let oy=select(0u,u32(params.upsample.z),n>1u);let outX=gid.x*n+ox;let outY=gid.y*n+oy;if (outX>=outRes.x || outY>=outRes.y) {return;}\nlet outIdx=outY*outRes.x+outX;let packed=accumCount[outIdx];let count=select(0u,packed & 0xFFFFu,(packed>>16u)==gen);let t=select(1.0/(f32(count)+1.0),1.0,count==0u);let prev=accumBuffer[outIdx];let newRgb=mix(prev.rgb,premult,t);let newCov=mix(prev.w,hit,t);accumBuffer[outIdx]=vec4f(newRgb,newCov);accumCount[outIdx]=(gen<<16u) | min(count+1u,u32(params.misc2.x));if (hit>0.5) {accumDepth[outIdx]=depth;} else if (count==0u) {accumDepth[outIdx]=1.0;}}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\nconst includes = [gaussianPointSplattingWGSL];\nfor (const inc of includes) {\n if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {\n ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;\n }\n}\n\n/** @internal */\nexport const gpsResolveComputeShaderWGSL = { name, shader };\n"]}
@@ -0,0 +1,5 @@
1
+ /** @internal */
2
+ export declare const gpsScanAddComputeShaderWGSL: {
3
+ name: string;
4
+ shader: string;
5
+ };
@@ -0,0 +1,22 @@
1
+ // Do not edit.
2
+ import { ShaderStore } from "../Engines/shaderStore.js";
3
+ import { gaussianPointSplattingScanWGSL } from "./ShadersInclude/gaussianPointSplattingScan.js";
4
+ const name = "gpsScanAddComputeShader";
5
+ const shader = `#include<gaussianPointSplattingScan>
6
+ @group(0) @binding(0) var<storage,read_write> cdf : array<u32>;@group(0) @binding(1) var<storage,read> blockSums : array<u32>;@compute @workgroup_size(256,1,1)
7
+ fn main(@builtin(global_invocation_id) gid : vec3u) {let i=gid.y*65535u*256u+gid.x;if (i>=arrayLength(&cdf)) {return;}
8
+ cdf[i]=gpsSaturatingAdd(cdf[i],blockSums[i/512u]);}
9
+ `;
10
+ // Sideeffect
11
+ if (!ShaderStore.ShadersStoreWGSL[name]) {
12
+ ShaderStore.ShadersStoreWGSL[name] = shader;
13
+ }
14
+ const includes = [gaussianPointSplattingScanWGSL];
15
+ for (const inc of includes) {
16
+ if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {
17
+ ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;
18
+ }
19
+ }
20
+ /** @internal */
21
+ export const gpsScanAddComputeShaderWGSL = { name, shader };
22
+ //# sourceMappingURL=gpsScanAdd.compute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gpsScanAdd.compute.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/gpsScanAdd.compute.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,8BAA8B,EAAE,MAAM,6CAA6C,CAAC;AAE7F,MAAM,IAAI,GAAG,yBAAyB,CAAC;AACvC,MAAM,MAAM,GAAG;;;;CAId,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IACtC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,CAAC;AACD,MAAM,QAAQ,GAAG,CAAC,8BAA8B,CAAC,CAAC;AAClD,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;IACzB,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAClD,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC;IAChE,CAAC;AACL,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,2BAA2B,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport { gaussianPointSplattingScanWGSL } from \"./ShadersInclude/gaussianPointSplattingScan\";\n\nconst name = \"gpsScanAddComputeShader\";\nconst shader = `#include<gaussianPointSplattingScan>\n@group(0) @binding(0) var<storage,read_write> cdf : array<u32>;@group(0) @binding(1) var<storage,read> blockSums : array<u32>;@compute @workgroup_size(256,1,1)\nfn main(@builtin(global_invocation_id) gid : vec3u) {let i=gid.y*65535u*256u+gid.x;if (i>=arrayLength(&cdf)) {return;}\ncdf[i]=gpsSaturatingAdd(cdf[i],blockSums[i/512u]);}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\nconst includes = [gaussianPointSplattingScanWGSL];\nfor (const inc of includes) {\n if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {\n ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;\n }\n}\n\n/** @internal */\nexport const gpsScanAddComputeShaderWGSL = { name, shader };\n"]}
@@ -0,0 +1,5 @@
1
+ /** @internal */
2
+ export declare const gpsScanBlocksComputeShaderWGSL: {
3
+ name: string;
4
+ shader: string;
5
+ };
@@ -0,0 +1,23 @@
1
+ // Do not edit.
2
+ import { ShaderStore } from "../Engines/shaderStore.js";
3
+ import { gaussianPointSplattingScanWGSL } from "./ShadersInclude/gaussianPointSplattingScan.js";
4
+ const name = "gpsScanBlocksComputeShader";
5
+ const shader = `#include<gaussianPointSplattingScan>
6
+ @group(0) @binding(0) var<storage,read> weights : array<u32>;@group(0) @binding(1) var<storage,read_write> cdf : array<u32>;@group(0) @binding(2) var<storage,read_write> blockSums : array<u32>;@compute @workgroup_size(256,1,1)
7
+ fn main(@builtin(local_invocation_id) lid : vec3u,@builtin(workgroup_id) wid : vec3u) {let t=lid.x;let block=wid.y*65535u+wid.x;let base=block*512u;let n=arrayLength(&weights);let i0=base+2u*t;let i1=base+2u*t+1u;gpsScanTemp[2u*t]=select(0u,weights[i0],i0<n);gpsScanTemp[2u*t+1u]=select(0u,weights[i1],i1<n);let total=gpsScanExclusive512(t);if (t==0u) {blockSums[block]=total;}
8
+ if (i0<n) {cdf[i0]=gpsScanTemp[2u*t];}
9
+ if (i1<n) {cdf[i1]=gpsScanTemp[2u*t+1u];}}
10
+ `;
11
+ // Sideeffect
12
+ if (!ShaderStore.ShadersStoreWGSL[name]) {
13
+ ShaderStore.ShadersStoreWGSL[name] = shader;
14
+ }
15
+ const includes = [gaussianPointSplattingScanWGSL];
16
+ for (const inc of includes) {
17
+ if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {
18
+ ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;
19
+ }
20
+ }
21
+ /** @internal */
22
+ export const gpsScanBlocksComputeShaderWGSL = { name, shader };
23
+ //# sourceMappingURL=gpsScanBlocks.compute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gpsScanBlocks.compute.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/gpsScanBlocks.compute.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,8BAA8B,EAAE,MAAM,6CAA6C,CAAC;AAE7F,MAAM,IAAI,GAAG,4BAA4B,CAAC;AAC1C,MAAM,MAAM,GAAG;;;;;CAKd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IACtC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,CAAC;AACD,MAAM,QAAQ,GAAG,CAAC,8BAA8B,CAAC,CAAC;AAClD,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;IACzB,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAClD,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC;IAChE,CAAC;AACL,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,8BAA8B,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport { gaussianPointSplattingScanWGSL } from \"./ShadersInclude/gaussianPointSplattingScan\";\n\nconst name = \"gpsScanBlocksComputeShader\";\nconst shader = `#include<gaussianPointSplattingScan>\n@group(0) @binding(0) var<storage,read> weights : array<u32>;@group(0) @binding(1) var<storage,read_write> cdf : array<u32>;@group(0) @binding(2) var<storage,read_write> blockSums : array<u32>;@compute @workgroup_size(256,1,1)\nfn main(@builtin(local_invocation_id) lid : vec3u,@builtin(workgroup_id) wid : vec3u) {let t=lid.x;let block=wid.y*65535u+wid.x;let base=block*512u;let n=arrayLength(&weights);let i0=base+2u*t;let i1=base+2u*t+1u;gpsScanTemp[2u*t]=select(0u,weights[i0],i0<n);gpsScanTemp[2u*t+1u]=select(0u,weights[i1],i1<n);let total=gpsScanExclusive512(t);if (t==0u) {blockSums[block]=total;}\nif (i0<n) {cdf[i0]=gpsScanTemp[2u*t];}\nif (i1<n) {cdf[i1]=gpsScanTemp[2u*t+1u];}}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\nconst includes = [gaussianPointSplattingScanWGSL];\nfor (const inc of includes) {\n if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {\n ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;\n }\n}\n\n/** @internal */\nexport const gpsScanBlocksComputeShaderWGSL = { name, shader };\n"]}
@@ -0,0 +1,5 @@
1
+ /** @internal */
2
+ export declare const gpsScanSumsComputeShaderWGSL: {
3
+ name: string;
4
+ shader: string;
5
+ };
@@ -0,0 +1,30 @@
1
+ // Do not edit.
2
+ import { ShaderStore } from "../Engines/shaderStore.js";
3
+ import { gaussianPointSplattingScanWGSL } from "./ShadersInclude/gaussianPointSplattingScan.js";
4
+ const name = "gpsScanSumsComputeShader";
5
+ const shader = `#include<gaussianPointSplattingScan>
6
+ @group(0) @binding(0) var<storage,read_write> blockSums : array<u32>;@group(0) @binding(1) var<storage,read_write> pointCount : array<u32>;@group(0) @binding(2) var<storage,read_write> indirectArgs : array<u32>;var<workgroup> wgCarry : u32;var<workgroup> wgChunkTotal : u32;@compute @workgroup_size(256,1,1)
7
+ fn main(@builtin(local_invocation_id) lid : vec3u) {let t=lid.x;let n=arrayLength(&blockSums);if (t==0u) {wgCarry=0u;}
8
+ workgroupBarrier();var chunk=0u;loop {if (chunk>=n) {break;}
9
+ let i0=chunk+2u*t;let i1=chunk+2u*t+1u;gpsScanTemp[2u*t]=select(0u,blockSums[i0],i0<n);gpsScanTemp[2u*t+1u]=select(0u,blockSums[i1],i1<n);let total=gpsScanExclusive512(t);if (t==0u) {wgChunkTotal=total;}
10
+ workgroupBarrier();if (i0<n) {blockSums[i0]=gpsSaturatingAdd(gpsScanTemp[2u*t],wgCarry);}
11
+ if (i1<n) {blockSums[i1]=gpsSaturatingAdd(gpsScanTemp[2u*t+1u],wgCarry);}
12
+ workgroupBarrier();if (t==0u) {wgCarry=gpsSaturatingAdd(wgCarry,wgChunkTotal);}
13
+ workgroupBarrier();chunk=chunk+512u;}
14
+ if (t==0u) {let totalGroups=wgCarry/256u+select(0u,1u,(wgCarry % 256u) != 0u);let gx=min(totalGroups,65535u);let gy=totalGroups/65535u+select(0u,1u,(totalGroups % 65535u) != 0u);pointCount[0]=wgCarry;
15
+ pointCount[1]=totalGroups;
16
+ indirectArgs[0]=gx;indirectArgs[1]=gy;indirectArgs[2]=1u;}}
17
+ `;
18
+ // Sideeffect
19
+ if (!ShaderStore.ShadersStoreWGSL[name]) {
20
+ ShaderStore.ShadersStoreWGSL[name] = shader;
21
+ }
22
+ const includes = [gaussianPointSplattingScanWGSL];
23
+ for (const inc of includes) {
24
+ if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {
25
+ ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;
26
+ }
27
+ }
28
+ /** @internal */
29
+ export const gpsScanSumsComputeShaderWGSL = { name, shader };
30
+ //# sourceMappingURL=gpsScanSums.compute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gpsScanSums.compute.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/gpsScanSums.compute.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,8BAA8B,EAAE,MAAM,6CAA6C,CAAC;AAE7F,MAAM,IAAI,GAAG,0BAA0B,CAAC;AACxC,MAAM,MAAM,GAAG;;;;;;;;;;;;CAYd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IACtC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,CAAC;AACD,MAAM,QAAQ,GAAG,CAAC,8BAA8B,CAAC,CAAC;AAClD,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;IACzB,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAClD,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC;IAChE,CAAC;AACL,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport { gaussianPointSplattingScanWGSL } from \"./ShadersInclude/gaussianPointSplattingScan\";\n\nconst name = \"gpsScanSumsComputeShader\";\nconst shader = `#include<gaussianPointSplattingScan>\n@group(0) @binding(0) var<storage,read_write> blockSums : array<u32>;@group(0) @binding(1) var<storage,read_write> pointCount : array<u32>;@group(0) @binding(2) var<storage,read_write> indirectArgs : array<u32>;var<workgroup> wgCarry : u32;var<workgroup> wgChunkTotal : u32;@compute @workgroup_size(256,1,1)\nfn main(@builtin(local_invocation_id) lid : vec3u) {let t=lid.x;let n=arrayLength(&blockSums);if (t==0u) {wgCarry=0u;}\nworkgroupBarrier();var chunk=0u;loop {if (chunk>=n) {break;}\nlet i0=chunk+2u*t;let i1=chunk+2u*t+1u;gpsScanTemp[2u*t]=select(0u,blockSums[i0],i0<n);gpsScanTemp[2u*t+1u]=select(0u,blockSums[i1],i1<n);let total=gpsScanExclusive512(t);if (t==0u) {wgChunkTotal=total;}\nworkgroupBarrier();if (i0<n) {blockSums[i0]=gpsSaturatingAdd(gpsScanTemp[2u*t],wgCarry);}\nif (i1<n) {blockSums[i1]=gpsSaturatingAdd(gpsScanTemp[2u*t+1u],wgCarry);}\nworkgroupBarrier();if (t==0u) {wgCarry=gpsSaturatingAdd(wgCarry,wgChunkTotal);}\nworkgroupBarrier();chunk=chunk+512u;}\nif (t==0u) {let totalGroups=wgCarry/256u+select(0u,1u,(wgCarry % 256u) != 0u);let gx=min(totalGroups,65535u);let gy=totalGroups/65535u+select(0u,1u,(totalGroups % 65535u) != 0u);pointCount[0]=wgCarry; \npointCount[1]=totalGroups; \nindirectArgs[0]=gx;indirectArgs[1]=gy;indirectArgs[2]=1u;}}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\nconst includes = [gaussianPointSplattingScanWGSL];\nfor (const inc of includes) {\n if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {\n ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;\n }\n}\n\n/** @internal */\nexport const gpsScanSumsComputeShaderWGSL = { name, shader };\n"]}
@@ -0,0 +1,5 @@
1
+ /** @internal */
2
+ export declare const gpsSplatComputeShaderWGSL: {
3
+ name: string;
4
+ shader: string;
5
+ };
@@ -0,0 +1,37 @@
1
+ // Do not edit.
2
+ import { ShaderStore } from "../Engines/shaderStore.js";
3
+ import { gaussianPointSplattingWGSL } from "./ShadersInclude/gaussianPointSplatting.js";
4
+ const name = "gpsSplatComputeShader";
5
+ const shader = `#include<gaussianPointSplatting>
6
+ @group(0) @binding(0) var<storage,read> cdf : array<u32>;@group(0) @binding(1) var<storage,read> gsData : array<GpsScreen>;@group(0) @binding(2) var<storage,read_write> imageBuffer : array<atomic<u32>>;@group(0) @binding(3) var<uniform> uniforms : GpsUniforms;@group(0) @binding(4) var<storage,read> pointCount : array<u32>;@group(0) @binding(5) var<storage,read> partTable : array<u32>;
7
+ fn gpsFindGaussian(p : u32,loInit : u32,hiInit : u32)->u32 {var lo=loInit;var hi=hiInit;loop {if (lo+1u>=hi) {break;}
8
+ let mid=(lo+hi)>>1u;if (cdf[mid]<=p) {lo=mid;} else {hi=mid;}}
9
+ return lo;}
10
+ @compute @workgroup_size(256,1,1)
11
+ fn main(@builtin(global_invocation_id) gid : vec3u) {let p=gid.y*65535u*256u+gid.x;let total=pointCount[0];if (p>=total) {return;}
12
+ let count=u32(uniforms.params0.x);let bucket=min(u32(max(f32(p)/f32(total)*f32(GPS_PARTITION_BUCKETS),0.0)),GPS_PARTITION_BUCKETS-1u);let loB=select(bucket-1u,0u,bucket==0u);let hiB=min(bucket+2u,GPS_PARTITION_BUCKETS);let g=gpsFindGaussian(p,partTable[loB],min(partTable[hiB]+1u,count));let s=gsData[g];let pixelMean=gpsGetPixelMean(s);let conic=gpsGetConic(s);let chol=gpsGetChol(s);let opacity=s.colorOp.w;let saturate=(s.depth.y & GPS_FLAG_SATURATE) != 0u;var st=gpsHash2(p,u32(uniforms.params0.w));st=gpsPcg(st);let u1=gpsUnit(st);st=gpsPcg(st);let u2=gpsUnit(st);var offset : vec2f;if ((s.depth.y & GPS_FLAG_SCREEN_RECT) != 0u) {let rectMin=vec2f(f32(s.depth.z & 0xFFFFu),f32(s.depth.z>>16u));let rectMax=vec2f(f32(s.depth.w & 0xFFFFu),f32(s.depth.w>>16u));offset=mix(rectMin,rectMax,vec2f(u1,u2))-pixelMean;} else {var z : vec2f;if (saturate) {let r=sqrt(u1)*2.8284271;
13
+ let ang=GPS_TWO_PI*u2;z=vec2f(r*cos(ang),r*sin(ang));} else {z=gpsCorrectedBoxMuller(u1,u2,opacity);}
14
+ offset=vec2f(chol.x*z.x,chol.y*z.x+chol.z*z.y);}
15
+ let mahalanobis2=conic.x*offset.x*offset.x+2.0*conic.y*offset.x*offset.y+conic.z*offset.y*offset.y;if (mahalanobis2>8.0) {return;}
16
+ let pixel=floor(pixelMean+offset);let x=i32(pixel.x);let y=i32(pixel.y);let res=vec2i(vec2u(uniforms.resNearFar.xy));if (x<0 || y<0 || x>=res.x || y>=res.y) {return;}
17
+ let alpha=select(opacity*exp(-0.5*mahalanobis2),opacity,saturate);if (alpha<0.00392) {
18
+ return;}
19
+ if ((s.depth.y & GPS_FLAG_SCREEN_RECT) != 0u) {st=gpsPcg(st);if (gpsUnit(st)*gpsPointIntensity(opacity)>=gpsPointIntensity(alpha)) {return;}}
20
+ st=gpsPcg(st);let dr=gpsUnit(st)-0.5;st=gpsPcg(st);let dg=gpsUnit(st)-0.5;st=gpsPcg(st);let db=gpsUnit(st)-0.5;let dithered=s.colorOp.rgb/uniforms.projectedDepth.z+vec3f(dr/31.0,dg/63.0,db/31.0);var depthKey=s.depth.x;if ((u32(uniforms.misc.w) & 2u) != 0u) {let ndcXY=((pixel+0.5-uniforms.pixelMap.zw)/uniforms.pixelMap.xy)*2.0-1.0;let projected=gpsProjectedDepth(uniforms.inverseProjection,ndcXY,bitcast<f32>(s.depth.x));if (!(projected.x>=0.0 && projected.x<=1.0 && projected.y>0.0)) {return;}
21
+ let ordered=select(projected.x,1.0-projected.x,(u32(uniforms.misc.w) & 4u) != 0u);let normalized=clamp((ordered-uniforms.projectedDepth.x)/max(uniforms.projectedDepth.y-uniforms.projectedDepth.x,1e-6),0.0,1.0);depthKey=u32(normalized*f32(GPS_DEPTH_MAX_CODE));}
22
+ let key=gpsPackKey(depthKey,gpsPackRGB565(dithered) ^ u32(uniforms.misc.z));let idx=u32(y)*u32(res.x)+u32(x);if (atomicLoad(&imageBuffer[idx])<=key) {return;}
23
+ atomicMin(&imageBuffer[idx],key);}
24
+ `;
25
+ // Sideeffect
26
+ if (!ShaderStore.ShadersStoreWGSL[name]) {
27
+ ShaderStore.ShadersStoreWGSL[name] = shader;
28
+ }
29
+ const includes = [gaussianPointSplattingWGSL];
30
+ for (const inc of includes) {
31
+ if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {
32
+ ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;
33
+ }
34
+ }
35
+ /** @internal */
36
+ export const gpsSplatComputeShaderWGSL = { name, shader };
37
+ //# sourceMappingURL=gpsSplat.compute.js.map