@onerjs/core 9.0.2 → 9.0.4
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.
- package/Buffers/buffer.pure.js +4 -0
- package/Buffers/buffer.pure.js.map +1 -1
- package/Cameras/camera.pure.d.ts +14 -0
- package/Cameras/camera.pure.js +15 -0
- package/Cameras/camera.pure.js.map +1 -1
- package/Compute/computeShader.pure.d.ts +2 -1
- package/Compute/computeShader.pure.js +29 -10
- package/Compute/computeShader.pure.js.map +1 -1
- package/Culling/ray.core.js +22 -9
- package/Culling/ray.core.js.map +1 -1
- package/Engines/IDrawContext.d.ts +2 -0
- package/Engines/IDrawContext.js.map +1 -1
- package/Engines/Native/nativeInterfaces.d.ts +55 -4
- package/Engines/Native/nativeInterfaces.js.map +1 -1
- package/Engines/Native/nativeRenderTargetWrapper.d.ts +1 -0
- package/Engines/Native/nativeRenderTargetWrapper.js +5 -1
- package/Engines/Native/nativeRenderTargetWrapper.js.map +1 -1
- package/Engines/Processors/shaderCodeInliner.d.ts +2 -0
- package/Engines/Processors/shaderCodeInliner.js +251 -6
- package/Engines/Processors/shaderCodeInliner.js.map +1 -1
- package/Engines/Processors/shaderProcessor.js +10 -1
- package/Engines/Processors/shaderProcessor.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.debugging.pure.js +12 -0
- package/Engines/WebGPU/Extensions/engine.debugging.pure.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.pure.js +0 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.pure.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.query.pure.js +5 -0
- package/Engines/WebGPU/Extensions/engine.query.pure.js.map +1 -1
- package/Engines/WebGPU/webgpuBufferManager.js +7 -0
- package/Engines/WebGPU/webgpuBufferManager.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheTextureView.d.ts +1 -1
- package/Engines/WebGPU/webgpuCacheTextureView.js +20 -8
- package/Engines/WebGPU/webgpuCacheTextureView.js.map +1 -1
- package/Engines/WebGPU/webgpuDrawContext.d.ts +2 -0
- package/Engines/WebGPU/webgpuDrawContext.js +6 -0
- package/Engines/WebGPU/webgpuDrawContext.js.map +1 -1
- package/Engines/WebGPU/webgpuQuerySet.d.ts +3 -3
- package/Engines/WebGPU/webgpuQuerySet.js +23 -9
- package/Engines/WebGPU/webgpuQuerySet.js.map +1 -1
- package/Engines/WebGPU/webgpuRenderPassCommandStream.d.ts +156 -0
- package/Engines/WebGPU/webgpuRenderPassCommandStream.js +323 -0
- package/Engines/WebGPU/webgpuRenderPassCommandStream.js.map +1 -0
- package/Engines/WebGPU/webgpuTextureManager.d.ts +1 -1
- package/Engines/WebGPU/webgpuTextureManager.js +4 -3
- package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
- package/Engines/WebGPU/webgpuTimestampQuery.d.ts +3 -1
- package/Engines/WebGPU/webgpuTimestampQuery.js +9 -6
- package/Engines/WebGPU/webgpuTimestampQuery.js.map +1 -1
- package/Engines/abstractEngine.pure.d.ts +2 -0
- package/Engines/abstractEngine.pure.js +14 -5
- package/Engines/abstractEngine.pure.js.map +1 -1
- package/Engines/constants.d.ts +6 -0
- package/Engines/constants.js +6 -0
- package/Engines/constants.js.map +1 -1
- package/Engines/engine.d.ts +198 -24
- package/Engines/pure.d.ts +1 -0
- package/Engines/pure.js +1 -0
- package/Engines/pure.js.map +1 -1
- package/Engines/renderCommandBatcher.pure.d.ts +16 -0
- package/Engines/renderCommandBatcher.pure.js +24 -0
- package/Engines/renderCommandBatcher.pure.js.map +1 -0
- package/Engines/thinEngine.functions.js +3 -2
- package/Engines/thinEngine.functions.js.map +1 -1
- package/Engines/thinEngine.pure.js +18 -2
- package/Engines/thinEngine.pure.js.map +1 -1
- package/Engines/thinNativeEngine.pure.d.ts +10 -7
- package/Engines/thinNativeEngine.pure.js +117 -46
- package/Engines/thinNativeEngine.pure.js.map +1 -1
- package/Engines/thinWebGPUEngine.d.ts +8 -0
- package/Engines/thinWebGPUEngine.js +11 -0
- package/Engines/thinWebGPUEngine.js.map +1 -1
- package/Engines/webgpuEngine.pure.d.ts +60 -1
- package/Engines/webgpuEngine.pure.js +238 -42
- package/Engines/webgpuEngine.pure.js.map +1 -1
- package/FlowGraph/Blocks/Data/Audio/flowGraphGetSoundVolumeBlock.pure.d.ts +3 -3
- package/FlowGraph/Blocks/Data/Audio/flowGraphGetSoundVolumeBlock.pure.js +2 -1
- package/FlowGraph/Blocks/Data/Audio/flowGraphGetSoundVolumeBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Data/Audio/flowGraphIsSoundPlayingBlock.pure.d.ts +3 -3
- package/FlowGraph/Blocks/Data/Audio/flowGraphIsSoundPlayingBlock.pure.js +2 -1
- package/FlowGraph/Blocks/Data/Audio/flowGraphIsSoundPlayingBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphMeshIntersectionEventBlock.d.ts +5 -0
- package/FlowGraph/Blocks/Event/flowGraphMeshIntersectionEventBlock.js +8 -0
- package/FlowGraph/Blocks/Event/flowGraphMeshIntersectionEventBlock.js.map +1 -0
- package/FlowGraph/Blocks/Event/flowGraphMeshIntersectionEventBlock.pure.d.ts +77 -0
- package/FlowGraph/Blocks/Event/flowGraphMeshIntersectionEventBlock.pure.js +141 -0
- package/FlowGraph/Blocks/Event/flowGraphMeshIntersectionEventBlock.pure.js.map +1 -0
- package/FlowGraph/Blocks/Event/flowGraphSoundEndedEventBlock.pure.d.ts +5 -3
- package/FlowGraph/Blocks/Event/flowGraphSoundEndedEventBlock.pure.js +38 -7
- package/FlowGraph/Blocks/Event/flowGraphSoundEndedEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/index.d.ts +1 -0
- package/FlowGraph/Blocks/Event/index.js +1 -0
- package/FlowGraph/Blocks/Event/index.js.map +1 -1
- package/FlowGraph/Blocks/Event/pure.d.ts +1 -0
- package/FlowGraph/Blocks/Event/pure.js +1 -0
- package/FlowGraph/Blocks/Event/pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPauseSoundBlock.pure.d.ts +3 -3
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPauseSoundBlock.pure.js +2 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPauseSoundBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlaySoundBlock.pure.d.ts +3 -3
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlaySoundBlock.pure.js +2 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlaySoundBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphSetSoundVolumeBlock.pure.d.ts +3 -3
- package/FlowGraph/Blocks/Execution/Audio/flowGraphSetSoundVolumeBlock.pure.js +2 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphSetSoundVolumeBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopSoundBlock.pure.d.ts +3 -3
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopSoundBlock.pure.js +2 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopSoundBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/allBlocks.pure.js +2 -0
- package/FlowGraph/Blocks/allBlocks.pure.js.map +1 -1
- package/FlowGraph/Blocks/flowGraphBlockFactory.js +2 -0
- package/FlowGraph/Blocks/flowGraphBlockFactory.js.map +1 -1
- package/FlowGraph/Blocks/flowGraphBlockNames.d.ts +1 -0
- package/FlowGraph/Blocks/flowGraphBlockNames.js +1 -0
- package/FlowGraph/Blocks/flowGraphBlockNames.js.map +1 -1
- package/FlowGraph/flowGraph.d.ts +12 -1
- package/FlowGraph/flowGraph.js +38 -0
- package/FlowGraph/flowGraph.js.map +1 -1
- package/FlowGraph/flowGraphCoordinator.d.ts +44 -0
- package/FlowGraph/flowGraphCoordinator.js +141 -0
- package/FlowGraph/flowGraphCoordinator.js.map +1 -1
- package/FlowGraph/flowGraphDataConnection.pure.js +41 -14
- package/FlowGraph/flowGraphDataConnection.pure.js.map +1 -1
- package/FlowGraph/flowGraphParser.js +105 -5
- package/FlowGraph/flowGraphParser.js.map +1 -1
- package/FlowGraph/flowGraphSoundAssets.d.ts +40 -0
- package/FlowGraph/flowGraphSoundAssets.js +33 -0
- package/FlowGraph/flowGraphSoundAssets.js.map +1 -0
- package/FlowGraph/index.d.ts +1 -0
- package/FlowGraph/index.js +1 -0
- package/FlowGraph/index.js.map +1 -1
- package/FlowGraph/pure.d.ts +1 -0
- package/FlowGraph/pure.js +1 -0
- package/FlowGraph/pure.js.map +1 -1
- package/FlowGraph/serialization.d.ts +8 -0
- package/FlowGraph/serialization.js +31 -12
- package/FlowGraph/serialization.js.map +1 -1
- package/FlowGraph/typeDefinitions.d.ts +25 -0
- package/FlowGraph/typeDefinitions.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/taaTask.js +2 -0
- package/FrameGraph/Tasks/PostProcesses/taaTask.js.map +1 -1
- package/Instrumentation/engineInstrumentation.d.ts +1 -0
- package/Instrumentation/engineInstrumentation.js +25 -6
- package/Instrumentation/engineInstrumentation.js.map +1 -1
- package/Lights/Clustered/clusteredLightContainer.pure.js +2 -0
- package/Lights/Clustered/clusteredLightContainer.pure.js.map +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.pure.d.ts +36 -1
- package/Lights/Shadows/cascadedShadowGenerator.pure.js +202 -27
- package/Lights/Shadows/cascadedShadowGenerator.pure.js.map +1 -1
- package/Lights/directionalLight.pure.d.ts +24 -10
- package/Lights/directionalLight.pure.js +29 -11
- package/Lights/directionalLight.pure.js.map +1 -1
- package/Loading/sceneLoader.d.ts +1 -1
- package/Loading/sceneLoader.js +1 -1
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js +4 -4
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js.map +1 -1
- package/Materials/Node/Blocks/Dual/lightBlock.pure.js +1 -1
- package/Materials/Node/Blocks/Dual/lightBlock.pure.js.map +1 -1
- package/Materials/Node/Blocks/Input/inputBlock.pure.js +4 -0
- package/Materials/Node/Blocks/Input/inputBlock.pure.js.map +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.pure.d.ts +9 -0
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.pure.js +23 -3
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.pure.js.map +1 -1
- package/Materials/PBR/openpbrMaterial.pure.js +1 -1
- package/Materials/PBR/openpbrMaterial.pure.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.pure.d.ts +9 -0
- package/Materials/PBR/pbrBaseMaterial.pure.js +60 -1
- package/Materials/PBR/pbrBaseMaterial.pure.js.map +1 -1
- package/Materials/PBR/pbrBaseSimpleMaterial.d.ts +11 -0
- package/Materials/PBR/pbrBaseSimpleMaterial.js +21 -2
- package/Materials/PBR/pbrBaseSimpleMaterial.js.map +1 -1
- package/Materials/PBR/pbrMaterial.pure.d.ts +12 -0
- package/Materials/PBR/pbrMaterial.pure.js +23 -3
- package/Materials/PBR/pbrMaterial.pure.js.map +1 -1
- package/Materials/Textures/Filtering/hdrIrradianceFiltering.d.ts +1 -0
- package/Materials/Textures/Filtering/hdrIrradianceFiltering.js +10 -0
- package/Materials/Textures/Filtering/hdrIrradianceFiltering.js.map +1 -1
- package/Materials/Textures/HTML/htmlInCanvasPolyfill.d.ts +5 -0
- package/Materials/Textures/HTML/htmlInCanvasPolyfill.js +7 -0
- package/Materials/Textures/HTML/htmlInCanvasPolyfill.js.map +1 -1
- package/Materials/Textures/HTML/htmlInteractionManager.d.ts +9 -3
- package/Materials/Textures/HTML/htmlInteractionManager.js +64 -5
- package/Materials/Textures/HTML/htmlInteractionManager.js.map +1 -1
- package/Materials/Textures/HTML/htmlTexture.d.ts +11 -11
- package/Materials/Textures/HTML/htmlTexture.js +106 -65
- package/Materials/Textures/HTML/htmlTexture.js.map +1 -1
- package/Materials/Textures/Loaders/internalTextureLoader.d.ts +2 -1
- package/Materials/Textures/Loaders/internalTextureLoader.js.map +1 -1
- package/Materials/Textures/Loaders/ktxTextureLoader.d.ts +2 -1
- package/Materials/Textures/Loaders/ktxTextureLoader.js +4 -50
- package/Materials/Textures/Loaders/ktxTextureLoader.js.map +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.pure.js +10 -0
- package/Materials/Textures/Procedurals/proceduralTexture.pure.js.map +1 -1
- package/Materials/Textures/dynamicTexture.pure.js +6 -0
- package/Materials/Textures/dynamicTexture.pure.js.map +1 -1
- package/Materials/Textures/ktx2encoderTypes.d.ts +51 -0
- package/Materials/Textures/ktx2encoderTypes.js +2 -0
- package/Materials/Textures/ktx2encoderTypes.js.map +1 -0
- package/Materials/Textures/renderTargetTexture.pure.js +10 -2
- package/Materials/Textures/renderTargetTexture.pure.js.map +1 -1
- package/Materials/Textures/textureMerger.d.ts +11 -0
- package/Materials/Textures/textureMerger.js +34 -19
- package/Materials/Textures/textureMerger.js.map +1 -1
- package/Materials/Textures/textureProcessor.d.ts +145 -0
- package/Materials/Textures/textureProcessor.js +445 -45
- package/Materials/Textures/textureProcessor.js.map +1 -1
- package/Materials/Textures/textureSampling.functions.d.ts +41 -0
- package/Materials/Textures/textureSampling.functions.js +82 -0
- package/Materials/Textures/textureSampling.functions.js.map +1 -0
- package/Materials/drawWrapper.d.ts +8 -0
- package/Materials/drawWrapper.js +19 -0
- package/Materials/drawWrapper.js.map +1 -1
- package/Materials/effect.pure.d.ts +6 -0
- package/Materials/effect.pure.js +28 -6
- package/Materials/effect.pure.js.map +1 -1
- package/Materials/effect.webgl.functions.pure.js +1 -1
- package/Materials/effect.webgl.functions.pure.js.map +1 -1
- package/Materials/material.pure.d.ts +5 -0
- package/Materials/material.pure.js +9 -2
- package/Materials/material.pure.js.map +1 -1
- package/Materials/materialFlags.d.ts +6 -0
- package/Materials/materialFlags.js +14 -0
- package/Materials/materialFlags.js.map +1 -1
- package/Materials/materialHelper.functions.d.ts +2 -1
- package/Materials/materialHelper.functions.js +36 -2
- package/Materials/materialHelper.functions.js.map +1 -1
- package/Materials/materialHelper.geometryrendering.js +19 -16
- package/Materials/materialHelper.geometryrendering.js.map +1 -1
- package/Materials/materialPluginManager.pure.js +12 -8
- package/Materials/materialPluginManager.pure.js.map +1 -1
- package/Materials/prePassConfiguration.js +19 -16
- package/Materials/prePassConfiguration.js.map +1 -1
- package/Materials/shaderMaterial.pure.js +19 -6
- package/Materials/shaderMaterial.pure.js.map +1 -1
- package/Materials/shadowDepthWrapper.d.ts +6 -0
- package/Materials/shadowDepthWrapper.js +17 -0
- package/Materials/shadowDepthWrapper.js.map +1 -1
- package/Meshes/Compression/dracoCodec.d.ts +14 -0
- package/Meshes/Compression/dracoCodec.js +22 -0
- package/Meshes/Compression/dracoCodec.js.map +1 -1
- package/Meshes/Compression/dracoDecoder.d.ts +1 -0
- package/Meshes/Compression/dracoDecoder.js +27 -0
- package/Meshes/Compression/dracoDecoder.js.map +1 -1
- package/Meshes/Compression/dracoEncoder.d.ts +1 -0
- package/Meshes/Compression/dracoEncoder.js +8 -0
- package/Meshes/Compression/dracoEncoder.js.map +1 -1
- package/Meshes/Compression/meshoptCompression.d.ts +1 -0
- package/Meshes/Compression/meshoptCompression.js +9 -0
- package/Meshes/Compression/meshoptCompression.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingGpuSorter.d.ts +415 -0
- package/Meshes/GaussianSplatting/gaussianSplattingGpuSorter.js +912 -0
- package/Meshes/GaussianSplatting/gaussianSplattingGpuSorter.js.map +1 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.d.ts +3 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js +40 -9
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +112 -8
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +696 -74
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
- package/Meshes/abstractMesh.pure.js +12 -4
- package/Meshes/abstractMesh.pure.js.map +1 -1
- package/Meshes/geometry.d.ts +5 -0
- package/Meshes/geometry.js +25 -0
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/index.d.ts +1 -0
- package/Meshes/index.js +1 -0
- package/Meshes/index.js.map +1 -1
- package/Meshes/mesh.pure.d.ts +7 -0
- package/Meshes/mesh.pure.js +18 -13
- package/Meshes/mesh.pure.js.map +1 -1
- package/Meshes/pure.d.ts +1 -0
- package/Meshes/pure.js +1 -0
- package/Meshes/pure.js.map +1 -1
- package/Meshes/subMesh.pure.d.ts +3 -0
- package/Meshes/subMesh.pure.js +26 -0
- package/Meshes/subMesh.pure.js.map +1 -1
- package/Meshes/thinInstanceMesh.pure.js +5 -3
- package/Meshes/thinInstanceMesh.pure.js.map +1 -1
- package/Misc/index.d.ts +1 -0
- package/Misc/index.js +1 -0
- package/Misc/index.js.map +1 -1
- package/Misc/khronosTextureContainer2.d.ts +3 -2
- package/Misc/khronosTextureContainer2.js +24 -6
- package/Misc/khronosTextureContainer2.js.map +1 -1
- package/Misc/khronosTextureContainer2Encoder.d.ts +166 -0
- package/Misc/khronosTextureContainer2Encoder.js +556 -0
- package/Misc/khronosTextureContainer2Encoder.js.map +1 -0
- package/Misc/khronosTextureContainer2EncoderWorker.d.ts +61 -0
- package/Misc/khronosTextureContainer2EncoderWorker.js +55 -0
- package/Misc/khronosTextureContainer2EncoderWorker.js.map +1 -0
- package/Misc/pure.d.ts +1 -0
- package/Misc/pure.js +1 -0
- package/Misc/pure.js.map +1 -1
- package/Misc/textureFormat.functions.d.ts +6 -0
- package/Misc/textureFormat.functions.js +54 -0
- package/Misc/textureFormat.functions.js.map +1 -0
- package/Misc/textureTools.d.ts +6 -2
- package/Misc/textureTools.js +100 -42
- package/Misc/textureTools.js.map +1 -1
- package/Misc/tools.pure.js +1 -1
- package/Misc/tools.pure.js.map +1 -1
- package/Particles/Node/Blocks/systemBlock.pure.d.ts +1 -1
- package/Particles/Node/Blocks/systemBlock.pure.js +6 -3
- package/Particles/Node/Blocks/systemBlock.pure.js.map +1 -1
- package/Particles/computeShaderParticleSystem.pure.js +5 -0
- package/Particles/computeShaderParticleSystem.pure.js.map +1 -1
- package/Particles/gpuParticleSystem.pure.d.ts +2 -0
- package/Particles/gpuParticleSystem.pure.js +25 -1
- package/Particles/gpuParticleSystem.pure.js.map +1 -1
- package/Particles/solidParticle.d.ts +5 -0
- package/Particles/solidParticle.js +5 -0
- package/Particles/solidParticle.js.map +1 -1
- package/Particles/solidParticleSystem.d.ts +10 -0
- package/Particles/solidParticleSystem.js +72 -13
- package/Particles/solidParticleSystem.js.map +1 -1
- package/Particles/thinParticleSystem.pure.js +4 -0
- package/Particles/thinParticleSystem.pure.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/taaMaterialManager.pure.d.ts +27 -6
- package/PostProcesses/RenderPipeline/Pipelines/taaMaterialManager.pure.js +60 -5
- package/PostProcesses/RenderPipeline/Pipelines/taaMaterialManager.pure.js.map +1 -1
- package/PostProcesses/thinTAAPostProcess.d.ts +1 -0
- package/PostProcesses/thinTAAPostProcess.js +17 -1
- package/PostProcesses/thinTAAPostProcess.js.map +1 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.pure.d.ts +2 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.pure.js +6 -5
- package/PostProcesses/volumetricLightScatteringPostProcess.pure.js.map +1 -1
- package/Rendering/boundingBoxRenderer.pure.js +2 -3
- package/Rendering/boundingBoxRenderer.pure.js.map +1 -1
- package/Rendering/geometryBufferRenderer.pure.js +8 -2
- package/Rendering/geometryBufferRenderer.pure.js.map +1 -1
- package/Rendering/objectRenderer.d.ts +1 -0
- package/Rendering/objectRenderer.js +14 -0
- package/Rendering/objectRenderer.js.map +1 -1
- package/Shaders/ShadersInclude/bumpFragmentMainFunctions.js +2 -2
- package/Shaders/ShadersInclude/bumpFragmentMainFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/bumpVertex.js +1 -1
- package/Shaders/ShadersInclude/bumpVertex.js.map +1 -1
- package/Shaders/ShadersInclude/bumpVertexDeclaration.js +1 -1
- package/Shaders/ShadersInclude/bumpVertexDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/hdrFilteringFunctions.js +5 -1
- package/Shaders/ShadersInclude/hdrFilteringFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/helperFunctions.js +2 -2
- package/Shaders/ShadersInclude/helperFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrBackgroundTransmission.js +1 -1
- package/Shaders/ShadersInclude/openpbrBackgroundTransmission.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrVertexDeclaration.js +6 -0
- package/Shaders/ShadersInclude/openpbrVertexDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockFinalLitComponents.js +11 -1
- package/Shaders/ShadersInclude/pbrBlockFinalLitComponents.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockNormalFinal.js +9 -0
- package/Shaders/ShadersInclude/pbrBlockNormalFinal.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockReflectance.js +1 -1
- package/Shaders/ShadersInclude/pbrBlockReflectance.js.map +1 -1
- package/Shaders/ShadersInclude/pbrClusteredLightingFunctions.js +1 -1
- package/Shaders/ShadersInclude/pbrClusteredLightingFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/pbrFragmentDeclaration.js +7 -1
- package/Shaders/ShadersInclude/pbrFragmentDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.js +1 -0
- package/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/pbrIBLFunctions.js +12 -0
- package/Shaders/ShadersInclude/pbrIBLFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/pbrUboDeclaration.js +1 -1
- package/Shaders/ShadersInclude/pbrUboDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/pbrVertexDeclaration.js +3 -0
- package/Shaders/ShadersInclude/pbrVertexDeclaration.js.map +1 -1
- package/Shaders/geometry.vertex.js +6 -6
- package/Shaders/geometry.vertex.js.map +1 -1
- package/Shaders/gpuUpdateParticles.vertex.js +1 -1
- package/Shaders/gpuUpdateParticles.vertex.js.map +1 -1
- package/Shaders/lod.fragment.js +15 -2
- package/Shaders/lod.fragment.js.map +1 -1
- package/Shaders/lod3D.fragment.js +15 -2
- package/Shaders/lod3D.fragment.js.map +1 -1
- package/Shaders/lodCube.fragment.js +15 -2
- package/Shaders/lodCube.fragment.js.map +1 -1
- package/Shaders/openpbr.vertex.js +2 -0
- package/Shaders/openpbr.vertex.js.map +1 -1
- package/Shaders/pbr.fragment.js +12 -1
- package/Shaders/pbr.fragment.js.map +1 -1
- package/Shaders/pbr.vertex.js +2 -0
- package/Shaders/pbr.vertex.js.map +1 -1
- package/Shaders/textureMerger.fragment.js +28 -0
- package/Shaders/textureMerger.fragment.js.map +1 -1
- package/Shaders/textureProcessor.fragment.js +26 -4
- package/Shaders/textureProcessor.fragment.js.map +1 -1
- package/Shaders/volumetricLightScattering.fragment.js +1 -1
- package/Shaders/volumetricLightScattering.fragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/bumpFragmentMainFunctions.js +2 -2
- package/ShadersWGSL/ShadersInclude/bumpFragmentMainFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/bumpVertex.js +1 -1
- package/ShadersWGSL/ShadersInclude/bumpVertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/bumpVertexDeclaration.js +1 -1
- package/ShadersWGSL/ShadersInclude/bumpVertexDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/hdrFilteringFunctions.js +1 -1
- package/ShadersWGSL/ShadersInclude/hdrFilteringFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/helperFunctions.js +2 -2
- package/ShadersWGSL/ShadersInclude/helperFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/lightFragment.js +44 -2
- package/ShadersWGSL/ShadersInclude/lightFragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/lightUboDeclaration.js +17 -3
- package/ShadersWGSL/ShadersInclude/lightUboDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/lightVxUboDeclaration.js +12 -1
- package/ShadersWGSL/ShadersInclude/lightVxUboDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrBackgroundTransmission.js +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrBackgroundTransmission.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockFinalLitComponents.js +11 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockFinalLitComponents.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockNormalFinal.js +9 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockNormalFinal.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockReflectance.js +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockReflectance.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrClusteredLightingFunctions.js +1 -1
- package/ShadersWGSL/ShadersInclude/pbrClusteredLightingFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingSetupFunctions.js +1 -1
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingSetupFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrFragmentSamplersDeclaration.js +1 -0
- package/ShadersWGSL/ShadersInclude/pbrFragmentSamplersDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrIBLFunctions.js +8 -0
- package/ShadersWGSL/ShadersInclude/pbrIBLFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrUboDeclaration.js +1 -1
- package/ShadersWGSL/ShadersInclude/pbrUboDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/prePassVertex.js +2 -2
- package/ShadersWGSL/ShadersInclude/prePassVertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/prePassVertexDeclaration.js +1 -1
- package/ShadersWGSL/ShadersInclude/prePassVertexDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/sceneUboDeclaration.js +3 -1
- package/ShadersWGSL/ShadersInclude/sceneUboDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/shadowsVertex.js +16 -0
- package/ShadersWGSL/ShadersInclude/shadowsVertex.js.map +1 -1
- package/ShadersWGSL/default.fragment.js +4 -4
- package/ShadersWGSL/default.fragment.js.map +1 -1
- package/ShadersWGSL/default.vertex.js +1 -1
- package/ShadersWGSL/default.vertex.js.map +1 -1
- package/ShadersWGSL/gaussianSplatting.vertex.js +3 -3
- package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
- package/ShadersWGSL/gpuUpdateParticles.compute.js +1 -1
- package/ShadersWGSL/gpuUpdateParticles.compute.js.map +1 -1
- package/ShadersWGSL/gsSortCount.compute.d.ts +5 -0
- package/ShadersWGSL/gsSortCount.compute.js +19 -0
- package/ShadersWGSL/gsSortCount.compute.js.map +1 -0
- package/ShadersWGSL/gsSortKeys.compute.d.ts +5 -0
- package/ShadersWGSL/gsSortKeys.compute.js +49 -0
- package/ShadersWGSL/gsSortKeys.compute.js.map +1 -0
- package/ShadersWGSL/gsSortOutput.compute.d.ts +5 -0
- package/ShadersWGSL/gsSortOutput.compute.js +28 -0
- package/ShadersWGSL/gsSortOutput.compute.js.map +1 -0
- package/ShadersWGSL/gsSortScanLocal.compute.d.ts +5 -0
- package/ShadersWGSL/gsSortScanLocal.compute.js +23 -0
- package/ShadersWGSL/gsSortScanLocal.compute.js.map +1 -0
- package/ShadersWGSL/gsSortScanSums.compute.d.ts +5 -0
- package/ShadersWGSL/gsSortScanSums.compute.js +19 -0
- package/ShadersWGSL/gsSortScanSums.compute.js.map +1 -0
- package/ShadersWGSL/gsSortScatter.compute.d.ts +5 -0
- package/ShadersWGSL/gsSortScatter.compute.js +33 -0
- package/ShadersWGSL/gsSortScatter.compute.js.map +1 -0
- package/ShadersWGSL/lod.fragment.js +14 -2
- package/ShadersWGSL/lod.fragment.js.map +1 -1
- package/ShadersWGSL/lod3D.fragment.js +14 -2
- package/ShadersWGSL/lod3D.fragment.js.map +1 -1
- package/ShadersWGSL/lodCube.fragment.js +14 -2
- package/ShadersWGSL/lodCube.fragment.js.map +1 -1
- package/ShadersWGSL/openpbr.vertex.js +3 -1
- package/ShadersWGSL/openpbr.vertex.js.map +1 -1
- package/ShadersWGSL/pbr.fragment.js +11 -0
- package/ShadersWGSL/pbr.fragment.js.map +1 -1
- package/ShadersWGSL/pbr.vertex.js +3 -1
- package/ShadersWGSL/pbr.vertex.js.map +1 -1
- package/ShadersWGSL/textureMerger.fragment.js +40 -4
- package/ShadersWGSL/textureMerger.fragment.js.map +1 -1
- package/ShadersWGSL/textureProcessor.fragment.js +26 -4
- package/ShadersWGSL/textureProcessor.fragment.js.map +1 -1
- package/Sprites/spriteRenderer.js +15 -5
- package/Sprites/spriteRenderer.js.map +1 -1
- package/package.json +1 -1
- package/scene.pure.d.ts +23 -1
- package/scene.pure.js +83 -1
- package/scene.pure.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gaussianSplattingMeshBase.pure.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAK7D,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAmB,MAAM,6BAA6B,CAAC;AAEpG,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,O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GAAG,KAAK,CAAC,CAAC;QAC5E,CAAC;QAED,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,IAAI,CAAC,MAAM,IAAI,SAAS,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QAEzE,OAAO,IAAI,CAAC;IAChB,CAAC;;AA54GD;;;;GAIG;AACW,yCAAe,GAAG,IAAI,AAAP,CAAQ;AAErC;;;GAGG;AACW,4CAAkB,GAAG,KAAK,AAAR,CAAS;AAoF1B,0CAAgB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,AAAxB,CAAyB,CAAC,uEAAuE;AACjH,gCAAM,GAAG,mBAAmB,AAAtB,CAAuB;AAC5C,4GAA4G;AAC5G,sEAAsE;AACvD,yCAAe,GAAG,MAAM,AAAT,CAAU;AACxC,uEAAuE;AACxD,iDAAuB,GAAG,KAAK,AAAR,CAAS;AASvB,oCAAU,GAAG,EAAE,AAAL,CAAM,CAAC,yBAAyB;AAGxC,qDAA2B,GAAG,IAAI,AAAP,CAAQ;AAkU7D;;;GAGG;AACW,iDAAuB,GAAG,CAAC,AAAJ,CAAK;AAw9F9C;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAAC,YAAoB,EAAE,SAAiB;IACrE,MAAM,MAAM,GAAiB,EAAE,CAAC;IAChC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,EAAE,CAAC,EAAE,EAAE,CAAC;QACpC,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,SAAS,CAAC,CAAC;QACtC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACd,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\n\nimport { type Scene } from \"core/scene.pure\";\nimport { type DeepImmutable, type Nullable } from \"core/types\";\nimport { type BaseTexture } from \"core/Materials/Textures/baseTexture.pure\";\nimport { SubMesh } from \"../subMesh.pure\";\nimport { type AbstractMesh } from \"../abstractMesh.pure\";\nimport { Mesh } from \"../mesh.pure\";\nimport { VertexData } from \"../mesh.vertexData\";\nimport { Matrix, TmpVectors, Vector2, Vector3, type Quaternion } from \"core/Maths/math.vector.pure\";\n\nimport { Logger } from \"core/Misc/logger\";\nimport { Observable } from \"core/Misc/observable\";\nimport { GaussianSplattingMaterial } from \"core/Materials/GaussianSplatting/gaussianSplattingMaterial.pure\";\nimport { RawTexture } from \"core/Materials/Textures/rawTexture\";\nimport { MultiRenderTarget } from \"core/Materials/Textures/multiRenderTarget.pure\";\nimport { Color4 } from \"core/Maths/math.color.pure\";\nimport { type InternalTexture } from \"core/Materials/Textures/internalTexture\";\nimport { Constants } from \"core/Engines/constants\";\nimport { FromHalfFloat, ToHalfFloat } from \"core/Misc/textureTools\";\nimport { type Material } from \"core/Materials/material.pure\";\nimport { type Effect } from \"core/Materials/effect.pure\";\nimport { Scalar } from \"core/Maths/math.scalar\";\nimport { runCoroutineSync, runCoroutineAsync, createYieldingScheduler, type Coroutine } from \"core/Misc/coroutine\";\nimport { EngineStore } from \"core/Engines/engineStore\";\nimport { type Camera } from \"core/Cameras/camera.pure\";\nimport { ImportMeshAsync } from \"core/Loading/sceneLoader\";\nimport { type INative } from \"core/Engines/Native/nativeInterfaces\";\nimport { type AbstractEngine } from \"core/Engines/abstractEngine.pure\";\nimport { type ICustomAnimationFrameRequester } from \"core/Misc/customAnimationFrameRequester\";\nimport { GaussianSplattingSortWorker, GaussianSplattingSortWorkerCommand } from \"./gaussianSplattingSortWorker\";\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\ndeclare const _native: INative;\n\n/** Internal mirror of ISogTexturePack (defined in loaders) — avoids a circular import. */\ninterface ISogPackInternal {\n version: 1 | 2;\n splatCount: number;\n shDegree: number;\n meansTextureL: BaseTexture;\n meansTextureU: BaseTexture;\n scalesTexture: BaseTexture;\n quatsTexture: BaseTexture;\n sh0Texture: BaseTexture;\n shCentroidsTexture?: BaseTexture;\n shLabelsTexture?: BaseTexture;\n codebookTexture?: BaseTexture;\n meansMin: [number, number, number];\n meansMax: [number, number, number];\n scalesMin?: [number, number, number];\n scalesMax?: [number, number, number];\n sh0Min?: [number, number, number, number];\n sh0Max?: [number, number, number, number];\n shnMin?: number;\n shnMax?: number;\n shCoeffCount: number;\n positions: Float32Array;\n}\n\n/**\n * Safe-orbit camera limits embedded in a Gaussian Splatting file's metadata (Adobe safe-orbit\n * extension). Exposed on the loaded mesh via {@link GaussianSplattingMeshBase.safeOrbitCameraLimits}\n * so consumers can read/apply the limits independently of the scene's active camera — the loader's\n * automatic application only affects an active ArcRotateCamera at load time.\n */\nexport interface ISafeOrbitCameraLimits {\n /** Minimum safe orbit radius (distance from the camera to its target), if the file specifies one. */\n radiusMin?: number;\n /** Safe elevation range as `[minElevation, maxElevation]` in radians, if the file specifies one. */\n elevationMinMax?: [number, number];\n}\n\nconst IsNative = typeof _native !== \"undefined\";\nconst Native = IsNative ? _native : null;\ninterface IDelayedTextureUpdate {\n covA: Uint16Array;\n covB: Uint16Array;\n colors: Uint8Array;\n centers: Float32Array;\n sh?: Uint8Array[];\n}\ninterface IUpdateOptions {\n flipY?: boolean;\n /** @internal When set, skips reprocessing splats [0, previousVertexCount) and copies from cached arrays instead. */\n previousVertexCount?: number;\n}\n\n/**\n * Defines a contiguous source-splat range to render from a GaussianSplattingMesh.\n */\nexport interface IGaussianSplattingSplatRange {\n /**\n * First source splat index to render.\n */\n offset: number;\n /**\n * Number of source splats to render.\n */\n count: number;\n}\n\ninterface ITextureDataUpdateCapableEngine {\n updateTextureData(\n texture: InternalTexture,\n imageData: ArrayBufferView,\n xOffset: number,\n yOffset: number,\n width: number,\n height: number,\n faceIndex?: number,\n lod?: number,\n generateMipMaps?: boolean\n ): void;\n updateRawTexture(\n texture: Nullable<InternalTexture>,\n data: Nullable<ArrayBufferView>,\n format: number,\n invertY: boolean,\n compression?: Nullable<string>,\n type?: number,\n useSRGBBuffer?: boolean\n ): void;\n _gl?: unknown;\n isWebGPU?: boolean;\n}\n\n// @internal\nconst UnpackUnorm = (value: number, bits: number) => {\n const t = (1 << bits) - 1;\n return (value & t) / t;\n};\n\n// @internal\nconst Unpack111011 = (value: number, result: Vector3) => {\n result.x = UnpackUnorm(value >>> 21, 11);\n result.y = UnpackUnorm(value >>> 11, 10);\n result.z = UnpackUnorm(value, 11);\n};\n\n// @internal\nconst Unpack8888 = (value: number, result: Uint8ClampedArray) => {\n result[0] = UnpackUnorm(value >>> 24, 8) * 255;\n result[1] = UnpackUnorm(value >>> 16, 8) * 255;\n result[2] = UnpackUnorm(value >>> 8, 8) * 255;\n result[3] = UnpackUnorm(value, 8) * 255;\n};\n\n// @internal\n// unpack quaternion with 2,10,10,10 format (largest element, 3x10bit element)\nconst UnpackRot = (value: number, result: Quaternion) => {\n const norm = 1.0 / (Math.sqrt(2) * 0.5);\n const a = (UnpackUnorm(value >>> 20, 10) - 0.5) * norm;\n const b = (UnpackUnorm(value >>> 10, 10) - 0.5) * norm;\n const c = (UnpackUnorm(value, 10) - 0.5) * norm;\n const m = Math.sqrt(1.0 - (a * a + b * b + c * c));\n\n switch (value >>> 30) {\n case 0:\n result.set(m, a, b, c);\n break;\n case 1:\n result.set(a, m, b, c);\n break;\n case 2:\n result.set(a, b, m, c);\n break;\n case 3:\n result.set(a, b, c, m);\n break;\n }\n};\n\ninterface ICompressedPLYChunk {\n min: Vector3;\n max: Vector3;\n minScale: Vector3;\n maxScale: Vector3;\n minColor: Vector3;\n maxColor: Vector3;\n}\n\n/**\n * To support multiple camera rendering, rendered mesh is separated from the GaussianSplattingMesh itself.\n * The GS mesh serves as a proxy and a different mesh is rendered for each camera. This hot switch is done\n * in the render() function. Each camera has a corresponding ICameraViewInfo object. The key is the camera unique id.\n * ICameraViewInfo and the rendered mesh are created in method `_postToWorker`\n * Mesh are disabled to not let the scene render them directly.\n * ICameraViewInfo are sorted per last frame id update to prioritize the less recently updated ones.\n * There is 1 web worker per GaussianSplattingMesh to avoid too many copies between main thread and workers.\n * So, only one sort is being done at a time per GaussianSplattingMeshBase. If multiple cameras need an update,\n * they will be processed one by one in subsequent frames.\n */\ninterface ICameraViewInfo {\n camera: Camera;\n cameraDirection: Vector3;\n sortWorldMatrix: Matrix;\n sortCameraForward: Vector3;\n sortCameraPosition: Vector3;\n sortRequestId: number;\n sortAppliedId: number;\n mesh: Mesh;\n frameIdLastUpdate: number;\n splatIndexBufferSet: boolean;\n}\n/**\n * Representation of the types\n */\nconst enum PLYType {\n FLOAT,\n INT,\n UINT,\n DOUBLE,\n UCHAR,\n USHORT,\n UNDEFINED,\n}\n\n/**\n * Usage types of the PLY values\n */\nconst enum PLYValue {\n MIN_X,\n MIN_Y,\n MIN_Z,\n MAX_X,\n MAX_Y,\n MAX_Z,\n\n MIN_SCALE_X,\n MIN_SCALE_Y,\n MIN_SCALE_Z,\n\n MAX_SCALE_X,\n MAX_SCALE_Y,\n MAX_SCALE_Z,\n\n PACKED_POSITION,\n PACKED_ROTATION,\n PACKED_SCALE,\n PACKED_COLOR,\n X,\n Y,\n Z,\n SCALE_0,\n SCALE_1,\n SCALE_2,\n\n DIFFUSE_RED,\n DIFFUSE_GREEN,\n DIFFUSE_BLUE,\n OPACITY,\n\n F_DC_0,\n F_DC_1,\n F_DC_2,\n F_DC_3,\n\n ROT_0,\n ROT_1,\n ROT_2,\n ROT_3,\n\n MIN_COLOR_R,\n MIN_COLOR_G,\n MIN_COLOR_B,\n\n MAX_COLOR_R,\n MAX_COLOR_G,\n MAX_COLOR_B,\n\n SH_0,\n SH_1,\n SH_2,\n SH_3,\n SH_4,\n SH_5,\n SH_6,\n SH_7,\n SH_8,\n SH_9,\n SH_10,\n SH_11,\n SH_12,\n SH_13,\n SH_14,\n SH_15,\n SH_16,\n SH_17,\n SH_18,\n SH_19,\n SH_20,\n SH_21,\n SH_22,\n SH_23,\n SH_24,\n SH_25,\n SH_26,\n SH_27,\n SH_28,\n SH_29,\n SH_30,\n SH_31,\n SH_32,\n SH_33,\n SH_34,\n SH_35,\n SH_36,\n SH_37,\n SH_38,\n SH_39,\n SH_40,\n SH_41,\n SH_42,\n SH_43,\n SH_44,\n SH_45,\n SH_46,\n SH_47,\n SH_48,\n SH_49,\n SH_50,\n SH_51,\n SH_52,\n SH_53,\n SH_54,\n SH_55,\n SH_56,\n SH_57,\n SH_58,\n SH_59,\n SH_60,\n SH_61,\n SH_62,\n SH_63,\n SH_64,\n SH_65,\n SH_66,\n SH_67,\n SH_68,\n SH_69,\n SH_70,\n SH_71,\n\n UNDEFINED,\n}\n\n/**\n * Property field found in PLY header\n */\nexport type PlyProperty = {\n /**\n * Value usage\n */\n value: PLYValue;\n /**\n * Value type\n */\n type: PLYType;\n /**\n * offset in byte from te beginning of the splat\n */\n offset: number;\n};\n\n/**\n * meta info on Splat file\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport interface PLYHeader {\n /**\n * number of splats\n */\n vertexCount: number;\n /**\n * number of spatial chunks for compressed ply\n */\n chunkCount: number;\n /**\n * length in bytes of the vertex info\n */\n rowVertexLength: number;\n /**\n * length in bytes of the chunk\n */\n rowChunkLength: number;\n /**\n * array listing properties per vertex\n */\n vertexProperties: PlyProperty[];\n /**\n * array listing properties per chunk\n */\n chunkProperties: PlyProperty[];\n /**\n * data view for parsing chunks and vertices\n */\n dataView: DataView;\n /**\n * buffer for the data view\n */\n buffer: ArrayBuffer;\n /**\n * degree of SH coefficients\n */\n shDegree: number;\n /**\n * number of coefficient per splat\n */\n shCoefficientCount: number;\n /**\n * buffer for SH coefficients\n */\n shBuffer: ArrayBuffer | null;\n}\n\n// Inter-frame task-queue yield\n// Depth-sort results arrive via worker postMessage, which is a regular-priority\n// task. At high refresh rates the rAF loop can leave almost no time for the\n// regular task queue, starving sort results for hundreds of milliseconds.\n// Installing a customAnimationFrameRequester that inserts a setTimeout(0) before\n// each rAF forces the event loop to drain regular tasks between frames.\n// The wrapper is ref-counted so it is installed when the first GSplat mesh is\n// created and removed when the last one is disposed.\n\ninterface IGsInterFrameYieldRequester extends ICustomAnimationFrameRequester {\n _gsInterFrameYield: true;\n _refCount: number;\n}\n\nfunction _AcquireGsInterFrameYield(engine: AbstractEngine): void {\n // Browser-only optimization: wraps the global requestAnimationFrame, which\n // doesn't exist on Babylon Native. Skip it there so the engine uses its\n // default frame scheduling.\n if (IsNative) {\n return;\n }\n const existing = engine.customAnimationFrameRequester as IGsInterFrameYieldRequester | null;\n if (existing?._gsInterFrameYield) {\n existing._refCount++;\n return;\n }\n if (existing) {\n // Slot is owned by another requester. Don't interfere.\n return;\n }\n let _timeoutId = 0;\n let _innerRafId = 0;\n const wrapper: IGsInterFrameYieldRequester = {\n _gsInterFrameYield: true,\n _refCount: 1,\n requestAnimationFrame: (callback: Function): number => {\n // Insert a setTimeout(0) to yield to the regular task queue (worker\n // postMessage results, input events) before scheduling the next animation\n // frame. Without this, a continuous rAF loop at high refresh rates leaves\n // almost no time for regular tasks, starving worker messages for hundreds of ms.\n _timeoutId = setTimeout(() => {\n _innerRafId = requestAnimationFrame(callback as FrameRequestCallback);\n }, 0) as unknown as number;\n return _timeoutId;\n },\n cancelAnimationFrame: (_id: number) => {\n clearTimeout(_timeoutId);\n if (_innerRafId > 0) {\n cancelAnimationFrame(_innerRafId);\n }\n _timeoutId = 0;\n _innerRafId = 0;\n },\n };\n engine.customAnimationFrameRequester = wrapper;\n}\n\n// Counterpart to _AcquireGsInterFrameYield. Call once per mesh on dispose.\nfunction _ReleaseGsInterFrameYield(engine: AbstractEngine): void {\n const existing = engine.customAnimationFrameRequester as IGsInterFrameYieldRequester | null;\n if (!existing?._gsInterFrameYield) {\n return;\n }\n existing._refCount--;\n if (existing._refCount === 0) {\n engine.customAnimationFrameRequester = null;\n }\n}\n\n/**\n * Base class for Gaussian Splatting meshes. Contains all single-cloud rendering logic.\n * @internal Use GaussianSplattingMesh instead; this class is an internal implementation detail.\n */\nexport class GaussianSplattingMeshBase extends Mesh {\n /**\n * When true (default), the depth-sort worker uses the fast O(n) counting (radix) sort. Set to false to\n * fall back to the legacy comparison sort (useful for A/B comparison or as a safety fallback). The change\n * takes effect on the next sort.\n */\n public static UseCountingSort = true;\n\n /**\n * When true, the depth-sort worker logs each sort's duration (ms) and active splat count to the console.\n * Off by default; intended for performance investigation only.\n */\n public static LogSortPerformance = false;\n\n /**\n * Safe-orbit camera limits parsed from the source file's metadata, or `null` when the file\n * carries none. The loader also auto-applies these to an active ArcRotateCamera at load time\n * (unless `disableAutoCameraLimits` is set); this field exposes the raw values so they can be\n * applied or tracked regardless of the active camera type. See {@link ISafeOrbitCameraLimits}.\n */\n public safeOrbitCameraLimits: Nullable<ISafeOrbitCameraLimits> = null;\n\n /** @internal */\n public _vertexCount = 0;\n protected _worker: Nullable<Worker> = null;\n private _modelViewProjectionMatrix = Matrix.Identity();\n private _depthMix: BigInt64Array;\n protected _canPostToWorker = true;\n private _readyToDisplay = false;\n private _sortRequestId = 0;\n // Incremented on every active-range change. A worker sort result is only applied when it was computed\n // for the current range version (and size), so a sort for stale ranges is never rendered.\n private _activeRangeVersion = 0;\n private _hasRenderedOnce = false;\n protected _covariancesATexture: Nullable<BaseTexture> = null;\n protected _covariancesBTexture: Nullable<BaseTexture> = null;\n protected _centersTexture: Nullable<BaseTexture> = null;\n protected _colorsTexture: Nullable<BaseTexture> = null;\n // When a streaming part is reserved, the four core data textures (centers, covA, covB, colors) are backed\n // by this MRT's attachments instead of standalone RawTextures, so a streaming engine can GPU-decode into\n // the reserved region while static parts still CPU-upload into it. Null in the normal\n // (non-streaming) path, which keeps using RawTextures unchanged.\n protected _mrtAtlas: Nullable<MultiRenderTarget> = null;\n protected _useMrtAtlas = false;\n // Higher-order SH atlas. When a streaming part needs baked SH, `_shTextures` become the single\n // attachments of these render-targetable integer MRTs (one per packed-u32 SH texture) so the streaming engine\n // GPU-decodes SH into the reserved region while static SH parts still CPU-upload into them. Null in the normal\n // path (SH stays plain RawTextures). One MRT per attachment keeps within WebGPU's per-sample byte budget.\n protected _shMrtAtlas: Nullable<MultiRenderTarget[]> = null;\n protected _useShMrtAtlas = false;\n protected _shMrtAtlasTextureCount = 0;\n protected _rotationsATexture: Nullable<BaseTexture> = null;\n protected _rotationsBTexture: Nullable<BaseTexture> = null;\n protected _rotationScaleTexture: Nullable<BaseTexture> = null;\n // Rotation/scale atlas. When a streaming part needs voxel-IBL rotation/scale, the three rotation\n // textures become the attachments of this render-targetable half-float MRT so the streaming engine GPU-decodes\n // rotation/scale into the reserved region while static parts still CPU-upload into it. Null in the normal path\n // (rotation stays plain RawTextures created per-splat by `_makeSplat`).\n protected _rotMrtAtlas: Nullable<MultiRenderTarget> = null;\n protected _useRotMrtAtlas = false;\n private _rotationDataA: Nullable<Uint16Array> = null;\n private _rotationDataB: Nullable<Uint16Array> = null;\n private _rotationScaleData: Nullable<Uint16Array> = null;\n protected _needsRotationScaleTextures: boolean = false;\n protected _splatPositions: Nullable<Float32Array> = null;\n private _splatIndex: Nullable<Float32Array> = null;\n protected _shTextures: Nullable<BaseTexture[]> = null;\n /** @internal */\n public _splatsData: Nullable<ArrayBuffer> = null;\n /** @internal */\n public _shData: Nullable<Uint8Array[]> = null;\n private _textureSize: Vector2 = new Vector2(0, 0);\n protected readonly _keepInRam: boolean = false;\n protected _alwaysRetainSplatsData: boolean = false;\n protected _flipY = false;\n\n private _delayedTextureUpdate: Nullable<IDelayedTextureUpdate> = null;\n protected _useRGBACovariants = false;\n protected _useSog = false;\n protected _sogParams: Nullable<ISogPackInternal> = null;\n private _material: Nullable<Material> = null;\n\n private _tmpCovariances = [0, 0, 0, 0, 0, 0];\n private _splatSizeMin: number = Infinity;\n private _splatSizeMax: number = -Infinity;\n private _sortIsDirty = false;\n // A forced sort requested while no classic pass needed sorting; runs on the next classic pass.\n private _forcedSortPending = false;\n protected _activeSplatRanges: Nullable<Uint32Array> = null;\n private _activeSplatRangeKey = \"\";\n private _activeSplatRenderCount = 0;\n\n // Cached bounding box for incremental addPart updates (O(1) vs O(N) scan of positions)\n protected _cachedBoundingMin: Nullable<Vector3> = null;\n protected _cachedBoundingMax: Nullable<Vector3> = null;\n\n private static _RowOutputLength = 3 * 4 + 3 * 4 + 4 + 4; // Vector3 position, Vector3 scale, 1 u8 quaternion, 1 color with alpha\n private static _SH_C0 = 0.28209479177387814;\n // batch size between 2 yield calls. This value is a tradeoff between updates overhead and framerate hiccups\n // This step is faster the PLY conversion. So batch size can be bigger\n private static _SplatBatchSize = 327680;\n // batch size between 2 yield calls during the PLY to splat conversion.\n private static _PlyConversionBatchSize = 32768;\n /** @internal */\n public _shDegree = 0;\n /** Incremented whenever `_updateData` replaces the splat data, even when it reuses the same buffer. @internal */\n public _splatDataRevision = 0;\n /** True while `_updateData` is filling the atlas, so consumers keep the last complete data. @internal */\n public _splatDataPending = false;\n protected _maxShDegree = 0;\n\n private static readonly _BatchSize = 16; // 16 splats per instance\n private _cameraViewInfos = new Map<number, ICameraViewInfo>();\n\n protected static readonly _DefaultViewUpdateThreshold = 1e-4;\n\n /** Fired after parts are added or the mesh is rebuilt following a removal. Payload is the new part count. */\n public readonly onPartCountChangedObservable = new Observable<number>();\n\n /** Fired after part-removal validation passes but before the mesh is rebuilt.\n * Payload is the original (pre-removal) part index. */\n public readonly onPartRemovedObservable = new Observable<number>();\n\n /**\n * Fired just before an existing MRT-backed atlas is recreated to grow it (e.g. adding a part while a streaming\n * part exists). Payload is the OLD atlas. Streaming parts subscribe to back up their GPU-only region before it\n * is disposed. Only fires when growing an existing MRT atlas (not on first creation).\n * @internal\n */\n public readonly _onBeforeAtlasRebuildObservable = new Observable<MultiRenderTarget>();\n\n /**\n * Fired after the new (grown) MRT-backed atlas has been created and its CPU data uploaded. Payload is the NEW\n * atlas. Streaming parts subscribe to rebind to it and restore their backed-up region.\n * @internal\n */\n public readonly _onAfterAtlasRebuildObservable = new Observable<MultiRenderTarget>();\n\n /**\n * Returns a byte-accurate view for retained splat data, preserving any non-zero byte offset.\n * @param data The retained splat source bytes.\n * @returns A Uint8Array covering the exact source byte range.\n * @internal\n */\n protected static _GetSplatDataBytes(data: ArrayBuffer | ArrayBufferView): Uint8Array {\n return ArrayBuffer.isView(data) ? new Uint8Array(data.buffer, data.byteOffset, data.byteLength) : new Uint8Array(data);\n }\n\n /**\n * Returns a Float32 reinterpretation for retained splat data, copying only when alignment requires it.\n * @param data The retained splat source bytes.\n * @returns A Float32Array over the exact source byte range.\n * @internal\n */\n protected static _GetSplatDataFloats(data: ArrayBuffer | ArrayBufferView): Float32Array {\n const bytes = GaussianSplattingMeshBase._GetSplatDataBytes(data);\n const floatSize = Float32Array.BYTES_PER_ELEMENT;\n\n if (bytes.byteLength % floatSize !== 0) {\n throw new Error(`Gaussian splat data byte length (${bytes.byteLength}) is not divisible by ${floatSize} and cannot be reinterpreted as Float32 data.`);\n }\n\n if (bytes.byteOffset % floatSize !== 0) {\n const copy = new Uint8Array(bytes.byteLength);\n copy.set(bytes);\n return new Float32Array(copy.buffer, 0, bytes.byteLength / floatSize);\n }\n\n return new Float32Array(bytes.buffer, bytes.byteOffset, bytes.byteLength / floatSize);\n }\n\n private static _BuildSplatRangeData(\n ranges: Nullable<readonly IGaussianSplattingSplatRange[]>,\n vertexCount: number\n ): { ranges: Nullable<Uint32Array>; count: number; key: string } {\n if (ranges === null) {\n return { ranges: null, count: vertexCount, key: \"\" };\n }\n\n const rangePairs: number[] = [];\n let totalCount = 0;\n let key = \"\";\n for (const range of ranges) {\n const start = Math.max(0, Math.floor(range.offset));\n const count = Math.max(0, Math.floor(range.count));\n const end = Math.min(vertexCount, start + count);\n const rangeCount = Math.max(0, end - start);\n if (rangeCount === 0) {\n continue;\n }\n\n rangePairs.push(start, rangeCount);\n totalCount += rangeCount;\n key += `${start}:${rangeCount};`;\n }\n\n return { ranges: new Uint32Array(rangePairs), count: totalCount, key };\n }\n\n /**\n * Cosine value of the angle threshold to update view dependent splat sorting. Default is 0.0001.\n */\n public viewUpdateThreshold: number = GaussianSplattingMeshBase._DefaultViewUpdateThreshold;\n\n protected _disableDepthSort = false;\n /**\n * If true, disables depth sorting of the splats (default: false)\n * Disabling sorting also discards deferred forced-sort requests.\n */\n public get disableDepthSort() {\n return this._disableDepthSort;\n }\n public set disableDepthSort(value: boolean) {\n if (!this._disableDepthSort && value) {\n this._worker?.terminate();\n this._worker = null;\n this._disableDepthSort = true;\n this._forcedSortPending = false;\n } else if (this._disableDepthSort && !value) {\n this._disableDepthSort = false;\n this._sortIsDirty = true;\n this._instantiateWorker();\n }\n }\n\n /**\n * View direction factor used to compute the SH view direction in the shader.\n * @deprecated Not used anymore for SH rendering\n */\n public get viewDirectionFactor() {\n return Vector3.OneReadOnly;\n }\n\n /**\n * SH degree. 0 = no sh (default). 1 = 3 parameters. 2 = 8 parameters. 3 = 15 parameters.\n * Value is clamped between 0 and the maximum degree available from loaded data.\n */\n public get shDegree() {\n return this._shDegree;\n }\n\n public set shDegree(value: number) {\n const maxDegree = this._maxShDegree;\n const clamped = Math.max(0, Math.min(Math.round(value), maxDegree));\n if (this._shDegree === clamped) {\n return;\n }\n this._shDegree = clamped;\n this.material?.resetDrawCache();\n }\n\n /**\n * Maximum SH degree available from the loaded data.\n */\n public get maxShDegree() {\n return this._maxShDegree;\n }\n\n /**\n * Number of splats in the mesh\n */\n public get splatCount() {\n return this._splatIndex?.length;\n }\n\n /**\n * Number of source splats currently selected for rendering.\n * When no range filter is active, this is the mesh's full source splat count.\n */\n public get renderedSplatCount(): number {\n return this._activeSplatRanges ? this._activeSplatRenderCount : this._vertexCount;\n }\n\n /**\n * Restricts rendering to the provided source splat ranges.\n * Passing `null` clears the range filter and renders the full source splat set.\n * @param ranges contiguous source ranges to render, or null to render all splats\n */\n public setSplatIndexRanges(ranges: Nullable<readonly IGaussianSplattingSplatRange[]>): void {\n this._setSplatIndexRanges(ranges);\n }\n\n private _setSplatIndexRanges(ranges: Nullable<readonly IGaussianSplattingSplatRange[]>): void {\n const rangeData = GaussianSplattingMeshBase._BuildSplatRangeData(ranges, this._vertexCount);\n const isSameRangeSet = this._activeSplatRanges === null ? rangeData.ranges === null : rangeData.ranges !== null && this._activeSplatRangeKey === rangeData.key;\n if (isSameRangeSet) {\n return;\n }\n\n this._activeSplatRanges = rangeData.ranges;\n this._activeSplatRangeKey = rangeData.key;\n this._activeSplatRenderCount = rangeData.count;\n this._activeRangeVersion++;\n this._postIntervalsToWorker();\n if (this._worker) {\n // Defer swapping the rendered index buffer until the worker returns a depth sort computed for\n // this exact range set (see the worker `onmessage` handler). Until then we keep rendering the\n // previous fully-sorted state, so a range/LOD change never shows an unsorted flash nor a stale\n // index buffer (rendering indices that belong to a different active set, which caused the\n // disappear/reappear flicker). Only the worker's depth buffer is resized here so the next sort\n // produces the right number of entries.\n this._ensureDepthMixSize(Math.max((this._activeSplatRenderCount + 15) & ~0xf, 16));\n this._sortIsDirty = true;\n this._postToWorker(true);\n } else {\n // Synchronous sort paths (disabled depth sort / Native): swap the index buffer immediately.\n this._updateSplatIndexBuffer(this._vertexCount);\n this._postToWorker(true);\n }\n }\n\n /**\n * Whether the depth sort is settled: a sort computed for the current active ranges and camera has been\n * applied to the rendered index buffer, and no further sort is pending or in flight (including a forced sort\n * deferred until a classic pass needs it). For a static camera\n * and a fixed active set this becomes true once the final sort completes. Used by streaming subclasses to\n * detect when rendering is fully up to date (e.g. for deterministic screenshots) and by IBL shadows to\n * avoid voxelizing against an index buffer the worker has not finished (re)building yet.\n * @internal\n */\n public get _isDepthSortSettled(): boolean {\n return this._readyToDisplay && !this._sortIsDirty && !this._forcedSortPending && this._canPostToWorker;\n }\n\n // (Re)allocates the worker depth buffer to the given padded size. A fresh array is allocated when the\n // size differs or the current buffer is detached (in-flight in the worker), so a queued sort can be\n // re-posted with a correctly-sized buffer without disturbing the in-flight one.\n private _ensureDepthMixSize(paddedCount: number): void {\n if (IsNative) {\n return;\n }\n if (!this._depthMix || this._depthMix.length !== paddedCount || this._depthMix.buffer.byteLength === 0) {\n this._depthMix = new BigInt64Array(paddedCount);\n }\n }\n\n /**\n * Sends the active source-splat intervals to the sort worker. When no range filter is active,\n * a single interval covering all source splats is sent so the worker never assumes the full set.\n */\n private _postIntervalsToWorker(): void {\n if (!this._worker) {\n return;\n }\n const intervals = this._activeSplatRanges ? new Uint32Array(this._activeSplatRanges) : new Uint32Array([0, this._vertexCount]);\n this._worker.postMessage({ command: GaussianSplattingSortWorkerCommand.INTERVALS, intervals }, [intervals.buffer]);\n }\n\n /**\n * Initializes this mesh to render from an externally-provided, GPU-decoded work buffer, bypassing the\n * CPU `updateData` path. The four textures must hold the standard decoded GS layout addressed by linear\n * splat index over a square texture: centers (x,y,z,1), covariance A (Sigma00,01,02,11) and B\n * (Sigma12,22,*,*) as full covariance (so `center.w` is 1), and RGBA color. `splatPositions` are the\n * stride-4 CPU centers consumed by the depth-sort worker.\n * @param centers centers texture\n * @param covariancesA covariance A texture\n * @param covariancesB covariance B texture\n * @param colors color texture\n * @param splatPositions stride-4 CPU centers for depth sorting (length vertexCount*4)\n * @param vertexCount number of splats addressable in the work buffer\n * @param shTextures optional baked higher-order SH textures (packed-u32) produced by the work buffer's SH decode.\n * When provided, the draw path lights the decoded splats with view-dependent SH (the non-SOG `shTexture0..N`\n * path). `shDegree` sets both the max and active SH degree.\n * @param shDegree SH degree of the baked SH textures (0 = none). Ignored when `shTextures` is empty/omitted.\n * @param rotationTextures optional decoded rotation/scale textures ([rotA, rotB, rotScale]) produced by the work\n * buffer's rotation decode. When provided, they drive the voxel-IBL rotation/scale samplers so the streamed\n * splats participate in voxel-based IBL shadowing.\n */\n protected _setExternalWorkBuffer(\n centers: BaseTexture,\n covariancesA: BaseTexture,\n covariancesB: BaseTexture,\n colors: BaseTexture,\n splatPositions: Float32Array,\n vertexCount: number,\n shTextures?: Nullable<BaseTexture[]>,\n shDegree: number = 0,\n rotationTextures?: Nullable<BaseTexture[]>\n ): void {\n this._covariancesATexture = covariancesA;\n this._covariancesBTexture = covariancesB;\n this._centersTexture = centers;\n this._colorsTexture = colors;\n this._splatPositions = splatPositions;\n this._vertexCount = vertexCount;\n if (shTextures && shTextures.length) {\n this._shTextures = shTextures;\n this._maxShDegree = shDegree;\n this._shDegree = shDegree;\n }\n // Point the voxel-IBL rotation/scale samplers at the work buffer's decoded rotation textures ([rotA, rotB,\n // rotScale]) so a standalone stream can cast/receive voxel-IBL shadows.\n if (rotationTextures && rotationTextures.length >= 3) {\n this._rotationsATexture = rotationTextures[0];\n this._rotationsBTexture = rotationTextures[1];\n this._rotationScaleTexture = rotationTextures[2];\n this._needsRotationScaleTextures = true;\n }\n this._activeSplatRanges = null;\n this._activeSplatRangeKey = \"\";\n this._activeSplatRenderCount = 0;\n this._readyToDisplay = false;\n // Sizes _splatIndex/_depthMix, starts the sort worker, and posts positions + intervals.\n this._instantiateWorker();\n // updateData (bypassed here) normally enables the mesh; do it explicitly for the work-buffer path.\n this.setEnabled(true);\n }\n\n /**\n * returns the splats data array buffer that contains in order : postions (3 floats), size (3 floats), color (4 bytes), orientation quaternion (4 bytes)\n * Only available if the mesh was created with keepInRam: true\n */\n public get splatsData() {\n return this._keepInRam ? this._splatsData : null;\n }\n\n /**\n * returns the SH data arrays\n * Only available if the mesh was created with keepInRam: true\n */\n public get shData() {\n return this._keepInRam ? this._shData : null;\n }\n\n /**\n * Returns the min/max size range of splats in this mesh, where size is pow(|det(Σ)|, 1/6)\n * of the 3D covariance matrix — equivalent to the geometric mean of the principal radii.\n * Computed automatically during updateData(). Returns null before any data has been loaded.\n */\n public get splatSizeRange(): Nullable<{ min: number; max: number }> {\n if (!isFinite(this._splatSizeMin) || !isFinite(this._splatSizeMax)) {\n return null;\n }\n return { min: this._splatSizeMin, max: this._splatSizeMax };\n }\n\n /**\n * Set the number of batch (a batch is 16384 splats) after which a display update is performed\n * A value of 0 (default) means display update will not happens before splat is ready.\n */\n public static ProgressiveUpdateAmount = 0;\n\n /**\n * Gets the covariancesA texture\n */\n public get covariancesATexture() {\n return this._covariancesATexture;\n }\n\n /**\n * Gets the covariancesB texture\n */\n public get covariancesBTexture() {\n return this._covariancesBTexture;\n }\n\n /**\n * Gets the centers texture\n */\n public get centersTexture() {\n return this._centersTexture;\n }\n\n /**\n * Gets the colors texture\n */\n public get colorsTexture() {\n return this._colorsTexture;\n }\n\n /**\n * Gets the rotation matrix A texture (rotation elements m[0],m[1],m[2],m[4])\n */\n public get rotationsATexture() {\n return this._rotationsATexture;\n }\n\n /**\n * Gets the rotation matrix B texture (rotation elements m[5],m[6],m[8],m[9])\n */\n public get rotationsBTexture() {\n return this._rotationsBTexture;\n }\n\n /**\n * Gets the rotation scale texture (rotation element m[10] followed by scale diagonal sx,sy,sz)\n */\n public get rotationScaleTexture() {\n return this._rotationScaleTexture;\n }\n\n /**\n * Enables or disables generation of rotation and scale matrix textures, required for voxel-based IBL shadows.\n */\n public get needsRotationScaleTextures() {\n return this._needsRotationScaleTextures;\n }\n\n public set needsRotationScaleTextures(value: boolean) {\n if (this._needsRotationScaleTextures === value) {\n return;\n }\n this._needsRotationScaleTextures = value;\n if (value && this._covariancesATexture) {\n if (this._splatsData) {\n this.updateData(this._splatsData, this._shData ?? undefined, { flipY: false }, undefined, this._shDegree);\n } else {\n Logger.Error(\n \"GaussianSplattingMeshBase: needsRotationScaleTextures was enabled after the mesh was already loaded, but the splat data is not kept in RAM. \" +\n \"The rotation and scale matrix textures cannot be initialized. Please reload the mesh data via updateData() or construct with keepInRam=true.\"\n );\n }\n }\n }\n\n /**\n * Gets the SH textures\n */\n public get shTextures() {\n return this._shTextures;\n }\n\n /**\n * True when this mesh holds raw SOG webp textures (dequantized in-shader) rather than the\n * pre-decoded covariance/center/color textures produced by the standard splat loader.\n */\n public get useSog(): boolean {\n return this._useSog;\n }\n\n /**\n * SOG dequantization parameters paired with the raw textures.\n * Set by the splat loader when `useSogTextures: true`. Null otherwise.\n */\n public get sogParams(): Nullable<ISogPackInternal> {\n return this._sogParams;\n }\n\n /**\n * Install a set of raw SOG webp textures and bind the mesh to the in-shader dequantization path.\n * @param pack SOG texture pack produced by ParseSogMetaAsTextures.\n * @internal\n */\n public setSogTextureData(pack: ISogPackInternal): void {\n this._useSog = true;\n this._sogParams?.codebookTexture?.dispose();\n this._sogParams = pack;\n this._vertexCount = pack.splatCount;\n this._shDegree = pack.shDegree ?? 0;\n this._maxShDegree = this._shDegree;\n\n // Stride-4 (xyz + 1) — required by the depth-sort worker and the centers texture path.\n this._splatPositions = pack.positions;\n\n // Reuse existing texture slots for SOG textures (the shader, under USE_SOG, samples them as RGBA8).\n this._covariancesATexture?.dispose();\n this._covariancesBTexture?.dispose();\n this._centersTexture?.dispose();\n this._colorsTexture?.dispose();\n this._rotationsATexture?.dispose();\n if (this._shTextures) {\n for (const t of this._shTextures) {\n t.dispose();\n }\n }\n\n this._centersTexture = pack.meansTextureL;\n this._covariancesATexture = pack.meansTextureU;\n this._covariancesBTexture = pack.scalesTexture;\n this._rotationsATexture = pack.quatsTexture;\n this._colorsTexture = pack.sh0Texture;\n\n const shTextures: BaseTexture[] = [];\n if (pack.shCentroidsTexture) {\n shTextures.push(pack.shCentroidsTexture);\n }\n if (pack.shLabelsTexture) {\n shTextures.push(pack.shLabelsTexture);\n }\n this._shTextures = shTextures.length ? shTextures : null;\n\n // Force pipeline rebuild so the USE_SOG define and extra samplers are picked up.\n this._material?.resetDrawCache();\n\n const size = pack.meansTextureL.getSize();\n this._textureSize.x = size.width;\n this._textureSize.y = size.height;\n\n this._updateSplatIndexBuffer(this._vertexCount);\n this._instantiateWorker();\n\n // Compute bounds from the CPU-decoded positions (stride-4) so the mesh is not frustum-culled.\n const positions = pack.positions as Float32Array;\n const minimum = new Vector3(Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY);\n const maximum = new Vector3(Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY);\n for (let i = 0; i < this._vertexCount; i++) {\n const x = positions[i * 4 + 0];\n const y = positions[i * 4 + 1];\n const z = positions[i * 4 + 2];\n if (x < minimum.x) {\n minimum.x = x;\n }\n if (y < minimum.y) {\n minimum.y = y;\n }\n if (z < minimum.z) {\n minimum.z = z;\n }\n if (x > maximum.x) {\n maximum.x = x;\n }\n if (y > maximum.y) {\n maximum.y = y;\n }\n if (z > maximum.z) {\n maximum.z = z;\n }\n }\n this.getBoundingInfo().reConstruct(minimum, maximum, this.getWorldMatrix());\n this.setEnabled(true);\n this._sortIsDirty = true;\n }\n\n /**\n * Gets the kernel size\n * Documentation and mathematical explanations here:\n * https://github.com/graphdeco-inria/gaussian-splatting/issues/294#issuecomment-1772688093\n * https://github.com/autonomousvision/mip-splatting/issues/18#issuecomment-1929388931\n */\n public get kernelSize() {\n return this._material instanceof GaussianSplattingMaterial ? this._material.kernelSize : 0;\n }\n\n /**\n * Get the compensation state\n */\n public get compensation() {\n return this._material instanceof GaussianSplattingMaterial ? this._material.compensation : false;\n }\n\n /**\n * Minimum projected splat size, in pixels, below which a splat is discarded (0 = disabled).\n * Applied in real time; no rebuild required.\n */\n public get minPixelSize(): number {\n return this._material instanceof GaussianSplattingMaterial ? this._material.minPixelSize : 0;\n }\n\n public set minPixelSize(value: number) {\n if (this._material instanceof GaussianSplattingMaterial) {\n this._material.minPixelSize = Math.max(0, value);\n }\n }\n\n private _loadingPromise: Promise<void> | null = null;\n\n /**\n * Sets the rendering material and updates camera views. Notifies material-change observers when the material changes.\n */\n public override set material(value: Nullable<Material>) {\n const previous = this._material;\n this._material = value;\n if (value) {\n value.backFaceCulling = false;\n value.cullBackFaces = false;\n value.resetDrawCache();\n }\n this._cameraViewInfos?.forEach((cameraViewInfo) => {\n cameraViewInfo.mesh.material = value;\n });\n if (previous !== value && this.onMaterialChangedObservable.hasObservers()) {\n this.onMaterialChangedObservable.notifyObservers(this);\n }\n }\n\n /**\n * get rendering material\n */\n public override get material(): Nullable<Material> {\n return this._material;\n }\n\n private static _MakeSplatGeometryForMesh(mesh: Mesh): void {\n const vertexData = new VertexData();\n const originPositions = [-2, -2, 0, 2, -2, 0, 2, 2, 0, -2, 2, 0];\n const originIndices = [0, 1, 2, 0, 2, 3];\n const positions = [];\n const indices = [];\n for (let i = 0; i < GaussianSplattingMeshBase._BatchSize; i++) {\n for (let j = 0; j < 12; j++) {\n if (j == 2 || j == 5 || j == 8 || j == 11) {\n positions.push(i); // local splat index\n } else {\n positions.push(originPositions[j]);\n }\n }\n indices.push(originIndices.map((v) => v + i * 4));\n }\n\n vertexData.positions = positions;\n vertexData.indices = indices.flat();\n\n vertexData.applyToMesh(mesh);\n }\n\n /**\n * Creates a new gaussian splatting mesh\n * @param name defines the name of the mesh\n * @param url defines the url to load from (optional)\n * @param scene defines the hosting scene (optional)\n * @param keepInRam keep datas in ram for editing purpose\n */\n constructor(name: string, url: Nullable<string> = null, scene: Nullable<Scene> = null, keepInRam: boolean = false) {\n super(name, scene);\n\n this.subMeshes = [];\n new SubMesh(0, 0, 4 * GaussianSplattingMeshBase._BatchSize, 0, 6 * GaussianSplattingMeshBase._BatchSize, this);\n\n this.setEnabled(false);\n // webGL2 and webGPU support for RG texture with float16 is fine. not webGL1\n this._useRGBACovariants = !this.getEngine().isWebGPU && this.getEngine().version === 1.0;\n _AcquireGsInterFrameYield(this.getEngine());\n\n this._keepInRam = keepInRam;\n if (url) {\n this._loadingPromise = this.loadFileAsync(url);\n }\n const gaussianSplattingMaterial = new GaussianSplattingMaterial(this.name + \"_material\", this._scene);\n // Cast is safe: GaussianSplattingMeshBase is @internal; all concrete instances are GaussianSplattingMesh.\n gaussianSplattingMaterial.setSourceMesh(this as any);\n gaussianSplattingMaterial.doNotSerialize = true;\n this._material = gaussianSplattingMaterial;\n\n // delete meshes created for cameras on camera removal\n this._scene.onCameraRemovedObservable.add((camera: Camera) => {\n const cameraId = camera.uniqueId;\n // delete mesh for this camera\n const cameraViewInfos = this._cameraViewInfos.get(cameraId);\n if (cameraViewInfos) {\n // If the cached shadow-caster geometry came from the mesh we're disposing, drop it\n // so isReady()/render() re-cache it from a surviving camera (see isReady()).\n // Must run before dispose(), which nulls the inner mesh's geometry.\n if (this._geometry === cameraViewInfos.mesh.geometry) {\n this._geometry = null;\n }\n cameraViewInfos.mesh.dispose();\n this._cameraViewInfos.delete(cameraId);\n }\n });\n }\n\n /**\n * Get the loading promise when loading the mesh from a URL in the constructor\n * @returns constructor loading promise or null if no URL was provided\n */\n public getLoadingPromise(): Promise<void> | null {\n return this._loadingPromise;\n }\n\n /** @internal */\n public override get _isGaussianSplatting(): boolean {\n return true;\n }\n\n /**\n * Returns the class name\n * @returns \"GaussianSplattingMeshBase\"\n */\n public override getClassName(): string {\n return \"GaussianSplattingMeshBase\";\n }\n\n /**\n * Returns the total number of vertices (splats) within the mesh\n * @returns the total number of vertices\n */\n public override getTotalVertices(): number {\n return this._vertexCount;\n }\n\n /**\n * Is this node ready to be used/rendered\n * @param completeCheck defines if a complete check (including materials and lights) has to be done (false by default)\n * @returns true when ready\n */\n public override isReady(completeCheck = false): boolean {\n const sortRequired = this._isSortRequired();\n if (!super.isReady(sortRequired && completeCheck, true)) {\n return false;\n }\n\n if (!sortRequired && !this._geometry) {\n this._postToWorker();\n }\n if (sortRequired && !this._readyToDisplay) {\n // mesh is ready when worker has done at least 1 sorting\n this._postToWorker(true);\n return false;\n }\n\n // Before the first successful render, require an applied index buffer. A pending refresh can\n // use the latest completed buffer, otherwise a transform changed every frame would starve the\n // first render. Once rendered, the render loop continuously re-sorts as the camera/world changes.\n if (sortRequired && !this._hasRenderedOnce && !this._disableDepthSort) {\n const cameras = this._scene.activeCameras?.length ? this._scene.activeCameras : [this._scene.activeCamera!];\n const canRenderWithPendingRefresh = this._scene._isInRenderingMeshEvaluation() && cameras.filter((camera) => camera !== null).length === 1;\n const worldMatrix = this.computeWorldMatrix(true);\n let sortBufferMissing = false;\n let sortRefreshPending = false;\n let worldMatrixDirty = false;\n for (const camera of cameras) {\n if (!camera) {\n continue;\n }\n\n const cameraViewInfo = this._cameraViewInfos.get(camera.uniqueId);\n if (!cameraViewInfo || !cameraViewInfo.splatIndexBufferSet || cameraViewInfo.sortAppliedId === 0) {\n sortBufferMissing = true;\n continue;\n }\n\n if (cameraViewInfo.sortAppliedId !== cameraViewInfo.sortRequestId) {\n sortRefreshPending = true;\n continue;\n }\n\n // If world matrix drifted (user applied transforms after load), request an updated sort.\n // Camera drift is intentionally excluded here: checking camera movement would cause isReady()\n // to return false indefinitely while the camera is moving. The render loop handles camera\n // re-sorting continuously via _postToWorker() in render().\n if (this._isSortStateDirty(cameraViewInfo, worldMatrix, camera, true)) {\n worldMatrixDirty = true;\n }\n }\n\n if (sortBufferMissing || sortRefreshPending || worldMatrixDirty) {\n // Try to post any pending sort so subsequent polling iterations make progress.\n this._postToWorker(true);\n // A single-camera scene may use its latest completed sort while a transform refresh is\n // pending, which prevents continuously changing transforms from starving the first render.\n // Multi-camera scenes must wait because each viewport needs its own refreshed ordering.\n if (sortBufferMissing || !canRenderWithPendingRefresh) {\n return false;\n }\n }\n }\n\n // Attach the splat geometry to the GS top mesh so that the shadow generator (which renders\n // shadow casters via the top mesh's subMeshes, NOT through this mesh's render() override)\n // has valid geometry on the very first shadow pass. Without this, the first shadow render\n // happens before render() is called and the GS produces no shadow caster output.\n if (!this._geometry && this._cameraViewInfos.size) {\n this._geometry = this._cameraViewInfos.values().next().value!.mesh.geometry;\n }\n\n // If the material declares a shadow depth wrapper, make sure its effect is compiled for\n // each subMesh against the scene's shadow generators. Otherwise the first shadow pass\n // would be skipped (ShadowGenerator.isReady would return false) and we'd miss the shadow\n // on a renderCount=1 capture.\n // The shadow generator's depth wrapper is standalone (it wraps a ShaderMaterial), so its\n // isReadyForSubMesh path stamps an effect on subMesh._drawWrappers[engine.currentRenderPassId].\n // If we leave currentRenderPassId set to the main pass while doing this, we'd overwrite the\n // GS material's defines on the main draw wrapper, causing the GS material to recreate its\n // defines on the next call and lose any plugin-driven define state (e.g. defines toggled\n // by a MaterialPluginBase.isReadyForSubMesh override). Temporarily switch to each shadow\n // generator's render pass id while preparing it (matches the pattern used in Mesh.isReady).\n if (this.material && this.material.shadowDepthWrapper) {\n const engine = this._scene.getEngine();\n const previousRenderPassId = engine.currentRenderPassId;\n try {\n for (const light of this._scene.lights) {\n const shadowGenerator = light.getShadowGenerator();\n if (!shadowGenerator) {\n continue;\n }\n const shadowMap = shadowGenerator.getShadowMap();\n const renderPassIds = shadowMap?.renderPassIds;\n if (!renderPassIds || renderPassIds.length === 0) {\n continue;\n }\n for (let p = 0; p < renderPassIds.length; ++p) {\n engine.currentRenderPassId = renderPassIds[p];\n for (const subMesh of this.subMeshes) {\n if (!shadowGenerator.isReady(subMesh, true, false)) {\n return false;\n }\n }\n }\n }\n } finally {\n engine.currentRenderPassId = previousRenderPassId;\n }\n }\n\n return true;\n }\n\n public _getCameraDirection(camera: Camera): Vector3 {\n const cameraViewMatrix = camera.getViewMatrix();\n const cameraProjectionMatrix = camera.getProjectionMatrix();\n const cameraViewProjectionMatrix = TmpVectors.Matrix[0];\n cameraViewMatrix.multiplyToRef(cameraProjectionMatrix, cameraViewProjectionMatrix);\n\n const modelMatrix = this.computeWorldMatrix(true);\n const modelViewMatrix = TmpVectors.Matrix[1];\n modelMatrix.multiplyToRef(cameraViewMatrix, modelViewMatrix);\n modelMatrix.multiplyToRef(cameraViewProjectionMatrix, this._modelViewProjectionMatrix);\n\n // return vector used to compute distance to camera\n const localDirection = TmpVectors.Vector3[1];\n localDirection.set(modelViewMatrix.m[2], modelViewMatrix.m[6], modelViewMatrix.m[10]);\n localDirection.normalize();\n\n return localDirection;\n }\n\n private _isSortStateDirty(cameraViewInfo: ICameraViewInfo, worldMatrix: Matrix, camera: Camera, worldMatrixOnly = false): boolean {\n const world = worldMatrix.m;\n const previousWorld = cameraViewInfo.sortWorldMatrix.m;\n for (let i = 0; i < previousWorld.length; i++) {\n if (!Scalar.WithinEpsilon(previousWorld[i], world[i], this.viewUpdateThreshold)) {\n return true;\n }\n }\n\n if (worldMatrixOnly) {\n return false;\n }\n\n const cameraViewMatrix = camera.getViewMatrix();\n if (\n !Scalar.WithinEpsilon(cameraViewInfo.sortCameraForward.x, cameraViewMatrix.m[2], this.viewUpdateThreshold) ||\n !Scalar.WithinEpsilon(cameraViewInfo.sortCameraForward.y, cameraViewMatrix.m[6], this.viewUpdateThreshold) ||\n !Scalar.WithinEpsilon(cameraViewInfo.sortCameraForward.z, cameraViewMatrix.m[10], this.viewUpdateThreshold)\n ) {\n return true;\n }\n\n const cameraPosition = camera.globalPosition;\n return (\n !Scalar.WithinEpsilon(cameraViewInfo.sortCameraPosition.x, cameraPosition.x, this.viewUpdateThreshold) ||\n !Scalar.WithinEpsilon(cameraViewInfo.sortCameraPosition.y, cameraPosition.y, this.viewUpdateThreshold) ||\n !Scalar.WithinEpsilon(cameraViewInfo.sortCameraPosition.z, cameraPosition.z, this.viewUpdateThreshold)\n );\n }\n\n /** @internal */\n public _postToWorker(forced = false): void {\n const scene = this._scene;\n const frameId = scene.getFrameId();\n // force update or at least frame update for camera is outdated\n let outdated = false;\n this._cameraViewInfos.forEach((cameraViewInfos) => {\n if (cameraViewInfos.frameIdLastUpdate !== frameId) {\n outdated = true;\n }\n });\n\n // array of cameras used for rendering\n const cameras = this._scene.activeCameras?.length ? this._scene.activeCameras : [this._scene.activeCamera!];\n // list view infos for active cameras\n const activeViewInfos: ICameraViewInfo[] = [];\n cameras.forEach((camera) => {\n if (!camera) {\n return;\n }\n const cameraId = camera.uniqueId;\n\n const cameraViewInfos = this._cameraViewInfos.get(cameraId);\n if (cameraViewInfos) {\n activeViewInfos.push(cameraViewInfos);\n } else {\n // mesh doesn't exist yet for this camera\n const cameraMesh = new Mesh(this.name + \"_cameraMesh_\" + cameraId, this._scene);\n cameraMesh.doNotSerialize = true;\n // not visible with inspector or the scene graph\n cameraMesh.reservedDataStore = { hidden: true, _gaussianSplattingSourceMesh: this };\n cameraMesh.setEnabled(false);\n cameraMesh.material = this.material;\n if (cameraMesh.material && cameraMesh.material instanceof GaussianSplattingMaterial) {\n const gsMaterial = cameraMesh.material as GaussianSplattingMaterial;\n // GaussianSplattingMaterial source mesh may not have been set yet.\n // This happens for cloned resources from asset containers for instance,\n // where material is cloned before mesh.\n if (!gsMaterial.getSourceMesh()) {\n // Cast is safe: see constructor comment above.\n gsMaterial.setSourceMesh(this as any);\n }\n }\n GaussianSplattingMeshBase._MakeSplatGeometryForMesh(cameraMesh);\n\n const newViewInfos: ICameraViewInfo = {\n camera: camera,\n cameraDirection: new Vector3(0, 0, 0),\n sortWorldMatrix: Matrix.Identity(),\n sortCameraForward: new Vector3(0, 0, 0),\n sortCameraPosition: new Vector3(0, 0, 0),\n sortRequestId: 0,\n sortAppliedId: 0,\n mesh: cameraMesh,\n frameIdLastUpdate: frameId,\n splatIndexBufferSet: false,\n };\n activeViewInfos.push(newViewInfos);\n this._cameraViewInfos.set(cameraId, newViewInfos);\n }\n });\n // Sort view infos: cameras without a completed initial sort come first so they don't get starved\n // by a `forced` re-sort of an already-initialized camera (which would consume `_canPostToWorker`).\n // A camera can already have the shared index buffer bound when another camera's first sort resizes it,\n // so splatIndexBufferSet alone does not mean this camera has received its own sorted result.\n // Among initialized cameras, the least recently updated comes first.\n activeViewInfos.sort((a, b) => {\n if ((a.sortAppliedId === 0) !== (b.sortAppliedId === 0)) {\n return a.sortAppliedId === 0 ? -1 : 1;\n }\n if (a.splatIndexBufferSet !== b.splatIndexBufferSet) {\n return a.splatIndexBufferSet ? 1 : -1;\n }\n return a.frameIdLastUpdate - b.frameIdLastUpdate;\n });\n\n // The native sort writes into _splatPositions/_splatIndex: both must be allocated (they still are\n // null before any splat data has been committed) or the native binding throws on the conversion.\n const hasNativeSort = !!Native?.sortSplats && !!this._splatPositions && !!this._splatIndex;\n // When depth sort is disabled, no sort function must run: fall through to the no-sort path below.\n const sortRequired = this._isSortRequired();\n const hasSortFunction = sortRequired && !this._disableDepthSort && (this._worker || hasNativeSort);\n // A forced sort (new data or parts) requested while no classic pass needs sorting (e.g. point\n // splatting) is deferred to the next classic pass; the camera and world may be unchanged by then.\n if (forced && !sortRequired && !this._disableDepthSort) {\n this._forcedSortPending = true;\n } else if (hasSortFunction && this._forcedSortPending) {\n forced = true;\n }\n if ((forced || outdated) && hasSortFunction && (this._scene.activeCameras?.length || this._scene.activeCamera) && this._canPostToWorker) {\n const worldMatrix = this.computeWorldMatrix(true);\n // view infos sorted by least recent updated frame id\n activeViewInfos.forEach((cameraViewInfos) => {\n const camera = cameraViewInfos.camera;\n const cameraDirection = this._getCameraDirection(camera);\n if ((forced || this._isSortStateDirty(cameraViewInfos, worldMatrix, camera)) && this._canPostToWorker) {\n const cameraViewMatrix = camera.getViewMatrix();\n cameraViewInfos.cameraDirection.copyFrom(cameraDirection);\n cameraViewInfos.sortWorldMatrix.copyFrom(worldMatrix);\n cameraViewInfos.sortCameraForward.set(cameraViewMatrix.m[2], cameraViewMatrix.m[6], cameraViewMatrix.m[10]);\n cameraViewInfos.sortCameraPosition.copyFrom(camera.globalPosition);\n cameraViewInfos.sortRequestId = ++this._sortRequestId;\n cameraViewInfos.frameIdLastUpdate = frameId;\n this._canPostToWorker = false;\n this._forcedSortPending = false;\n if (this._worker) {\n this._worker.postMessage(\n {\n command: GaussianSplattingSortWorkerCommand.SORT,\n worldMatrix: worldMatrix.m,\n cameraForward: [cameraViewMatrix.m[2], cameraViewMatrix.m[6], cameraViewMatrix.m[10]],\n cameraPosition: [camera.globalPosition.x, camera.globalPosition.y, camera.globalPosition.z],\n depthMix: this._depthMix,\n cameraId: camera.uniqueId,\n sortRequestId: cameraViewInfos.sortRequestId,\n rangeVersion: this._activeRangeVersion,\n useCountingSort: GaussianSplattingMeshBase.UseCountingSort,\n rightHanded: this._scene.useRightHandedSystem,\n logSortPerformance: GaussianSplattingMeshBase.LogSortPerformance,\n },\n [this._depthMix.buffer]\n );\n } else if (Native?.sortSplats) {\n if (this._activeSplatRanges) {\n // Native sort can't filter ranges: fall back to the (already range-filtered) identity index buffer.\n this._updateSplatIndexBuffer(this._vertexCount);\n } else {\n Native.sortSplats(this._modelViewProjectionMatrix, this._splatPositions!, this._splatIndex!, this._scene.useRightHandedSystem);\n }\n if (cameraViewInfos.splatIndexBufferSet) {\n cameraViewInfos.mesh.thinInstanceBufferUpdated(\"splatIndex\");\n } else {\n cameraViewInfos.mesh.thinInstanceSetBuffer(\"splatIndex\", this._splatIndex, 16, false);\n cameraViewInfos.splatIndexBufferSet = true;\n }\n cameraViewInfos.sortAppliedId = cameraViewInfos.sortRequestId;\n this._canPostToWorker = true;\n this._readyToDisplay = true;\n }\n }\n });\n } else if (this._disableDepthSort || !sortRequired) {\n // ShadowGenerator bypasses render()/isReady(), so its atlas cannot wait for a deferred camera sort.\n if (this._delayedTextureUpdate) {\n this._updateSplatIndexBuffer(this._vertexCount);\n this._cameraViewInfos.forEach((info) => {\n if (info.splatIndexBufferSet) {\n info.mesh.thinInstanceBufferUpdated(\"splatIndex\");\n }\n });\n this._commitDelayedTextureUpdate();\n }\n if (this._splatIndex) {\n activeViewInfos.forEach((cameraViewInfos) => {\n if (!cameraViewInfos.splatIndexBufferSet) {\n cameraViewInfos.mesh.thinInstanceSetBuffer(\"splatIndex\", this._splatIndex, 16, false);\n cameraViewInfos.splatIndexBufferSet = true;\n }\n });\n this._readyToDisplay = true;\n }\n // With a worker, the gate is owned by in-flight sorts and rebuilds; their completion unlocks it.\n if (this._disableDepthSort || !this._worker) {\n this._canPostToWorker = true;\n }\n }\n }\n /**\n * Triggers the draw call for the mesh. Usually, you don't need to call this method by your own because the mesh rendering is handled by the scene rendering manager\n * @param subMesh defines the subMesh to render\n * @param enableAlphaMode defines if alpha mode can be changed\n * @param effectiveMeshReplacement defines an optional mesh used to provide info for the rendering\n * @returns the current mesh\n */\n public override render(subMesh: SubMesh, enableAlphaMode: boolean, effectiveMeshReplacement?: AbstractMesh): Mesh {\n let beforeNotified = false;\n if (!this._isSortRequired()) {\n this.onBeforeRenderObservable.notifyObservers(this);\n beforeNotified = true;\n if (this._drawPointPass(enableAlphaMode)) {\n this.onAfterRenderObservable.notifyObservers(this);\n return this;\n }\n }\n this._postToWorker();\n\n // geometry used for shadows, bind the first found in the camera view infos\n if (!this._geometry && this._cameraViewInfos.size) {\n this._geometry = this._cameraViewInfos.values().next().value!.mesh.geometry;\n }\n\n const cameraId = this._scene.activeCamera!.uniqueId;\n const cameraViewInfos = this._cameraViewInfos.get(cameraId);\n if (!cameraViewInfos || !cameraViewInfos.splatIndexBufferSet) {\n if (beforeNotified) {\n this.onAfterRenderObservable.notifyObservers(this);\n }\n return this;\n }\n\n if (!beforeNotified && this.onBeforeRenderObservable) {\n this.onBeforeRenderObservable.notifyObservers(this);\n }\n const mesh = cameraViewInfos.mesh;\n mesh.getWorldMatrix().copyFrom(this.getWorldMatrix());\n\n // Propagate render pass material overrides (e.g., GPU picking) to the inner camera mesh.\n // When this mesh is rendered into a RenderTargetTexture with a material override (via setMaterialForRendering),\n // the override is set on this proxy mesh but needs to be applied to the actual camera mesh that does the rendering.\n const engine = this._scene.getEngine();\n const renderPassId = engine.currentRenderPassId;\n const renderPassMaterial = this.getMaterialForRenderPass(renderPassId);\n if (renderPassMaterial) {\n mesh.setMaterialForRenderPass(renderPassId, renderPassMaterial);\n }\n\n const ret = this._drawColorPass(mesh, subMesh, enableAlphaMode, effectiveMeshReplacement);\n\n this._hasRenderedOnce = true;\n\n // Clean up the temporary override to avoid affecting other render passes\n if (renderPassMaterial) {\n mesh.setMaterialForRenderPass(renderPassId, undefined);\n }\n\n if (this.onAfterRenderObservable) {\n this.onAfterRenderObservable.notifyObservers(this);\n }\n return ret;\n }\n\n /**\n * Draws the inner per-camera mesh for one render pass. Subclasses may replace selected passes.\n * @param mesh inner per-camera mesh carrying the sorted splat geometry\n * @param subMesh the submesh to draw\n * @param enableAlphaMode whether alpha mode can be changed\n * @param effectiveMeshReplacement optional mesh providing render info\n * @returns the drawn mesh\n */\n protected _drawColorPass(mesh: Mesh, subMesh: SubMesh, enableAlphaMode: boolean, effectiveMeshReplacement?: AbstractMesh): Mesh {\n return mesh.render(subMesh, enableAlphaMode, effectiveMeshReplacement);\n }\n\n /**\n * Whether the current pass needs classic sorted splat geometry.\n * @returns whether classic sorting is required\n */\n protected _isSortRequired(): boolean {\n return true;\n }\n\n /**\n * Handles a compute-owned pass before allocating or waiting for sorted geometry.\n * @param _enableAlphaMode whether alpha mode can be changed\n * @returns whether the pass was handled\n */\n protected _drawPointPass(_enableAlphaMode: boolean): boolean {\n return false;\n }\n\n private static _TypeNameToEnum(name: string): PLYType {\n switch (name) {\n case \"float\":\n return PLYType.FLOAT;\n case \"int\":\n return PLYType.INT;\n case \"uint\":\n return PLYType.UINT;\n case \"double\":\n return PLYType.DOUBLE;\n case \"uchar\":\n return PLYType.UCHAR;\n case \"ushort\":\n case \"uint16\":\n return PLYType.USHORT;\n }\n return PLYType.UNDEFINED;\n }\n\n private static _ValueNameToEnum(name: string): PLYValue {\n switch (name) {\n case \"min_x\":\n return PLYValue.MIN_X;\n case \"min_y\":\n return PLYValue.MIN_Y;\n case \"min_z\":\n return PLYValue.MIN_Z;\n case \"max_x\":\n return PLYValue.MAX_X;\n case \"max_y\":\n return PLYValue.MAX_Y;\n case \"max_z\":\n return PLYValue.MAX_Z;\n case \"min_scale_x\":\n return PLYValue.MIN_SCALE_X;\n case \"min_scale_y\":\n return PLYValue.MIN_SCALE_Y;\n case \"min_scale_z\":\n return PLYValue.MIN_SCALE_Z;\n case \"max_scale_x\":\n return PLYValue.MAX_SCALE_X;\n case \"max_scale_y\":\n return PLYValue.MAX_SCALE_Y;\n case \"max_scale_z\":\n return PLYValue.MAX_SCALE_Z;\n case \"packed_position\":\n return PLYValue.PACKED_POSITION;\n case \"packed_rotation\":\n return PLYValue.PACKED_ROTATION;\n case \"packed_scale\":\n return PLYValue.PACKED_SCALE;\n case \"packed_color\":\n return PLYValue.PACKED_COLOR;\n case \"x\":\n return PLYValue.X;\n case \"y\":\n return PLYValue.Y;\n case \"z\":\n return PLYValue.Z;\n case \"scale_0\":\n return PLYValue.SCALE_0;\n case \"scale_1\":\n return PLYValue.SCALE_1;\n case \"scale_2\":\n return PLYValue.SCALE_2;\n case \"diffuse_red\":\n case \"red\":\n return PLYValue.DIFFUSE_RED;\n case \"diffuse_green\":\n case \"green\":\n return PLYValue.DIFFUSE_GREEN;\n case \"diffuse_blue\":\n case \"blue\":\n return PLYValue.DIFFUSE_BLUE;\n case \"f_dc_0\":\n return PLYValue.F_DC_0;\n case \"f_dc_1\":\n return PLYValue.F_DC_1;\n case \"f_dc_2\":\n return PLYValue.F_DC_2;\n case \"f_dc_3\":\n return PLYValue.F_DC_3;\n case \"opacity\":\n return PLYValue.OPACITY;\n case \"rot_0\":\n return PLYValue.ROT_0;\n case \"rot_1\":\n return PLYValue.ROT_1;\n case \"rot_2\":\n return PLYValue.ROT_2;\n case \"rot_3\":\n return PLYValue.ROT_3;\n case \"min_r\":\n return PLYValue.MIN_COLOR_R;\n case \"min_g\":\n return PLYValue.MIN_COLOR_G;\n case \"min_b\":\n return PLYValue.MIN_COLOR_B;\n case \"max_r\":\n return PLYValue.MAX_COLOR_R;\n case \"max_g\":\n return PLYValue.MAX_COLOR_G;\n case \"max_b\":\n return PLYValue.MAX_COLOR_B;\n case \"f_rest_0\":\n return PLYValue.SH_0;\n case \"f_rest_1\":\n return PLYValue.SH_1;\n case \"f_rest_2\":\n return PLYValue.SH_2;\n case \"f_rest_3\":\n return PLYValue.SH_3;\n case \"f_rest_4\":\n return PLYValue.SH_4;\n case \"f_rest_5\":\n return PLYValue.SH_5;\n case \"f_rest_6\":\n return PLYValue.SH_6;\n case \"f_rest_7\":\n return PLYValue.SH_7;\n case \"f_rest_8\":\n return PLYValue.SH_8;\n case \"f_rest_9\":\n return PLYValue.SH_9;\n case \"f_rest_10\":\n return PLYValue.SH_10;\n case \"f_rest_11\":\n return PLYValue.SH_11;\n case \"f_rest_12\":\n return PLYValue.SH_12;\n case \"f_rest_13\":\n return PLYValue.SH_13;\n case \"f_rest_14\":\n return PLYValue.SH_14;\n case \"f_rest_15\":\n return PLYValue.SH_15;\n case \"f_rest_16\":\n return PLYValue.SH_16;\n case \"f_rest_17\":\n return PLYValue.SH_17;\n case \"f_rest_18\":\n return PLYValue.SH_18;\n case \"f_rest_19\":\n return PLYValue.SH_19;\n case \"f_rest_20\":\n return PLYValue.SH_20;\n case \"f_rest_21\":\n return PLYValue.SH_21;\n case \"f_rest_22\":\n return PLYValue.SH_22;\n case \"f_rest_23\":\n return PLYValue.SH_23;\n case \"f_rest_24\":\n return PLYValue.SH_24;\n case \"f_rest_25\":\n return PLYValue.SH_25;\n case \"f_rest_26\":\n return PLYValue.SH_26;\n case \"f_rest_27\":\n return PLYValue.SH_27;\n case \"f_rest_28\":\n return PLYValue.SH_28;\n case \"f_rest_29\":\n return PLYValue.SH_29;\n case \"f_rest_30\":\n return PLYValue.SH_30;\n case \"f_rest_31\":\n return PLYValue.SH_31;\n case \"f_rest_32\":\n return PLYValue.SH_32;\n case \"f_rest_33\":\n return PLYValue.SH_33;\n case \"f_rest_34\":\n return PLYValue.SH_34;\n case \"f_rest_35\":\n return PLYValue.SH_35;\n case \"f_rest_36\":\n return PLYValue.SH_36;\n case \"f_rest_37\":\n return PLYValue.SH_37;\n case \"f_rest_38\":\n return PLYValue.SH_38;\n case \"f_rest_39\":\n return PLYValue.SH_39;\n case \"f_rest_40\":\n return PLYValue.SH_40;\n case \"f_rest_41\":\n return PLYValue.SH_41;\n case \"f_rest_42\":\n return PLYValue.SH_42;\n case \"f_rest_43\":\n return PLYValue.SH_43;\n case \"f_rest_44\":\n return PLYValue.SH_44;\n case \"f_rest_45\":\n return PLYValue.SH_45;\n case \"f_rest_46\":\n return PLYValue.SH_46;\n case \"f_rest_47\":\n return PLYValue.SH_47;\n case \"f_rest_48\":\n return PLYValue.SH_48;\n case \"f_rest_49\":\n return PLYValue.SH_49;\n case \"f_rest_50\":\n return PLYValue.SH_50;\n case \"f_rest_51\":\n return PLYValue.SH_51;\n case \"f_rest_52\":\n return PLYValue.SH_52;\n case \"f_rest_53\":\n return PLYValue.SH_53;\n case \"f_rest_54\":\n return PLYValue.SH_54;\n case \"f_rest_55\":\n return PLYValue.SH_55;\n case \"f_rest_56\":\n return PLYValue.SH_56;\n case \"f_rest_57\":\n return PLYValue.SH_57;\n case \"f_rest_58\":\n return PLYValue.SH_58;\n case \"f_rest_59\":\n return PLYValue.SH_59;\n case \"f_rest_60\":\n return PLYValue.SH_60;\n case \"f_rest_61\":\n return PLYValue.SH_61;\n case \"f_rest_62\":\n return PLYValue.SH_62;\n case \"f_rest_63\":\n return PLYValue.SH_63;\n case \"f_rest_64\":\n return PLYValue.SH_64;\n case \"f_rest_65\":\n return PLYValue.SH_65;\n case \"f_rest_66\":\n return PLYValue.SH_66;\n case \"f_rest_67\":\n return PLYValue.SH_67;\n case \"f_rest_68\":\n return PLYValue.SH_68;\n case \"f_rest_69\":\n return PLYValue.SH_69;\n case \"f_rest_70\":\n return PLYValue.SH_70;\n case \"f_rest_71\":\n return PLYValue.SH_71;\n }\n\n return PLYValue.UNDEFINED;\n }\n /**\n * Parse a PLY file header and returns metas infos on splats and chunks\n * @param data the loaded buffer\n * @returns a PLYHeader\n */\n static ParseHeader(data: ArrayBuffer): PLYHeader | null {\n const ubuf = new Uint8Array(data);\n const header = new TextDecoder().decode(ubuf.slice(0, 1024 * 10));\n const headerEnd = \"end_header\\n\";\n const headerEndIndex = header.indexOf(headerEnd);\n if (headerEndIndex < 0 || !header) {\n // standard splat\n return null;\n }\n const vertexCount = parseInt(/element vertex (\\d+)\\n/.exec(header)![1]);\n const chunkElement = /element chunk (\\d+)\\n/.exec(header);\n let chunkCount = 0;\n if (chunkElement) {\n chunkCount = parseInt(chunkElement[1]);\n }\n let rowVertexOffset = 0;\n let rowChunkOffset = 0;\n const offsets: Record<string, number> = {\n double: 8,\n int: 4,\n uint: 4,\n float: 4,\n short: 2,\n ushort: 2,\n uint16: 2,\n uchar: 1,\n list: 0,\n };\n\n const enum ElementMode {\n Vertex = 0,\n Chunk = 1,\n SH = 2,\n Unused = 3,\n }\n let chunkMode = ElementMode.Chunk;\n const vertexProperties: PlyProperty[] = [];\n const chunkProperties: PlyProperty[] = [];\n const filtered = header.slice(0, headerEndIndex).split(\"\\n\");\n let shDegree = 0;\n for (const prop of filtered) {\n if (prop.startsWith(\"property \")) {\n const [, typeName, name] = prop.split(\" \");\n\n const value = GaussianSplattingMeshBase._ValueNameToEnum(name);\n if (value != PLYValue.UNDEFINED) {\n // SH degree 1,2,3 or 4 for 9, 24, 45 or 72 values\n if (value >= PLYValue.SH_71) {\n shDegree = 4;\n } else if (value >= PLYValue.SH_44) {\n shDegree = Math.max(shDegree, 3);\n } else if (value >= PLYValue.SH_23) {\n shDegree = Math.max(shDegree, 2);\n } else if (value >= PLYValue.SH_8) {\n shDegree = Math.max(shDegree, 1);\n }\n }\n const type = GaussianSplattingMeshBase._TypeNameToEnum(typeName);\n if (chunkMode == ElementMode.Chunk) {\n chunkProperties.push({ value, type, offset: rowChunkOffset });\n rowChunkOffset += offsets[typeName];\n } else if (chunkMode == ElementMode.Vertex) {\n vertexProperties.push({ value, type, offset: rowVertexOffset });\n rowVertexOffset += offsets[typeName];\n } else if (chunkMode == ElementMode.SH) {\n // SH doesn't count for vertex row size but its properties are used to retrieve SH\n vertexProperties.push({ value, type, offset: rowVertexOffset });\n }\n\n if (!offsets[typeName]) {\n Logger.Warn(`Unsupported property type: ${typeName}.`);\n }\n } else if (prop.startsWith(\"element \")) {\n const [, type] = prop.split(\" \");\n if (type == \"chunk\") {\n chunkMode = ElementMode.Chunk;\n } else if (type == \"vertex\") {\n chunkMode = ElementMode.Vertex;\n } else if (type == \"sh\") {\n chunkMode = ElementMode.SH;\n } else {\n chunkMode = ElementMode.Unused;\n }\n }\n }\n\n const dataView = new DataView(data, headerEndIndex + headerEnd.length);\n const buffer = new ArrayBuffer(GaussianSplattingMeshBase._RowOutputLength * vertexCount);\n\n let shBuffer = null;\n let shCoefficientCount = 0;\n if (shDegree) {\n const shVectorCount = (shDegree + 1) * (shDegree + 1) - 1;\n shCoefficientCount = shVectorCount * 3;\n shBuffer = new ArrayBuffer(shCoefficientCount * vertexCount);\n }\n\n return {\n vertexCount: vertexCount,\n chunkCount: chunkCount,\n rowVertexLength: rowVertexOffset,\n rowChunkLength: rowChunkOffset,\n vertexProperties: vertexProperties,\n chunkProperties: chunkProperties,\n dataView: dataView,\n buffer: buffer,\n shDegree: shDegree,\n shCoefficientCount: shCoefficientCount,\n shBuffer: shBuffer,\n };\n }\n private static _GetCompressedChunks(header: PLYHeader, offset: { value: number }): Array<ICompressedPLYChunk> | null {\n if (!header.chunkCount) {\n return null;\n }\n const dataView = header.dataView;\n const compressedChunks = new Array<ICompressedPLYChunk>(header.chunkCount);\n for (let i = 0; i < header.chunkCount; i++) {\n const currentChunk = {\n min: new Vector3(),\n max: new Vector3(),\n minScale: new Vector3(),\n maxScale: new Vector3(),\n minColor: new Vector3(0, 0, 0),\n maxColor: new Vector3(1, 1, 1),\n };\n compressedChunks[i] = currentChunk;\n for (let propertyIndex = 0; propertyIndex < header.chunkProperties.length; propertyIndex++) {\n const property = header.chunkProperties[propertyIndex];\n let value;\n switch (property.type) {\n case PLYType.FLOAT:\n value = dataView.getFloat32(property.offset + offset.value, true);\n break;\n default:\n continue;\n }\n\n switch (property.value) {\n case PLYValue.MIN_X:\n currentChunk.min.x = value;\n break;\n case PLYValue.MIN_Y:\n currentChunk.min.y = value;\n break;\n case PLYValue.MIN_Z:\n currentChunk.min.z = value;\n break;\n case PLYValue.MAX_X:\n currentChunk.max.x = value;\n break;\n case PLYValue.MAX_Y:\n currentChunk.max.y = value;\n break;\n case PLYValue.MAX_Z:\n currentChunk.max.z = value;\n break;\n case PLYValue.MIN_SCALE_X:\n currentChunk.minScale.x = value;\n break;\n case PLYValue.MIN_SCALE_Y:\n currentChunk.minScale.y = value;\n break;\n case PLYValue.MIN_SCALE_Z:\n currentChunk.minScale.z = value;\n break;\n case PLYValue.MAX_SCALE_X:\n currentChunk.maxScale.x = value;\n break;\n case PLYValue.MAX_SCALE_Y:\n currentChunk.maxScale.y = value;\n break;\n case PLYValue.MAX_SCALE_Z:\n currentChunk.maxScale.z = value;\n break;\n case PLYValue.MIN_COLOR_R:\n currentChunk.minColor.x = value;\n break;\n case PLYValue.MIN_COLOR_G:\n currentChunk.minColor.y = value;\n break;\n case PLYValue.MIN_COLOR_B:\n currentChunk.minColor.z = value;\n break;\n case PLYValue.MAX_COLOR_R:\n currentChunk.maxColor.x = value;\n break;\n case PLYValue.MAX_COLOR_G:\n currentChunk.maxColor.y = value;\n break;\n case PLYValue.MAX_COLOR_B:\n currentChunk.maxColor.z = value;\n break;\n }\n }\n offset.value += header.rowChunkLength;\n }\n return compressedChunks;\n }\n\n private static _GetSplat(header: PLYHeader, index: number, compressedChunks: Array<ICompressedPLYChunk> | null, offset: { value: number }): void {\n const q = TmpVectors.Quaternion[0];\n const temp3 = TmpVectors.Vector3[0];\n\n const rowOutputLength = GaussianSplattingMeshBase._RowOutputLength;\n const buffer = header.buffer;\n const dataView = header.dataView;\n const position = new Float32Array(buffer, index * rowOutputLength, 3);\n const scale = new Float32Array(buffer, index * rowOutputLength + 12, 3);\n const rgba = new Uint8ClampedArray(buffer, index * rowOutputLength + 24, 4);\n const rot = new Uint8ClampedArray(buffer, index * rowOutputLength + 28, 4);\n let sh = null;\n if (header.shBuffer) {\n sh = new Uint8ClampedArray(header.shBuffer, index * header.shCoefficientCount, header.shCoefficientCount);\n }\n const chunkIndex = index >> 8;\n let r0: number = 255;\n let r1: number = 0;\n let r2: number = 0;\n let r3: number = 0;\n\n const plySH = [];\n\n for (let propertyIndex = 0; propertyIndex < header.vertexProperties.length; propertyIndex++) {\n const property = header.vertexProperties[propertyIndex];\n let value;\n switch (property.type) {\n case PLYType.FLOAT:\n value = dataView.getFloat32(offset.value + property.offset, true);\n break;\n case PLYType.INT:\n value = dataView.getInt32(offset.value + property.offset, true);\n break;\n case PLYType.UINT:\n value = dataView.getUint32(offset.value + property.offset, true);\n break;\n case PLYType.DOUBLE:\n value = dataView.getFloat64(offset.value + property.offset, true);\n break;\n case PLYType.UCHAR:\n value = dataView.getUint8(offset.value + property.offset);\n break;\n case PLYType.USHORT:\n value = FromHalfFloat(dataView.getUint16(offset.value + property.offset, true));\n break;\n default:\n continue;\n }\n\n switch (property.value) {\n case PLYValue.PACKED_POSITION:\n {\n const compressedChunk = compressedChunks![chunkIndex];\n Unpack111011(value, temp3);\n position[0] = Scalar.Lerp(compressedChunk.min.x, compressedChunk.max.x, temp3.x);\n position[1] = Scalar.Lerp(compressedChunk.min.y, compressedChunk.max.y, temp3.y);\n position[2] = Scalar.Lerp(compressedChunk.min.z, compressedChunk.max.z, temp3.z);\n }\n break;\n case PLYValue.PACKED_ROTATION:\n {\n UnpackRot(value, q);\n\n r0 = q.x;\n r1 = q.y;\n r2 = q.z;\n r3 = q.w;\n }\n break;\n case PLYValue.PACKED_SCALE:\n {\n const compressedChunk = compressedChunks![chunkIndex];\n Unpack111011(value, temp3);\n scale[0] = Math.exp(Scalar.Lerp(compressedChunk.minScale.x, compressedChunk.maxScale.x, temp3.x));\n scale[1] = Math.exp(Scalar.Lerp(compressedChunk.minScale.y, compressedChunk.maxScale.y, temp3.y));\n scale[2] = Math.exp(Scalar.Lerp(compressedChunk.minScale.z, compressedChunk.maxScale.z, temp3.z));\n }\n break;\n case PLYValue.PACKED_COLOR:\n {\n const compressedChunk = compressedChunks![chunkIndex];\n Unpack8888(value, rgba);\n rgba[0] = Scalar.Lerp(compressedChunk.minColor.x, compressedChunk.maxColor.x, rgba[0] / 255) * 255;\n rgba[1] = Scalar.Lerp(compressedChunk.minColor.y, compressedChunk.maxColor.y, rgba[1] / 255) * 255;\n rgba[2] = Scalar.Lerp(compressedChunk.minColor.z, compressedChunk.maxColor.z, rgba[2] / 255) * 255;\n }\n break;\n case PLYValue.X:\n position[0] = value;\n break;\n case PLYValue.Y:\n position[1] = value;\n break;\n case PLYValue.Z:\n position[2] = value;\n break;\n case PLYValue.SCALE_0:\n scale[0] = Math.exp(value);\n break;\n case PLYValue.SCALE_1:\n scale[1] = Math.exp(value);\n break;\n case PLYValue.SCALE_2:\n scale[2] = Math.exp(value);\n break;\n case PLYValue.DIFFUSE_RED:\n rgba[0] = value;\n break;\n case PLYValue.DIFFUSE_GREEN:\n rgba[1] = value;\n break;\n case PLYValue.DIFFUSE_BLUE:\n rgba[2] = value;\n break;\n case PLYValue.F_DC_0:\n rgba[0] = (0.5 + GaussianSplattingMeshBase._SH_C0 * value) * 255;\n break;\n case PLYValue.F_DC_1:\n rgba[1] = (0.5 + GaussianSplattingMeshBase._SH_C0 * value) * 255;\n break;\n case PLYValue.F_DC_2:\n rgba[2] = (0.5 + GaussianSplattingMeshBase._SH_C0 * value) * 255;\n break;\n case PLYValue.F_DC_3:\n rgba[3] = (0.5 + GaussianSplattingMeshBase._SH_C0 * value) * 255;\n break;\n case PLYValue.OPACITY:\n rgba[3] = (1 / (1 + Math.exp(-value))) * 255;\n break;\n case PLYValue.ROT_0:\n r0 = value;\n break;\n case PLYValue.ROT_1:\n r1 = value;\n break;\n case PLYValue.ROT_2:\n r2 = value;\n break;\n case PLYValue.ROT_3:\n r3 = value;\n break;\n }\n if (sh && property.value >= PLYValue.SH_0 && property.value <= PLYValue.SH_71) {\n const shIndex = property.value - PLYValue.SH_0;\n if (property.type == PLYType.UCHAR && header.chunkCount) {\n // compressed ply. dataView points to beginning of vertex\n // could be improved with a direct copy instead of a per SH index computation + copy\n const compressedValue = dataView.getUint8(\n header.rowChunkLength * header.chunkCount + header.vertexCount * header.rowVertexLength + index * header.shCoefficientCount + shIndex\n );\n // compressed .ply SH import : https://github.com/playcanvas/engine/blob/fda3f0368b45d7381f0b5a1722bd2056128eaebe/src/scene/gsplat/gsplat-compressed-data.js#L88C81-L88C98\n plySH[shIndex] = (compressedValue * (8 / 255) - 4) * 127.5 + 127.5;\n } else {\n const clampedValue = Scalar.Clamp(value * 127.5 + 127.5, 0, 255);\n plySH[shIndex] = clampedValue;\n }\n }\n }\n\n if (sh) {\n const shDim = header.shDegree == 1 ? 3 : header.shDegree == 2 ? 8 : header.shDegree == 3 ? 15 : 24;\n for (let j = 0; j < shDim; j++) {\n sh[j * 3 + 0] = plySH[j];\n sh[j * 3 + 1] = plySH[j + shDim];\n sh[j * 3 + 2] = plySH[j + shDim * 2];\n }\n }\n\n q.set(r1, r2, r3, r0);\n q.normalize();\n rot[0] = q.w * 127.5 + 127.5;\n rot[1] = q.x * 127.5 + 127.5;\n rot[2] = q.y * 127.5 + 127.5;\n rot[3] = q.z * 127.5 + 127.5;\n offset.value += header.rowVertexLength;\n }\n\n /**\n * Converts a .ply data with SH coefficients splat\n * if data array buffer is not ply, returns the original buffer\n * @param data the .ply data to load\n * @param useCoroutine use coroutine and yield\n * @returns the loaded splat buffer and optional array of sh coefficients\n */\n public static *ConvertPLYWithSHToSplat(data: ArrayBuffer, useCoroutine = false) {\n const header = GaussianSplattingMeshBase.ParseHeader(data);\n if (!header) {\n return { buffer: data };\n }\n\n const offset = { value: 0 };\n const compressedChunks = GaussianSplattingMeshBase._GetCompressedChunks(header, offset);\n\n for (let i = 0; i < header.vertexCount; i++) {\n GaussianSplattingMeshBase._GetSplat(header, i, compressedChunks, offset);\n if (i % GaussianSplattingMeshBase._PlyConversionBatchSize === 0 && useCoroutine) {\n yield;\n }\n }\n\n let sh = null;\n // make SH texture buffers\n if (header.shDegree && header.shBuffer) {\n const textureCount = Math.ceil(header.shCoefficientCount / 16); // 4 components can be stored per texture, 4 sh per component\n let shIndexRead = 0;\n const ubuf = new Uint8Array(header.shBuffer);\n\n // sh is an array of uint8array that will be used to create sh textures\n sh = [];\n\n const splatCount = header.vertexCount;\n const engine = EngineStore.LastCreatedEngine;\n if (engine) {\n const width = engine.getCaps().maxTextureSize;\n const height = Math.ceil(splatCount / width);\n // create array for the number of textures needed.\n sh = AllocateShBuffers(textureCount, height * width * 4 * 4);\n\n for (let i = 0; i < splatCount; i++) {\n for (let shIndexWrite = 0; shIndexWrite < header.shCoefficientCount; shIndexWrite++) {\n const shValue = ubuf[shIndexRead++];\n\n const textureIndex = Math.floor(shIndexWrite / 16);\n const shArray = sh[textureIndex];\n\n const byteIndexInTexture = shIndexWrite % 16; // [0..15]\n const offsetPerSplat = i * 16; // 16 sh values per texture per splat.\n shArray[byteIndexInTexture + offsetPerSplat] = shValue;\n }\n }\n }\n }\n\n return { buffer: header.buffer, sh: sh, shDegree: header.shDegree };\n }\n\n /**\n * Converts a .ply data array buffer to splat\n * if data array buffer is not ply, returns the original buffer\n * @param data the .ply data to load\n * @param useCoroutine use coroutine and yield\n * @returns the loaded splat buffer without SH coefficient, whether ply contains or not SH.\n */\n public static *ConvertPLYToSplat(data: ArrayBuffer, useCoroutine = false) {\n const header = GaussianSplattingMeshBase.ParseHeader(data);\n if (!header) {\n return data;\n }\n\n const offset = { value: 0 };\n const compressedChunks = GaussianSplattingMeshBase._GetCompressedChunks(header, offset);\n\n for (let i = 0; i < header.vertexCount; i++) {\n GaussianSplattingMeshBase._GetSplat(header, i, compressedChunks, offset);\n if (i % GaussianSplattingMeshBase._PlyConversionBatchSize === 0 && useCoroutine) {\n yield;\n }\n }\n\n return header.buffer;\n }\n\n /**\n * Converts a .ply data array buffer to splat\n * if data array buffer is not ply, returns the original buffer\n * @param data the .ply data to load\n * @returns the loaded splat buffer\n */\n public static async ConvertPLYToSplatAsync(data: ArrayBuffer) {\n return await runCoroutineAsync(GaussianSplattingMeshBase.ConvertPLYToSplat(data, true), createYieldingScheduler());\n }\n\n /**\n * Converts a .ply with SH data array buffer to splat\n * if data array buffer is not ply, returns the original buffer\n * @param data the .ply data to load\n * @returns the loaded splat buffer with SH\n */\n public static async ConvertPLYWithSHToSplatAsync(data: ArrayBuffer) {\n return await runCoroutineAsync(GaussianSplattingMeshBase.ConvertPLYWithSHToSplat(data, true), createYieldingScheduler());\n }\n /**\n * Loads a .splat Gaussian Splatting array buffer asynchronously\n * @param data arraybuffer containing splat file\n * @returns a promise that resolves when the operation is complete\n */\n\n public async loadDataAsync(data: ArrayBuffer): Promise<void> {\n return await this.updateDataAsync(data);\n }\n\n /**\n * Loads a Gaussian or Splatting file asynchronously\n * @param url path to the splat file to load\n * @param scene optional scene it belongs to\n * @returns a promise that resolves when the operation is complete\n * @deprecated Please use SceneLoader.ImportMeshAsync instead\n */\n public async loadFileAsync(url: string, scene?: Scene): Promise<void> {\n await ImportMeshAsync(url, (scene || EngineStore.LastCreatedScene)!, { pluginOptions: { splat: { gaussianSplattingMesh: this } } });\n }\n\n /**\n * Releases resources associated with this mesh.\n * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)\n */\n public override dispose(doNotRecurse?: boolean): void {\n if (this._mrtAtlas) {\n // The four data textures are attachments of this MRT — dispose the MRT, not each attachment.\n this._mrtAtlas.dispose();\n this._mrtAtlas = null;\n this._covariancesATexture = this._covariancesBTexture = this._centersTexture = this._colorsTexture = null;\n } else {\n this._covariancesATexture?.dispose();\n this._covariancesBTexture?.dispose();\n this._centersTexture?.dispose();\n this._colorsTexture?.dispose();\n }\n if (this._shMrtAtlas) {\n // SH attachments belong to these MRTs — dispose the MRTs, not each attachment (which is _shTextures[k]\n // for k < _shMrtAtlas.length).\n for (const mrt of this._shMrtAtlas) {\n mrt.dispose();\n }\n // Defence in depth: free any _shTextures entries beyond the MRT-backed set (not MRT-owned, so the loop\n // above misses them). The reuse guard keeps the atlas sized correctly, so this is normally a no-op.\n if (this._shTextures) {\n for (let k = this._shMrtAtlas.length; k < this._shTextures.length; k++) {\n this._shTextures[k].dispose();\n }\n }\n this._shMrtAtlas = null;\n } else if (this._shTextures) {\n for (const shTexture of this._shTextures) {\n shTexture.dispose();\n }\n }\n this._shTextures = null;\n\n if (this._rotMrtAtlas) {\n // The three rotation textures are attachments of this MRT — dispose the MRT, not each attachment.\n this._rotMrtAtlas.dispose();\n this._rotMrtAtlas = null;\n } else {\n this._rotationsATexture?.dispose();\n this._rotationsBTexture?.dispose();\n this._rotationScaleTexture?.dispose();\n }\n this._sogParams?.codebookTexture?.dispose();\n this._rotationsATexture = null;\n this._rotationsBTexture = null;\n this._rotationScaleTexture = null;\n this._rotationDataA = null;\n this._rotationDataB = null;\n this._rotationScaleData = null;\n this._covariancesATexture = null;\n this._covariancesBTexture = null;\n this._centersTexture = null;\n this._colorsTexture = null;\n this._shTextures = null;\n this._cachedBoundingMin = null;\n this._cachedBoundingMax = null;\n // Note: _splatsData and _shData are intentionally kept alive after dispose.\n // They can still be used as runtime source buffers by a compound mesh that retained\n // this mesh's data before disposal.\n\n _ReleaseGsInterFrameYield(this.getEngine());\n this._worker?.terminate();\n this._worker = null;\n\n this.onPartCountChangedObservable.clear();\n this.onPartRemovedObservable.clear();\n\n // delete meshes created for each camera\n this._cameraViewInfos.forEach((cameraViewInfo) => {\n cameraViewInfo.mesh.dispose();\n });\n\n super.dispose(doNotRecurse, true);\n }\n\n protected _copyTextures(source: GaussianSplattingMeshBase): void {\n this._covariancesATexture = source.covariancesATexture?.clone()!;\n this._covariancesBTexture = source.covariancesBTexture?.clone()!;\n this._centersTexture = source.centersTexture?.clone()!;\n this._colorsTexture = source.colorsTexture?.clone()!;\n if (source._shTextures) {\n this._shTextures = [];\n for (const shTexture of source._shTextures) {\n this._shTextures?.push(shTexture.clone()!);\n }\n }\n if (source._rotationsATexture) {\n this._rotationsATexture = source._rotationsATexture.clone()!;\n this._rotationsBTexture = source._rotationsBTexture?.clone()!;\n this._rotationScaleTexture = source._rotationScaleTexture?.clone()!;\n }\n }\n\n /**\n * Returns a new Mesh object generated from the current mesh properties.\n * @param name is a string, the name given to the new mesh\n * @returns a new Gaussian Splatting Mesh\n */\n public override clone(name: string = \"\"): GaussianSplattingMeshBase {\n const newGS = new GaussianSplattingMeshBase(name, undefined, this.getScene());\n newGS._copySource(this);\n newGS.makeGeometryUnique();\n newGS._vertexCount = this._vertexCount;\n newGS._copyTextures(this);\n newGS._modelViewProjectionMatrix = Matrix.Identity();\n newGS._splatPositions = this._splatPositions;\n newGS._readyToDisplay = false;\n newGS._hasRenderedOnce = false;\n newGS._disableDepthSort = this._disableDepthSort;\n newGS._instantiateWorker();\n\n const binfo = this.getBoundingInfo();\n newGS.getBoundingInfo().reConstruct(binfo.minimum, binfo.maximum, this.getWorldMatrix());\n\n newGS.forcedInstanceCount = this.forcedInstanceCount;\n newGS.setEnabled(true);\n return newGS;\n }\n\n protected _makeEmptySplat(index: number, covA: Uint16Array, covB: Uint16Array, colorArray: Uint8Array): void {\n const covBSItemSize = this._useRGBACovariants ? 4 : 2;\n this._splatPositions![4 * index + 0] = 0;\n this._splatPositions![4 * index + 1] = 0;\n this._splatPositions![4 * index + 2] = 0;\n\n covA[index * 4 + 0] = ToHalfFloat(0);\n covA[index * 4 + 1] = ToHalfFloat(0);\n covA[index * 4 + 2] = ToHalfFloat(0);\n covA[index * 4 + 3] = ToHalfFloat(0);\n covB[index * covBSItemSize + 0] = ToHalfFloat(0);\n covB[index * covBSItemSize + 1] = ToHalfFloat(0);\n colorArray[index * 4 + 3] = 0;\n }\n\n /**\n * Processes a single splat from the source buffer (at srcIndex) and writes the result into\n * the destination texture arrays at dstIndex. This decoupling allows addPart to feed multiple\n * independent source buffers into a single set of destination arrays without merging them first.\n * @param dstIndex - destination splat index (into _splatPositions, covA, covB, colorArray)\n * @param fBuffer - float32 view of the source .splat buffer\n * @param uBuffer - uint8 view of the source .splat buffer\n * @param covA - destination covariancesA array\n * @param covB - destination covariancesB array\n * @param colorArray - destination color array\n * @param minimum - accumulated bounding minimum (updated in-place)\n * @param maximum - accumulated bounding maximum (updated in-place)\n * @param flipY - whether to negate the Y position\n * @param srcIndex - source splat index (defaults to dstIndex when omitted)\n * @param dstArrayIndex - index into the covA/covB/colorArray transients (defaults to dstIndex). Lets a streaming\n * write pass count-sized transients indexed from 0 while dstIndex still addresses the atlas-sized _splatPositions.\n */\n protected _makeSplat(\n dstIndex: number,\n fBuffer: Float32Array,\n uBuffer: Uint8Array,\n covA: Uint16Array,\n covB: Uint16Array,\n colorArray: Uint8Array,\n minimum: Vector3,\n maximum: Vector3,\n flipY: boolean,\n srcIndex: number = dstIndex,\n dstArrayIndex: number = dstIndex\n ): void {\n const matrixRotation = TmpVectors.Matrix[0];\n const matrixScale = TmpVectors.Matrix[1];\n const quaternion = TmpVectors.Quaternion[0];\n const covBSItemSize = this._useRGBACovariants ? 4 : 2;\n\n const x = fBuffer[8 * srcIndex + 0];\n const y = fBuffer[8 * srcIndex + 1] * (flipY ? -1 : 1);\n const z = fBuffer[8 * srcIndex + 2];\n\n this._splatPositions![4 * dstIndex + 0] = x;\n this._splatPositions![4 * dstIndex + 1] = y;\n this._splatPositions![4 * dstIndex + 2] = z;\n\n minimum.minimizeInPlaceFromFloats(x, y, z);\n maximum.maximizeInPlaceFromFloats(x, y, z);\n\n quaternion.set(\n (uBuffer[32 * srcIndex + 28 + 1] - 127.5) / 127.5,\n (uBuffer[32 * srcIndex + 28 + 2] - 127.5) / 127.5,\n (uBuffer[32 * srcIndex + 28 + 3] - 127.5) / 127.5,\n -(uBuffer[32 * srcIndex + 28 + 0] - 127.5) / 127.5\n );\n quaternion.normalize();\n quaternion.toRotationMatrix(matrixRotation);\n\n Matrix.ScalingToRef(fBuffer[8 * srcIndex + 3 + 0] * 2, fBuffer[8 * srcIndex + 3 + 1] * 2, fBuffer[8 * srcIndex + 3 + 2] * 2, matrixScale);\n\n if (this._needsRotationScaleTextures) {\n // Sized to the atlas (_splatPositions), not covA: these persistent arrays are indexed by the global\n // dstIndex, so a count-sized covA transient must not shrink them.\n const rotLength = this._splatPositions!.length;\n if (!this._rotationDataA || this._rotationDataA.length < rotLength) {\n this._rotationDataA = new Uint16Array(rotLength);\n this._rotationDataB = new Uint16Array(rotLength);\n this._rotationScaleData = new Uint16Array(rotLength);\n }\n const rotDataA = this._rotationDataA;\n const rotDataB = this._rotationDataB!;\n const rotScaleData = this._rotationScaleData!;\n const rm = matrixRotation.m;\n const sm = matrixScale.m;\n rotDataA[dstIndex * 4 + 0] = ToHalfFloat(rm[0]);\n rotDataA[dstIndex * 4 + 1] = ToHalfFloat(rm[1]);\n rotDataA[dstIndex * 4 + 2] = ToHalfFloat(rm[2]);\n rotDataA[dstIndex * 4 + 3] = ToHalfFloat(rm[4]);\n rotDataB[dstIndex * 4 + 0] = ToHalfFloat(rm[5]);\n rotDataB[dstIndex * 4 + 1] = ToHalfFloat(rm[6]);\n rotDataB[dstIndex * 4 + 2] = ToHalfFloat(rm[8]);\n rotDataB[dstIndex * 4 + 3] = ToHalfFloat(rm[9]);\n rotScaleData[dstIndex * 4 + 0] = ToHalfFloat(rm[10]);\n rotScaleData[dstIndex * 4 + 1] = ToHalfFloat(sm[0]);\n rotScaleData[dstIndex * 4 + 2] = ToHalfFloat(sm[5]);\n rotScaleData[dstIndex * 4 + 3] = ToHalfFloat(sm[10]);\n }\n\n const m = matrixRotation.multiplyToRef(matrixScale, TmpVectors.Matrix[0]).m;\n\n const covariances = this._tmpCovariances;\n covariances[0] = m[0] * m[0] + m[1] * m[1] + m[2] * m[2];\n covariances[1] = m[0] * m[4] + m[1] * m[5] + m[2] * m[6];\n covariances[2] = m[0] * m[8] + m[1] * m[9] + m[2] * m[10];\n covariances[3] = m[4] * m[4] + m[5] * m[5] + m[6] * m[6];\n covariances[4] = m[4] * m[8] + m[5] * m[9] + m[6] * m[10];\n covariances[5] = m[8] * m[8] + m[9] * m[9] + m[10] * m[10];\n\n // normalize covA, covB\n let factor = -10000;\n for (let covIndex = 0; covIndex < 6; covIndex++) {\n factor = Math.max(factor, Math.abs(covariances[covIndex]));\n }\n\n this._splatPositions![4 * dstIndex + 3] = factor;\n const transform = factor;\n\n covA[dstArrayIndex * 4 + 0] = ToHalfFloat(covariances[0] / transform);\n covA[dstArrayIndex * 4 + 1] = ToHalfFloat(covariances[1] / transform);\n covA[dstArrayIndex * 4 + 2] = ToHalfFloat(covariances[2] / transform);\n covA[dstArrayIndex * 4 + 3] = ToHalfFloat(covariances[3] / transform);\n covB[dstArrayIndex * covBSItemSize + 0] = ToHalfFloat(covariances[4] / transform);\n covB[dstArrayIndex * covBSItemSize + 1] = ToHalfFloat(covariances[5] / transform);\n\n const c0 = covariances[0];\n const c1 = covariances[1];\n const c2 = covariances[2];\n const c3 = covariances[3];\n const c4 = covariances[4];\n const c5 = covariances[5];\n const det3d = c0 * (c3 * c5 - c4 * c4) - c1 * (c1 * c5 - c4 * c2) + c2 * (c1 * c4 - c3 * c2);\n const splatSize = Math.pow(Math.abs(det3d), 1.0 / 6.0);\n if (splatSize < this._splatSizeMin) {\n this._splatSizeMin = splatSize;\n }\n if (splatSize > this._splatSizeMax) {\n this._splatSizeMax = splatSize;\n }\n\n // colors\n colorArray[dstArrayIndex * 4 + 0] = uBuffer[32 * srcIndex + 24 + 0];\n colorArray[dstArrayIndex * 4 + 1] = uBuffer[32 * srcIndex + 24 + 1];\n colorArray[dstArrayIndex * 4 + 2] = uBuffer[32 * srcIndex + 24 + 2];\n colorArray[dstArrayIndex * 4 + 3] = uBuffer[32 * srcIndex + 24 + 3];\n }\n\n protected _onUpdateTextures(_textureSize: Vector2) {}\n\n /**\n * Called when part index data is received during a data load. Override to store and manage\n * part index state (e.g. allocating the padded Uint8Array).\n * No-op in the base class.\n * @param _partIndices - the raw part indices passed in by the caller\n * @param _textureLength - the padded texture length (width × height) to allocate into\n */\n protected _onIndexDataReceived(_partIndices: Uint8Array, _textureLength: number): void {}\n\n /**\n * Called at the start of an incremental texture update, before any splats are processed.\n * Override to perform incremental-specific setup, such as ensuring the part-index GPU texture\n * exists before the sub-texture upload begins.\n * No-op in the base class.\n * @param _textureSize - current texture dimensions\n */\n protected _onIncrementalUpdateStart(_textureSize: Vector2): void {}\n\n /**\n * Whether this mesh is in compound mode (has at least one part added via addPart).\n * Returns `false` in the base class; overridden to return `true` in the compound subclass.\n * Consumed by the material and depth renderer to toggle compound-specific shader paths.\n * @internal\n */\n public get isCompound(): boolean {\n return false;\n }\n\n protected _setDelayedTextureUpdate(covA: Uint16Array, covB: Uint16Array, colorArray: Uint8Array, sh?: Uint8Array[]): void {\n this._delayedTextureUpdate = { covA, covB, colors: colorArray, centers: this._splatPositions!, sh };\n }\n\n private _commitDelayedTextureUpdate(): void {\n const update = this._delayedTextureUpdate;\n if (!update) {\n return;\n }\n const textureSize = this._getTextureSize(this._vertexCount);\n this._updateSubTextures(update.centers, update.covA, update.covB, update.colors, 0, textureSize.y, update.sh);\n this._delayedTextureUpdate = null;\n }\n\n /**\n * Creates (or recreates) the MRT-backed data atlas at the given size and points the four core data\n * textures at its attachments. The attachments use the same decoded GS layout as {@link GaussianSplattingWorkBuffer}\n * — [centers F32, covA HALF_FLOAT, covB HALF_FLOAT, colors U8], all RGBA — so a streaming engine can render\n * (decode/relayout) directly into the same textures the GS material samples, while static parts CPU-upload\n * into them via {@link _updateSubTextures}. Covariance B is RGBA here (its extra channels unused), so the\n * atlas forces {@link _useRGBACovariants}.\n * @param textureSize atlas dimensions (width, height)\n */\n protected _createMrtAtlas(textureSize: Vector2): void {\n // covB carries only Sigma12/Sigma22 but MRT attachments are RGBA, so switch to the RGBA covariant layout.\n this._useRGBACovariants = true;\n const engine = this.getEngine();\n // No real GPU (NullEngine): skip MRT allocation. The reservation's part/index/range logic still runs;\n // texture population requires a real (WebGL2/WebGPU) backend.\n const updateEngine = this._getTextureDataUpdateEngine();\n if (!updateEngine._gl && !updateEngine.isWebGPU) {\n return;\n }\n const covType = engine.getCaps().textureHalfFloatRender ? Constants.TEXTURETYPE_HALF_FLOAT : Constants.TEXTURETYPE_FLOAT;\n const mrt = new MultiRenderTarget(\n this.name + \"_gsAtlas\",\n { width: textureSize.x, height: textureSize.y },\n 4,\n this._scene,\n {\n types: [Constants.TEXTURETYPE_FLOAT, covType, covType, Constants.TEXTURETYPE_UNSIGNED_BYTE],\n formats: [Constants.TEXTUREFORMAT_RGBA, Constants.TEXTUREFORMAT_RGBA, Constants.TEXTUREFORMAT_RGBA, Constants.TEXTUREFORMAT_RGBA],\n samplingModes: [\n Constants.TEXTURE_NEAREST_SAMPLINGMODE,\n Constants.TEXTURE_NEAREST_SAMPLINGMODE,\n Constants.TEXTURE_NEAREST_SAMPLINGMODE,\n Constants.TEXTURE_NEAREST_SAMPLINGMODE,\n ],\n generateDepthBuffer: false,\n generateDepthTexture: false,\n generateMipMaps: false,\n },\n [this.name + \"_gsCenters\", this.name + \"_gsCovA\", this.name + \"_gsCovB\", this.name + \"_gsColors\"]\n );\n mrt.clearColor = new Color4(0, 0, 0, 0);\n mrt.renderList = [];\n // Suppress clearing so a streaming engine's decode passes ACCUMULATE into the atlas (each decode writes\n // only its region and must not wipe static parts or previously-decoded splats). All texels are defined by\n // the initial full CPU sub-upload below (the reserved region's arrays are zero => invisible padding).\n mrt.onClearObservable.add(() => {});\n // Render once so the attachment textures are really allocated on the GPU before the CPU sub-uploads\n // below (on WebGPU, writeTexture requires the destination texture to already exist).\n mrt.render();\n this._mrtAtlas = mrt;\n this._centersTexture = mrt.textures[0];\n this._covariancesATexture = mrt.textures[1];\n this._covariancesBTexture = mrt.textures[2];\n this._colorsTexture = mrt.textures[3];\n }\n\n /**\n * Creates the shared higher-order SH atlas: `_shMrtAtlasTextureCount` single-attachment integer render targets\n * (RGBA_INTEGER / UNSIGNED_INTEGER, packed-u32), sized to the whole atlas, so a streaming engine can GPU-decode\n * baked SH into the reserved region and static SH parts CPU-upload into the same attachments. `_shTextures` (the\n * draw path's `shTexture0..N` samplers) are the attachments. One MRT per attachment keeps within WebGPU's\n * per-sample color-attachment byte budget. No-op without a real GPU backend (mirrors {@link _createMrtAtlas}).\n * @param textureSize atlas dimensions (width, height)\n */\n protected _createShMrtAtlas(textureSize: Vector2): void {\n const updateEngine = this._getTextureDataUpdateEngine();\n if (!updateEngine._gl && !updateEngine.isWebGPU) {\n return;\n }\n const count = this._shMrtAtlasTextureCount;\n if (count <= 0) {\n return;\n }\n const mrts: MultiRenderTarget[] = [];\n const shTextures: BaseTexture[] = [];\n for (let k = 0; k < count; k++) {\n const name = `${this.name}_gsShAtlas${k}`;\n const mrt = new MultiRenderTarget(\n name,\n { width: textureSize.x, height: textureSize.y },\n 1,\n this._scene,\n {\n types: [Constants.TEXTURETYPE_UNSIGNED_INTEGER],\n formats: [Constants.TEXTUREFORMAT_RGBA_INTEGER],\n samplingModes: [Constants.TEXTURE_NEAREST_SAMPLINGMODE],\n generateDepthBuffer: false,\n generateDepthTexture: false,\n generateMipMaps: false,\n },\n [name]\n );\n mrt.clearColor = new Color4(0, 0, 0, 0);\n mrt.renderList = [];\n // Accumulate: each SH decode writes only its region; the rest stays whatever was there (neutral for a\n // fresh atlas — 128 == 0 lighting is guaranteed by decoding every splat's region, incl. no-SH files).\n mrt.onClearObservable.add(() => {});\n const attachment = mrt.textures[0];\n attachment.wrapU = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n attachment.wrapV = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n // Allocate on the GPU before any CPU sub-upload (WebGPU writeTexture needs the resource to exist).\n mrt.render();\n mrts.push(mrt);\n shTextures.push(attachment);\n }\n this._shMrtAtlas = mrts;\n this._shTextures = shTextures;\n }\n\n /**\n * Creates the shared rotation/scale atlas: one 3-attachment half-float render target ([rotA, rotB, rotScale])\n * sized to the whole atlas, so a streaming engine can GPU-decode rotation/scale into the reserved region and\n * static parts CPU-upload into the same attachments. `_rotationsATexture`/`_rotationsBTexture`/\n * `_rotationScaleTexture` (the voxel-IBL samplers) become the three attachments. No-op without a real GPU\n * backend (mirrors {@link _createMrtAtlas}).\n * @param textureSize atlas dimensions (width, height)\n */\n protected _createRotMrtAtlas(textureSize: Vector2): void {\n const updateEngine = this._getTextureDataUpdateEngine();\n if (!updateEngine._gl && !updateEngine.isWebGPU) {\n return;\n }\n const rotType = this.getEngine().getCaps().textureHalfFloatRender ? Constants.TEXTURETYPE_HALF_FLOAT : Constants.TEXTURETYPE_FLOAT;\n const name = this.name + \"_gsRotAtlas\";\n const mrt = new MultiRenderTarget(\n name,\n { width: textureSize.x, height: textureSize.y },\n 3,\n this._scene,\n {\n types: [rotType, rotType, rotType],\n formats: [Constants.TEXTUREFORMAT_RGBA, Constants.TEXTUREFORMAT_RGBA, Constants.TEXTUREFORMAT_RGBA],\n samplingModes: [Constants.TEXTURE_NEAREST_SAMPLINGMODE, Constants.TEXTURE_NEAREST_SAMPLINGMODE, Constants.TEXTURE_NEAREST_SAMPLINGMODE],\n generateDepthBuffer: false,\n generateDepthTexture: false,\n generateMipMaps: false,\n },\n [name + \"A\", name + \"B\", name + \"Scale\"]\n );\n mrt.clearColor = new Color4(0, 0, 0, 0);\n mrt.renderList = [];\n // Accumulate: each rotation decode writes only its region; the rest stays whatever was there.\n mrt.onClearObservable.add(() => {});\n for (const attachment of mrt.textures) {\n attachment.wrapU = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n attachment.wrapV = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n }\n // Allocate on the GPU before any CPU sub-upload (WebGPU writeTexture needs the resource to exist).\n mrt.render();\n this._rotMrtAtlas = mrt;\n this._rotationsATexture = mrt.textures[0];\n this._rotationsBTexture = mrt.textures[1];\n this._rotationScaleTexture = mrt.textures[2];\n }\n\n // NB: partIndices is assumed to be padded to a round texture size\n protected _updateTextures(covA: Uint16Array, covB: Uint16Array, colorArray: Uint8Array, sh?: Uint8Array[]): void {\n const textureSize = this._getTextureSize(this._vertexCount);\n // Update the textures\n const createTextureFromData = (data: Float32Array, width: number, height: number, format: number) => {\n return new RawTexture(data, width, height, format, this._scene, false, false, Constants.TEXTURE_NEAREST_SAMPLINGMODE, Constants.TEXTURETYPE_FLOAT);\n };\n\n const createTextureFromDataU8 = (data: Uint8Array, width: number, height: number, format: number) => {\n return new RawTexture(data, width, height, format, this._scene, false, false, Constants.TEXTURE_NEAREST_SAMPLINGMODE, Constants.TEXTURETYPE_UNSIGNED_BYTE);\n };\n\n const createEmptyTextureU32 = (width: number, height: number, format: number) => {\n return new RawTexture(null, width, height, format, this._scene, false, false, Constants.TEXTURE_NEAREST_SAMPLINGMODE, Constants.TEXTURETYPE_UNSIGNED_INTEGER);\n };\n\n const createTextureFromDataF16 = (data: Uint16Array, width: number, height: number, format: number) => {\n return new RawTexture(data, width, height, format, this._scene, false, false, Constants.TEXTURE_NEAREST_SAMPLINGMODE, Constants.TEXTURETYPE_HALF_FLOAT);\n };\n\n const firstTime = this._covariancesATexture === null;\n const textureSizeChanged = this._textureSize.y != textureSize.y;\n // The render-backed SH atlas must have one attachment per SH texture the material samples, i.e. sized to the\n // compound's MERGED SH degree (`sh` spans static + streaming), not just the streaming parts' requested count —\n // otherwise a lower-degree stream mixed with a higher-degree static part (or a later higher-degree stream)\n // leaves the atlas undersized. `sh` is always present when a streaming SH part is live (its degree makes it so).\n if (this._useShMrtAtlas && sh) {\n this._shMrtAtlasTextureCount = sh.length;\n }\n // First streaming-part reservation must convert the existing RawTexture atlas to the MRT-backed atlas,\n // which requires the full (re)build branch even when the texture height is unchanged. Same for the SH atlas:\n // a streaming SH part must convert the SH textures to render-targetable integer MRTs (and recreate them when\n // the required attachment count changes).\n const needsMrtConversion =\n (this._useMrtAtlas && !this._mrtAtlas) ||\n (this._useShMrtAtlas && (!this._shMrtAtlas || this._shMrtAtlas.length !== this._shMrtAtlasTextureCount)) ||\n (this._useRotMrtAtlas && !this._rotMrtAtlas);\n\n if (!firstTime && !textureSizeChanged && !needsMrtConversion) {\n this._setDelayedTextureUpdate(covA, covB, colorArray, sh);\n const positions = Float32Array.from(this._splatPositions!);\n const vertexCount = this._vertexCount;\n if (this._worker) {\n this._worker.postMessage({ command: GaussianSplattingSortWorkerCommand.POSITIONS, positions, vertexCount }, [positions.buffer]);\n // Re-sync the active interval set in case the source splat count changed.\n this._postIntervalsToWorker();\n }\n\n // Handle SH textures in update path - create if they don't exist. Skip when the SH atlas is\n // render-backed (_useShMrtAtlas): those targets are created/managed by _createShMrtAtlas, not here.\n if (sh && !this._shTextures && !this._useShMrtAtlas) {\n this._shTextures = [];\n for (let textureIndex = 0; textureIndex < sh.length; textureIndex++) {\n const shTexture = createEmptyTextureU32(textureSize.x, textureSize.y, Constants.TEXTUREFORMAT_RGBA_INTEGER);\n shTexture.wrapU = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n shTexture.wrapV = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n this._shTextures!.push(shTexture);\n this._updateShTextureData(shTexture, sh[textureIndex], textureSize.x, 0, textureSize.y);\n }\n }\n\n if (this._needsRotationScaleTextures && this._rotationDataA) {\n if (this._rotationsATexture) {\n this._updateTextureFromData(this._rotationsATexture, this._rotationDataA, textureSize.x, 0, textureSize.y);\n this._updateTextureFromData(this._rotationsBTexture!, this._rotationDataB!, textureSize.x, 0, textureSize.y);\n this._updateTextureFromData(this._rotationScaleTexture!, this._rotationScaleData!, textureSize.x, 0, textureSize.y);\n } else {\n // Rotation textures not yet created (needsRotationScaleTextures was enabled after initial load).\n this._rotationsATexture = createTextureFromDataF16(this._rotationDataA, textureSize.x, textureSize.y, Constants.TEXTUREFORMAT_RGBA);\n this._rotationsBTexture = createTextureFromDataF16(this._rotationDataB!, textureSize.x, textureSize.y, Constants.TEXTUREFORMAT_RGBA);\n this._rotationScaleTexture = createTextureFromDataF16(this._rotationScaleData!, textureSize.x, textureSize.y, Constants.TEXTUREFORMAT_RGBA);\n this._rotationsATexture.wrapU = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n this._rotationsATexture.wrapV = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n this._rotationsBTexture.wrapU = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n this._rotationsBTexture.wrapV = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n this._rotationScaleTexture.wrapU = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n this._rotationScaleTexture.wrapV = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n }\n }\n\n this._onUpdateTextures(textureSize);\n\n this._postToWorker(true);\n } else {\n // Full rebuild: the texture size changed (or this is a size-changing reload), so the existing\n // GPU textures cannot be reused. Dispose them before recreating to avoid leaking the old ones.\n // Growing an EXISTING MRT atlas: let streaming parts back up their GPU-only region from the old atlas\n // before it is disposed (they restore it into the new atlas via _onAfterAtlasRebuildObservable).\n const growingMrtAtlas = this._useMrtAtlas && !!this._mrtAtlas;\n if (growingMrtAtlas) {\n this._onBeforeAtlasRebuildObservable.notifyObservers(this._mrtAtlas!);\n }\n if (this._mrtAtlas) {\n // The four data textures are attachments of this MRT — dispose the MRT, not each attachment.\n this._mrtAtlas.dispose();\n this._mrtAtlas = null;\n this._covariancesATexture = this._covariancesBTexture = this._centersTexture = this._colorsTexture = null;\n } else {\n this._covariancesATexture?.dispose();\n this._covariancesBTexture?.dispose();\n this._centersTexture?.dispose();\n this._colorsTexture?.dispose();\n }\n // Dispose+null the rotation/scale textures before the MRT-branch _updateSubTextures below: that helper\n // also writes the rotation textures, so leaving them at the old (smaller) height would upload the taller\n // region out of bounds. Nulling them makes it skip rotation; the block further down recreates them.\n if (this._rotMrtAtlas) {\n // The three rotation textures are attachments of this MRT — dispose the MRT, not each attachment.\n this._rotMrtAtlas.dispose();\n this._rotMrtAtlas = null;\n this._rotationsATexture = null;\n this._rotationsBTexture = null;\n this._rotationScaleTexture = null;\n } else if (this._rotationsATexture) {\n this._rotationsATexture.dispose();\n this._rotationsBTexture?.dispose();\n this._rotationScaleTexture?.dispose();\n this._rotationsATexture = null;\n this._rotationsBTexture = null;\n this._rotationScaleTexture = null;\n }\n if (this._shTextures) {\n // SH attachments belong to _shMrtAtlas MRTs (dispose the MRT, not each attachment) when render-backed.\n if (this._shMrtAtlas) {\n for (const mrt of this._shMrtAtlas) {\n mrt.dispose();\n }\n // Defence in depth: free any _shTextures entries beyond the MRT-backed set (see dispose()).\n for (let k = this._shMrtAtlas.length; k < this._shTextures.length; k++) {\n this._shTextures[k].dispose();\n }\n this._shMrtAtlas = null;\n } else {\n for (const shTexture of this._shTextures) {\n shTexture.dispose();\n }\n }\n this._shTextures = null;\n }\n\n this._textureSize = textureSize;\n if (this._useMrtAtlas) {\n // Back the four data textures with a render-targetable MRT so a streaming engine can decode\n // into the reserved region; static splats are CPU-uploaded into the same attachments below.\n this._createMrtAtlas(textureSize);\n // Same for the higher-order SH atlas (integer render targets), when a streaming part needs baked SH.\n if (this._useShMrtAtlas) {\n this._createShMrtAtlas(textureSize);\n }\n // Same for the rotation/scale atlas (half-float), created before the _updateSubTextures below so\n // static parts' CPU rotation data lands in the shared attachments (streamed rows are decoded after).\n if (this._useRotMrtAtlas) {\n this._createRotMrtAtlas(textureSize);\n }\n if (this._mrtAtlas) {\n this._updateSubTextures(this._splatPositions!, covA, covB, colorArray, 0, textureSize.y);\n // Render-backed SH: CPU-upload the static parts' SH into the shared SH atlas HERE — before the\n // streaming restore below — so a streamed region's restored SH wins over the bulk (neutral) fill,\n // exactly like the core atlas's _updateSubTextures-then-restore ordering. (`sh` covers the whole\n // atlas; streamed rows are neutral in it and get overwritten by the restore.)\n if (this._useShMrtAtlas && sh) {\n const shTex = this._shTextures as Nullable<BaseTexture[]>;\n if (shTex) {\n for (let textureIndex = 0; textureIndex < sh.length && textureIndex < shTex.length; textureIndex++) {\n this._updateShTextureData(shTex[textureIndex], sh[textureIndex], textureSize.x, 0, textureSize.y);\n }\n }\n }\n // New atlas is populated (streamed regions currently zeroed); let streaming parts rebind and\n // restore their backed-up region into it, overwriting those zeros with the preserved data.\n if (growingMrtAtlas) {\n this._onAfterAtlasRebuildObservable.notifyObservers(this._mrtAtlas);\n }\n }\n } else {\n this._covariancesATexture = createTextureFromDataF16(covA, textureSize.x, textureSize.y, Constants.TEXTUREFORMAT_RGBA);\n this._covariancesBTexture = createTextureFromDataF16(\n covB,\n textureSize.x,\n textureSize.y,\n this._useRGBACovariants ? Constants.TEXTUREFORMAT_RGBA : Constants.TEXTUREFORMAT_RG\n );\n this._centersTexture = createTextureFromData(this._splatPositions!, textureSize.x, textureSize.y, Constants.TEXTUREFORMAT_RGBA);\n this._colorsTexture = createTextureFromDataU8(colorArray, textureSize.x, textureSize.y, Constants.TEXTUREFORMAT_RGBA);\n }\n\n // Render-backed SH (_useShMrtAtlas) was already CPU-uploaded above (before the streaming restore); only\n // the plain RawTexture SH path is handled here.\n if (sh && !this._useShMrtAtlas) {\n {\n this._shTextures = [];\n for (let textureIndex = 0; textureIndex < sh.length; textureIndex++) {\n const shTexture = createEmptyTextureU32(textureSize.x, textureSize.y, Constants.TEXTUREFORMAT_RGBA_INTEGER);\n shTexture.wrapU = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n shTexture.wrapV = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n this._shTextures!.push(shTexture);\n }\n for (let textureIndex = 0; textureIndex < sh.length; textureIndex++) {\n this._updateShTextureData(this._shTextures[textureIndex], sh[textureIndex], textureSize.x, 0, textureSize.y);\n }\n }\n }\n\n // Render-backed rotation (_useRotMrtAtlas) was already created + CPU-uploaded above (via _updateSubTextures,\n // before the streaming restore); only the plain RawTexture rotation path is handled here.\n if (this._needsRotationScaleTextures && !this._useRotMrtAtlas) {\n const rotDataA = this._rotationDataA ?? new Uint16Array(covA.length);\n const rotDataB = this._rotationDataB ?? new Uint16Array(covA.length);\n const rotScaleData = this._rotationScaleData ?? new Uint16Array(covA.length);\n // Already disposed+nulled in the rebuild's disposal block above; just (re)create at the new size.\n this._rotationsATexture = createTextureFromDataF16(rotDataA, textureSize.x, textureSize.y, Constants.TEXTUREFORMAT_RGBA);\n this._rotationsBTexture = createTextureFromDataF16(rotDataB, textureSize.x, textureSize.y, Constants.TEXTUREFORMAT_RGBA);\n this._rotationScaleTexture = createTextureFromDataF16(rotScaleData, textureSize.x, textureSize.y, Constants.TEXTUREFORMAT_RGBA);\n this._rotationsATexture.wrapU = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n this._rotationsATexture.wrapV = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n this._rotationsBTexture.wrapU = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n this._rotationsBTexture.wrapV = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n this._rotationScaleTexture.wrapU = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n this._rotationScaleTexture.wrapV = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n }\n\n this._onUpdateTextures(textureSize);\n\n if (firstTime) {\n this._instantiateWorker();\n } else {\n if (this._worker) {\n const positions = Float32Array.from(this._splatPositions!);\n const vertexCount = this._vertexCount;\n this._worker.postMessage({ command: GaussianSplattingSortWorkerCommand.POSITIONS, positions, vertexCount }, [positions.buffer]);\n // Re-sync the active interval set in case the source splat count changed.\n this._postIntervalsToWorker();\n }\n this._postToWorker(true);\n }\n }\n }\n\n /**\n * Checks whether the GPU textures can be incrementally updated for a new addPart operation,\n * avoiding a full texture re-upload for existing splats.\n * Requires that the GPU textures already exist and the texture height won't change.\n * @param previousVertexCount - The number of splats previously committed to GPU\n * @param vertexCount - The new total number of splats\n * @param requiredShTextureCount - SH texture count this update requires (the merged `sh.length`), 0 when no SH\n * @returns true when only the new splat region needs to be uploaded\n */\n protected _canReuseCachedData(previousVertexCount: number, vertexCount: number, requiredShTextureCount: number = 0): boolean {\n if (previousVertexCount <= 0 || previousVertexCount > vertexCount) {\n return false;\n }\n if (this._splatPositions === null || this._cachedBoundingMin === null || this._cachedBoundingMax === null) {\n return false;\n }\n if (this._covariancesATexture === null) {\n return false;\n }\n // Switching to (or resizing) a render-backed atlas requires a full rebuild so the affected textures are\n // recreated as MRT attachments — the incremental sub-upload path cannot convert them. These must mirror the\n // `needsMrtConversion` checks in _updateTextures: if they disagree, an incremental data prep (which fills only\n // the new splats) would be paired with a full-rebuild upload (which uploads the whole array), zeroing the\n // existing parts. Covers the first streaming reservation, a later part that introduces/grows SH, and rotation.\n if (this._useMrtAtlas && !this._mrtAtlas) {\n return false;\n }\n // Compare against the count this update requires, not `_shMrtAtlasTextureCount` — that field is refreshed\n // only in _updateTextures (skipped on the incremental path), so a higher-degree addPart would pass the guard\n // on a stale count and never grow the SH atlas.\n if (this._useShMrtAtlas && (!this._shMrtAtlas || this._shMrtAtlas.length !== requiredShTextureCount)) {\n return false;\n }\n if (this._useRotMrtAtlas && !this._rotMrtAtlas) {\n return false;\n }\n // Can only do an incremental GPU update if texture height doesn't need to grow\n const newTextureSize = this._getTextureSize(vertexCount);\n return newTextureSize.y === this._textureSize.y;\n }\n\n /**\n * Posts updated positions to the sort worker and marks the sort as dirty.\n * Called after processing new splats so the worker can re-sort with the complete position set.\n * Subclasses (e.g. compound) may override to additionally post part-index data.\n */\n protected _notifyWorkerNewData(): void {\n if (this._worker) {\n const positions = Float32Array.from(this._splatPositions!);\n const vertexCount = this._vertexCount;\n this._worker.postMessage({ command: GaussianSplattingSortWorkerCommand.POSITIONS, positions, vertexCount }, [positions.buffer]);\n // The source splat count may have changed (e.g. addPart): re-sync the worker's active\n // interval set so it covers the current splats instead of a stale (smaller) range.\n this._postIntervalsToWorker();\n }\n this._sortIsDirty = true;\n }\n\n /**\n * Patches only a contiguous range of source-splat centers in the sort worker, instead of re-copying and\n * transferring the entire position buffer (which is hundreds of MB for large streamed datasets and caused\n * a multi-frame freeze on every LOD decode). The worker must already hold a full-size position buffer (from\n * the initial {@link GaussianSplattingSortWorkerCommand.POSITIONS} message at worker creation). Marks the\n * sort dirty so the new splats are sorted in; the caller is responsible for any interval/range refresh.\n * @param splatOffset first splat index of the updated range\n * @param splatCount number of splats in the updated range\n */\n protected _postWorkerPositionsRange(splatOffset: number, splatCount: number): void {\n if (!this._worker || !this._splatPositions || splatCount <= 0) {\n return;\n }\n const floatOffset = splatOffset * 4;\n // Copy just the changed region (stride 4) so the main thread keeps its own _splatPositions intact.\n const data = this._splatPositions.slice(floatOffset, floatOffset + splatCount * 4);\n this._worker.postMessage({ command: GaussianSplattingSortWorkerCommand.POSITIONS_UPDATE, offset: floatOffset, data }, [data.buffer]);\n this._sortIsDirty = true;\n }\n\n /**\n * Decodes raw `.splat` bytes (32 bytes/splat) into a contiguous sub-range of the already-allocated atlas,\n * uploading only the affected texels (never touching neighboring parts' texels) and patching just that\n * range of positions in the sort worker. Used to populate a region reserved by\n * {@link GaussianSplattingMesh.reserveStreamingPart} — the CPU path a streaming engine uses when GPU\n * decode/readback is unavailable, and the seam that verifies reservation + interleaving before the\n * streaming engine exists.\n *\n * The atlas textures and `_splatPositions` must already be sized to cover `[globalOffset, globalOffset+count)`\n * (guaranteed after `reserveStreamingPart`). Bounds of the written centers are accumulated into `min`/`max`\n * when provided (so the caller can grow the owning part's bounding info).\n * @param globalOffset first atlas splat index to write\n * @param count number of splats to write\n * @param splatsData raw `.splat` bytes for `count` splats (stride 32)\n * @param min optional running min accumulator for the written centers\n * @param max optional running max accumulator for the written centers\n */\n protected _writeStreamingSplats(globalOffset: number, count: number, splatsData: ArrayBuffer | ArrayBufferView, min?: Vector3, max?: Vector3): void {\n if (!this._splatPositions) {\n return;\n }\n // Validate the range against the atlas and the input length (independent of GPU state): an out-of-range\n // offset/count would write over another part's texels or allocate a huge transient (the CPU arrays are\n // atlas-indexed up to `end`); a short input would read past its end.\n const capacity = this._splatPositions.length / 4;\n const uBuffer = GaussianSplattingMeshBase._GetSplatDataBytes(splatsData);\n if (!Number.isInteger(globalOffset) || !Number.isInteger(count) || globalOffset < 0 || count < 0 || globalOffset + count > capacity) {\n throw new Error(`_writeStreamingSplats: range [${globalOffset}, ${globalOffset + count}) is outside the atlas bounds [0, ${capacity})`);\n }\n if (uBuffer.length < count * 32) {\n throw new Error(`_writeStreamingSplats: splatsData has ${uBuffer.length} bytes, need ${count * 32} for ${count} splats (stride 32)`);\n }\n if (count === 0 || !this._covariancesATexture) {\n return;\n }\n const textureSize = this._getTextureSize(this._vertexCount);\n const width = textureSize.x;\n const covBSItemSize = this._useRGBACovariants ? 4 : 2;\n const end = globalOffset + count;\n\n const fBuffer = GaussianSplattingMeshBase._GetSplatDataFloats(splatsData);\n\n // Transients are sized to `count`, not `end` (globalOffset + count): sizing by atlas position would allocate\n // tens of MB for a small write near a large atlas's tail. dstIndex still addresses the atlas _splatPositions.\n const covA = new Uint16Array(count * 4);\n const covB = new Uint16Array(count * covBSItemSize);\n const colorArray = new Uint8Array(count * 4);\n const localMin = min ?? new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\n const localMax = max ?? new Vector3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);\n for (let i = 0; i < count; i++) {\n this._makeSplat(globalOffset + i, fBuffer, uBuffer, covA, covB, colorArray, localMin, localMax, this._flipY, i, i);\n }\n\n // Retain the written bytes so future full rebuilds / picking see the region's real data.\n if (this._splatsData) {\n const dst = new Uint8Array(GaussianSplattingMeshBase._GetSplatDataBytes(this._splatsData).buffer);\n dst.set(uBuffer.subarray(0, count * 32), globalOffset * 32);\n }\n\n // Upload only the written texels, one contiguous per-row run at a time (rectangular sub-uploads never\n // clobber texels outside [globalOffset, end), so neighboring parts on a shared boundary row are safe).\n const positions = this._splatPositions;\n let gi = globalOffset;\n while (gi < end) {\n const row = Math.floor(gi / width);\n const runEnd = Math.min(end, (row + 1) * width);\n const col = gi - row * width;\n const runLen = runEnd - gi;\n // covA/covB/colorArray are count-sized (0-based), so rebase by globalOffset; positions stays global.\n const li = gi - globalOffset;\n this._updateTextureFromDataRect(this._covariancesATexture!, new Uint16Array(covA.buffer, li * 4 * 2, runLen * 4), col, row, runLen, 1);\n this._updateTextureFromDataRect(this._covariancesBTexture!, new Uint16Array(covB.buffer, li * covBSItemSize * 2, runLen * covBSItemSize), col, row, runLen, 1);\n this._updateTextureFromDataRect(this._centersTexture!, new Float32Array(positions.buffer, gi * 4 * 4, runLen * 4), col, row, runLen, 1);\n this._updateTextureFromDataRect(this._colorsTexture!, new Uint8Array(colorArray.buffer, li * 4, runLen * 4), col, row, runLen, 1);\n gi = runEnd;\n }\n\n this._postWorkerPositionsRange(globalOffset, count);\n }\n\n private *_updateData(\n data: ArrayBuffer,\n isAsync: boolean,\n sh?: Uint8Array[],\n partIndices?: Uint8Array,\n { flipY = false, previousVertexCount = 0 }: IUpdateOptions = {},\n shDegree?: number\n ): Coroutine<void> {\n if (!this._covariancesATexture) {\n this._readyToDisplay = false;\n }\n this._flipY = flipY;\n this._splatDataRevision++;\n this._splatDataPending = true;\n\n const uBuffer = new Uint8Array(data);\n const fBuffer = new Float32Array(uBuffer.buffer);\n\n // Optionally store the raw splat buffer as an ArrayBuffer. This is the source reference\n // used by _addPartsInternal when a full texture rebuild is needed. Use uBuffer.buffer as\n // the canonical backing store — it is always a tightly packed ArrayBuffer containing\n // exactly the bytes we processed, avoiding issues with ArrayBufferView.byteOffset.\n if (this._keepInRam || this._alwaysRetainSplatsData) {\n this._splatsData = uBuffer.buffer;\n this._shData = sh ? sh.map((arr) => new Uint8Array(arr)) : null;\n } else {\n this._splatsData = null;\n this._shData = null;\n }\n\n const vertexCount = uBuffer.length / GaussianSplattingMeshBase._RowOutputLength;\n if (vertexCount != this._vertexCount) {\n // The source set changed: drop any active range filter so the buffers resize to the full\n // set. Callers (e.g. streaming LOD) re-apply their ranges after the data is committed.\n this._activeSplatRanges = null;\n this._activeSplatRangeKey = \"\";\n this._activeSplatRenderCount = 0;\n this._updateSplatIndexBuffer(vertexCount);\n }\n this._vertexCount = vertexCount;\n this._maxShDegree = sh ? (shDegree ?? 0) : 0;\n this._shDegree = this._maxShDegree;\n\n const textureSize = this._getTextureSize(vertexCount);\n const textureLength = textureSize.x * textureSize.y;\n const lineCountUpdate = GaussianSplattingMeshBase.ProgressiveUpdateAmount ?? textureSize.y;\n\n // Delegate part index storage to subclasses (e.g. GaussianSplattingMesh compound mode).\n if (partIndices) {\n this._onIndexDataReceived(partIndices, textureLength);\n }\n\n const minimum = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\n const maximum = new Vector3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);\n\n const covBSItemSize = this._useRGBACovariants ? 4 : 2;\n const covA = new Uint16Array(textureLength * 4);\n const covB = new Uint16Array(covBSItemSize * textureLength);\n const colorArray = new Uint8Array(textureLength * 4);\n\n // Incremental path: only upload the rows that contain new splats, leaving the already-committed\n // GPU region untouched. Falls through to the full-rebuild path when textures don't exist yet\n // or the texture height needs to grow.\n const incremental = this._canReuseCachedData(previousVertexCount, vertexCount, sh?.length ?? 0);\n\n if (!incremental) {\n this._splatSizeMin = Infinity;\n this._splatSizeMax = -Infinity;\n }\n\n // The first texture line/texel that must be (re-)processed and uploaded.\n // For a full rebuild this is 0. For an incremental update it is the row boundary just before\n // previousVertexCount so that any partial old row is re-processed as a complete row.\n const firstNewLine = incremental ? Math.floor(previousVertexCount / textureSize.x) : 0;\n const firstNewTexel = firstNewLine * textureSize.x;\n\n // Preserve old positions before replacing the array (incremental only)\n const oldPositions = this._splatPositions;\n this._splatPositions = new Float32Array(4 * textureLength);\n\n if (incremental) {\n this._splatPositions.set(oldPositions!.subarray(0, previousVertexCount * 4));\n minimum.copyFrom(this._cachedBoundingMin!);\n maximum.copyFrom(this._cachedBoundingMax!);\n // Let subclasses handle any incremental-specific setup (e.g. ensuring part-index textures)\n this._onIncrementalUpdateStart(textureSize);\n }\n\n if (GaussianSplattingMeshBase.ProgressiveUpdateAmount) {\n // Full rebuild: create GPU textures upfront with empty data; the loop fills them in batches via _updateSubTextures\n if (!incremental) {\n this._updateTextures(covA, covB, colorArray, sh);\n }\n this.setEnabled(true);\n\n const partCount = Math.ceil(textureSize.y / lineCountUpdate);\n for (let partIndex = 0; partIndex < partCount; partIndex++) {\n const updateLine = partIndex * lineCountUpdate;\n const batchEndLine = Math.min(updateLine + lineCountUpdate, textureSize.y);\n\n // Skip batches that lie entirely within the already-committed GPU region\n if (batchEndLine <= firstNewLine) {\n continue;\n }\n\n // Clip upload start to firstNewLine to avoid overwriting committed data with zeros\n const uploadStartLine = Math.max(updateLine, firstNewLine);\n const uploadStartTexel = uploadStartLine * textureSize.x;\n const batchEndTexel = batchEndLine * textureSize.x;\n\n for (let splatIdx = uploadStartTexel; splatIdx < batchEndTexel; splatIdx++) {\n if (splatIdx < vertexCount) {\n this._makeSplat(splatIdx, fBuffer, uBuffer, covA, covB, colorArray, minimum, maximum, flipY);\n } else {\n this._makeEmptySplat(splatIdx, covA, covB, colorArray);\n }\n }\n\n this._updateSubTextures(this._splatPositions, covA, covB, colorArray, uploadStartLine, batchEndLine - uploadStartLine, sh);\n this.getBoundingInfo().reConstruct(minimum, maximum, this.getWorldMatrix());\n if (isAsync) {\n yield;\n }\n }\n\n this._notifyWorkerNewData();\n } else {\n // Process splats from firstNewTexel: re-processes the partial old row (incremental) or processes everything from 0 (full rebuild)\n for (let i = firstNewTexel; i < vertexCount; i++) {\n this._makeSplat(i, fBuffer, uBuffer, covA, covB, colorArray, minimum, maximum, flipY);\n if (isAsync && i % GaussianSplattingMeshBase._SplatBatchSize === 0) {\n yield;\n }\n }\n\n // Incremental pads the full texture; full rebuild pads only to the next 16-splat boundary\n const paddedEnd = incremental ? textureLength : (vertexCount + 15) & ~0xf;\n for (let i = vertexCount; i < paddedEnd; i++) {\n this._makeEmptySplat(i, covA, covB, colorArray);\n }\n\n if (incremental) {\n // Partial upload: only rows from firstNewLine onwards; existing rows stay on GPU\n this._updateSubTextures(this._splatPositions, covA, covB, colorArray, firstNewLine, textureSize.y - firstNewLine, sh);\n this.getBoundingInfo().reConstruct(minimum, maximum, this.getWorldMatrix());\n this.setEnabled(true);\n this._notifyWorkerNewData();\n } else {\n // Full upload: create or replace all GPU textures\n this._updateTextures(covA, covB, colorArray, sh);\n this.getBoundingInfo().reConstruct(minimum, maximum, this.getWorldMatrix());\n this.setEnabled(true);\n this._sortIsDirty = true;\n }\n }\n\n // Cache bounding box for the next incremental addPart call\n this._cachedBoundingMin = minimum.clone();\n this._cachedBoundingMax = maximum.clone();\n\n this._splatDataPending = false;\n this._postToWorker(true);\n }\n\n /**\n * Update asynchronously the buffer\n * @param data array buffer containing center, color, orientation and scale of splats\n * @param sh optional array of uint8 array for SH data\n * @param partIndices optional array of uint8 for rig node indices\n * @param shDegree optional SH degree of the data\n * @returns a promise\n */\n public async updateDataAsync(data: ArrayBuffer, sh?: Uint8Array[], partIndices?: Uint8Array, shDegree?: number): Promise<void> {\n return await runCoroutineAsync(this._updateData(data, true, sh, partIndices, undefined, shDegree), createYieldingScheduler());\n }\n\n /**\n * @experimental\n * Update data from GS (position, orientation, color, scaling)\n * @param data array that contain all the datas\n * @param sh optional array of uint8 array for SH data\n * @param options optional informations on how to treat data (needs to be 3rd for backward compatibility)\n * @param partIndices optional array of uint8 for rig node indices\n * @param shDegree optional SH degree of the data\n */\n public updateData(data: ArrayBuffer, sh?: Uint8Array[], options: IUpdateOptions = { flipY: true }, partIndices?: Uint8Array, shDegree?: number): void {\n runCoroutineSync(this._updateData(data, false, sh, partIndices, options, shDegree));\n }\n\n /**\n * Refreshes the bounding info, taking into account all the thin instances defined\n * @returns the current Gaussian Splatting\n */\n public override refreshBoundingInfo(): Mesh {\n this.thinInstanceRefreshBoundingInfo(false);\n return this;\n }\n\n // in case size is different\n protected _updateSplatIndexBuffer(vertexCount: number): void {\n const renderedSplatCount = this._activeSplatRanges ? this._activeSplatRenderCount : vertexCount;\n const paddedVertexCount = Math.max((renderedSplatCount + 15) & ~0xf, 16);\n\n const previousIndex = this._splatIndex;\n\n if (!previousIndex || paddedVertexCount !== previousIndex.length) {\n this._splatIndex = new Float32Array(paddedVertexCount);\n\n // update meshes for knowns cameras\n this._cameraViewInfos.forEach((cameraViewInfos) => {\n cameraViewInfos.mesh.thinInstanceSetBuffer(\"splatIndex\", this._splatIndex, 16, false);\n });\n }\n\n const splatIndex = this._splatIndex!;\n\n // Populate the buffer with the current active source indices (identity when unfiltered) so every\n // rendered slot points at a valid splat. This is the synchronous (no async sort worker) path; the\n // worker path instead defers the index-buffer swap until a matching sort lands (see _onWorkerCreated).\n if (this._activeSplatRanges) {\n let index = 0;\n for (let rangeIndex = 0; rangeIndex < this._activeSplatRanges.length; rangeIndex += 2) {\n const start = this._activeSplatRanges[rangeIndex];\n const count = this._activeSplatRanges[rangeIndex + 1];\n for (let sourceIndex = start; sourceIndex < start + count; sourceIndex++) {\n splatIndex[index++] = sourceIndex;\n }\n }\n // Pad with `vertexCount` itself, not 0: splat 0 is real data, not a reserved empty slot, and\n // range filtering can leave it fully visible — see gaussianSplattingSortWorker.ts.\n for (; index < paddedVertexCount; index++) {\n splatIndex[index] = vertexCount;\n }\n } else {\n for (let i = 0; i < paddedVertexCount; i++) {\n splatIndex[i] = i;\n }\n }\n\n // Update depthMix\n if ((!this._depthMix || paddedVertexCount !== this._depthMix.length) && !IsNative) {\n this._depthMix = new BigInt64Array(paddedVertexCount);\n }\n\n this.forcedInstanceCount = Math.max(paddedVertexCount >> 4, 1);\n }\n\n protected _updateTextureFromData = (texture: BaseTexture, data: ArrayBufferView, width: number, lineStart: number, lineCount: number) => {\n const engine = this._getTextureDataUpdateEngine();\n const internalTexture = texture.getInternalTexture()!;\n // NativeEngine and NullEngine support complete raw uploads, but not sub-texture uploads.\n if (!engine._gl && !engine.isWebGPU && lineStart === 0 && lineCount === internalTexture.height) {\n engine.updateRawTexture(internalTexture, data, internalTexture.format, internalTexture.invertY, null, internalTexture.type, internalTexture._useSRGBBuffer);\n return;\n }\n engine.updateTextureData(internalTexture, data, 0, lineStart, width, lineCount, 0, 0, false);\n };\n\n protected _updateTextureFromDataRect = (texture: BaseTexture, data: ArrayBufferView, xOffset: number, yOffset: number, width: number, height: number) => {\n const engine = this._getTextureDataUpdateEngine();\n engine.updateTextureData(texture.getInternalTexture()!, data, xOffset, yOffset, width, height, 0, 0, false);\n };\n\n protected _getTextureDataUpdateEngine(): ITextureDataUpdateCapableEngine {\n return this.getEngine() as unknown as ITextureDataUpdateCapableEngine;\n }\n\n protected _updateShTextureData(texture: BaseTexture, shData: Uint8Array, textureWidth: number, lineStart: number, lineCount: number): void {\n const engine = this._getTextureDataUpdateEngine();\n\n // NativeEngine/NullEngine, updateTextureData unsupported\n if (!engine._gl && !engine.isWebGPU) {\n const internalTexture = texture.getInternalTexture()!;\n const expectedByteLength = textureWidth * internalTexture.height * 16;\n let uploadData: Uint32Array;\n if (shData.byteLength === expectedByteLength && shData.byteOffset % Uint32Array.BYTES_PER_ELEMENT === 0) {\n uploadData = new Uint32Array(shData.buffer, shData.byteOffset, shData.byteLength / Uint32Array.BYTES_PER_ELEMENT);\n } else {\n const padded = new Uint8Array(expectedByteLength);\n padded.set(shData.subarray(0, Math.min(shData.byteLength, expectedByteLength)));\n uploadData = new Uint32Array(padded.buffer);\n }\n engine.updateRawTexture(internalTexture, uploadData, internalTexture.format, internalTexture.invertY, null, internalTexture.type, internalTexture._useSRGBBuffer);\n return;\n }\n\n const bytesPerTexel = 16;\n const componentsPerTexel = 4;\n const startTexel = lineStart * textureWidth;\n const availableTexelCount = Math.floor(shData.byteLength / bytesPerTexel);\n\n if (startTexel >= availableTexelCount) {\n return;\n }\n\n let texelCount = Math.min(lineCount * textureWidth, availableTexelCount - startTexel);\n if (texelCount <= 0) {\n return;\n }\n\n const createView = (byteOffset: number, viewTexelCount: number) => {\n return new Uint32Array(shData.buffer, shData.byteOffset + byteOffset, viewTexelCount * componentsPerTexel);\n };\n\n const fullRowCount = Math.floor(texelCount / textureWidth);\n if (fullRowCount > 0) {\n const fullRowTexelCount = fullRowCount * textureWidth;\n this._updateTextureFromData(texture, createView(startTexel * bytesPerTexel, fullRowTexelCount), textureWidth, lineStart, fullRowCount);\n texelCount -= fullRowTexelCount;\n }\n\n if (texelCount > 0) {\n const partialRowOffset = (startTexel + fullRowCount * textureWidth) * bytesPerTexel;\n this._updateTextureFromDataRect(texture, createView(partialRowOffset, texelCount), 0, lineStart + fullRowCount, texelCount, 1);\n }\n }\n\n protected _updateSubTextures(centers: Float32Array, covA: Uint16Array, covB: Uint16Array, colors: Uint8Array, lineStart: number, lineCount: number, sh?: Uint8Array[]): void {\n const textureSize = this._getTextureSize(this._vertexCount);\n const covBSItemSize = this._useRGBACovariants ? 4 : 2;\n const texelStart = lineStart * textureSize.x;\n const texelCount = lineCount * textureSize.x;\n const covAView = new Uint16Array(covA.buffer, texelStart * 4 * Uint16Array.BYTES_PER_ELEMENT, texelCount * 4);\n const covBView = new Uint16Array(covB.buffer, texelStart * covBSItemSize * Uint16Array.BYTES_PER_ELEMENT, texelCount * covBSItemSize);\n const colorsView = new Uint8Array(colors.buffer, texelStart * 4, texelCount * 4);\n const centersView = new Float32Array(centers.buffer, texelStart * 4 * Float32Array.BYTES_PER_ELEMENT, texelCount * 4);\n this._updateTextureFromData(this._covariancesATexture!, covAView, textureSize.x, lineStart, lineCount);\n this._updateTextureFromData(this._covariancesBTexture!, covBView, textureSize.x, lineStart, lineCount);\n this._updateTextureFromData(this._centersTexture!, centersView, textureSize.x, lineStart, lineCount);\n this._updateTextureFromData(this._colorsTexture!, colorsView, textureSize.x, lineStart, lineCount);\n if (this._rotationsATexture && this._rotationDataA) {\n const rotAView = new Uint16Array(this._rotationDataA.buffer, texelStart * 4 * Uint16Array.BYTES_PER_ELEMENT, texelCount * 4);\n const rotBView = new Uint16Array(this._rotationDataB!.buffer, texelStart * 4 * Uint16Array.BYTES_PER_ELEMENT, texelCount * 4);\n const rotScaleView = new Uint16Array(this._rotationScaleData!.buffer, texelStart * 4 * Uint16Array.BYTES_PER_ELEMENT, texelCount * 4);\n this._updateTextureFromData(this._rotationsATexture, rotAView, textureSize.x, lineStart, lineCount);\n this._updateTextureFromData(this._rotationsBTexture!, rotBView, textureSize.x, lineStart, lineCount);\n this._updateTextureFromData(this._rotationScaleTexture!, rotScaleView, textureSize.x, lineStart, lineCount);\n }\n if (sh) {\n for (let i = 0; i < sh.length; i++) {\n this._updateShTextureData(this._shTextures![i], sh[i], textureSize.x, lineStart, lineCount);\n }\n }\n }\n\n protected _instantiateWorker(): void {\n if (!this._vertexCount) {\n return;\n }\n // The identity index buffer must exist even when no sort worker is needed: every render path\n // (including the Native one) reads it, and a null buffer breaks the Native bindings.\n this._updateSplatIndexBuffer(this._vertexCount);\n if (this._disableDepthSort) {\n return;\n }\n\n // no worker in native\n if (IsNative) {\n return;\n }\n\n // Start the worker thread\n this._worker?.terminate();\n // Reset the posting gate so the new worker can immediately receive sort requests.\n // If the previous worker was terminated mid-sort it would never have set _canPostToWorker\n // back to true, leaving the sort permanently frozen on the new worker.\n this._canPostToWorker = true;\n this._worker = new Worker(\n URL.createObjectURL(\n new Blob([\"(\", GaussianSplattingSortWorker.toString(), \")(self)\"], {\n type: \"application/javascript\",\n })\n )\n );\n\n const positions = Float32Array.from(this._splatPositions!);\n const vertexCount = this._vertexCount;\n\n this._worker.postMessage({ command: GaussianSplattingSortWorkerCommand.POSITIONS, positions, vertexCount }, [positions.buffer]);\n // The main thread owns the active interval set: send it explicitly (covering all indices when\n // no LOD filter is active) rather than letting the worker assume the full source set.\n this._postIntervalsToWorker();\n this._onWorkerCreated(this._worker!);\n\n this._worker.onerror = () => {\n // If the worker throws an unhandled error, unlock the posting gate so the next frame can retry the sort.\n this._canPostToWorker = true;\n };\n\n this._worker.onmessage = (e) => {\n // Size the result against the active (rendered) splat count, which may be a subset of the\n // full source set when an interval/LOD filter is active.\n const renderedPadded = Math.max((this.renderedSplatCount + 15) & ~0xf, 16);\n\n // Discard the result and trigger a fresh sort if it no longer matches the current active set:\n // either the active count changed since it was posted, or it was computed for a stale range\n // version (the active ranges changed while it was in flight). Applying it would render indices\n // that belong to a different active set.\n if (e.data.depthMix.length != renderedPadded || e.data.rangeVersion !== this._activeRangeVersion) {\n // Only re-enable posting and trigger a re-sort if the buffer is available.\n // If byteLength === 0 the buffer is already in-flight for a newer sort;\n // that sort's onmessage will handle things when it returns.\n if (this._depthMix.buffer.byteLength > 0) {\n this._canPostToWorker = true;\n this._postToWorker(true);\n this._sortIsDirty = false;\n }\n return;\n }\n\n this._depthMix = e.data.depthMix;\n const cameraId = e.data.cameraId;\n const sortRequestId = e.data.sortRequestId;\n\n // The index buffer swap is deferred to here so the previous fully-sorted state stays on screen\n // until this matching sort lands. Resize it now (the active count may have grown/shrunk since the\n // last applied sort) and rebind it for every known camera.\n if (!this._splatIndex || this._splatIndex.length !== renderedPadded) {\n this._splatIndex = new Float32Array(renderedPadded);\n this._cameraViewInfos.forEach((info) => {\n info.mesh.thinInstanceSetBuffer(\"splatIndex\", this._splatIndex, 16, false);\n info.splatIndexBufferSet = true;\n });\n }\n\n const indexMix = new Uint32Array(e.data.depthMix.buffer);\n if (this._splatIndex) {\n for (let j = 0; j < renderedPadded; j++) {\n this._splatIndex[j] = indexMix[2 * j];\n }\n }\n this.forcedInstanceCount = Math.max(renderedPadded >> 4, 1);\n this._commitDelayedTextureUpdate();\n\n // get mesh for camera and update its instance buffer\n const cameraViewInfos = this._cameraViewInfos.get(cameraId);\n if (cameraViewInfos) {\n if (cameraViewInfos.splatIndexBufferSet) {\n cameraViewInfos.mesh.thinInstanceBufferUpdated(\"splatIndex\");\n } else {\n cameraViewInfos.mesh.thinInstanceSetBuffer(\"splatIndex\", this._splatIndex, 16, false);\n cameraViewInfos.splatIndexBufferSet = true;\n }\n cameraViewInfos.sortAppliedId = sortRequestId;\n }\n this._canPostToWorker = true;\n this._readyToDisplay = true;\n // sort is dirty when GS is visible for progressive update with a this message arriving but positions were partially filled\n // another update needs to be kicked. The kick can't happen just when the position buffer is ready because _canPostToWorker might be false.\n if (this._sortIsDirty) {\n this._postToWorker(true);\n this._sortIsDirty = false;\n }\n };\n }\n\n protected _getTextureSize(length: number): Vector2 {\n const engine = this._scene.getEngine();\n const width = engine.getCaps().maxTextureSize;\n\n let height = 1;\n\n if (engine.version === 1 && !engine.isWebGPU) {\n while (width * height < length) {\n height *= 2;\n }\n // See the WebGL2/WebGPU branch below for why this guarantees an extra row when `length`\n // exactly fills every row. A power-of-2 height has to double to add any slack at all.\n // Usually this is a no-op since it is rare that the asset exactly contains a power-of-2\n // number of splats.\n if (length > 0 && width * height === length) {\n height *= 2;\n }\n } else {\n height = Math.ceil(length / width);\n // When `length` exactly fills every row, force one extra (fully zeroed) row so the atlas\n // always has at least one genuinely-empty splat slot past the real data, at index `length`.\n // The sort worker (gaussianSplattingSortWorker.ts) relies on that slot always existing to\n // safely pad the 16-aligned draw order — without it, the only \"spare\" index would be the\n // last real splat, which range-filtering (setSplatIndexRanges/opacity/size culling) can\n // leave fully visible and opaque, reproducing the same \"stuck in front\" bug on that splat.\n if (length > 0 && height * width === length) {\n height += 1;\n }\n }\n\n if (height > width) {\n Logger.Error(\"GaussianSplatting texture size: (\" + width + \", \" + height + \"), maxTextureSize: \" + width);\n height = width;\n }\n\n return new Vector2(width, height);\n }\n\n /**\n * Called after the sort worker has been created and the initial positions message has been sent.\n * Override in subclasses to post any additional setup messages the worker needs (e.g. group\n * indices, per-part matrices, etc.).\n * @param _worker the newly created worker\n */\n protected _onWorkerCreated(_worker: Worker): void {}\n\n /**\n * Called by the material to bind any extra shader uniforms that are specific to this mesh type.\n * The base implementation is a no-op; override in subclasses to bind additional data.\n * @param _effect the shader effect that is being bound\n * @internal\n */\n public bindExtraEffectUniforms(_effect: Effect): void {}\n\n /**\n * Processes all splats from a source GaussianSplattingMesh directly into the destination\n * texture arrays starting at dstOffset. This is the core of the texture-direct compound API:\n * no merged CPU buffer is ever created; each source mesh is written straight into its region.\n *\n * @param source - The source mesh whose splats are appended\n * @param dstOffset - The destination splat index at which writing starts\n * @param covA - Destination covA array (full texture size)\n * @param covB - Destination covB array (full texture size)\n * @param colorArray - Destination color array (full texture size)\n * @param sh - Destination SH arrays (full texture size), or undefined\n * @param minimum - Accumulated bounding min (updated in-place)\n * @param maximum - Accumulated bounding max (updated in-place)\n * @internal Use GaussianSplattingMesh.addPart instead\n */\n protected _appendSourceToArrays(\n source: GaussianSplattingMeshBase,\n dstOffset: number,\n covA: Uint16Array,\n covB: Uint16Array,\n colorArray: Uint8Array,\n sh: Uint8Array[] | undefined,\n minimum: Vector3,\n maximum: Vector3\n ): void {\n const srcCount = source._vertexCount;\n const bytesPerTexel = 16;\n const srcRaw = source._splatsData;\n if (!srcRaw || srcCount === 0) {\n return;\n }\n const uBuffer = GaussianSplattingMeshBase._GetSplatDataBytes(srcRaw);\n const fBuffer = GaussianSplattingMeshBase._GetSplatDataFloats(srcRaw);\n\n for (let i = 0; i < srcCount; i++) {\n this._makeSplat(dstOffset + i, fBuffer, uBuffer, covA, covB, colorArray, minimum, maximum, false, i);\n }\n\n // Copy SH data if both source and destination have it\n if (sh && source._shData) {\n for (let texIdx = 0; texIdx < sh.length; texIdx++) {\n if (texIdx < source._shData.length) {\n sh[texIdx].set(source._shData[texIdx].subarray(0, srcCount * bytesPerTexel), dstOffset * bytesPerTexel);\n }\n }\n }\n }\n\n /**\n * Modifies the splats according to the passed transformation matrix.\n * @param transform defines the transform matrix to use\n * @returns the current mesh\n */\n public override bakeTransformIntoVertices(transform: DeepImmutable<Matrix>): Mesh {\n const arrayBuffer = this.splatsData;\n if (!arrayBuffer) {\n Logger.Error(\"Cannot bake transform into vertices if splatsData is not kept in RAM\");\n return this;\n }\n\n // Check for uniform scaling\n const m = transform.m;\n const scaleX = Math.sqrt(m[0] * m[0] + m[1] * m[1] + m[2] * m[2]);\n const scaleY = Math.sqrt(m[4] * m[4] + m[5] * m[5] + m[6] * m[6]);\n const scaleZ = Math.sqrt(m[8] * m[8] + m[9] * m[9] + m[10] * m[10]);\n const epsilon = 0.001;\n if (Math.abs(scaleX - scaleY) > epsilon || Math.abs(scaleX - scaleZ) > epsilon) {\n Logger.Error(\"Gaussian Splatting bakeTransformIntoVertices does not support non-uniform scaling\");\n return this;\n }\n\n const uBuffer = new Uint8Array(arrayBuffer);\n const fBuffer = new Float32Array(arrayBuffer);\n\n const temp = TmpVectors.Vector3[0];\n let index: number;\n const quaternion = TmpVectors.Quaternion[0];\n const transformedQuaternion = TmpVectors.Quaternion[1];\n transform.decompose(temp, transformedQuaternion, temp);\n for (index = 0; index < this._vertexCount; index++) {\n const floatIndex = index * 8; // 8 floats per splat (center.x, center.y, center.z, scale.x, scale.y, scale.z, ...)\n Vector3.TransformCoordinatesFromFloatsToRef(fBuffer[floatIndex], fBuffer[floatIndex + 1], fBuffer[floatIndex + 2], transform, temp);\n fBuffer[floatIndex] = temp.x;\n fBuffer[floatIndex + 1] = temp.y;\n fBuffer[floatIndex + 2] = temp.z;\n\n // Apply uniform scaling to splat scales\n fBuffer[floatIndex + 3] *= scaleX;\n fBuffer[floatIndex + 4] *= scaleX;\n fBuffer[floatIndex + 5] *= scaleX;\n\n // Unpack quaternion from uint8array (matching _GetSplat packing convention)\n quaternion.set(\n (uBuffer[32 * index + 28 + 1] - 127.5) / 127.5,\n (uBuffer[32 * index + 28 + 2] - 127.5) / 127.5,\n (uBuffer[32 * index + 28 + 3] - 127.5) / 127.5,\n (uBuffer[32 * index + 28 + 0] - 127.5) / 127.5\n );\n quaternion.normalize();\n\n // If there is a negative scaling, we need to flip the quaternion to keep the correct handedness\n if (this.scaling.x < 0) {\n quaternion.x = -quaternion.x;\n quaternion.w = -quaternion.w;\n }\n if (this.scaling.y < 0) {\n quaternion.y = -quaternion.y;\n quaternion.w = -quaternion.w;\n }\n if (this.scaling.z < 0) {\n quaternion.z = -quaternion.z;\n quaternion.w = -quaternion.w;\n }\n\n // Transform the quaternion\n transformedQuaternion.multiplyToRef(quaternion, quaternion);\n quaternion.normalize();\n\n // Pack quaternion back to uint8array (matching _GetSplat packing convention)\n uBuffer[32 * index + 28 + 0] = Math.round(quaternion.w * 127.5 + 127.5);\n uBuffer[32 * index + 28 + 1] = Math.round(quaternion.x * 127.5 + 127.5);\n uBuffer[32 * index + 28 + 2] = Math.round(quaternion.y * 127.5 + 127.5);\n uBuffer[32 * index + 28 + 3] = Math.round(quaternion.z * 127.5 + 127.5);\n }\n\n this.updateData(arrayBuffer, this.shData ?? undefined, { flipY: false });\n\n return this;\n }\n}\n\n/**\n * Allocates SH texture buffers pre-filled with 128 (the neutral encoding of ~0.0 in the\n * shader's decompose() function). Padding bytes beyond the actual coefficients in the last\n * texture are read as higher-order SH bands when the mesh is added to a compound with a\n * higher degree; zero would decode to -1.0 instead, producing wrong colors.\n * @param textureCount number of SH textures to allocate\n * @param bytesEach byte size of each texture buffer\n * @returns array of initialized Uint8Array buffers\n */\nexport function AllocateShBuffers(textureCount: number, bytesEach: number): Uint8Array[] {\n const result: Uint8Array[] = [];\n for (let i = 0; i < textureCount; i++) {\n const arr = new Uint8Array(bytesEach);\n arr.fill(128);\n result.push(arr);\n }\n return result;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"gaussianSplattingMeshBase.pure.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAK7D,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAmB,MAAM,6BAA6B,CAAC;AAEpG,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAiB,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iEAAiE,CAAC;AAC5G,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AACnF,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAGpE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,uBAAuB,EAAkB,MAAM,qBAAqB,CAAC;AACnH,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAI3D,OAAO,EAAE,2BAA2B,EAAE,kCAAkC,EAAE,MAAM,+BAA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ACD,OAAO,MAAM,CAAC;AAClB,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\n\nimport { type Scene } from \"core/scene.pure\";\nimport { type DeepImmutable, type Nullable } from \"core/types\";\nimport { type BaseTexture } from \"core/Materials/Textures/baseTexture.pure\";\nimport { SubMesh } from \"../subMesh.pure\";\nimport { type AbstractMesh } from \"../abstractMesh.pure\";\nimport { Mesh } from \"../mesh.pure\";\nimport { VertexData } from \"../mesh.vertexData\";\nimport { Matrix, TmpVectors, Vector2, Vector3, type Quaternion } from \"core/Maths/math.vector.pure\";\n\nimport { Logger } from \"core/Misc/logger\";\nimport { Observable, type Observer } from \"core/Misc/observable\";\nimport { GaussianSplattingMaterial } from \"core/Materials/GaussianSplatting/gaussianSplattingMaterial.pure\";\nimport { RawTexture } from \"core/Materials/Textures/rawTexture\";\nimport { MultiRenderTarget } from \"core/Materials/Textures/multiRenderTarget.pure\";\nimport { Color4 } from \"core/Maths/math.color.pure\";\nimport { type InternalTexture } from \"core/Materials/Textures/internalTexture\";\nimport { Constants } from \"core/Engines/constants\";\nimport { FromHalfFloat, ToHalfFloat } from \"core/Misc/textureTools\";\nimport { type Material } from \"core/Materials/material.pure\";\nimport { type Effect } from \"core/Materials/effect.pure\";\nimport { Scalar } from \"core/Maths/math.scalar\";\nimport { runCoroutineSync, runCoroutineAsync, createYieldingScheduler, type Coroutine } from \"core/Misc/coroutine\";\nimport { EngineStore } from \"core/Engines/engineStore\";\nimport { type Camera } from \"core/Cameras/camera.pure\";\nimport { ImportMeshAsync } from \"core/Loading/sceneLoader\";\nimport { type INative } from \"core/Engines/Native/nativeInterfaces\";\nimport { type AbstractEngine } from \"core/Engines/abstractEngine.pure\";\nimport { type ICustomAnimationFrameRequester } from \"core/Misc/customAnimationFrameRequester\";\nimport { GaussianSplattingSortWorker, GaussianSplattingSortWorkerCommand } from \"./gaussianSplattingSortWorker\";\nimport { GaussianSplattingGpuSorter, type GaussianSplattingGpuSortOutput, type IGaussianSplattingGpuSortOptions } from \"./gaussianSplattingGpuSorter\";\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\ndeclare const _native: INative;\n\n// The compute shaders of the GPU sorter are loaded lazily, only when a WebGPU mesh uses the GPU sort.\nlet _GpuSortDependenciesReady = false;\nlet _GpuSortDependenciesFailed = false;\nlet _GpuSortDependenciesLoading = false;\n\nasync function _LoadGpuSortDependenciesAsync(): Promise<void> {\n if (_GpuSortDependenciesLoading) {\n return;\n }\n _GpuSortDependenciesLoading = true;\n try {\n await GaussianSplattingGpuSorter.LoadDependenciesAsync();\n _GpuSortDependenciesReady = true;\n } catch (e) {\n _GpuSortDependenciesFailed = true;\n Logger.Warn(\"Gaussian Splatting GPU sort shaders failed to load, falling back to the CPU sort: \" + e);\n }\n}\n\n/** Internal mirror of ISogTexturePack (defined in loaders) — avoids a circular import. */\ninterface ISogPackInternal {\n version: 1 | 2;\n splatCount: number;\n shDegree: number;\n meansTextureL: BaseTexture;\n meansTextureU: BaseTexture;\n scalesTexture: BaseTexture;\n quatsTexture: BaseTexture;\n sh0Texture: BaseTexture;\n shCentroidsTexture?: BaseTexture;\n shLabelsTexture?: BaseTexture;\n codebookTexture?: BaseTexture;\n meansMin: [number, number, number];\n meansMax: [number, number, number];\n scalesMin?: [number, number, number];\n scalesMax?: [number, number, number];\n sh0Min?: [number, number, number, number];\n sh0Max?: [number, number, number, number];\n shnMin?: number;\n shnMax?: number;\n shCoeffCount: number;\n positions: Float32Array;\n}\n\n/**\n * Safe-orbit camera limits embedded in a Gaussian Splatting file's metadata (Adobe safe-orbit\n * extension). Exposed on the loaded mesh via {@link GaussianSplattingMeshBase.safeOrbitCameraLimits}\n * so consumers can read/apply the limits independently of the scene's active camera — the loader's\n * automatic application only affects an active ArcRotateCamera at load time.\n */\nexport interface ISafeOrbitCameraLimits {\n /** Minimum safe orbit radius (distance from the camera to its target), if the file specifies one. */\n radiusMin?: number;\n /** Safe elevation range as `[minElevation, maxElevation]` in radians, if the file specifies one. */\n elevationMinMax?: [number, number];\n}\n\nconst IsNative = typeof _native !== \"undefined\";\nconst Native = IsNative ? _native : null;\ninterface IDelayedTextureUpdate {\n covA: Uint16Array;\n covB: Uint16Array;\n colors: Uint8Array;\n centers: Float32Array;\n sh?: Uint8Array[];\n}\ninterface IUpdateOptions {\n flipY?: boolean;\n /** @internal When set, skips reprocessing splats [0, previousVertexCount) and copies from cached arrays instead. */\n previousVertexCount?: number;\n}\n\n/**\n * Defines a contiguous source-splat range to render from a GaussianSplattingMesh.\n */\nexport interface IGaussianSplattingSplatRange {\n /**\n * First source splat index to render.\n */\n offset: number;\n /**\n * Number of source splats to render.\n */\n count: number;\n}\n\ninterface ITextureDataUpdateCapableEngine {\n updateTextureData(\n texture: InternalTexture,\n imageData: ArrayBufferView,\n xOffset: number,\n yOffset: number,\n width: number,\n height: number,\n faceIndex?: number,\n lod?: number,\n generateMipMaps?: boolean\n ): void;\n updateRawTexture(\n texture: Nullable<InternalTexture>,\n data: Nullable<ArrayBufferView>,\n format: number,\n invertY: boolean,\n compression?: Nullable<string>,\n type?: number,\n useSRGBBuffer?: boolean\n ): void;\n _gl?: unknown;\n isWebGPU?: boolean;\n}\n\n// @internal\nconst UnpackUnorm = (value: number, bits: number) => {\n const t = (1 << bits) - 1;\n return (value & t) / t;\n};\n\n// @internal\nconst Unpack111011 = (value: number, result: Vector3) => {\n result.x = UnpackUnorm(value >>> 21, 11);\n result.y = UnpackUnorm(value >>> 11, 10);\n result.z = UnpackUnorm(value, 11);\n};\n\n// @internal\nconst Unpack8888 = (value: number, result: Uint8ClampedArray) => {\n result[0] = UnpackUnorm(value >>> 24, 8) * 255;\n result[1] = UnpackUnorm(value >>> 16, 8) * 255;\n result[2] = UnpackUnorm(value >>> 8, 8) * 255;\n result[3] = UnpackUnorm(value, 8) * 255;\n};\n\n// @internal\n// unpack quaternion with 2,10,10,10 format (largest element, 3x10bit element)\nconst UnpackRot = (value: number, result: Quaternion) => {\n const norm = 1.0 / (Math.sqrt(2) * 0.5);\n const a = (UnpackUnorm(value >>> 20, 10) - 0.5) * norm;\n const b = (UnpackUnorm(value >>> 10, 10) - 0.5) * norm;\n const c = (UnpackUnorm(value, 10) - 0.5) * norm;\n const m = Math.sqrt(1.0 - (a * a + b * b + c * c));\n\n switch (value >>> 30) {\n case 0:\n result.set(m, a, b, c);\n break;\n case 1:\n result.set(a, m, b, c);\n break;\n case 2:\n result.set(a, b, m, c);\n break;\n case 3:\n result.set(a, b, c, m);\n break;\n }\n};\n\ninterface ICompressedPLYChunk {\n min: Vector3;\n max: Vector3;\n minScale: Vector3;\n maxScale: Vector3;\n minColor: Vector3;\n maxColor: Vector3;\n}\n\n/**\n * To support multiple camera rendering, rendered mesh is separated from the GaussianSplattingMesh itself.\n * The GS mesh serves as a proxy and a different mesh is rendered for each camera. This hot switch is done\n * in the render() function. Each camera has a corresponding ICameraViewInfo object. The key is the camera unique id.\n * ICameraViewInfo and the rendered mesh are created in method `_postToWorker`\n * Mesh are disabled to not let the scene render them directly.\n * ICameraViewInfo are sorted per last frame id update to prioritize the less recently updated ones.\n * There is 1 web worker per GaussianSplattingMesh to avoid too many copies between main thread and workers.\n * So, only one sort is being done at a time per GaussianSplattingMeshBase. If multiple cameras need an update,\n * they will be processed one by one in subsequent frames.\n */\ninterface ICameraViewInfo {\n camera: Camera;\n cameraDirection: Vector3;\n sortWorldMatrix: Matrix;\n sortCameraForward: Vector3;\n sortCameraPosition: Vector3;\n sortRequestId: number;\n sortAppliedId: number;\n mesh: Mesh;\n frameIdLastUpdate: number;\n splatIndexBufferSet: boolean;\n // GPU sort only: the camera's own sort output, the data revision it was last sorted for and the buffers version bound on `mesh`.\n gpuOutput: Nullable<GaussianSplattingGpuSortOutput>;\n gpuAppliedRevision: number;\n gpuBuffersVersion: number;\n gpuLastSortFrameId: number;\n}\n/**\n * Representation of the types\n */\nconst enum PLYType {\n FLOAT,\n INT,\n UINT,\n DOUBLE,\n UCHAR,\n USHORT,\n UNDEFINED,\n}\n\n/**\n * Usage types of the PLY values\n */\nconst enum PLYValue {\n MIN_X,\n MIN_Y,\n MIN_Z,\n MAX_X,\n MAX_Y,\n MAX_Z,\n\n MIN_SCALE_X,\n MIN_SCALE_Y,\n MIN_SCALE_Z,\n\n MAX_SCALE_X,\n MAX_SCALE_Y,\n MAX_SCALE_Z,\n\n PACKED_POSITION,\n PACKED_ROTATION,\n PACKED_SCALE,\n PACKED_COLOR,\n X,\n Y,\n Z,\n SCALE_0,\n SCALE_1,\n SCALE_2,\n\n DIFFUSE_RED,\n DIFFUSE_GREEN,\n DIFFUSE_BLUE,\n OPACITY,\n\n F_DC_0,\n F_DC_1,\n F_DC_2,\n F_DC_3,\n\n ROT_0,\n ROT_1,\n ROT_2,\n ROT_3,\n\n MIN_COLOR_R,\n MIN_COLOR_G,\n MIN_COLOR_B,\n\n MAX_COLOR_R,\n MAX_COLOR_G,\n MAX_COLOR_B,\n\n SH_0,\n SH_1,\n SH_2,\n SH_3,\n SH_4,\n SH_5,\n SH_6,\n SH_7,\n SH_8,\n SH_9,\n SH_10,\n SH_11,\n SH_12,\n SH_13,\n SH_14,\n SH_15,\n SH_16,\n SH_17,\n SH_18,\n SH_19,\n SH_20,\n SH_21,\n SH_22,\n SH_23,\n SH_24,\n SH_25,\n SH_26,\n SH_27,\n SH_28,\n SH_29,\n SH_30,\n SH_31,\n SH_32,\n SH_33,\n SH_34,\n SH_35,\n SH_36,\n SH_37,\n SH_38,\n SH_39,\n SH_40,\n SH_41,\n SH_42,\n SH_43,\n SH_44,\n SH_45,\n SH_46,\n SH_47,\n SH_48,\n SH_49,\n SH_50,\n SH_51,\n SH_52,\n SH_53,\n SH_54,\n SH_55,\n SH_56,\n SH_57,\n SH_58,\n SH_59,\n SH_60,\n SH_61,\n SH_62,\n SH_63,\n SH_64,\n SH_65,\n SH_66,\n SH_67,\n SH_68,\n SH_69,\n SH_70,\n SH_71,\n\n UNDEFINED,\n}\n\n/**\n * Property field found in PLY header\n */\nexport type PlyProperty = {\n /**\n * Value usage\n */\n value: PLYValue;\n /**\n * Value type\n */\n type: PLYType;\n /**\n * offset in byte from te beginning of the splat\n */\n offset: number;\n};\n\n/**\n * meta info on Splat file\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport interface PLYHeader {\n /**\n * number of splats\n */\n vertexCount: number;\n /**\n * number of spatial chunks for compressed ply\n */\n chunkCount: number;\n /**\n * length in bytes of the vertex info\n */\n rowVertexLength: number;\n /**\n * length in bytes of the chunk\n */\n rowChunkLength: number;\n /**\n * array listing properties per vertex\n */\n vertexProperties: PlyProperty[];\n /**\n * array listing properties per chunk\n */\n chunkProperties: PlyProperty[];\n /**\n * data view for parsing chunks and vertices\n */\n dataView: DataView;\n /**\n * buffer for the data view\n */\n buffer: ArrayBuffer;\n /**\n * degree of SH coefficients\n */\n shDegree: number;\n /**\n * number of coefficient per splat\n */\n shCoefficientCount: number;\n /**\n * buffer for SH coefficients\n */\n shBuffer: ArrayBuffer | null;\n}\n\n// Inter-frame task-queue yield\n// Depth-sort results arrive via worker postMessage, which is a regular-priority\n// task. At high refresh rates the rAF loop can leave almost no time for the\n// regular task queue, starving sort results for hundreds of milliseconds.\n// Installing a customAnimationFrameRequester that inserts a setTimeout(0) before\n// each rAF forces the event loop to drain regular tasks between frames.\n// The wrapper is ref-counted so it is installed when the first GSplat mesh is\n// created and removed when the last one is disposed.\n\ninterface IGsInterFrameYieldRequester extends ICustomAnimationFrameRequester {\n _gsInterFrameYield: true;\n _refCount: number;\n}\n\nfunction _AcquireGsInterFrameYield(engine: AbstractEngine): void {\n // Browser-only optimization: wraps the global requestAnimationFrame, which\n // doesn't exist on Babylon Native. Skip it there so the engine uses its\n // default frame scheduling.\n if (IsNative) {\n return;\n }\n const existing = engine.customAnimationFrameRequester as IGsInterFrameYieldRequester | null;\n if (existing?._gsInterFrameYield) {\n existing._refCount++;\n return;\n }\n if (existing) {\n // Slot is owned by another requester. Don't interfere.\n return;\n }\n let _timeoutId = 0;\n let _innerRafId = 0;\n const wrapper: IGsInterFrameYieldRequester = {\n _gsInterFrameYield: true,\n _refCount: 1,\n requestAnimationFrame: (callback: Function): number => {\n // Insert a setTimeout(0) to yield to the regular task queue (worker\n // postMessage results, input events) before scheduling the next animation\n // frame. Without this, a continuous rAF loop at high refresh rates leaves\n // almost no time for regular tasks, starving worker messages for hundreds of ms.\n _timeoutId = setTimeout(() => {\n _innerRafId = requestAnimationFrame(callback as FrameRequestCallback);\n }, 0) as unknown as number;\n return _timeoutId;\n },\n cancelAnimationFrame: (_id: number) => {\n clearTimeout(_timeoutId);\n if (_innerRafId > 0) {\n cancelAnimationFrame(_innerRafId);\n }\n _timeoutId = 0;\n _innerRafId = 0;\n },\n };\n engine.customAnimationFrameRequester = wrapper;\n}\n\n// Counterpart to _AcquireGsInterFrameYield. Call once per mesh on dispose.\nfunction _ReleaseGsInterFrameYield(engine: AbstractEngine): void {\n const existing = engine.customAnimationFrameRequester as IGsInterFrameYieldRequester | null;\n if (!existing?._gsInterFrameYield) {\n return;\n }\n existing._refCount--;\n if (existing._refCount === 0) {\n engine.customAnimationFrameRequester = null;\n }\n}\n\n/**\n * Base class for Gaussian Splatting meshes. Contains all single-cloud rendering logic.\n * @internal Use GaussianSplattingMesh instead; this class is an internal implementation detail.\n */\nexport class GaussianSplattingMeshBase extends Mesh {\n /**\n * When true (default), the depth-sort worker uses the fast O(n) counting (radix) sort. Set to false to\n * fall back to the legacy comparison sort (useful for A/B comparison or as a safety fallback). The change\n * takes effect on the next sort.\n */\n public static UseCountingSort = true;\n\n /**\n * When true, the depth-sort worker logs each sort's duration (ms) and active splat count to the console.\n * Off by default; intended for performance investigation only.\n */\n public static LogSortPerformance = false;\n\n /**\n * When true, meshes sort their splats on the GPU with a compute shader when the engine is WebGPU with compute shader support\n * and the splat count is within the GPU sorter limit. The CPU worker is then not created. False by default: the asynchronous CPU\n * worker is usually faster on low-end GPUs while the camera moves, because the GPU sort competes with rendering. Other engines\n * (WebGL, Native) always use the CPU worker. Meshes of a scene using a custom render function (`scene.customRenderFunction`, other than\n * the frame graph one) also keep the CPU worker, because the GPU sort is dispatched from `onBeforeRenderObservable`.\n * A mesh leaves the GPU sort for the CPU worker, and does not come back to it, when depth sorting is disabled at runtime\n * (see {@link GaussianSplattingMeshBase.disableDepthSort}), when point splatting is enabled, or when it starts streaming parts.\n * After a WebGPU device restoration, the sorter and its buffers are recreated.\n * Progressive loading sorts only the batches already uploaded, making them displayable before loading completes.\n * Read when the mesh instantiates its sort, so set it before loading data.\n * See also {@link GaussianSplattingMeshBase.useGpuSort} to override it on a single mesh.\n * @experimental\n */\n public static UseGpuSort = false;\n\n /**\n * Minimum number of frames between two GPU sorts of the same camera view when only the view changed (the camera moved or the mesh world\n * transform changed). Sorts caused by data changes (new splat data, parts, ranges) and the first sort of a view bypass this throttle.\n * After the first render, requests are coalesced at the next scene pre-render; initial readiness checks can sort synchronously.\n * The default of 1 re-sorts whenever the view changed. On a slow GPU the sort competes with rendering; a value of 2 or\n * more trades a slightly stale order during camera motion for a lower GPU cost, like the asynchronous CPU worker does.\n * @experimental\n */\n public static GpuSortMinFrameInterval = 1;\n\n /**\n * Overrides {@link GaussianSplattingMeshBase.UseGpuSort} for this mesh when not null. Set it before loading data.\n * @experimental\n */\n public useGpuSort: Nullable<boolean> = null;\n\n /**\n * Safe-orbit camera limits parsed from the source file's metadata, or `null` when the file\n * carries none. The loader also auto-applies these to an active ArcRotateCamera at load time\n * (unless `disableAutoCameraLimits` is set); this field exposes the raw values so they can be\n * applied or tracked regardless of the active camera type. See {@link ISafeOrbitCameraLimits}.\n */\n public safeOrbitCameraLimits: Nullable<ISafeOrbitCameraLimits> = null;\n\n /** @internal */\n public _vertexCount = 0;\n protected _worker: Nullable<Worker> = null;\n private _modelViewProjectionMatrix = Matrix.Identity();\n private _depthMix: BigInt64Array;\n protected _canPostToWorker = true;\n private _readyToDisplay = false;\n private _sortRequestId = 0;\n // Incremented on every active-range change. A worker sort result is only applied when it was computed\n // for the current range version (and size), so a sort for stale ranges is never rendered.\n private _activeRangeVersion = 0;\n private _hasRenderedOnce = false;\n protected _covariancesATexture: Nullable<BaseTexture> = null;\n protected _covariancesBTexture: Nullable<BaseTexture> = null;\n protected _centersTexture: Nullable<BaseTexture> = null;\n protected _colorsTexture: Nullable<BaseTexture> = null;\n // When a streaming part is reserved, the four core data textures (centers, covA, covB, colors) are backed\n // by this MRT's attachments instead of standalone RawTextures, so a streaming engine can GPU-decode into\n // the reserved region while static parts still CPU-upload into it. Null in the normal\n // (non-streaming) path, which keeps using RawTextures unchanged.\n protected _mrtAtlas: Nullable<MultiRenderTarget> = null;\n protected _useMrtAtlas = false;\n // Higher-order SH atlas. When a streaming part needs baked SH, `_shTextures` become the single\n // attachments of these render-targetable integer MRTs (one per packed-u32 SH texture) so the streaming engine\n // GPU-decodes SH into the reserved region while static SH parts still CPU-upload into them. Null in the normal\n // path (SH stays plain RawTextures). One MRT per attachment keeps within WebGPU's per-sample byte budget.\n protected _shMrtAtlas: Nullable<MultiRenderTarget[]> = null;\n protected _useShMrtAtlas = false;\n protected _shMrtAtlasTextureCount = 0;\n protected _rotationsATexture: Nullable<BaseTexture> = null;\n protected _rotationsBTexture: Nullable<BaseTexture> = null;\n protected _rotationScaleTexture: Nullable<BaseTexture> = null;\n // Rotation/scale atlas. When a streaming part needs voxel-IBL rotation/scale, the three rotation\n // textures become the attachments of this render-targetable half-float MRT so the streaming engine GPU-decodes\n // rotation/scale into the reserved region while static parts still CPU-upload into it. Null in the normal path\n // (rotation stays plain RawTextures created per-splat by `_makeSplat`).\n protected _rotMrtAtlas: Nullable<MultiRenderTarget> = null;\n protected _useRotMrtAtlas = false;\n private _rotationDataA: Nullable<Uint16Array> = null;\n private _rotationDataB: Nullable<Uint16Array> = null;\n private _rotationScaleData: Nullable<Uint16Array> = null;\n protected _needsRotationScaleTextures: boolean = false;\n protected _splatPositions: Nullable<Float32Array> = null;\n private _splatIndex: Nullable<Float32Array> = null;\n protected _shTextures: Nullable<BaseTexture[]> = null;\n /** @internal */\n public _splatsData: Nullable<ArrayBuffer> = null;\n /** @internal */\n public _shData: Nullable<Uint8Array[]> = null;\n private _textureSize: Vector2 = new Vector2(0, 0);\n protected readonly _keepInRam: boolean = false;\n protected _alwaysRetainSplatsData: boolean = false;\n protected _flipY = false;\n\n private _delayedTextureUpdate: Nullable<IDelayedTextureUpdate> = null;\n protected _useRGBACovariants = false;\n protected _useSog = false;\n protected _sogParams: Nullable<ISogPackInternal> = null;\n private _material: Nullable<Material> = null;\n\n private _tmpCovariances = [0, 0, 0, 0, 0, 0];\n private _splatSizeMin: number = Infinity;\n private _splatSizeMax: number = -Infinity;\n private _sortIsDirty = false;\n // A forced sort requested while no classic pass needed sorting; runs on the next classic pass.\n private _forcedSortPending = false;\n\n // GPU sort state. `_gpuMode` is true when this mesh sorts with the GPU sorter instead of the worker.\n private _gpuMode = false;\n private _gpuSorter: Nullable<GaussianSplattingGpuSorter> = null;\n private _gpuObserver: Nullable<Observer<Scene>> = null;\n private _gpuRestoreObserver: Nullable<Observer<AbstractEngine>> = null;\n // Incremented whenever the sort inputs change (data, ranges, part matrices): every camera output is then sorted again.\n private _gpuDataRevision = 1;\n private _gpuSourceDirty = true;\n private _gpuIntervalsDirty = true;\n // Null outside progressive loading; otherwise only this prefix of the source has been uploaded.\n private _gpuProgressiveCount: Nullable<number> = null;\n private _gpuSortPending = false;\n private _gpuPaddedCount = 0;\n private _gpuBoundsMin: Nullable<Vector3> = null;\n private _gpuBoundsMax: Nullable<Vector3> = null;\n private _gpuBoundsDirty = true;\n private _gpuSortOptions: IGaussianSplattingGpuSortOptions = {};\n private _gpuViewInfos: ICameraViewInfo[] = [];\n private _gpuCollectFrameId = 0;\n private _gpuCameraPosition = [0, 0, 0];\n // Set when the worker has to be (re)created lazily after leaving the GPU sort mode.\n private _workerPending = false;\n private _gpuPartMatricesDirty = false;\n // Set when the mesh cannot use the GPU sort (e.g. an external work buffer is used as centers).\n private _gpuSortForbidden = false;\n protected _activeSplatRanges: Nullable<Uint32Array> = null;\n private _activeSplatRangeKey = \"\";\n private _activeSplatRenderCount = 0;\n\n // Cached bounding box for incremental addPart updates (O(1) vs O(N) scan of positions)\n protected _cachedBoundingMin: Nullable<Vector3> = null;\n protected _cachedBoundingMax: Nullable<Vector3> = null;\n\n private static _RowOutputLength = 3 * 4 + 3 * 4 + 4 + 4; // Vector3 position, Vector3 scale, 1 u8 quaternion, 1 color with alpha\n private static _SH_C0 = 0.28209479177387814;\n // batch size between 2 yield calls. This value is a tradeoff between updates overhead and framerate hiccups\n // This step is faster the PLY conversion. So batch size can be bigger\n private static _SplatBatchSize = 327680;\n // batch size between 2 yield calls during the PLY to splat conversion.\n private static _PlyConversionBatchSize = 32768;\n /** @internal */\n public _shDegree = 0;\n /** Incremented whenever `_updateData` replaces the splat data, even when it reuses the same buffer. @internal */\n public _splatDataRevision = 0;\n /** True while `_updateData` is filling the atlas, so consumers keep the last complete data. @internal */\n public _splatDataPending = false;\n protected _maxShDegree = 0;\n\n private static readonly _BatchSize = 16; // 16 splats per instance\n private _cameraViewInfos = new Map<number, ICameraViewInfo>();\n private _cameraRemovedObserver: Nullable<Observer<Camera>> = null;\n\n protected static readonly _DefaultViewUpdateThreshold = 1e-4;\n\n /** Fired after parts are added or the mesh is rebuilt following a removal. Payload is the new part count. */\n public readonly onPartCountChangedObservable = new Observable<number>();\n\n /** Fired after part-removal validation passes but before the mesh is rebuilt.\n * Payload is the original (pre-removal) part index. */\n public readonly onPartRemovedObservable = new Observable<number>();\n\n /**\n * Fired just before an existing MRT-backed atlas is recreated to grow it (e.g. adding a part while a streaming\n * part exists). Payload is the OLD atlas. Streaming parts subscribe to back up their GPU-only region before it\n * is disposed. Only fires when growing an existing MRT atlas (not on first creation).\n * @internal\n */\n public readonly _onBeforeAtlasRebuildObservable = new Observable<MultiRenderTarget>();\n\n /**\n * Fired after the new (grown) MRT-backed atlas has been created and its CPU data uploaded. Payload is the NEW\n * atlas. Streaming parts subscribe to rebind to it and restore their backed-up region.\n * @internal\n */\n public readonly _onAfterAtlasRebuildObservable = new Observable<MultiRenderTarget>();\n\n /**\n * Returns a byte-accurate view for retained splat data, preserving any non-zero byte offset.\n * @param data The retained splat source bytes.\n * @returns A Uint8Array covering the exact source byte range.\n * @internal\n */\n protected static _GetSplatDataBytes(data: ArrayBuffer | ArrayBufferView): Uint8Array {\n return ArrayBuffer.isView(data) ? new Uint8Array(data.buffer, data.byteOffset, data.byteLength) : new Uint8Array(data);\n }\n\n /**\n * Returns a Float32 reinterpretation for retained splat data, copying only when alignment requires it.\n * @param data The retained splat source bytes.\n * @returns A Float32Array over the exact source byte range.\n * @internal\n */\n protected static _GetSplatDataFloats(data: ArrayBuffer | ArrayBufferView): Float32Array {\n const bytes = GaussianSplattingMeshBase._GetSplatDataBytes(data);\n const floatSize = Float32Array.BYTES_PER_ELEMENT;\n\n if (bytes.byteLength % floatSize !== 0) {\n throw new Error(`Gaussian splat data byte length (${bytes.byteLength}) is not divisible by ${floatSize} and cannot be reinterpreted as Float32 data.`);\n }\n\n if (bytes.byteOffset % floatSize !== 0) {\n const copy = new Uint8Array(bytes.byteLength);\n copy.set(bytes);\n return new Float32Array(copy.buffer, 0, bytes.byteLength / floatSize);\n }\n\n return new Float32Array(bytes.buffer, bytes.byteOffset, bytes.byteLength / floatSize);\n }\n\n private static _BuildSplatRangeData(\n ranges: Nullable<readonly IGaussianSplattingSplatRange[]>,\n vertexCount: number\n ): { ranges: Nullable<Uint32Array>; count: number; key: string } {\n if (ranges === null) {\n return { ranges: null, count: vertexCount, key: \"\" };\n }\n\n const rangePairs: number[] = [];\n let totalCount = 0;\n let key = \"\";\n for (const range of ranges) {\n const start = Math.max(0, Math.floor(range.offset));\n const count = Math.max(0, Math.floor(range.count));\n const end = Math.min(vertexCount, start + count);\n const rangeCount = Math.max(0, end - start);\n if (rangeCount === 0) {\n continue;\n }\n\n rangePairs.push(start, rangeCount);\n totalCount += rangeCount;\n key += `${start}:${rangeCount};`;\n }\n\n return { ranges: new Uint32Array(rangePairs), count: totalCount, key };\n }\n\n /**\n * Cosine value of the angle threshold to update view dependent splat sorting. Default is 0.0001.\n */\n public viewUpdateThreshold: number = GaussianSplattingMeshBase._DefaultViewUpdateThreshold;\n\n protected _disableDepthSort = false;\n /**\n * If true, disables depth sorting of the splats (default: false)\n * Disabling sorting also discards deferred forced-sort requests.\n * A mesh sorted on the GPU (see {@link GaussianSplattingMeshBase.UseGpuSort}) leaves the GPU sort when it is disabled at runtime\n * and uses the identity index buffer of the CPU path. It does not return to the GPU sort when sorting is enabled again: the CPU worker is used instead.\n */\n public get disableDepthSort() {\n return this._disableDepthSort;\n }\n public set disableDepthSort(value: boolean) {\n if (!this._disableDepthSort && value) {\n this._worker?.terminate();\n this._worker = null;\n this._disableDepthSort = true;\n this._forcedSortPending = false;\n if (this._gpuMode) {\n // The GPU sort has no identity output: the CPU path provides valid indices for every view and data update.\n this._switchToWorkerSort();\n }\n } else if (this._disableDepthSort && !value) {\n this._disableDepthSort = false;\n this._sortIsDirty = true;\n this._instantiateWorker();\n }\n }\n\n /**\n * View direction factor used to compute the SH view direction in the shader.\n * @deprecated Not used anymore for SH rendering\n */\n public get viewDirectionFactor() {\n return Vector3.OneReadOnly;\n }\n\n /**\n * SH degree. 0 = no sh (default). 1 = 3 parameters. 2 = 8 parameters. 3 = 15 parameters.\n * Value is clamped between 0 and the maximum degree available from loaded data.\n */\n public get shDegree() {\n return this._shDegree;\n }\n\n public set shDegree(value: number) {\n const maxDegree = this._maxShDegree;\n const clamped = Math.max(0, Math.min(Math.round(value), maxDegree));\n if (this._shDegree === clamped) {\n return;\n }\n this._shDegree = clamped;\n this.material?.resetDrawCache();\n }\n\n /**\n * Maximum SH degree available from the loaded data.\n */\n public get maxShDegree() {\n return this._maxShDegree;\n }\n\n /**\n * Number of splats in the mesh\n */\n public get splatCount() {\n return this._gpuMode ? this._gpuPaddedCount : this._splatIndex?.length;\n }\n\n /**\n * Number of source splats currently selected for rendering.\n * When no range filter is active, this is the mesh's full source splat count.\n */\n public get renderedSplatCount(): number {\n return this._activeSplatRanges ? this._activeSplatRenderCount : this._vertexCount;\n }\n\n /**\n * Restricts rendering to the provided source splat ranges.\n * Passing `null` clears the range filter and renders the full source splat set.\n * @param ranges contiguous source ranges to render, or null to render all splats\n */\n public setSplatIndexRanges(ranges: Nullable<readonly IGaussianSplattingSplatRange[]>): void {\n this._setSplatIndexRanges(ranges);\n }\n\n private _setSplatIndexRanges(ranges: Nullable<readonly IGaussianSplattingSplatRange[]>): void {\n const rangeData = GaussianSplattingMeshBase._BuildSplatRangeData(ranges, this._vertexCount);\n const isSameRangeSet = this._activeSplatRanges === null ? rangeData.ranges === null : rangeData.ranges !== null && this._activeSplatRangeKey === rangeData.key;\n if (isSameRangeSet) {\n return;\n }\n\n this._activeSplatRanges = rangeData.ranges;\n this._activeSplatRangeKey = rangeData.key;\n this._activeSplatRenderCount = rangeData.count;\n this._activeRangeVersion++;\n if (this._gpuMode) {\n this._gpuIntervalsDirty = true;\n this._gpuDataRevision++;\n this._sortIsDirty = true;\n this._postToWorker(true);\n return;\n }\n this._postIntervalsToWorker();\n if (this._worker) {\n // Defer swapping the rendered index buffer until the worker returns a depth sort computed for\n // this exact range set (see the worker `onmessage` handler). Until then we keep rendering the\n // previous fully-sorted state, so a range/LOD change never shows an unsorted flash nor a stale\n // index buffer (rendering indices that belong to a different active set, which caused the\n // disappear/reappear flicker). Only the worker's depth buffer is resized here so the next sort\n // produces the right number of entries.\n this._ensureDepthMixSize(Math.max((this._activeSplatRenderCount + 15) & ~0xf, 16));\n this._sortIsDirty = true;\n this._postToWorker(true);\n } else {\n // Synchronous sort paths (disabled depth sort / Native): swap the index buffer immediately.\n this._updateSplatIndexBuffer(this._vertexCount);\n this._postToWorker(true);\n }\n }\n\n /**\n * Whether the depth sort is settled: a sort computed for the current active ranges and camera has been\n * applied to the rendered index buffer, and no further sort is pending or in flight (including a forced sort\n * deferred until a classic pass needs it). For a static camera\n * and a fixed active set this becomes true once the final sort completes. Used by streaming subclasses to\n * detect when rendering is fully up to date (e.g. for deterministic screenshots) and by IBL shadows to\n * avoid voxelizing against an index buffer the worker has not finished (re)building yet.\n * @internal\n */\n public get _isDepthSortSettled(): boolean {\n if (this._gpuMode) {\n return this._readyToDisplay && !this._gpuSortPending && !this._forcedSortPending && this._canPostToWorker;\n }\n return this._readyToDisplay && !this._sortIsDirty && !this._forcedSortPending && this._canPostToWorker;\n }\n\n // (Re)allocates the worker depth buffer to the given padded size. A fresh array is allocated when the\n // size differs or the current buffer is detached (in-flight in the worker), so a queued sort can be\n // re-posted with a correctly-sized buffer without disturbing the in-flight one.\n private _ensureDepthMixSize(paddedCount: number): void {\n if (IsNative) {\n return;\n }\n if (!this._depthMix || this._depthMix.length !== paddedCount || this._depthMix.buffer.byteLength === 0) {\n this._depthMix = new BigInt64Array(paddedCount);\n }\n }\n\n /**\n * Sends the active source-splat intervals to the sort worker. When no range filter is active,\n * a single interval covering all source splats is sent so the worker never assumes the full set.\n */\n private _postIntervalsToWorker(): void {\n if (this._gpuMode) {\n this._gpuIntervalsDirty = true;\n this._gpuDataRevision++;\n return;\n }\n if (!this._worker) {\n return;\n }\n const intervals = this._activeSplatRanges ? new Uint32Array(this._activeSplatRanges) : new Uint32Array([0, this._vertexCount]);\n this._worker.postMessage({ command: GaussianSplattingSortWorkerCommand.INTERVALS, intervals }, [intervals.buffer]);\n }\n\n /**\n * Initializes this mesh to render from an externally-provided, GPU-decoded work buffer, bypassing the\n * CPU `updateData` path. The four textures must hold the standard decoded GS layout addressed by linear\n * splat index over a square texture: centers (x,y,z,1), covariance A (Sigma00,01,02,11) and B\n * (Sigma12,22,*,*) as full covariance (so `center.w` is 1), and RGBA color. `splatPositions` are the\n * stride-4 CPU centers consumed by the depth-sort worker.\n * @param centers centers texture\n * @param covariancesA covariance A texture\n * @param covariancesB covariance B texture\n * @param colors color texture\n * @param splatPositions stride-4 CPU centers for depth sorting (length vertexCount*4)\n * @param vertexCount number of splats addressable in the work buffer\n * @param shTextures optional baked higher-order SH textures (packed-u32) produced by the work buffer's SH decode.\n * When provided, the draw path lights the decoded splats with view-dependent SH (the non-SOG `shTexture0..N`\n * path). `shDegree` sets both the max and active SH degree.\n * @param shDegree SH degree of the baked SH textures (0 = none). Ignored when `shTextures` is empty/omitted.\n * @param rotationTextures optional decoded rotation/scale textures ([rotA, rotB, rotScale]) produced by the work\n * buffer's rotation decode. When provided, they drive the voxel-IBL rotation/scale samplers so the streamed\n * splats participate in voxel-based IBL shadowing.\n */\n protected _setExternalWorkBuffer(\n centers: BaseTexture,\n covariancesA: BaseTexture,\n covariancesB: BaseTexture,\n colors: BaseTexture,\n splatPositions: Float32Array,\n vertexCount: number,\n shTextures?: Nullable<BaseTexture[]>,\n shDegree: number = 0,\n rotationTextures?: Nullable<BaseTexture[]>\n ): void {\n this._covariancesATexture = covariancesA;\n this._covariancesBTexture = covariancesB;\n this._centersTexture = centers;\n this._colorsTexture = colors;\n this._splatPositions = splatPositions;\n this._vertexCount = vertexCount;\n if (shTextures && shTextures.length) {\n this._shTextures = shTextures;\n this._maxShDegree = shDegree;\n this._shDegree = shDegree;\n }\n // Point the voxel-IBL rotation/scale samplers at the work buffer's decoded rotation textures ([rotA, rotB,\n // rotScale]) so a standalone stream can cast/receive voxel-IBL shadows.\n if (rotationTextures && rotationTextures.length >= 3) {\n this._rotationsATexture = rotationTextures[0];\n this._rotationsBTexture = rotationTextures[1];\n this._rotationScaleTexture = rotationTextures[2];\n this._needsRotationScaleTextures = true;\n }\n // The centers are an external render target: only the CPU worker sorts this mesh for now.\n this._gpuSortForbidden = true;\n this._activeSplatRanges = null;\n this._activeSplatRangeKey = \"\";\n this._activeSplatRenderCount = 0;\n this._readyToDisplay = false;\n // Sizes _splatIndex/_depthMix, starts the sort worker, and posts positions + intervals.\n this._instantiateWorker();\n // updateData (bypassed here) normally enables the mesh; do it explicitly for the work-buffer path.\n this.setEnabled(true);\n }\n\n /**\n * returns the splats data array buffer that contains in order : postions (3 floats), size (3 floats), color (4 bytes), orientation quaternion (4 bytes)\n * Only available if the mesh was created with keepInRam: true\n */\n public get splatsData() {\n return this._keepInRam ? this._splatsData : null;\n }\n\n /**\n * returns the SH data arrays\n * Only available if the mesh was created with keepInRam: true\n */\n public get shData() {\n return this._keepInRam ? this._shData : null;\n }\n\n /**\n * Returns the min/max size range of splats in this mesh, where size is pow(|det(Σ)|, 1/6)\n * of the 3D covariance matrix — equivalent to the geometric mean of the principal radii.\n * Computed automatically during updateData(). Returns null before any data has been loaded.\n */\n public get splatSizeRange(): Nullable<{ min: number; max: number }> {\n if (!isFinite(this._splatSizeMin) || !isFinite(this._splatSizeMax)) {\n return null;\n }\n return { min: this._splatSizeMin, max: this._splatSizeMax };\n }\n\n /**\n * Set the number of batch (a batch is 16384 splats) after which a display update is performed\n * A value of 0 (default) means display update will not happens before splat is ready.\n */\n public static ProgressiveUpdateAmount = 0;\n\n /**\n * Gets the covariancesA texture.\n * On WebGPU it is created as a sampled-data-only texture (no render attachment usage), so it cannot be used as a render target.\n */\n public get covariancesATexture() {\n return this._covariancesATexture;\n }\n\n /**\n * Gets the covariancesB texture.\n * On WebGPU it is created as a sampled-data-only texture (no render attachment usage), so it cannot be used as a render target.\n */\n public get covariancesBTexture() {\n return this._covariancesBTexture;\n }\n\n /**\n * Gets the centers texture.\n * On WebGPU it is created as a sampled-data-only texture (no render attachment usage), so it cannot be used as a render target.\n */\n public get centersTexture() {\n return this._centersTexture;\n }\n\n /**\n * Gets the colors texture.\n * On WebGPU it is created as a sampled-data-only texture (no render attachment usage), so it cannot be used as a render target.\n */\n public get colorsTexture() {\n return this._colorsTexture;\n }\n\n /**\n * Gets the rotation matrix A texture (rotation elements m[0],m[1],m[2],m[4]).\n * On WebGPU it is created as a sampled-data-only texture (no render attachment usage), so it cannot be used as a render target.\n */\n public get rotationsATexture() {\n return this._rotationsATexture;\n }\n\n /**\n * Gets the rotation matrix B texture (rotation elements m[5],m[6],m[8],m[9]).\n * On WebGPU it is created as a sampled-data-only texture (no render attachment usage), so it cannot be used as a render target.\n */\n public get rotationsBTexture() {\n return this._rotationsBTexture;\n }\n\n /**\n * Gets the rotation scale texture (rotation element m[10] followed by scale diagonal sx,sy,sz).\n * On WebGPU it is created as a sampled-data-only texture (no render attachment usage), so it cannot be used as a render target.\n */\n public get rotationScaleTexture() {\n return this._rotationScaleTexture;\n }\n\n /**\n * Enables or disables generation of rotation and scale matrix textures, required for voxel-based IBL shadows.\n */\n public get needsRotationScaleTextures() {\n return this._needsRotationScaleTextures;\n }\n\n public set needsRotationScaleTextures(value: boolean) {\n if (this._needsRotationScaleTextures === value) {\n return;\n }\n this._needsRotationScaleTextures = value;\n if (value && this._covariancesATexture) {\n if (this._splatsData) {\n this.updateData(this._splatsData, this._shData ?? undefined, { flipY: false }, undefined, this._shDegree);\n } else {\n Logger.Error(\n \"GaussianSplattingMeshBase: needsRotationScaleTextures was enabled after the mesh was already loaded, but the splat data is not kept in RAM. \" +\n \"The rotation and scale matrix textures cannot be initialized. Please reload the mesh data via updateData() or construct with keepInRam=true.\"\n );\n }\n }\n }\n\n /**\n * Gets the SH textures.\n * On WebGPU these are created as sampled-data-only textures (no render attachment usage), so they cannot be used as render targets.\n */\n public get shTextures() {\n return this._shTextures;\n }\n\n /**\n * True when this mesh holds raw SOG webp textures (dequantized in-shader) rather than the\n * pre-decoded covariance/center/color textures produced by the standard splat loader.\n */\n public get useSog(): boolean {\n return this._useSog;\n }\n\n /**\n * SOG dequantization parameters paired with the raw textures.\n * Set by the splat loader when `useSogTextures: true`. Null otherwise.\n */\n public get sogParams(): Nullable<ISogPackInternal> {\n return this._sogParams;\n }\n\n /**\n * Install a set of raw SOG webp textures and bind the mesh to the in-shader dequantization path.\n * @param pack SOG texture pack produced by ParseSogMetaAsTextures.\n * @internal\n */\n public setSogTextureData(pack: ISogPackInternal): void {\n this._useSog = true;\n this._sogParams?.codebookTexture?.dispose();\n this._sogParams = pack;\n this._vertexCount = pack.splatCount;\n this._shDegree = pack.shDegree ?? 0;\n this._maxShDegree = this._shDegree;\n\n // Stride-4 (xyz + 1) — required by the depth-sort worker and the centers texture path.\n this._splatPositions = pack.positions;\n\n // Reuse existing texture slots for SOG textures (the shader, under USE_SOG, samples them as RGBA8).\n this._covariancesATexture?.dispose();\n this._covariancesBTexture?.dispose();\n this._centersTexture?.dispose();\n this._colorsTexture?.dispose();\n this._rotationsATexture?.dispose();\n if (this._shTextures) {\n for (const t of this._shTextures) {\n t.dispose();\n }\n }\n\n this._centersTexture = pack.meansTextureL;\n this._covariancesATexture = pack.meansTextureU;\n this._covariancesBTexture = pack.scalesTexture;\n this._rotationsATexture = pack.quatsTexture;\n this._colorsTexture = pack.sh0Texture;\n\n const shTextures: BaseTexture[] = [];\n if (pack.shCentroidsTexture) {\n shTextures.push(pack.shCentroidsTexture);\n }\n if (pack.shLabelsTexture) {\n shTextures.push(pack.shLabelsTexture);\n }\n this._shTextures = shTextures.length ? shTextures : null;\n\n // Force pipeline rebuild so the USE_SOG define and extra samplers are picked up.\n this._material?.resetDrawCache();\n\n const size = pack.meansTextureL.getSize();\n this._textureSize.x = size.width;\n this._textureSize.y = size.height;\n\n this._updateSplatIndexBuffer(this._vertexCount);\n this._instantiateWorker();\n\n // Compute bounds from the CPU-decoded positions (stride-4) so the mesh is not frustum-culled.\n const positions = pack.positions as Float32Array;\n const minimum = new Vector3(Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY);\n const maximum = new Vector3(Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY);\n for (let i = 0; i < this._vertexCount; i++) {\n const x = positions[i * 4 + 0];\n const y = positions[i * 4 + 1];\n const z = positions[i * 4 + 2];\n if (x < minimum.x) {\n minimum.x = x;\n }\n if (y < minimum.y) {\n minimum.y = y;\n }\n if (z < minimum.z) {\n minimum.z = z;\n }\n if (x > maximum.x) {\n maximum.x = x;\n }\n if (y > maximum.y) {\n maximum.y = y;\n }\n if (z > maximum.z) {\n maximum.z = z;\n }\n }\n this.getBoundingInfo().reConstruct(minimum, maximum, this.getWorldMatrix());\n this.setEnabled(true);\n this._sortIsDirty = true;\n }\n\n /**\n * Gets the kernel size\n * Documentation and mathematical explanations here:\n * https://github.com/graphdeco-inria/gaussian-splatting/issues/294#issuecomment-1772688093\n * https://github.com/autonomousvision/mip-splatting/issues/18#issuecomment-1929388931\n */\n public get kernelSize() {\n return this._material instanceof GaussianSplattingMaterial ? this._material.kernelSize : 0;\n }\n\n /**\n * Get the compensation state\n */\n public get compensation() {\n return this._material instanceof GaussianSplattingMaterial ? this._material.compensation : false;\n }\n\n /**\n * Minimum projected splat size, in pixels, below which a splat is discarded (0 = disabled).\n * Applied in real time; no rebuild required.\n */\n public get minPixelSize(): number {\n return this._material instanceof GaussianSplattingMaterial ? this._material.minPixelSize : 0;\n }\n\n public set minPixelSize(value: number) {\n if (this._material instanceof GaussianSplattingMaterial) {\n this._material.minPixelSize = Math.max(0, value);\n }\n }\n\n private _loadingPromise: Promise<void> | null = null;\n\n /**\n * Sets the rendering material and updates camera views. Notifies material-change observers when the material changes.\n */\n public override set material(value: Nullable<Material>) {\n const previous = this._material;\n this._material = value;\n if (value) {\n value.backFaceCulling = false;\n value.cullBackFaces = false;\n value.resetDrawCache();\n }\n this._cameraViewInfos?.forEach((cameraViewInfo) => {\n cameraViewInfo.mesh.material = value;\n });\n if (previous !== value && this.onMaterialChangedObservable.hasObservers()) {\n this.onMaterialChangedObservable.notifyObservers(this);\n }\n }\n\n /**\n * get rendering material\n */\n public override get material(): Nullable<Material> {\n return this._material;\n }\n\n private static _MakeSplatGeometryForMesh(mesh: Mesh): void {\n const vertexData = new VertexData();\n const originPositions = [-2, -2, 0, 2, -2, 0, 2, 2, 0, -2, 2, 0];\n const originIndices = [0, 1, 2, 0, 2, 3];\n const positions = [];\n const indices = [];\n for (let i = 0; i < GaussianSplattingMeshBase._BatchSize; i++) {\n for (let j = 0; j < 12; j++) {\n if (j == 2 || j == 5 || j == 8 || j == 11) {\n positions.push(i); // local splat index\n } else {\n positions.push(originPositions[j]);\n }\n }\n indices.push(originIndices.map((v) => v + i * 4));\n }\n\n vertexData.positions = positions;\n vertexData.indices = indices.flat();\n\n vertexData.applyToMesh(mesh);\n }\n\n /**\n * Creates a new gaussian splatting mesh\n * @param name defines the name of the mesh\n * @param url defines the url to load from (optional)\n * @param scene defines the hosting scene (optional)\n * @param keepInRam keep datas in ram for editing purpose\n */\n constructor(name: string, url: Nullable<string> = null, scene: Nullable<Scene> = null, keepInRam: boolean = false) {\n super(name, scene);\n\n this.subMeshes = [];\n new SubMesh(0, 0, 4 * GaussianSplattingMeshBase._BatchSize, 0, 6 * GaussianSplattingMeshBase._BatchSize, this);\n\n this.setEnabled(false);\n // webGL2 and webGPU support for RG texture with float16 is fine. not webGL1\n this._useRGBACovariants = !this.getEngine().isWebGPU && this.getEngine().version === 1.0;\n _AcquireGsInterFrameYield(this.getEngine());\n\n this._keepInRam = keepInRam;\n if (url) {\n this._loadingPromise = this.loadFileAsync(url);\n }\n const gaussianSplattingMaterial = new GaussianSplattingMaterial(this.name + \"_material\", this._scene);\n // Cast is safe: GaussianSplattingMeshBase is @internal; all concrete instances are GaussianSplattingMesh.\n gaussianSplattingMaterial.setSourceMesh(this as any);\n gaussianSplattingMaterial.doNotSerialize = true;\n this._material = gaussianSplattingMaterial;\n\n // delete meshes created for cameras on camera removal\n this._cameraRemovedObserver = this._scene.onCameraRemovedObservable.add((camera: Camera) => {\n const cameraId = camera.uniqueId;\n // delete mesh for this camera\n const cameraViewInfos = this._cameraViewInfos.get(cameraId);\n if (cameraViewInfos) {\n // If the cached shadow-caster geometry came from the mesh we're disposing, drop it\n // so isReady()/render() re-cache it from a surviving camera (see isReady()).\n // Must run before dispose(), which nulls the inner mesh's geometry.\n if (this._geometry === cameraViewInfos.mesh.geometry) {\n this._geometry = null;\n }\n cameraViewInfos.mesh.dispose();\n cameraViewInfos.gpuOutput?.dispose();\n cameraViewInfos.gpuOutput = null;\n this._cameraViewInfos.delete(cameraId);\n }\n });\n }\n\n /**\n * Get the loading promise when loading the mesh from a URL in the constructor\n * @returns constructor loading promise or null if no URL was provided\n */\n public getLoadingPromise(): Promise<void> | null {\n return this._loadingPromise;\n }\n\n /** @internal */\n public override get _isGaussianSplatting(): boolean {\n return true;\n }\n\n /**\n * Returns the class name\n * @returns \"GaussianSplattingMeshBase\"\n */\n public override getClassName(): string {\n return \"GaussianSplattingMeshBase\";\n }\n\n /**\n * Returns the total number of vertices (splats) within the mesh\n * @returns the total number of vertices\n */\n public override getTotalVertices(): number {\n return this._vertexCount;\n }\n\n /**\n * Is this node ready to be used/rendered\n * @param completeCheck defines if a complete check (including materials and lights) has to be done (false by default)\n * @returns true when ready\n */\n public override isReady(completeCheck = false): boolean {\n const sortRequired = this._isSortRequired();\n if (!super.isReady(sortRequired && completeCheck, true)) {\n return false;\n }\n\n if (!sortRequired && !this._geometry) {\n this._postToWorker();\n }\n if (sortRequired && !this._readyToDisplay) {\n // mesh is ready when worker has done at least 1 sorting\n this._postToWorker(true);\n return false;\n }\n\n // Before the first successful render, require an applied index buffer. A pending refresh can\n // use the latest completed buffer, otherwise a transform changed every frame would starve the\n // first render. Once rendered, the render loop continuously re-sorts as the camera/world changes.\n if (sortRequired && !this._hasRenderedOnce && !this._disableDepthSort) {\n const cameras = this._scene.activeCameras?.length ? this._scene.activeCameras : [this._scene.activeCamera!];\n const canRenderWithPendingRefresh = this._scene._isInRenderingMeshEvaluation() && cameras.filter((camera) => camera !== null).length === 1;\n const worldMatrix = this.computeWorldMatrix(true);\n let sortBufferMissing = false;\n let sortRefreshPending = false;\n let worldMatrixDirty = false;\n for (const camera of cameras) {\n if (!camera) {\n continue;\n }\n\n const cameraViewInfo = this._cameraViewInfos.get(camera.uniqueId);\n if (!cameraViewInfo || !cameraViewInfo.splatIndexBufferSet || cameraViewInfo.sortAppliedId === 0) {\n sortBufferMissing = true;\n continue;\n }\n\n if (cameraViewInfo.sortAppliedId !== cameraViewInfo.sortRequestId) {\n sortRefreshPending = true;\n continue;\n }\n\n // If world matrix drifted (user applied transforms after load), request an updated sort.\n // Camera drift is intentionally excluded here: checking camera movement would cause isReady()\n // to return false indefinitely while the camera is moving. The render loop handles camera\n // re-sorting continuously via _postToWorker() in render().\n if (this._isSortStateDirty(cameraViewInfo, worldMatrix, camera, true)) {\n worldMatrixDirty = true;\n }\n }\n\n if (sortBufferMissing || sortRefreshPending || worldMatrixDirty) {\n // Try to post any pending sort so subsequent polling iterations make progress.\n this._postToWorker(true);\n // A single-camera scene may use its latest completed sort while a transform refresh is\n // pending, which prevents continuously changing transforms from starving the first render.\n // Multi-camera scenes must wait because each viewport needs its own refreshed ordering.\n if (sortBufferMissing || !canRenderWithPendingRefresh) {\n return false;\n }\n }\n }\n\n // Attach the splat geometry to the GS top mesh so that the shadow generator (which renders\n // shadow casters via the top mesh's subMeshes, NOT through this mesh's render() override)\n // has valid geometry on the very first shadow pass. Without this, the first shadow render\n // happens before render() is called and the GS produces no shadow caster output.\n if (!this._geometry && this._cameraViewInfos.size) {\n this._geometry = this._cameraViewInfos.values().next().value!.mesh.geometry;\n }\n\n // If the material declares a shadow depth wrapper, make sure its effect is compiled for\n // each subMesh against the scene's shadow generators. Otherwise the first shadow pass\n // would be skipped (ShadowGenerator.isReady would return false) and we'd miss the shadow\n // on a renderCount=1 capture.\n // The shadow generator's depth wrapper is standalone (it wraps a ShaderMaterial), so its\n // isReadyForSubMesh path stamps an effect on subMesh._drawWrappers[engine.currentRenderPassId].\n // If we leave currentRenderPassId set to the main pass while doing this, we'd overwrite the\n // GS material's defines on the main draw wrapper, causing the GS material to recreate its\n // defines on the next call and lose any plugin-driven define state (e.g. defines toggled\n // by a MaterialPluginBase.isReadyForSubMesh override). Temporarily switch to each shadow\n // generator's render pass id while preparing it (matches the pattern used in Mesh.isReady).\n if (this.material && this.material.shadowDepthWrapper) {\n const engine = this._scene.getEngine();\n const previousRenderPassId = engine.currentRenderPassId;\n try {\n for (const light of this._scene.lights) {\n const shadowGenerator = light.getShadowGenerator();\n if (!shadowGenerator) {\n continue;\n }\n const shadowMap = shadowGenerator.getShadowMap();\n const renderPassIds = shadowMap?.renderPassIds;\n if (!renderPassIds || renderPassIds.length === 0) {\n continue;\n }\n for (let p = 0; p < renderPassIds.length; ++p) {\n engine.currentRenderPassId = renderPassIds[p];\n for (const subMesh of this.subMeshes) {\n if (!shadowGenerator.isReady(subMesh, true, false)) {\n return false;\n }\n }\n }\n }\n } finally {\n engine.currentRenderPassId = previousRenderPassId;\n }\n }\n\n return true;\n }\n\n public _getCameraDirection(camera: Camera): Vector3 {\n const cameraViewMatrix = camera.getViewMatrix();\n const cameraProjectionMatrix = camera.getProjectionMatrix();\n const cameraViewProjectionMatrix = TmpVectors.Matrix[0];\n cameraViewMatrix.multiplyToRef(cameraProjectionMatrix, cameraViewProjectionMatrix);\n\n const modelMatrix = this.computeWorldMatrix(true);\n const modelViewMatrix = TmpVectors.Matrix[1];\n modelMatrix.multiplyToRef(cameraViewMatrix, modelViewMatrix);\n modelMatrix.multiplyToRef(cameraViewProjectionMatrix, this._modelViewProjectionMatrix);\n\n // return vector used to compute distance to camera\n const localDirection = TmpVectors.Vector3[1];\n localDirection.set(modelViewMatrix.m[2], modelViewMatrix.m[6], modelViewMatrix.m[10]);\n localDirection.normalize();\n\n return localDirection;\n }\n\n private _isSortStateDirty(cameraViewInfo: ICameraViewInfo, worldMatrix: Matrix, camera: Camera, worldMatrixOnly = false): boolean {\n const world = worldMatrix.m;\n const previousWorld = cameraViewInfo.sortWorldMatrix.m;\n for (let i = 0; i < previousWorld.length; i++) {\n if (!Scalar.WithinEpsilon(previousWorld[i], world[i], this.viewUpdateThreshold)) {\n return true;\n }\n }\n\n if (worldMatrixOnly) {\n return false;\n }\n\n const cameraViewMatrix = camera.getViewMatrix();\n if (\n !Scalar.WithinEpsilon(cameraViewInfo.sortCameraForward.x, cameraViewMatrix.m[2], this.viewUpdateThreshold) ||\n !Scalar.WithinEpsilon(cameraViewInfo.sortCameraForward.y, cameraViewMatrix.m[6], this.viewUpdateThreshold) ||\n !Scalar.WithinEpsilon(cameraViewInfo.sortCameraForward.z, cameraViewMatrix.m[10], this.viewUpdateThreshold)\n ) {\n return true;\n }\n\n const cameraPosition = camera.globalPosition;\n return (\n !Scalar.WithinEpsilon(cameraViewInfo.sortCameraPosition.x, cameraPosition.x, this.viewUpdateThreshold) ||\n !Scalar.WithinEpsilon(cameraViewInfo.sortCameraPosition.y, cameraPosition.y, this.viewUpdateThreshold) ||\n !Scalar.WithinEpsilon(cameraViewInfo.sortCameraPosition.z, cameraPosition.z, this.viewUpdateThreshold)\n );\n }\n\n /** @internal */\n public _postToWorker(forced = false): void {\n if (this._gpuMode) {\n this._postToGpuSort(forced);\n return;\n }\n if (this._workerPending && this._vertexCount && this._splatPositions) {\n // Left the GPU sort mode: the worker is created lazily.\n this._instantiateWorker();\n }\n const frameId = this._scene.getFrameId();\n // force update or at least frame update for camera is outdated\n let outdated = false;\n this._cameraViewInfos.forEach((cameraViewInfos) => {\n if (cameraViewInfos.frameIdLastUpdate !== frameId) {\n outdated = true;\n }\n });\n\n // list view infos for active cameras, creating the missing ones\n const activeViewInfos: ICameraViewInfo[] = [];\n this._collectActiveViewInfos(frameId, false, activeViewInfos);\n // Sort view infos: cameras without a completed initial sort come first so they don't get starved\n // by a `forced` re-sort of an already-initialized camera (which would consume `_canPostToWorker`).\n // A camera can already have the shared index buffer bound when another camera's first sort resizes it,\n // so splatIndexBufferSet alone does not mean this camera has received its own sorted result.\n // Among initialized cameras, the least recently updated comes first.\n activeViewInfos.sort((a, b) => {\n if ((a.sortAppliedId === 0) !== (b.sortAppliedId === 0)) {\n return a.sortAppliedId === 0 ? -1 : 1;\n }\n if (a.splatIndexBufferSet !== b.splatIndexBufferSet) {\n return a.splatIndexBufferSet ? 1 : -1;\n }\n return a.frameIdLastUpdate - b.frameIdLastUpdate;\n });\n\n // The native sort writes into _splatPositions/_splatIndex: both must be allocated (they still are\n // null before any splat data has been committed) or the native binding throws on the conversion.\n const hasNativeSort = !!Native?.sortSplats && !!this._splatPositions && !!this._splatIndex;\n // When depth sort is disabled, no sort function must run: fall through to the no-sort path below.\n const sortRequired = this._isSortRequired();\n const hasSortFunction = sortRequired && !this._disableDepthSort && (this._worker || hasNativeSort);\n // A forced sort (new data or parts) requested while no classic pass needs sorting (e.g. point\n // splatting) is deferred to the next classic pass; the camera and world may be unchanged by then.\n if (forced && !sortRequired && !this._disableDepthSort) {\n this._forcedSortPending = true;\n } else if (hasSortFunction && this._forcedSortPending) {\n forced = true;\n }\n if ((forced || outdated) && hasSortFunction && (this._scene.activeCameras?.length || this._scene.activeCamera) && this._canPostToWorker) {\n const worldMatrix = this.computeWorldMatrix(true);\n // view infos sorted by least recent updated frame id\n activeViewInfos.forEach((cameraViewInfos) => {\n const camera = cameraViewInfos.camera;\n const cameraDirection = this._getCameraDirection(camera);\n if ((forced || this._isSortStateDirty(cameraViewInfos, worldMatrix, camera)) && this._canPostToWorker) {\n const cameraViewMatrix = camera.getViewMatrix();\n cameraViewInfos.cameraDirection.copyFrom(cameraDirection);\n cameraViewInfos.sortWorldMatrix.copyFrom(worldMatrix);\n cameraViewInfos.sortCameraForward.set(cameraViewMatrix.m[2], cameraViewMatrix.m[6], cameraViewMatrix.m[10]);\n cameraViewInfos.sortCameraPosition.copyFrom(camera.globalPosition);\n cameraViewInfos.sortRequestId = ++this._sortRequestId;\n cameraViewInfos.frameIdLastUpdate = frameId;\n this._canPostToWorker = false;\n this._forcedSortPending = false;\n if (this._worker) {\n this._worker.postMessage(\n {\n command: GaussianSplattingSortWorkerCommand.SORT,\n worldMatrix: worldMatrix.m,\n cameraForward: [cameraViewMatrix.m[2], cameraViewMatrix.m[6], cameraViewMatrix.m[10]],\n cameraPosition: [camera.globalPosition.x, camera.globalPosition.y, camera.globalPosition.z],\n depthMix: this._depthMix,\n cameraId: camera.uniqueId,\n sortRequestId: cameraViewInfos.sortRequestId,\n rangeVersion: this._activeRangeVersion,\n useCountingSort: GaussianSplattingMeshBase.UseCountingSort,\n rightHanded: this._scene.useRightHandedSystem,\n logSortPerformance: GaussianSplattingMeshBase.LogSortPerformance,\n },\n [this._depthMix.buffer]\n );\n } else if (Native?.sortSplats) {\n if (this._activeSplatRanges) {\n // Native sort can't filter ranges: fall back to the (already range-filtered) identity index buffer.\n this._updateSplatIndexBuffer(this._vertexCount);\n } else {\n Native.sortSplats(this._modelViewProjectionMatrix, this._splatPositions!, this._splatIndex!, this._scene.useRightHandedSystem);\n }\n if (cameraViewInfos.splatIndexBufferSet) {\n cameraViewInfos.mesh.thinInstanceBufferUpdated(\"splatIndex\");\n } else {\n cameraViewInfos.mesh.thinInstanceSetBuffer(\"splatIndex\", this._splatIndex, 16, false);\n cameraViewInfos.splatIndexBufferSet = true;\n }\n cameraViewInfos.sortAppliedId = cameraViewInfos.sortRequestId;\n this._canPostToWorker = true;\n this._readyToDisplay = true;\n this._sortIsDirty = false;\n }\n }\n });\n } else if (this._disableDepthSort || !sortRequired) {\n // ShadowGenerator bypasses render()/isReady(), so its atlas cannot wait for a deferred camera sort.\n if (this._delayedTextureUpdate) {\n this._updateSplatIndexBuffer(this._vertexCount);\n this._cameraViewInfos.forEach((info) => {\n if (info.splatIndexBufferSet) {\n info.mesh.thinInstanceBufferUpdated(\"splatIndex\");\n }\n });\n this._commitDelayedTextureUpdate();\n }\n if (this._splatIndex) {\n activeViewInfos.forEach((cameraViewInfos) => {\n if (!cameraViewInfos.splatIndexBufferSet) {\n cameraViewInfos.mesh.thinInstanceSetBuffer(\"splatIndex\", this._splatIndex, 16, false);\n cameraViewInfos.splatIndexBufferSet = true;\n }\n });\n this._readyToDisplay = true;\n }\n // With a worker, the gate is owned by in-flight sorts and rebuilds; their completion unlocks it.\n if (this._disableDepthSort || !this._worker) {\n this._canPostToWorker = true;\n }\n }\n }\n\n // Fills `out` with the view infos of the active cameras, creating the missing ones.\n private _collectActiveViewInfos(frameId: number, stampFrame: boolean, out: ICameraViewInfo[]): void {\n out.length = 0;\n const activeCameras = this._scene.activeCameras;\n if (activeCameras && activeCameras.length) {\n for (let i = 0; i < activeCameras.length; i++) {\n this._collectCameraViewInfo(activeCameras[i], frameId, stampFrame, out);\n }\n } else {\n this._collectCameraViewInfo(this._scene.activeCamera, frameId, stampFrame, out);\n }\n }\n\n private _collectCameraViewInfo(camera: Nullable<Camera>, frameId: number, stampFrame: boolean, out: ICameraViewInfo[]): void {\n if (!camera) {\n return;\n }\n const cameraId = camera.uniqueId;\n const existingViewInfos = this._cameraViewInfos.get(cameraId);\n if (existingViewInfos) {\n if (stampFrame) {\n existingViewInfos.frameIdLastUpdate = frameId;\n }\n out.push(existingViewInfos);\n return;\n }\n\n // mesh doesn't exist yet for this camera\n const cameraMesh = new Mesh(this.name + \"_cameraMesh_\" + cameraId, this._scene);\n cameraMesh.doNotSerialize = true;\n // not visible with inspector or the scene graph\n cameraMesh.reservedDataStore = { hidden: true, _gaussianSplattingSourceMesh: this };\n cameraMesh.setEnabled(false);\n cameraMesh.material = this.material;\n if (cameraMesh.material && cameraMesh.material instanceof GaussianSplattingMaterial) {\n const gsMaterial = cameraMesh.material as GaussianSplattingMaterial;\n // GaussianSplattingMaterial source mesh may not have been set yet.\n // This happens for cloned resources from asset containers for instance,\n // where material is cloned before mesh.\n if (!gsMaterial.getSourceMesh()) {\n // Cast is safe: see constructor comment above.\n gsMaterial.setSourceMesh(this as any);\n }\n }\n GaussianSplattingMeshBase._MakeSplatGeometryForMesh(cameraMesh);\n\n const newViewInfos: ICameraViewInfo = {\n camera: camera,\n cameraDirection: new Vector3(0, 0, 0),\n sortWorldMatrix: Matrix.Identity(),\n sortCameraForward: new Vector3(0, 0, 0),\n sortCameraPosition: new Vector3(0, 0, 0),\n sortRequestId: 0,\n sortAppliedId: 0,\n mesh: cameraMesh,\n frameIdLastUpdate: frameId,\n splatIndexBufferSet: false,\n gpuOutput: null,\n gpuAppliedRevision: 0,\n gpuBuffersVersion: 0,\n gpuLastSortFrameId: 0,\n };\n out.push(newViewInfos);\n this._cameraViewInfos.set(cameraId, newViewInfos);\n }\n\n /**\n * Whether the sort of this mesh runs on the GPU (WebGPU compute) instead of the CPU worker.\n * @internal\n */\n public get _isGpuSortActive(): boolean {\n return this._gpuMode;\n }\n\n // Tells the GPU sorter its source (textures, bounds, intervals, part matrices) changed and every camera must be sorted again.\n /** @internal */\n public _markGpuSourceDirty(): void {\n this._gpuSourceDirty = true;\n this._gpuIntervalsDirty = true;\n this._gpuBoundsDirty = true;\n this._gpuDataRevision++;\n }\n\n // Tells the GPU sorter the part transforms of a compound mesh changed.\n /** @internal */\n public _markGpuPartMatricesDirty(): void {\n this._gpuPartMatricesDirty = true;\n this._gpuDataRevision++;\n }\n\n /**\n * Texture holding the part index of each splat, for compound meshes. Null for a regular mesh.\n * @returns the part indices texture\n */\n protected _getGpuSortPartIndicesTexture(): Nullable<BaseTexture> {\n return null;\n }\n\n /**\n * Transforms of the parts of a compound mesh. They replace the world matrix when sorting. Null for a regular mesh.\n * @returns the part matrices\n */\n protected _getGpuSortPartMatrices(): Nullable<ReadonlyArray<Matrix>> {\n return null;\n }\n\n /**\n * Synchronizes compound part transforms before checking whether the GPU sort is up to date.\n */\n protected _syncPartProxyWorldMatrices(): void {}\n\n // Whether this mesh can use the GPU sorter. `vertexCount` is the (possibly upcoming) source splat count.\n private _isGpuSortEligible(vertexCount: number): boolean {\n if (!(this.useGpuSort ?? GaussianSplattingMeshBase.UseGpuSort) || IsNative || this._gpuSortForbidden || _GpuSortDependenciesFailed) {\n return false;\n }\n // Streaming parts decode into a render-target atlas: they keep using the CPU worker.\n if (this._useMrtAtlas || this._mrtAtlas) {\n return false;\n }\n // A custom render function (other than the frame graph one) does not notify onBeforeRenderObservable, where the sort is dispatched.\n const scene = this._scene;\n if (scene.customRenderFunction && !scene.frameGraph) {\n return false;\n }\n const engine = scene.getEngine();\n if (!GaussianSplattingGpuSorter.IsSupported(engine) || vertexCount > GaussianSplattingGpuSorter.GetMaxSupportedSplatCount(engine)) {\n return false;\n }\n // The mode is chosen when the sort buffers are first created: a mesh already bound to an identity index buffer keeps its worker.\n return this._gpuMode || (!this._disableDepthSort && !this._splatIndex);\n }\n\n private _enterGpuMode(): void {\n this._gpuMode = true;\n this._workerPending = false;\n this._worker?.terminate();\n this._worker = null;\n this._canPostToWorker = true;\n this._markGpuSourceDirty();\n if (!this._gpuObserver) {\n this._gpuObserver = this._scene.onBeforeRenderObservable.add(() => this._runGpuSort());\n }\n if (!this._gpuRestoreObserver) {\n this._gpuRestoreObserver = this._scene.getEngine().onContextRestoredObservable.add(() => this._onGpuContextRestored());\n }\n // The compute shaders are loaded lazily: the first sort waits for them.\n void _LoadGpuSortDependenciesAsync();\n }\n\n // After a device restoration the rebuilt storage buffers are empty, the sorter caches (radix parameters, intervals, bindings) describe the lost buffers,\n // and the geometry rebuild recreates the vertex buffer wrappers separately from the storage buffers they alias.\n // The sorter is dropped with all its outputs and every view is invalidated: the next sort recreates and rebinds everything from the current source.\n private _onGpuContextRestored(): void {\n if (!this._gpuMode) {\n return;\n }\n this._resetGpuViews();\n this._gpuSorter?.dispose();\n this._gpuSorter = null;\n this._readyToDisplay = false;\n this._gpuSortPending = true;\n this._canPostToWorker = true;\n this._markGpuSourceDirty();\n }\n\n // Drops the sort output bound to each view: they must be sorted and bound again.\n private _resetGpuViews(): void {\n this._cameraViewInfos.forEach((info) => {\n info.gpuOutput = null;\n info.gpuAppliedRevision = 0;\n info.gpuBuffersVersion = 0;\n info.splatIndexBufferSet = false;\n info.sortAppliedId = 0;\n info.sortRequestId = 0;\n info.mesh.forcedInstanceCount = 0;\n });\n }\n\n // Leaves the GPU sort mode. The worker is created by the next _postToWorker call.\n private _exitGpuMode(): void {\n if (!this._gpuMode) {\n return;\n }\n this._gpuMode = false;\n if (this._gpuObserver) {\n this._scene.onBeforeRenderObservable.remove(this._gpuObserver);\n this._gpuObserver = null;\n }\n if (this._gpuRestoreObserver) {\n this._scene.getEngine().onContextRestoredObservable.remove(this._gpuRestoreObserver);\n this._gpuRestoreObserver = null;\n }\n this._resetGpuViews();\n this._gpuSorter?.dispose();\n this._gpuSorter = null;\n this._gpuSortPending = false;\n this._readyToDisplay = false;\n this._canPostToWorker = true;\n this._sortIsDirty = true;\n this._workerPending = true;\n }\n\n /**\n * Switches a mesh sorted on the GPU to the CPU worker (e.g. when it starts streaming, which needs a render-target atlas).\n * @internal\n */\n public _switchToWorkerSort(): void {\n this._gpuSortForbidden = true;\n this._exitGpuMode();\n }\n\n private _postToGpuSort(forced: boolean): void {\n if (this._scene.customRenderFunction && !this._scene.frameGraph) {\n this._switchToWorkerSort();\n this._postToWorker(forced);\n return;\n }\n const frameId = this._scene.getFrameId();\n this._collectActiveViewInfos(frameId, true, this._gpuViewInfos);\n const sortRequired = this._isSortRequired();\n if (forced) {\n if (!sortRequired) {\n // Deferred to the next classic pass, like the worker path.\n if (!this._disableDepthSort) {\n this._forcedSortPending = true;\n }\n } else if (!this._gpuSortPending) {\n this._gpuDataRevision++;\n }\n this._gpuSortPending = true;\n } else if (sortRequired && this._forcedSortPending && !this._disableDepthSort) {\n this._forcedSortPending = false;\n if (!this._gpuSortPending) {\n this._gpuDataRevision++;\n }\n this._gpuSortPending = true;\n }\n\n if (!sortRequired) {\n this._commitDelayedTextureUpdate();\n this._canPostToWorker = true;\n return;\n }\n // Readiness polling must progress without a render loop. Once rendered, coalesce mutations at scene pre-render.\n if ((!this._readyToDisplay || !this._hasRenderedOnce) && !this._scene._isInRenderingMeshEvaluation() && !this._scene.getEngine()._currentRenderTarget) {\n this._runGpuSort();\n }\n }\n\n private _gpuViewNeedsSort(info: ICameraViewInfo, world: Matrix): boolean {\n if (info.gpuAppliedRevision !== this._gpuDataRevision || info.sortAppliedId === 0) {\n return true;\n }\n const minInterval = GaussianSplattingMeshBase.GpuSortMinFrameInterval;\n if (minInterval > 1 && this._scene.getFrameId() - info.gpuLastSortFrameId < minInterval) {\n return false;\n }\n return !this._disableDepthSort && this._isSortStateDirty(info, world, info.camera);\n }\n\n // Collects the view infos that were rendered or prepared during the previous or current frame.\n private _collectRecentViewInfo = (info: ICameraViewInfo) => {\n if (this._gpuCollectFrameId - info.frameIdLastUpdate <= 1 && this._gpuViewInfos.indexOf(info) < 0) {\n this._gpuViewInfos.push(info);\n }\n };\n\n private _ensureGpuSorter(): boolean {\n if (this._gpuSorter) {\n return true;\n }\n if (_GpuSortDependenciesFailed) {\n this._exitGpuMode();\n return false;\n }\n if (!_GpuSortDependenciesReady) {\n void _LoadGpuSortDependenciesAsync();\n return false;\n }\n this._gpuSorter = new GaussianSplattingGpuSorter(this._scene.getEngine(), this.name + \"_gpuSort\");\n this._gpuSourceDirty = true;\n return true;\n }\n\n // Local-space bounds of the splat centers, used by the sorter to derive the depth range.\n private _updateGpuBounds(): boolean {\n const positions = this._splatPositions;\n if (!positions) {\n return false;\n }\n if (!this._gpuBoundsDirty && this._gpuBoundsMin) {\n return true;\n }\n const min = (this._gpuBoundsMin ??= new Vector3());\n const max = (this._gpuBoundsMax ??= new Vector3());\n min.setAll(Number.MAX_VALUE);\n max.setAll(-Number.MAX_VALUE);\n const count = Math.min(this._gpuProgressiveCount ?? this._vertexCount, Math.floor(positions.length / 4));\n for (let i = 0; i < count; i++) {\n const x = positions[i * 4];\n const y = positions[i * 4 + 1];\n const z = positions[i * 4 + 2];\n if (x < min.x) {\n min.x = x;\n }\n if (y < min.y) {\n min.y = y;\n }\n if (z < min.z) {\n min.z = z;\n }\n if (x > max.x) {\n max.x = x;\n }\n if (y > max.y) {\n max.y = y;\n }\n if (z > max.z) {\n max.z = z;\n }\n }\n if (count === 0) {\n min.setAll(0);\n max.setAll(0);\n }\n this._gpuBoundsDirty = false;\n return true;\n }\n\n private _applyGpuIntervals(sorter: GaussianSplattingGpuSorter): boolean {\n let intervals = this._activeSplatRanges;\n const uploaded = this._gpuProgressiveCount;\n if (uploaded !== null) {\n if (intervals) {\n intervals = new Uint32Array(intervals);\n for (let i = 0; i < intervals.length; i += 2) {\n intervals[i + 1] = Math.max(0, Math.min(intervals[i + 1], uploaded - intervals[i]));\n }\n } else {\n intervals = new Uint32Array([0, uploaded]);\n }\n }\n if (!sorter.setIntervals(intervals)) {\n this._switchToWorkerSort();\n return false;\n }\n this._gpuIntervalsDirty = false;\n return true;\n }\n\n private _applyGpuSource(sorter: GaussianSplattingGpuSorter): boolean {\n const sog = this._useSog ? this._sogParams : null;\n const centersTexture = sog ? sog.meansTextureL : this._centersTexture;\n if (!centersTexture) {\n return false;\n }\n const partIndicesTexture = this._getGpuSortPartIndicesTexture();\n let accepted: boolean;\n if (sog) {\n accepted = sorter.setSource({\n vertexCount: this._vertexCount,\n textureWidth: this._textureSize.x,\n centersTexture,\n sog: { meansHighTexture: sog.meansTextureU, meansMin: sog.meansMin, meansMax: sog.meansMax },\n });\n } else {\n if (!this._updateGpuBounds()) {\n return false;\n }\n accepted = sorter.setSource({\n vertexCount: this._vertexCount,\n textureWidth: this._textureSize.x,\n centersTexture,\n partIndicesTexture: partIndicesTexture ?? undefined,\n boundsMin: this._gpuBoundsMin!.asArray(),\n boundsMax: this._gpuBoundsMax!.asArray(),\n });\n }\n if (!accepted) {\n this._switchToWorkerSort();\n return false;\n }\n if (!this._applyGpuIntervals(sorter)) {\n return false;\n }\n sorter.setPartMatrices(partIndicesTexture ? this._getGpuSortPartMatrices() : null);\n this._gpuSourceDirty = false;\n this._gpuPartMatricesDirty = false;\n return true;\n }\n\n private _bindGpuOutput(info: ICameraViewInfo, output: GaussianSplattingGpuSortOutput): void {\n const mesh = info.mesh;\n if (info.gpuBuffersVersion !== output.buffersVersion || !info.splatIndexBufferSet) {\n const vertexBuffers = output.vertexBuffers;\n for (let i = 0; i < vertexBuffers.length; i++) {\n // The sort output owns the vertex buffers\n mesh.setVerticesBuffer(vertexBuffers[i], false);\n }\n info.gpuBuffersVersion = output.buffersVersion;\n }\n mesh.forcedInstanceCount = Math.max(output.instanceCount, 1);\n }\n\n // Sorts the splats of every view that needs it. Runs before the scene renders: compute work cannot be dispatched during a render pass.\n private _runGpuSort(): void {\n if (\n !this._gpuMode ||\n !this._canPostToWorker ||\n !this._vertexCount ||\n !this._centersTexture ||\n (this._splatDataPending && !this._gpuProgressiveCount) ||\n !this._isSortRequired()\n ) {\n return;\n }\n this._syncPartProxyWorldMatrices();\n const scene = this._scene;\n const frameId = scene.getFrameId();\n const views = this._gpuViewInfos;\n views.length = 0;\n this._gpuCollectFrameId = frameId;\n this._cameraViewInfos.forEach(this._collectRecentViewInfo);\n if (views.length === 0) {\n return;\n }\n\n const world = this.computeWorldMatrix(true);\n let needsSort = false;\n for (let i = 0; i < views.length && !needsSort; i++) {\n needsSort = this._gpuViewNeedsSort(views[i], world);\n }\n if (!needsSort) {\n return;\n }\n\n if (!this._ensureGpuSorter()) {\n return;\n }\n const sorter = this._gpuSorter!;\n // The pending texture rows are uploaded right before sorting so the centers match the sort source.\n this._commitDelayedTextureUpdate();\n if (this._gpuSourceDirty && !this._applyGpuSource(sorter)) {\n return;\n }\n if (this._gpuIntervalsDirty && !this._applyGpuIntervals(sorter)) {\n return;\n }\n if (this._gpuPartMatricesDirty) {\n sorter.setPartMatrices(this._getGpuSortPartIndicesTexture() ? this._getGpuSortPartMatrices() : null);\n this._gpuPartMatricesDirty = false;\n }\n\n const options = this._gpuSortOptions;\n options.rightHanded = scene.useRightHandedSystem;\n const cameraPosition = this._gpuCameraPosition;\n options.cameraPosition = cameraPosition;\n\n const revision = this._gpuDataRevision;\n let allApplied = true;\n for (let i = 0; i < views.length; i++) {\n const info = views[i];\n if (!this._gpuViewNeedsSort(info, world)) {\n continue;\n }\n const camera = info.camera;\n const viewMatrix = camera.getViewMatrix();\n const position = camera.globalPosition;\n cameraPosition[0] = position.x;\n cameraPosition[1] = position.y;\n cameraPosition[2] = position.z;\n\n const output = (info.gpuOutput ??= sorter.createOutput());\n if (!sorter.sort(output, world, viewMatrix, options)) {\n allApplied = false;\n if (info.gpuBuffersVersion !== output.buffersVersion) {\n // The output buffers were recreated: the bound ones are gone, so wait for the next successful sort to render this view.\n this._bindGpuOutput(info, output);\n info.splatIndexBufferSet = false;\n info.sortAppliedId = 0;\n }\n continue;\n }\n this._bindGpuOutput(info, output);\n\n info.sortWorldMatrix.copyFrom(world);\n info.sortCameraForward.set(viewMatrix.m[2], viewMatrix.m[6], viewMatrix.m[10]);\n info.sortCameraPosition.copyFrom(position);\n info.sortRequestId = info.sortAppliedId = ++this._sortRequestId;\n info.gpuAppliedRevision = revision;\n info.gpuLastSortFrameId = frameId;\n info.splatIndexBufferSet = true;\n this._gpuPaddedCount = output.paddedCount;\n this.forcedInstanceCount = Math.max(output.instanceCount, 1);\n this._readyToDisplay = true;\n this._sortIsDirty = false;\n }\n if (allApplied) {\n this._gpuSortPending = false;\n this._forcedSortPending = false;\n }\n }\n\n /**\n * Triggers the draw call for the mesh. Usually, you don't need to call this method by your own because the mesh rendering is handled by the scene rendering manager\n * @param subMesh defines the subMesh to render\n * @param enableAlphaMode defines if alpha mode can be changed\n * @param effectiveMeshReplacement defines an optional mesh used to provide info for the rendering\n * @returns the current mesh\n */\n public override render(subMesh: SubMesh, enableAlphaMode: boolean, effectiveMeshReplacement?: AbstractMesh): Mesh {\n let beforeNotified = false;\n if (!this._isSortRequired()) {\n this.onBeforeRenderObservable.notifyObservers(this);\n beforeNotified = true;\n if (this._drawPointPass(enableAlphaMode)) {\n this.onAfterRenderObservable.notifyObservers(this);\n return this;\n }\n }\n this._postToWorker();\n\n // geometry used for shadows, bind the first found in the camera view infos\n if (!this._geometry && this._cameraViewInfos.size) {\n this._geometry = this._cameraViewInfos.values().next().value!.mesh.geometry;\n }\n\n const cameraId = this._scene.activeCamera!.uniqueId;\n const cameraViewInfos = this._cameraViewInfos.get(cameraId);\n if (!cameraViewInfos || !cameraViewInfos.splatIndexBufferSet) {\n if (beforeNotified) {\n this.onAfterRenderObservable.notifyObservers(this);\n }\n return this;\n }\n\n if (!beforeNotified && this.onBeforeRenderObservable) {\n this.onBeforeRenderObservable.notifyObservers(this);\n }\n const mesh = cameraViewInfos.mesh;\n mesh.getWorldMatrix().copyFrom(this.getWorldMatrix());\n\n // Propagate render pass material overrides (e.g., GPU picking) to the inner camera mesh.\n // When this mesh is rendered into a RenderTargetTexture with a material override (via setMaterialForRendering),\n // the override is set on this proxy mesh but needs to be applied to the actual camera mesh that does the rendering.\n const engine = this._scene.getEngine();\n const renderPassId = engine.currentRenderPassId;\n const renderPassMaterial = this.getMaterialForRenderPass(renderPassId);\n if (renderPassMaterial) {\n mesh.setMaterialForRenderPass(renderPassId, renderPassMaterial);\n }\n\n const ret = this._drawColorPass(mesh, subMesh, enableAlphaMode, effectiveMeshReplacement);\n\n this._hasRenderedOnce = true;\n\n // Clean up the temporary override to avoid affecting other render passes\n if (renderPassMaterial) {\n mesh.setMaterialForRenderPass(renderPassId, undefined);\n }\n\n if (this.onAfterRenderObservable) {\n this.onAfterRenderObservable.notifyObservers(this);\n }\n return ret;\n }\n\n /**\n * Draws the inner per-camera mesh for one render pass. Subclasses may replace selected passes.\n * @param mesh inner per-camera mesh carrying the sorted splat geometry\n * @param subMesh the submesh to draw\n * @param enableAlphaMode whether alpha mode can be changed\n * @param effectiveMeshReplacement optional mesh providing render info\n * @returns the drawn mesh\n */\n protected _drawColorPass(mesh: Mesh, subMesh: SubMesh, enableAlphaMode: boolean, effectiveMeshReplacement?: AbstractMesh): Mesh {\n return mesh.render(subMesh, enableAlphaMode, effectiveMeshReplacement);\n }\n\n /**\n * Whether the current pass needs classic sorted splat geometry.\n * @returns whether classic sorting is required\n */\n protected _isSortRequired(): boolean {\n return true;\n }\n\n /**\n * Handles a compute-owned pass before allocating or waiting for sorted geometry.\n * @param _enableAlphaMode whether alpha mode can be changed\n * @returns whether the pass was handled\n */\n protected _drawPointPass(_enableAlphaMode: boolean): boolean {\n return false;\n }\n\n private static _TypeNameToEnum(name: string): PLYType {\n switch (name) {\n case \"float\":\n return PLYType.FLOAT;\n case \"int\":\n return PLYType.INT;\n case \"uint\":\n return PLYType.UINT;\n case \"double\":\n return PLYType.DOUBLE;\n case \"uchar\":\n return PLYType.UCHAR;\n case \"ushort\":\n case \"uint16\":\n return PLYType.USHORT;\n }\n return PLYType.UNDEFINED;\n }\n\n private static _ValueNameToEnum(name: string): PLYValue {\n switch (name) {\n case \"min_x\":\n return PLYValue.MIN_X;\n case \"min_y\":\n return PLYValue.MIN_Y;\n case \"min_z\":\n return PLYValue.MIN_Z;\n case \"max_x\":\n return PLYValue.MAX_X;\n case \"max_y\":\n return PLYValue.MAX_Y;\n case \"max_z\":\n return PLYValue.MAX_Z;\n case \"min_scale_x\":\n return PLYValue.MIN_SCALE_X;\n case \"min_scale_y\":\n return PLYValue.MIN_SCALE_Y;\n case \"min_scale_z\":\n return PLYValue.MIN_SCALE_Z;\n case \"max_scale_x\":\n return PLYValue.MAX_SCALE_X;\n case \"max_scale_y\":\n return PLYValue.MAX_SCALE_Y;\n case \"max_scale_z\":\n return PLYValue.MAX_SCALE_Z;\n case \"packed_position\":\n return PLYValue.PACKED_POSITION;\n case \"packed_rotation\":\n return PLYValue.PACKED_ROTATION;\n case \"packed_scale\":\n return PLYValue.PACKED_SCALE;\n case \"packed_color\":\n return PLYValue.PACKED_COLOR;\n case \"x\":\n return PLYValue.X;\n case \"y\":\n return PLYValue.Y;\n case \"z\":\n return PLYValue.Z;\n case \"scale_0\":\n return PLYValue.SCALE_0;\n case \"scale_1\":\n return PLYValue.SCALE_1;\n case \"scale_2\":\n return PLYValue.SCALE_2;\n case \"diffuse_red\":\n case \"red\":\n return PLYValue.DIFFUSE_RED;\n case \"diffuse_green\":\n case \"green\":\n return PLYValue.DIFFUSE_GREEN;\n case \"diffuse_blue\":\n case \"blue\":\n return PLYValue.DIFFUSE_BLUE;\n case \"f_dc_0\":\n return PLYValue.F_DC_0;\n case \"f_dc_1\":\n return PLYValue.F_DC_1;\n case \"f_dc_2\":\n return PLYValue.F_DC_2;\n case \"f_dc_3\":\n return PLYValue.F_DC_3;\n case \"opacity\":\n return PLYValue.OPACITY;\n case \"rot_0\":\n return PLYValue.ROT_0;\n case \"rot_1\":\n return PLYValue.ROT_1;\n case \"rot_2\":\n return PLYValue.ROT_2;\n case \"rot_3\":\n return PLYValue.ROT_3;\n case \"min_r\":\n return PLYValue.MIN_COLOR_R;\n case \"min_g\":\n return PLYValue.MIN_COLOR_G;\n case \"min_b\":\n return PLYValue.MIN_COLOR_B;\n case \"max_r\":\n return PLYValue.MAX_COLOR_R;\n case \"max_g\":\n return PLYValue.MAX_COLOR_G;\n case \"max_b\":\n return PLYValue.MAX_COLOR_B;\n case \"f_rest_0\":\n return PLYValue.SH_0;\n case \"f_rest_1\":\n return PLYValue.SH_1;\n case \"f_rest_2\":\n return PLYValue.SH_2;\n case \"f_rest_3\":\n return PLYValue.SH_3;\n case \"f_rest_4\":\n return PLYValue.SH_4;\n case \"f_rest_5\":\n return PLYValue.SH_5;\n case \"f_rest_6\":\n return PLYValue.SH_6;\n case \"f_rest_7\":\n return PLYValue.SH_7;\n case \"f_rest_8\":\n return PLYValue.SH_8;\n case \"f_rest_9\":\n return PLYValue.SH_9;\n case \"f_rest_10\":\n return PLYValue.SH_10;\n case \"f_rest_11\":\n return PLYValue.SH_11;\n case \"f_rest_12\":\n return PLYValue.SH_12;\n case \"f_rest_13\":\n return PLYValue.SH_13;\n case \"f_rest_14\":\n return PLYValue.SH_14;\n case \"f_rest_15\":\n return PLYValue.SH_15;\n case \"f_rest_16\":\n return PLYValue.SH_16;\n case \"f_rest_17\":\n return PLYValue.SH_17;\n case \"f_rest_18\":\n return PLYValue.SH_18;\n case \"f_rest_19\":\n return PLYValue.SH_19;\n case \"f_rest_20\":\n return PLYValue.SH_20;\n case \"f_rest_21\":\n return PLYValue.SH_21;\n case \"f_rest_22\":\n return PLYValue.SH_22;\n case \"f_rest_23\":\n return PLYValue.SH_23;\n case \"f_rest_24\":\n return PLYValue.SH_24;\n case \"f_rest_25\":\n return PLYValue.SH_25;\n case \"f_rest_26\":\n return PLYValue.SH_26;\n case \"f_rest_27\":\n return PLYValue.SH_27;\n case \"f_rest_28\":\n return PLYValue.SH_28;\n case \"f_rest_29\":\n return PLYValue.SH_29;\n case \"f_rest_30\":\n return PLYValue.SH_30;\n case \"f_rest_31\":\n return PLYValue.SH_31;\n case \"f_rest_32\":\n return PLYValue.SH_32;\n case \"f_rest_33\":\n return PLYValue.SH_33;\n case \"f_rest_34\":\n return PLYValue.SH_34;\n case \"f_rest_35\":\n return PLYValue.SH_35;\n case \"f_rest_36\":\n return PLYValue.SH_36;\n case \"f_rest_37\":\n return PLYValue.SH_37;\n case \"f_rest_38\":\n return PLYValue.SH_38;\n case \"f_rest_39\":\n return PLYValue.SH_39;\n case \"f_rest_40\":\n return PLYValue.SH_40;\n case \"f_rest_41\":\n return PLYValue.SH_41;\n case \"f_rest_42\":\n return PLYValue.SH_42;\n case \"f_rest_43\":\n return PLYValue.SH_43;\n case \"f_rest_44\":\n return PLYValue.SH_44;\n case \"f_rest_45\":\n return PLYValue.SH_45;\n case \"f_rest_46\":\n return PLYValue.SH_46;\n case \"f_rest_47\":\n return PLYValue.SH_47;\n case \"f_rest_48\":\n return PLYValue.SH_48;\n case \"f_rest_49\":\n return PLYValue.SH_49;\n case \"f_rest_50\":\n return PLYValue.SH_50;\n case \"f_rest_51\":\n return PLYValue.SH_51;\n case \"f_rest_52\":\n return PLYValue.SH_52;\n case \"f_rest_53\":\n return PLYValue.SH_53;\n case \"f_rest_54\":\n return PLYValue.SH_54;\n case \"f_rest_55\":\n return PLYValue.SH_55;\n case \"f_rest_56\":\n return PLYValue.SH_56;\n case \"f_rest_57\":\n return PLYValue.SH_57;\n case \"f_rest_58\":\n return PLYValue.SH_58;\n case \"f_rest_59\":\n return PLYValue.SH_59;\n case \"f_rest_60\":\n return PLYValue.SH_60;\n case \"f_rest_61\":\n return PLYValue.SH_61;\n case \"f_rest_62\":\n return PLYValue.SH_62;\n case \"f_rest_63\":\n return PLYValue.SH_63;\n case \"f_rest_64\":\n return PLYValue.SH_64;\n case \"f_rest_65\":\n return PLYValue.SH_65;\n case \"f_rest_66\":\n return PLYValue.SH_66;\n case \"f_rest_67\":\n return PLYValue.SH_67;\n case \"f_rest_68\":\n return PLYValue.SH_68;\n case \"f_rest_69\":\n return PLYValue.SH_69;\n case \"f_rest_70\":\n return PLYValue.SH_70;\n case \"f_rest_71\":\n return PLYValue.SH_71;\n }\n\n return PLYValue.UNDEFINED;\n }\n /**\n * Parse a PLY file header and returns metas infos on splats and chunks\n * @param data the loaded buffer\n * @returns a PLYHeader\n */\n static ParseHeader(data: ArrayBuffer): PLYHeader | null {\n const ubuf = new Uint8Array(data);\n const header = new TextDecoder().decode(ubuf.slice(0, 1024 * 10));\n const headerEnd = \"end_header\\n\";\n const headerEndIndex = header.indexOf(headerEnd);\n if (headerEndIndex < 0 || !header) {\n // standard splat\n return null;\n }\n const vertexCount = parseInt(/element vertex (\\d+)\\n/.exec(header)![1]);\n const chunkElement = /element chunk (\\d+)\\n/.exec(header);\n let chunkCount = 0;\n if (chunkElement) {\n chunkCount = parseInt(chunkElement[1]);\n }\n let rowVertexOffset = 0;\n let rowChunkOffset = 0;\n const offsets: Record<string, number> = {\n double: 8,\n int: 4,\n uint: 4,\n float: 4,\n short: 2,\n ushort: 2,\n uint16: 2,\n uchar: 1,\n list: 0,\n };\n\n const enum ElementMode {\n Vertex = 0,\n Chunk = 1,\n SH = 2,\n Unused = 3,\n }\n let chunkMode = ElementMode.Chunk;\n const vertexProperties: PlyProperty[] = [];\n const chunkProperties: PlyProperty[] = [];\n const filtered = header.slice(0, headerEndIndex).split(\"\\n\");\n let shDegree = 0;\n for (const prop of filtered) {\n if (prop.startsWith(\"property \")) {\n const [, typeName, name] = prop.split(\" \");\n\n const value = GaussianSplattingMeshBase._ValueNameToEnum(name);\n if (value != PLYValue.UNDEFINED) {\n // SH degree 1,2,3 or 4 for 9, 24, 45 or 72 values\n if (value >= PLYValue.SH_71) {\n shDegree = 4;\n } else if (value >= PLYValue.SH_44) {\n shDegree = Math.max(shDegree, 3);\n } else if (value >= PLYValue.SH_23) {\n shDegree = Math.max(shDegree, 2);\n } else if (value >= PLYValue.SH_8) {\n shDegree = Math.max(shDegree, 1);\n }\n }\n const type = GaussianSplattingMeshBase._TypeNameToEnum(typeName);\n if (chunkMode == ElementMode.Chunk) {\n chunkProperties.push({ value, type, offset: rowChunkOffset });\n rowChunkOffset += offsets[typeName];\n } else if (chunkMode == ElementMode.Vertex) {\n vertexProperties.push({ value, type, offset: rowVertexOffset });\n rowVertexOffset += offsets[typeName];\n } else if (chunkMode == ElementMode.SH) {\n // SH doesn't count for vertex row size but its properties are used to retrieve SH\n vertexProperties.push({ value, type, offset: rowVertexOffset });\n }\n\n if (!offsets[typeName]) {\n Logger.Warn(`Unsupported property type: ${typeName}.`);\n }\n } else if (prop.startsWith(\"element \")) {\n const [, type] = prop.split(\" \");\n if (type == \"chunk\") {\n chunkMode = ElementMode.Chunk;\n } else if (type == \"vertex\") {\n chunkMode = ElementMode.Vertex;\n } else if (type == \"sh\") {\n chunkMode = ElementMode.SH;\n } else {\n chunkMode = ElementMode.Unused;\n }\n }\n }\n\n const dataView = new DataView(data, headerEndIndex + headerEnd.length);\n const buffer = new ArrayBuffer(GaussianSplattingMeshBase._RowOutputLength * vertexCount);\n\n let shBuffer = null;\n let shCoefficientCount = 0;\n if (shDegree) {\n const shVectorCount = (shDegree + 1) * (shDegree + 1) - 1;\n shCoefficientCount = shVectorCount * 3;\n shBuffer = new ArrayBuffer(shCoefficientCount * vertexCount);\n }\n\n return {\n vertexCount: vertexCount,\n chunkCount: chunkCount,\n rowVertexLength: rowVertexOffset,\n rowChunkLength: rowChunkOffset,\n vertexProperties: vertexProperties,\n chunkProperties: chunkProperties,\n dataView: dataView,\n buffer: buffer,\n shDegree: shDegree,\n shCoefficientCount: shCoefficientCount,\n shBuffer: shBuffer,\n };\n }\n private static _GetCompressedChunks(header: PLYHeader, offset: { value: number }): Array<ICompressedPLYChunk> | null {\n if (!header.chunkCount) {\n return null;\n }\n const dataView = header.dataView;\n const compressedChunks = new Array<ICompressedPLYChunk>(header.chunkCount);\n for (let i = 0; i < header.chunkCount; i++) {\n const currentChunk = {\n min: new Vector3(),\n max: new Vector3(),\n minScale: new Vector3(),\n maxScale: new Vector3(),\n minColor: new Vector3(0, 0, 0),\n maxColor: new Vector3(1, 1, 1),\n };\n compressedChunks[i] = currentChunk;\n for (let propertyIndex = 0; propertyIndex < header.chunkProperties.length; propertyIndex++) {\n const property = header.chunkProperties[propertyIndex];\n let value;\n switch (property.type) {\n case PLYType.FLOAT:\n value = dataView.getFloat32(property.offset + offset.value, true);\n break;\n default:\n continue;\n }\n\n switch (property.value) {\n case PLYValue.MIN_X:\n currentChunk.min.x = value;\n break;\n case PLYValue.MIN_Y:\n currentChunk.min.y = value;\n break;\n case PLYValue.MIN_Z:\n currentChunk.min.z = value;\n break;\n case PLYValue.MAX_X:\n currentChunk.max.x = value;\n break;\n case PLYValue.MAX_Y:\n currentChunk.max.y = value;\n break;\n case PLYValue.MAX_Z:\n currentChunk.max.z = value;\n break;\n case PLYValue.MIN_SCALE_X:\n currentChunk.minScale.x = value;\n break;\n case PLYValue.MIN_SCALE_Y:\n currentChunk.minScale.y = value;\n break;\n case PLYValue.MIN_SCALE_Z:\n currentChunk.minScale.z = value;\n break;\n case PLYValue.MAX_SCALE_X:\n currentChunk.maxScale.x = value;\n break;\n case PLYValue.MAX_SCALE_Y:\n currentChunk.maxScale.y = value;\n break;\n case PLYValue.MAX_SCALE_Z:\n currentChunk.maxScale.z = value;\n break;\n case PLYValue.MIN_COLOR_R:\n currentChunk.minColor.x = value;\n break;\n case PLYValue.MIN_COLOR_G:\n currentChunk.minColor.y = value;\n break;\n case PLYValue.MIN_COLOR_B:\n currentChunk.minColor.z = value;\n break;\n case PLYValue.MAX_COLOR_R:\n currentChunk.maxColor.x = value;\n break;\n case PLYValue.MAX_COLOR_G:\n currentChunk.maxColor.y = value;\n break;\n case PLYValue.MAX_COLOR_B:\n currentChunk.maxColor.z = value;\n break;\n }\n }\n offset.value += header.rowChunkLength;\n }\n return compressedChunks;\n }\n\n private static _GetSplat(header: PLYHeader, index: number, compressedChunks: Array<ICompressedPLYChunk> | null, offset: { value: number }): void {\n const q = TmpVectors.Quaternion[0];\n const temp3 = TmpVectors.Vector3[0];\n\n const rowOutputLength = GaussianSplattingMeshBase._RowOutputLength;\n const buffer = header.buffer;\n const dataView = header.dataView;\n const position = new Float32Array(buffer, index * rowOutputLength, 3);\n const scale = new Float32Array(buffer, index * rowOutputLength + 12, 3);\n const rgba = new Uint8ClampedArray(buffer, index * rowOutputLength + 24, 4);\n const rot = new Uint8ClampedArray(buffer, index * rowOutputLength + 28, 4);\n let sh = null;\n if (header.shBuffer) {\n sh = new Uint8ClampedArray(header.shBuffer, index * header.shCoefficientCount, header.shCoefficientCount);\n }\n const chunkIndex = index >> 8;\n let r0: number = 255;\n let r1: number = 0;\n let r2: number = 0;\n let r3: number = 0;\n\n const plySH = [];\n\n for (let propertyIndex = 0; propertyIndex < header.vertexProperties.length; propertyIndex++) {\n const property = header.vertexProperties[propertyIndex];\n let value;\n switch (property.type) {\n case PLYType.FLOAT:\n value = dataView.getFloat32(offset.value + property.offset, true);\n break;\n case PLYType.INT:\n value = dataView.getInt32(offset.value + property.offset, true);\n break;\n case PLYType.UINT:\n value = dataView.getUint32(offset.value + property.offset, true);\n break;\n case PLYType.DOUBLE:\n value = dataView.getFloat64(offset.value + property.offset, true);\n break;\n case PLYType.UCHAR:\n value = dataView.getUint8(offset.value + property.offset);\n break;\n case PLYType.USHORT:\n value = FromHalfFloat(dataView.getUint16(offset.value + property.offset, true));\n break;\n default:\n continue;\n }\n\n switch (property.value) {\n case PLYValue.PACKED_POSITION:\n {\n const compressedChunk = compressedChunks![chunkIndex];\n Unpack111011(value, temp3);\n position[0] = Scalar.Lerp(compressedChunk.min.x, compressedChunk.max.x, temp3.x);\n position[1] = Scalar.Lerp(compressedChunk.min.y, compressedChunk.max.y, temp3.y);\n position[2] = Scalar.Lerp(compressedChunk.min.z, compressedChunk.max.z, temp3.z);\n }\n break;\n case PLYValue.PACKED_ROTATION:\n {\n UnpackRot(value, q);\n\n r0 = q.x;\n r1 = q.y;\n r2 = q.z;\n r3 = q.w;\n }\n break;\n case PLYValue.PACKED_SCALE:\n {\n const compressedChunk = compressedChunks![chunkIndex];\n Unpack111011(value, temp3);\n scale[0] = Math.exp(Scalar.Lerp(compressedChunk.minScale.x, compressedChunk.maxScale.x, temp3.x));\n scale[1] = Math.exp(Scalar.Lerp(compressedChunk.minScale.y, compressedChunk.maxScale.y, temp3.y));\n scale[2] = Math.exp(Scalar.Lerp(compressedChunk.minScale.z, compressedChunk.maxScale.z, temp3.z));\n }\n break;\n case PLYValue.PACKED_COLOR:\n {\n const compressedChunk = compressedChunks![chunkIndex];\n Unpack8888(value, rgba);\n rgba[0] = Scalar.Lerp(compressedChunk.minColor.x, compressedChunk.maxColor.x, rgba[0] / 255) * 255;\n rgba[1] = Scalar.Lerp(compressedChunk.minColor.y, compressedChunk.maxColor.y, rgba[1] / 255) * 255;\n rgba[2] = Scalar.Lerp(compressedChunk.minColor.z, compressedChunk.maxColor.z, rgba[2] / 255) * 255;\n }\n break;\n case PLYValue.X:\n position[0] = value;\n break;\n case PLYValue.Y:\n position[1] = value;\n break;\n case PLYValue.Z:\n position[2] = value;\n break;\n case PLYValue.SCALE_0:\n scale[0] = Math.exp(value);\n break;\n case PLYValue.SCALE_1:\n scale[1] = Math.exp(value);\n break;\n case PLYValue.SCALE_2:\n scale[2] = Math.exp(value);\n break;\n case PLYValue.DIFFUSE_RED:\n rgba[0] = value;\n break;\n case PLYValue.DIFFUSE_GREEN:\n rgba[1] = value;\n break;\n case PLYValue.DIFFUSE_BLUE:\n rgba[2] = value;\n break;\n case PLYValue.F_DC_0:\n rgba[0] = (0.5 + GaussianSplattingMeshBase._SH_C0 * value) * 255;\n break;\n case PLYValue.F_DC_1:\n rgba[1] = (0.5 + GaussianSplattingMeshBase._SH_C0 * value) * 255;\n break;\n case PLYValue.F_DC_2:\n rgba[2] = (0.5 + GaussianSplattingMeshBase._SH_C0 * value) * 255;\n break;\n case PLYValue.F_DC_3:\n rgba[3] = (0.5 + GaussianSplattingMeshBase._SH_C0 * value) * 255;\n break;\n case PLYValue.OPACITY:\n rgba[3] = (1 / (1 + Math.exp(-value))) * 255;\n break;\n case PLYValue.ROT_0:\n r0 = value;\n break;\n case PLYValue.ROT_1:\n r1 = value;\n break;\n case PLYValue.ROT_2:\n r2 = value;\n break;\n case PLYValue.ROT_3:\n r3 = value;\n break;\n }\n if (sh && property.value >= PLYValue.SH_0 && property.value <= PLYValue.SH_71) {\n const shIndex = property.value - PLYValue.SH_0;\n if (property.type == PLYType.UCHAR && header.chunkCount) {\n // compressed ply. dataView points to beginning of vertex\n // could be improved with a direct copy instead of a per SH index computation + copy\n const compressedValue = dataView.getUint8(\n header.rowChunkLength * header.chunkCount + header.vertexCount * header.rowVertexLength + index * header.shCoefficientCount + shIndex\n );\n // compressed .ply SH import : https://github.com/playcanvas/engine/blob/fda3f0368b45d7381f0b5a1722bd2056128eaebe/src/scene/gsplat/gsplat-compressed-data.js#L88C81-L88C98\n plySH[shIndex] = (compressedValue * (8 / 255) - 4) * 127.5 + 127.5;\n } else {\n const clampedValue = Scalar.Clamp(value * 127.5 + 127.5, 0, 255);\n plySH[shIndex] = clampedValue;\n }\n }\n }\n\n if (sh) {\n const shDim = header.shDegree == 1 ? 3 : header.shDegree == 2 ? 8 : header.shDegree == 3 ? 15 : 24;\n for (let j = 0; j < shDim; j++) {\n sh[j * 3 + 0] = plySH[j];\n sh[j * 3 + 1] = plySH[j + shDim];\n sh[j * 3 + 2] = plySH[j + shDim * 2];\n }\n }\n\n q.set(r1, r2, r3, r0);\n q.normalize();\n rot[0] = q.w * 127.5 + 127.5;\n rot[1] = q.x * 127.5 + 127.5;\n rot[2] = q.y * 127.5 + 127.5;\n rot[3] = q.z * 127.5 + 127.5;\n offset.value += header.rowVertexLength;\n }\n\n /**\n * Converts a .ply data with SH coefficients splat\n * if data array buffer is not ply, returns the original buffer\n * @param data the .ply data to load\n * @param useCoroutine use coroutine and yield\n * @returns the loaded splat buffer and optional array of sh coefficients\n */\n public static *ConvertPLYWithSHToSplat(data: ArrayBuffer, useCoroutine = false) {\n const header = GaussianSplattingMeshBase.ParseHeader(data);\n if (!header) {\n return { buffer: data };\n }\n\n const offset = { value: 0 };\n const compressedChunks = GaussianSplattingMeshBase._GetCompressedChunks(header, offset);\n\n for (let i = 0; i < header.vertexCount; i++) {\n GaussianSplattingMeshBase._GetSplat(header, i, compressedChunks, offset);\n if (i % GaussianSplattingMeshBase._PlyConversionBatchSize === 0 && useCoroutine) {\n yield;\n }\n }\n\n let sh = null;\n // make SH texture buffers\n if (header.shDegree && header.shBuffer) {\n const textureCount = Math.ceil(header.shCoefficientCount / 16); // 4 components can be stored per texture, 4 sh per component\n let shIndexRead = 0;\n const ubuf = new Uint8Array(header.shBuffer);\n\n // sh is an array of uint8array that will be used to create sh textures\n sh = [];\n\n const splatCount = header.vertexCount;\n const engine = EngineStore.LastCreatedEngine;\n if (engine) {\n const width = engine.getCaps().maxTextureSize;\n const height = Math.ceil(splatCount / width);\n // create array for the number of textures needed.\n sh = AllocateShBuffers(textureCount, height * width * 4 * 4);\n\n for (let i = 0; i < splatCount; i++) {\n for (let shIndexWrite = 0; shIndexWrite < header.shCoefficientCount; shIndexWrite++) {\n const shValue = ubuf[shIndexRead++];\n\n const textureIndex = Math.floor(shIndexWrite / 16);\n const shArray = sh[textureIndex];\n\n const byteIndexInTexture = shIndexWrite % 16; // [0..15]\n const offsetPerSplat = i * 16; // 16 sh values per texture per splat.\n shArray[byteIndexInTexture + offsetPerSplat] = shValue;\n }\n }\n }\n }\n\n return { buffer: header.buffer, sh: sh, shDegree: header.shDegree };\n }\n\n /**\n * Converts a .ply data array buffer to splat\n * if data array buffer is not ply, returns the original buffer\n * @param data the .ply data to load\n * @param useCoroutine use coroutine and yield\n * @returns the loaded splat buffer without SH coefficient, whether ply contains or not SH.\n */\n public static *ConvertPLYToSplat(data: ArrayBuffer, useCoroutine = false) {\n const header = GaussianSplattingMeshBase.ParseHeader(data);\n if (!header) {\n return data;\n }\n\n const offset = { value: 0 };\n const compressedChunks = GaussianSplattingMeshBase._GetCompressedChunks(header, offset);\n\n for (let i = 0; i < header.vertexCount; i++) {\n GaussianSplattingMeshBase._GetSplat(header, i, compressedChunks, offset);\n if (i % GaussianSplattingMeshBase._PlyConversionBatchSize === 0 && useCoroutine) {\n yield;\n }\n }\n\n return header.buffer;\n }\n\n /**\n * Converts a .ply data array buffer to splat\n * if data array buffer is not ply, returns the original buffer\n * @param data the .ply data to load\n * @returns the loaded splat buffer\n */\n public static async ConvertPLYToSplatAsync(data: ArrayBuffer) {\n return await runCoroutineAsync(GaussianSplattingMeshBase.ConvertPLYToSplat(data, true), createYieldingScheduler());\n }\n\n /**\n * Converts a .ply with SH data array buffer to splat\n * if data array buffer is not ply, returns the original buffer\n * @param data the .ply data to load\n * @returns the loaded splat buffer with SH\n */\n public static async ConvertPLYWithSHToSplatAsync(data: ArrayBuffer) {\n return await runCoroutineAsync(GaussianSplattingMeshBase.ConvertPLYWithSHToSplat(data, true), createYieldingScheduler());\n }\n /**\n * Loads a .splat Gaussian Splatting array buffer asynchronously\n * @param data arraybuffer containing splat file\n * @returns a promise that resolves when the operation is complete\n */\n\n public async loadDataAsync(data: ArrayBuffer): Promise<void> {\n return await this.updateDataAsync(data);\n }\n\n /**\n * Loads a Gaussian or Splatting file asynchronously\n * @param url path to the splat file to load\n * @param scene optional scene it belongs to\n * @returns a promise that resolves when the operation is complete\n * @deprecated Please use SceneLoader.ImportMeshAsync instead\n */\n public async loadFileAsync(url: string, scene?: Scene): Promise<void> {\n await ImportMeshAsync(url, (scene || EngineStore.LastCreatedScene)!, { pluginOptions: { splat: { gaussianSplattingMesh: this } } });\n }\n\n /**\n * Releases resources associated with this mesh.\n * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)\n */\n public override dispose(doNotRecurse?: boolean): void {\n if (this._mrtAtlas) {\n // The four data textures are attachments of this MRT — dispose the MRT, not each attachment.\n this._mrtAtlas.dispose();\n this._mrtAtlas = null;\n this._covariancesATexture = this._covariancesBTexture = this._centersTexture = this._colorsTexture = null;\n } else {\n this._covariancesATexture?.dispose();\n this._covariancesBTexture?.dispose();\n this._centersTexture?.dispose();\n this._colorsTexture?.dispose();\n }\n if (this._shMrtAtlas) {\n // SH attachments belong to these MRTs — dispose the MRTs, not each attachment (which is _shTextures[k]\n // for k < _shMrtAtlas.length).\n for (const mrt of this._shMrtAtlas) {\n mrt.dispose();\n }\n // Defence in depth: free any _shTextures entries beyond the MRT-backed set (not MRT-owned, so the loop\n // above misses them). The reuse guard keeps the atlas sized correctly, so this is normally a no-op.\n if (this._shTextures) {\n for (let k = this._shMrtAtlas.length; k < this._shTextures.length; k++) {\n this._shTextures[k].dispose();\n }\n }\n this._shMrtAtlas = null;\n } else if (this._shTextures) {\n for (const shTexture of this._shTextures) {\n shTexture.dispose();\n }\n }\n this._shTextures = null;\n\n if (this._rotMrtAtlas) {\n // The three rotation textures are attachments of this MRT — dispose the MRT, not each attachment.\n this._rotMrtAtlas.dispose();\n this._rotMrtAtlas = null;\n } else {\n this._rotationsATexture?.dispose();\n this._rotationsBTexture?.dispose();\n this._rotationScaleTexture?.dispose();\n }\n this._sogParams?.codebookTexture?.dispose();\n this._rotationsATexture = null;\n this._rotationsBTexture = null;\n this._rotationScaleTexture = null;\n this._rotationDataA = null;\n this._rotationDataB = null;\n this._rotationScaleData = null;\n this._covariancesATexture = null;\n this._covariancesBTexture = null;\n this._centersTexture = null;\n this._colorsTexture = null;\n this._shTextures = null;\n this._cachedBoundingMin = null;\n this._cachedBoundingMax = null;\n // Note: _splatsData and _shData are intentionally kept alive after dispose.\n // They can still be used as runtime source buffers by a compound mesh that retained\n // this mesh's data before disposal.\n\n _ReleaseGsInterFrameYield(this.getEngine());\n this._worker?.terminate();\n this._worker = null;\n\n this.onPartCountChangedObservable.clear();\n this.onPartRemovedObservable.clear();\n\n this._scene.onCameraRemovedObservable.remove(this._cameraRemovedObserver);\n this._cameraRemovedObserver = null;\n\n // delete meshes created for each camera\n this._cameraViewInfos.forEach((cameraViewInfo) => {\n cameraViewInfo.mesh.dispose();\n cameraViewInfo.gpuOutput?.dispose();\n cameraViewInfo.gpuOutput = null;\n });\n if (this._gpuObserver) {\n this._scene.onBeforeRenderObservable.remove(this._gpuObserver);\n this._gpuObserver = null;\n }\n if (this._gpuRestoreObserver) {\n this._scene.getEngine().onContextRestoredObservable.remove(this._gpuRestoreObserver);\n this._gpuRestoreObserver = null;\n }\n this._gpuSorter?.dispose();\n this._gpuSorter = null;\n this._gpuMode = false;\n\n super.dispose(doNotRecurse, true);\n }\n\n protected _copyTextures(source: GaussianSplattingMeshBase): void {\n // The texture dimensions are not copied with the underscore-prefixed fields: the sort source and incremental updates read them.\n this._textureSize.copyFrom(source._textureSize);\n this._covariancesATexture = source.covariancesATexture?.clone()!;\n this._covariancesBTexture = source.covariancesBTexture?.clone()!;\n this._centersTexture = source.centersTexture?.clone()!;\n this._colorsTexture = source.colorsTexture?.clone()!;\n if (source._shTextures) {\n this._shTextures = [];\n for (const shTexture of source._shTextures) {\n this._shTextures?.push(shTexture.clone()!);\n }\n }\n if (source._rotationsATexture) {\n this._rotationsATexture = source._rotationsATexture.clone()!;\n this._rotationsBTexture = source._rotationsBTexture?.clone()!;\n this._rotationScaleTexture = source._rotationScaleTexture?.clone()!;\n }\n }\n\n /**\n * Returns a new Mesh object generated from the current mesh properties.\n * @param name is a string, the name given to the new mesh\n * @returns a new Gaussian Splatting Mesh\n */\n public override clone(name: string = \"\"): GaussianSplattingMeshBase {\n const newGS = new GaussianSplattingMeshBase(name, undefined, this.getScene());\n newGS._copySource(this);\n newGS.makeGeometryUnique();\n newGS._vertexCount = this._vertexCount;\n newGS._copyTextures(this);\n newGS._modelViewProjectionMatrix = Matrix.Identity();\n newGS._splatPositions = this._splatPositions;\n newGS._readyToDisplay = false;\n newGS._hasRenderedOnce = false;\n newGS._disableDepthSort = this._disableDepthSort;\n newGS.useGpuSort = this.useGpuSort;\n newGS._instantiateWorker();\n\n const binfo = this.getBoundingInfo();\n newGS.getBoundingInfo().reConstruct(binfo.minimum, binfo.maximum, this.getWorldMatrix());\n\n newGS.forcedInstanceCount = this.forcedInstanceCount;\n newGS.setEnabled(true);\n return newGS;\n }\n\n protected _makeEmptySplat(index: number, covA: Uint16Array, covB: Uint16Array, colorArray: Uint8Array): void {\n const covBSItemSize = this._useRGBACovariants ? 4 : 2;\n this._splatPositions![4 * index + 0] = 0;\n this._splatPositions![4 * index + 1] = 0;\n this._splatPositions![4 * index + 2] = 0;\n\n covA[index * 4 + 0] = ToHalfFloat(0);\n covA[index * 4 + 1] = ToHalfFloat(0);\n covA[index * 4 + 2] = ToHalfFloat(0);\n covA[index * 4 + 3] = ToHalfFloat(0);\n covB[index * covBSItemSize + 0] = ToHalfFloat(0);\n covB[index * covBSItemSize + 1] = ToHalfFloat(0);\n colorArray[index * 4 + 3] = 0;\n }\n\n /**\n * Processes a single splat from the source buffer (at srcIndex) and writes the result into\n * the destination texture arrays at dstIndex. This decoupling allows addPart to feed multiple\n * independent source buffers into a single set of destination arrays without merging them first.\n * @param dstIndex - destination splat index (into _splatPositions, covA, covB, colorArray)\n * @param fBuffer - float32 view of the source .splat buffer\n * @param uBuffer - uint8 view of the source .splat buffer\n * @param covA - destination covariancesA array\n * @param covB - destination covariancesB array\n * @param colorArray - destination color array\n * @param minimum - accumulated bounding minimum (updated in-place)\n * @param maximum - accumulated bounding maximum (updated in-place)\n * @param flipY - whether to negate the Y position\n * @param srcIndex - source splat index (defaults to dstIndex when omitted)\n * @param dstArrayIndex - index into the covA/covB/colorArray transients (defaults to dstIndex). Lets a streaming\n * write pass count-sized transients indexed from 0 while dstIndex still addresses the atlas-sized _splatPositions.\n */\n protected _makeSplat(\n dstIndex: number,\n fBuffer: Float32Array,\n uBuffer: Uint8Array,\n covA: Uint16Array,\n covB: Uint16Array,\n colorArray: Uint8Array,\n minimum: Vector3,\n maximum: Vector3,\n flipY: boolean,\n srcIndex: number = dstIndex,\n dstArrayIndex: number = dstIndex\n ): void {\n const matrixRotation = TmpVectors.Matrix[0];\n const matrixScale = TmpVectors.Matrix[1];\n const quaternion = TmpVectors.Quaternion[0];\n const covBSItemSize = this._useRGBACovariants ? 4 : 2;\n\n const x = fBuffer[8 * srcIndex + 0];\n const y = fBuffer[8 * srcIndex + 1] * (flipY ? -1 : 1);\n const z = fBuffer[8 * srcIndex + 2];\n\n this._splatPositions![4 * dstIndex + 0] = x;\n this._splatPositions![4 * dstIndex + 1] = y;\n this._splatPositions![4 * dstIndex + 2] = z;\n\n minimum.minimizeInPlaceFromFloats(x, y, z);\n maximum.maximizeInPlaceFromFloats(x, y, z);\n\n quaternion.set(\n (uBuffer[32 * srcIndex + 28 + 1] - 127.5) / 127.5,\n (uBuffer[32 * srcIndex + 28 + 2] - 127.5) / 127.5,\n (uBuffer[32 * srcIndex + 28 + 3] - 127.5) / 127.5,\n -(uBuffer[32 * srcIndex + 28 + 0] - 127.5) / 127.5\n );\n quaternion.normalize();\n quaternion.toRotationMatrix(matrixRotation);\n\n Matrix.ScalingToRef(fBuffer[8 * srcIndex + 3 + 0] * 2, fBuffer[8 * srcIndex + 3 + 1] * 2, fBuffer[8 * srcIndex + 3 + 2] * 2, matrixScale);\n\n if (this._needsRotationScaleTextures) {\n // Sized to the atlas (_splatPositions), not covA: these persistent arrays are indexed by the global\n // dstIndex, so a count-sized covA transient must not shrink them.\n const rotLength = this._splatPositions!.length;\n if (!this._rotationDataA || this._rotationDataA.length < rotLength) {\n this._rotationDataA = new Uint16Array(rotLength);\n this._rotationDataB = new Uint16Array(rotLength);\n this._rotationScaleData = new Uint16Array(rotLength);\n }\n const rotDataA = this._rotationDataA;\n const rotDataB = this._rotationDataB!;\n const rotScaleData = this._rotationScaleData!;\n const rm = matrixRotation.m;\n const sm = matrixScale.m;\n rotDataA[dstIndex * 4 + 0] = ToHalfFloat(rm[0]);\n rotDataA[dstIndex * 4 + 1] = ToHalfFloat(rm[1]);\n rotDataA[dstIndex * 4 + 2] = ToHalfFloat(rm[2]);\n rotDataA[dstIndex * 4 + 3] = ToHalfFloat(rm[4]);\n rotDataB[dstIndex * 4 + 0] = ToHalfFloat(rm[5]);\n rotDataB[dstIndex * 4 + 1] = ToHalfFloat(rm[6]);\n rotDataB[dstIndex * 4 + 2] = ToHalfFloat(rm[8]);\n rotDataB[dstIndex * 4 + 3] = ToHalfFloat(rm[9]);\n rotScaleData[dstIndex * 4 + 0] = ToHalfFloat(rm[10]);\n rotScaleData[dstIndex * 4 + 1] = ToHalfFloat(sm[0]);\n rotScaleData[dstIndex * 4 + 2] = ToHalfFloat(sm[5]);\n rotScaleData[dstIndex * 4 + 3] = ToHalfFloat(sm[10]);\n }\n\n const m = matrixRotation.multiplyToRef(matrixScale, TmpVectors.Matrix[0]).m;\n\n const covariances = this._tmpCovariances;\n covariances[0] = m[0] * m[0] + m[1] * m[1] + m[2] * m[2];\n covariances[1] = m[0] * m[4] + m[1] * m[5] + m[2] * m[6];\n covariances[2] = m[0] * m[8] + m[1] * m[9] + m[2] * m[10];\n covariances[3] = m[4] * m[4] + m[5] * m[5] + m[6] * m[6];\n covariances[4] = m[4] * m[8] + m[5] * m[9] + m[6] * m[10];\n covariances[5] = m[8] * m[8] + m[9] * m[9] + m[10] * m[10];\n\n // normalize covA, covB\n let factor = -10000;\n for (let covIndex = 0; covIndex < 6; covIndex++) {\n factor = Math.max(factor, Math.abs(covariances[covIndex]));\n }\n\n this._splatPositions![4 * dstIndex + 3] = factor;\n const transform = factor;\n\n covA[dstArrayIndex * 4 + 0] = ToHalfFloat(covariances[0] / transform);\n covA[dstArrayIndex * 4 + 1] = ToHalfFloat(covariances[1] / transform);\n covA[dstArrayIndex * 4 + 2] = ToHalfFloat(covariances[2] / transform);\n covA[dstArrayIndex * 4 + 3] = ToHalfFloat(covariances[3] / transform);\n covB[dstArrayIndex * covBSItemSize + 0] = ToHalfFloat(covariances[4] / transform);\n covB[dstArrayIndex * covBSItemSize + 1] = ToHalfFloat(covariances[5] / transform);\n\n const c0 = covariances[0];\n const c1 = covariances[1];\n const c2 = covariances[2];\n const c3 = covariances[3];\n const c4 = covariances[4];\n const c5 = covariances[5];\n const det3d = c0 * (c3 * c5 - c4 * c4) - c1 * (c1 * c5 - c4 * c2) + c2 * (c1 * c4 - c3 * c2);\n const splatSize = Math.pow(Math.abs(det3d), 1.0 / 6.0);\n if (splatSize < this._splatSizeMin) {\n this._splatSizeMin = splatSize;\n }\n if (splatSize > this._splatSizeMax) {\n this._splatSizeMax = splatSize;\n }\n\n // colors\n colorArray[dstArrayIndex * 4 + 0] = uBuffer[32 * srcIndex + 24 + 0];\n colorArray[dstArrayIndex * 4 + 1] = uBuffer[32 * srcIndex + 24 + 1];\n colorArray[dstArrayIndex * 4 + 2] = uBuffer[32 * srcIndex + 24 + 2];\n colorArray[dstArrayIndex * 4 + 3] = uBuffer[32 * srcIndex + 24 + 3];\n }\n\n protected _onUpdateTextures(_textureSize: Vector2) {}\n\n /**\n * Called when part index data is received during a data load. Override to store and manage\n * part index state (e.g. allocating the padded Uint8Array).\n * No-op in the base class.\n * @param _partIndices - the raw part indices passed in by the caller\n * @param _textureLength - the padded texture length (width × height) to allocate into\n */\n protected _onIndexDataReceived(_partIndices: Uint8Array, _textureLength: number): void {}\n\n /**\n * Called at the start of an incremental texture update, before any splats are processed.\n * Override to perform incremental-specific setup, such as ensuring the part-index GPU texture\n * exists before the sub-texture upload begins.\n * No-op in the base class.\n * @param _textureSize - current texture dimensions\n */\n protected _onIncrementalUpdateStart(_textureSize: Vector2): void {}\n\n /**\n * Whether this mesh is in compound mode (has at least one part added via addPart).\n * Returns `false` in the base class; overridden to return `true` in the compound subclass.\n * Consumed by the material and depth renderer to toggle compound-specific shader paths.\n * @internal\n */\n public get isCompound(): boolean {\n return false;\n }\n\n protected _setDelayedTextureUpdate(covA: Uint16Array, covB: Uint16Array, colorArray: Uint8Array, sh?: Uint8Array[]): void {\n this._delayedTextureUpdate = { covA, covB, colors: colorArray, centers: this._splatPositions!, sh };\n }\n\n private _commitDelayedTextureUpdate(): void {\n const update = this._delayedTextureUpdate;\n if (!update) {\n return;\n }\n const textureSize = this._getTextureSize(this._vertexCount);\n this._updateSubTextures(update.centers, update.covA, update.covB, update.colors, 0, textureSize.y, update.sh);\n this._delayedTextureUpdate = null;\n }\n\n /**\n * Creates (or recreates) the MRT-backed data atlas at the given size and points the four core data\n * textures at its attachments. The attachments use the same decoded GS layout as {@link GaussianSplattingWorkBuffer}\n * — [centers F32, covA HALF_FLOAT, covB HALF_FLOAT, colors U8], all RGBA — so a streaming engine can render\n * (decode/relayout) directly into the same textures the GS material samples, while static parts CPU-upload\n * into them via {@link _updateSubTextures}. Covariance B is RGBA here (its extra channels unused), so the\n * atlas forces {@link _useRGBACovariants}.\n * @param textureSize atlas dimensions (width, height)\n */\n protected _createMrtAtlas(textureSize: Vector2): void {\n // covB carries only Sigma12/Sigma22 but MRT attachments are RGBA, so switch to the RGBA covariant layout.\n this._useRGBACovariants = true;\n const engine = this.getEngine();\n // No real GPU (NullEngine): skip MRT allocation. The reservation's part/index/range logic still runs;\n // texture population requires a real (WebGL2/WebGPU) backend.\n const updateEngine = this._getTextureDataUpdateEngine();\n if (!updateEngine._gl && !updateEngine.isWebGPU) {\n return;\n }\n const covType = engine.getCaps().textureHalfFloatRender ? Constants.TEXTURETYPE_HALF_FLOAT : Constants.TEXTURETYPE_FLOAT;\n const mrt = new MultiRenderTarget(\n this.name + \"_gsAtlas\",\n { width: textureSize.x, height: textureSize.y },\n 4,\n this._scene,\n {\n types: [Constants.TEXTURETYPE_FLOAT, covType, covType, Constants.TEXTURETYPE_UNSIGNED_BYTE],\n formats: [Constants.TEXTUREFORMAT_RGBA, Constants.TEXTUREFORMAT_RGBA, Constants.TEXTUREFORMAT_RGBA, Constants.TEXTUREFORMAT_RGBA],\n samplingModes: [\n Constants.TEXTURE_NEAREST_SAMPLINGMODE,\n Constants.TEXTURE_NEAREST_SAMPLINGMODE,\n Constants.TEXTURE_NEAREST_SAMPLINGMODE,\n Constants.TEXTURE_NEAREST_SAMPLINGMODE,\n ],\n generateDepthBuffer: false,\n generateDepthTexture: false,\n generateMipMaps: false,\n },\n [this.name + \"_gsCenters\", this.name + \"_gsCovA\", this.name + \"_gsCovB\", this.name + \"_gsColors\"]\n );\n mrt.clearColor = new Color4(0, 0, 0, 0);\n mrt.renderList = [];\n // Suppress clearing so a streaming engine's decode passes ACCUMULATE into the atlas (each decode writes\n // only its region and must not wipe static parts or previously-decoded splats). All texels are defined by\n // the initial full CPU sub-upload below (the reserved region's arrays are zero => invisible padding).\n mrt.onClearObservable.add(() => {});\n // Render once so the attachment textures are really allocated on the GPU before the CPU sub-uploads\n // below (on WebGPU, writeTexture requires the destination texture to already exist).\n mrt.render();\n this._mrtAtlas = mrt;\n this._centersTexture = mrt.textures[0];\n this._covariancesATexture = mrt.textures[1];\n this._covariancesBTexture = mrt.textures[2];\n this._colorsTexture = mrt.textures[3];\n }\n\n /**\n * Creates the shared higher-order SH atlas: `_shMrtAtlasTextureCount` single-attachment integer render targets\n * (RGBA_INTEGER / UNSIGNED_INTEGER, packed-u32), sized to the whole atlas, so a streaming engine can GPU-decode\n * baked SH into the reserved region and static SH parts CPU-upload into the same attachments. `_shTextures` (the\n * draw path's `shTexture0..N` samplers) are the attachments. One MRT per attachment keeps within WebGPU's\n * per-sample color-attachment byte budget. No-op without a real GPU backend (mirrors {@link _createMrtAtlas}).\n * @param textureSize atlas dimensions (width, height)\n */\n protected _createShMrtAtlas(textureSize: Vector2): void {\n const updateEngine = this._getTextureDataUpdateEngine();\n if (!updateEngine._gl && !updateEngine.isWebGPU) {\n return;\n }\n const count = this._shMrtAtlasTextureCount;\n if (count <= 0) {\n return;\n }\n const mrts: MultiRenderTarget[] = [];\n const shTextures: BaseTexture[] = [];\n for (let k = 0; k < count; k++) {\n const name = `${this.name}_gsShAtlas${k}`;\n const mrt = new MultiRenderTarget(\n name,\n { width: textureSize.x, height: textureSize.y },\n 1,\n this._scene,\n {\n types: [Constants.TEXTURETYPE_UNSIGNED_INTEGER],\n formats: [Constants.TEXTUREFORMAT_RGBA_INTEGER],\n samplingModes: [Constants.TEXTURE_NEAREST_SAMPLINGMODE],\n generateDepthBuffer: false,\n generateDepthTexture: false,\n generateMipMaps: false,\n },\n [name]\n );\n mrt.clearColor = new Color4(0, 0, 0, 0);\n mrt.renderList = [];\n // Accumulate: each SH decode writes only its region; the rest stays whatever was there (neutral for a\n // fresh atlas — 128 == 0 lighting is guaranteed by decoding every splat's region, incl. no-SH files).\n mrt.onClearObservable.add(() => {});\n const attachment = mrt.textures[0];\n attachment.wrapU = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n attachment.wrapV = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n // Allocate on the GPU before any CPU sub-upload (WebGPU writeTexture needs the resource to exist).\n mrt.render();\n mrts.push(mrt);\n shTextures.push(attachment);\n }\n this._shMrtAtlas = mrts;\n this._shTextures = shTextures;\n }\n\n /**\n * Creates the shared rotation/scale atlas: one 3-attachment half-float render target ([rotA, rotB, rotScale])\n * sized to the whole atlas, so a streaming engine can GPU-decode rotation/scale into the reserved region and\n * static parts CPU-upload into the same attachments. `_rotationsATexture`/`_rotationsBTexture`/\n * `_rotationScaleTexture` (the voxel-IBL samplers) become the three attachments. No-op without a real GPU\n * backend (mirrors {@link _createMrtAtlas}).\n * @param textureSize atlas dimensions (width, height)\n */\n protected _createRotMrtAtlas(textureSize: Vector2): void {\n const updateEngine = this._getTextureDataUpdateEngine();\n if (!updateEngine._gl && !updateEngine.isWebGPU) {\n return;\n }\n const rotType = this.getEngine().getCaps().textureHalfFloatRender ? Constants.TEXTURETYPE_HALF_FLOAT : Constants.TEXTURETYPE_FLOAT;\n const name = this.name + \"_gsRotAtlas\";\n const mrt = new MultiRenderTarget(\n name,\n { width: textureSize.x, height: textureSize.y },\n 3,\n this._scene,\n {\n types: [rotType, rotType, rotType],\n formats: [Constants.TEXTUREFORMAT_RGBA, Constants.TEXTUREFORMAT_RGBA, Constants.TEXTUREFORMAT_RGBA],\n samplingModes: [Constants.TEXTURE_NEAREST_SAMPLINGMODE, Constants.TEXTURE_NEAREST_SAMPLINGMODE, Constants.TEXTURE_NEAREST_SAMPLINGMODE],\n generateDepthBuffer: false,\n generateDepthTexture: false,\n generateMipMaps: false,\n },\n [name + \"A\", name + \"B\", name + \"Scale\"]\n );\n mrt.clearColor = new Color4(0, 0, 0, 0);\n mrt.renderList = [];\n // Accumulate: each rotation decode writes only its region; the rest stays whatever was there.\n mrt.onClearObservable.add(() => {});\n for (const attachment of mrt.textures) {\n attachment.wrapU = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n attachment.wrapV = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n }\n // Allocate on the GPU before any CPU sub-upload (WebGPU writeTexture needs the resource to exist).\n mrt.render();\n this._rotMrtAtlas = mrt;\n this._rotationsATexture = mrt.textures[0];\n this._rotationsBTexture = mrt.textures[1];\n this._rotationScaleTexture = mrt.textures[2];\n }\n\n // NB: partIndices is assumed to be padded to a round texture size\n protected _updateTextures(covA: Uint16Array, covB: Uint16Array, colorArray: Uint8Array, sh?: Uint8Array[]): void {\n const textureSize = this._getTextureSize(this._vertexCount);\n // Update the textures\n const createTextureFromData = (data: Float32Array, width: number, height: number, format: number) => {\n return new RawTexture(\n data,\n width,\n height,\n format,\n this._scene,\n false,\n false,\n Constants.TEXTURE_NEAREST_SAMPLINGMODE,\n Constants.TEXTURETYPE_FLOAT,\n Constants.TEXTURE_CREATIONFLAG_SAMPLED_DATA_ONLY\n );\n };\n\n const createTextureFromDataU8 = (data: Uint8Array, width: number, height: number, format: number) => {\n return new RawTexture(\n data,\n width,\n height,\n format,\n this._scene,\n false,\n false,\n Constants.TEXTURE_NEAREST_SAMPLINGMODE,\n Constants.TEXTURETYPE_UNSIGNED_BYTE,\n Constants.TEXTURE_CREATIONFLAG_SAMPLED_DATA_ONLY\n );\n };\n\n const createEmptyTextureU32 = (width: number, height: number, format: number) => {\n return new RawTexture(\n null,\n width,\n height,\n format,\n this._scene,\n false,\n false,\n Constants.TEXTURE_NEAREST_SAMPLINGMODE,\n Constants.TEXTURETYPE_UNSIGNED_INTEGER,\n Constants.TEXTURE_CREATIONFLAG_SAMPLED_DATA_ONLY\n );\n };\n\n const createTextureFromDataF16 = (data: Uint16Array, width: number, height: number, format: number) => {\n return new RawTexture(\n data,\n width,\n height,\n format,\n this._scene,\n false,\n false,\n Constants.TEXTURE_NEAREST_SAMPLINGMODE,\n Constants.TEXTURETYPE_HALF_FLOAT,\n Constants.TEXTURE_CREATIONFLAG_SAMPLED_DATA_ONLY\n );\n };\n\n const firstTime = this._covariancesATexture === null;\n const textureSizeChanged = this._textureSize.y != textureSize.y;\n // The render-backed SH atlas must have one attachment per SH texture the material samples, i.e. sized to the\n // compound's MERGED SH degree (`sh` spans static + streaming), not just the streaming parts' requested count —\n // otherwise a lower-degree stream mixed with a higher-degree static part (or a later higher-degree stream)\n // leaves the atlas undersized. `sh` is always present when a streaming SH part is live (its degree makes it so).\n if (this._useShMrtAtlas && sh) {\n this._shMrtAtlasTextureCount = sh.length;\n }\n // First streaming-part reservation must convert the existing RawTexture atlas to the MRT-backed atlas,\n // which requires the full (re)build branch even when the texture height is unchanged. Same for the SH atlas:\n // a streaming SH part must convert the SH textures to render-targetable integer MRTs (and recreate them when\n // the required attachment count changes).\n const needsMrtConversion =\n (this._useMrtAtlas && !this._mrtAtlas) ||\n (this._useShMrtAtlas && (!this._shMrtAtlas || this._shMrtAtlas.length !== this._shMrtAtlasTextureCount)) ||\n (this._useRotMrtAtlas && !this._rotMrtAtlas);\n\n if (!firstTime && !textureSizeChanged && !needsMrtConversion) {\n this._setDelayedTextureUpdate(covA, covB, colorArray, sh);\n if (this._worker) {\n const positions = Float32Array.from(this._splatPositions!);\n const vertexCount = this._vertexCount;\n this._worker.postMessage({ command: GaussianSplattingSortWorkerCommand.POSITIONS, positions, vertexCount }, [positions.buffer]);\n // Re-sync the active interval set in case the source splat count changed.\n this._postIntervalsToWorker();\n } else if (this._gpuMode) {\n this._markGpuSourceDirty();\n }\n\n // No sort-worker reply will flush the delayed upload (Native / no-worker path), so it is committed\n // below. That commit uploads every existing data, rotation and SH texture, so don't upload them here too.\n const commitWithoutWorker = !this._worker;\n\n // Handle SH textures in update path - create any that don't exist yet (including when a higher SH\n // degree needs more textures than are allocated). Skip when the SH atlas is render-backed\n // (_useShMrtAtlas): those targets are created/managed by _createShMrtAtlas, not here.\n if (sh && !this._useShMrtAtlas && (!this._shTextures || this._shTextures.length < sh.length)) {\n this._shTextures ??= [];\n for (let textureIndex = this._shTextures.length; textureIndex < sh.length; textureIndex++) {\n const shTexture = createEmptyTextureU32(textureSize.x, textureSize.y, Constants.TEXTUREFORMAT_RGBA_INTEGER);\n shTexture.wrapU = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n shTexture.wrapV = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n this._shTextures!.push(shTexture);\n if (!commitWithoutWorker) {\n this._updateShTextureData(shTexture, sh[textureIndex], textureSize.x, 0, textureSize.y);\n }\n }\n }\n\n if (commitWithoutWorker) {\n // Commit after the SH textures exist (the upload writes them) but before any rotation textures\n // are created below, since those are created with their data already.\n this._commitDelayedTextureUpdate();\n }\n\n if (this._needsRotationScaleTextures && this._rotationDataA) {\n if (this._rotationsATexture) {\n // Without a worker, the commit above already uploaded the rotation data.\n if (!commitWithoutWorker) {\n this._updateTextureFromData(this._rotationsATexture, this._rotationDataA, textureSize.x, 0, textureSize.y);\n this._updateTextureFromData(this._rotationsBTexture!, this._rotationDataB!, textureSize.x, 0, textureSize.y);\n this._updateTextureFromData(this._rotationScaleTexture!, this._rotationScaleData!, textureSize.x, 0, textureSize.y);\n }\n } else {\n // Rotation textures not yet created (needsRotationScaleTextures was enabled after initial load).\n this._rotationsATexture = createTextureFromDataF16(this._rotationDataA, textureSize.x, textureSize.y, Constants.TEXTUREFORMAT_RGBA);\n this._rotationsBTexture = createTextureFromDataF16(this._rotationDataB!, textureSize.x, textureSize.y, Constants.TEXTUREFORMAT_RGBA);\n this._rotationScaleTexture = createTextureFromDataF16(this._rotationScaleData!, textureSize.x, textureSize.y, Constants.TEXTUREFORMAT_RGBA);\n this._rotationsATexture.wrapU = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n this._rotationsATexture.wrapV = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n this._rotationsBTexture.wrapU = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n this._rotationsBTexture.wrapV = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n this._rotationScaleTexture.wrapU = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n this._rotationScaleTexture.wrapV = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n }\n }\n\n this._onUpdateTextures(textureSize);\n\n this._postToWorker(true);\n } else {\n // Full rebuild: the texture size changed (or this is a size-changing reload), so the existing\n // GPU textures cannot be reused. Dispose them before recreating to avoid leaking the old ones.\n // Growing an EXISTING MRT atlas: let streaming parts back up their GPU-only region from the old atlas\n // before it is disposed (they restore it into the new atlas via _onAfterAtlasRebuildObservable).\n const growingMrtAtlas = this._useMrtAtlas && !!this._mrtAtlas;\n if (growingMrtAtlas) {\n this._onBeforeAtlasRebuildObservable.notifyObservers(this._mrtAtlas!);\n }\n if (this._mrtAtlas) {\n // The four data textures are attachments of this MRT — dispose the MRT, not each attachment.\n this._mrtAtlas.dispose();\n this._mrtAtlas = null;\n this._covariancesATexture = this._covariancesBTexture = this._centersTexture = this._colorsTexture = null;\n } else {\n this._covariancesATexture?.dispose();\n this._covariancesBTexture?.dispose();\n this._centersTexture?.dispose();\n this._colorsTexture?.dispose();\n }\n // Dispose+null the rotation/scale textures before the MRT-branch _updateSubTextures below: that helper\n // also writes the rotation textures, so leaving them at the old (smaller) height would upload the taller\n // region out of bounds. Nulling them makes it skip rotation; the block further down recreates them.\n if (this._rotMrtAtlas) {\n // The three rotation textures are attachments of this MRT — dispose the MRT, not each attachment.\n this._rotMrtAtlas.dispose();\n this._rotMrtAtlas = null;\n this._rotationsATexture = null;\n this._rotationsBTexture = null;\n this._rotationScaleTexture = null;\n } else if (this._rotationsATexture) {\n this._rotationsATexture.dispose();\n this._rotationsBTexture?.dispose();\n this._rotationScaleTexture?.dispose();\n this._rotationsATexture = null;\n this._rotationsBTexture = null;\n this._rotationScaleTexture = null;\n }\n if (this._shTextures) {\n // SH attachments belong to _shMrtAtlas MRTs (dispose the MRT, not each attachment) when render-backed.\n if (this._shMrtAtlas) {\n for (const mrt of this._shMrtAtlas) {\n mrt.dispose();\n }\n // Defence in depth: free any _shTextures entries beyond the MRT-backed set (see dispose()).\n for (let k = this._shMrtAtlas.length; k < this._shTextures.length; k++) {\n this._shTextures[k].dispose();\n }\n this._shMrtAtlas = null;\n } else {\n for (const shTexture of this._shTextures) {\n shTexture.dispose();\n }\n }\n this._shTextures = null;\n }\n\n this._textureSize = textureSize;\n if (this._useMrtAtlas) {\n // Back the four data textures with a render-targetable MRT so a streaming engine can decode\n // into the reserved region; static splats are CPU-uploaded into the same attachments below.\n this._createMrtAtlas(textureSize);\n // Same for the higher-order SH atlas (integer render targets), when a streaming part needs baked SH.\n if (this._useShMrtAtlas) {\n this._createShMrtAtlas(textureSize);\n }\n // Same for the rotation/scale atlas (half-float), created before the _updateSubTextures below so\n // static parts' CPU rotation data lands in the shared attachments (streamed rows are decoded after).\n if (this._useRotMrtAtlas) {\n this._createRotMrtAtlas(textureSize);\n }\n if (this._mrtAtlas) {\n this._updateSubTextures(this._splatPositions!, covA, covB, colorArray, 0, textureSize.y);\n // Render-backed SH: CPU-upload the static parts' SH into the shared SH atlas HERE — before the\n // streaming restore below — so a streamed region's restored SH wins over the bulk (neutral) fill,\n // exactly like the core atlas's _updateSubTextures-then-restore ordering. (`sh` covers the whole\n // atlas; streamed rows are neutral in it and get overwritten by the restore.)\n if (this._useShMrtAtlas && sh) {\n const shTex = this._shTextures as Nullable<BaseTexture[]>;\n if (shTex) {\n for (let textureIndex = 0; textureIndex < sh.length && textureIndex < shTex.length; textureIndex++) {\n this._updateShTextureData(shTex[textureIndex], sh[textureIndex], textureSize.x, 0, textureSize.y);\n }\n }\n }\n // New atlas is populated (streamed regions currently zeroed); let streaming parts rebind and\n // restore their backed-up region into it, overwriting those zeros with the preserved data.\n if (growingMrtAtlas) {\n this._onAfterAtlasRebuildObservable.notifyObservers(this._mrtAtlas);\n }\n }\n } else {\n this._covariancesATexture = createTextureFromDataF16(covA, textureSize.x, textureSize.y, Constants.TEXTUREFORMAT_RGBA);\n this._covariancesBTexture = createTextureFromDataF16(\n covB,\n textureSize.x,\n textureSize.y,\n this._useRGBACovariants ? Constants.TEXTUREFORMAT_RGBA : Constants.TEXTUREFORMAT_RG\n );\n this._centersTexture = createTextureFromData(this._splatPositions!, textureSize.x, textureSize.y, Constants.TEXTUREFORMAT_RGBA);\n this._colorsTexture = createTextureFromDataU8(colorArray, textureSize.x, textureSize.y, Constants.TEXTUREFORMAT_RGBA);\n }\n\n // Render-backed SH (_useShMrtAtlas) was already CPU-uploaded above (before the streaming restore); only\n // the plain RawTexture SH path is handled here.\n if (sh && !this._useShMrtAtlas) {\n {\n this._shTextures = [];\n for (let textureIndex = 0; textureIndex < sh.length; textureIndex++) {\n const shTexture = createEmptyTextureU32(textureSize.x, textureSize.y, Constants.TEXTUREFORMAT_RGBA_INTEGER);\n shTexture.wrapU = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n shTexture.wrapV = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n this._shTextures!.push(shTexture);\n }\n for (let textureIndex = 0; textureIndex < sh.length; textureIndex++) {\n this._updateShTextureData(this._shTextures[textureIndex], sh[textureIndex], textureSize.x, 0, textureSize.y);\n }\n }\n }\n\n // Render-backed rotation (_useRotMrtAtlas) was already created + CPU-uploaded above (via _updateSubTextures,\n // before the streaming restore); only the plain RawTexture rotation path is handled here.\n if (this._needsRotationScaleTextures && !this._useRotMrtAtlas) {\n const rotDataA = this._rotationDataA ?? new Uint16Array(covA.length);\n const rotDataB = this._rotationDataB ?? new Uint16Array(covA.length);\n const rotScaleData = this._rotationScaleData ?? new Uint16Array(covA.length);\n // Already disposed+nulled in the rebuild's disposal block above; just (re)create at the new size.\n this._rotationsATexture = createTextureFromDataF16(rotDataA, textureSize.x, textureSize.y, Constants.TEXTUREFORMAT_RGBA);\n this._rotationsBTexture = createTextureFromDataF16(rotDataB, textureSize.x, textureSize.y, Constants.TEXTUREFORMAT_RGBA);\n this._rotationScaleTexture = createTextureFromDataF16(rotScaleData, textureSize.x, textureSize.y, Constants.TEXTUREFORMAT_RGBA);\n this._rotationsATexture.wrapU = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n this._rotationsATexture.wrapV = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n this._rotationsBTexture.wrapU = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n this._rotationsBTexture.wrapV = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n this._rotationScaleTexture.wrapU = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n this._rotationScaleTexture.wrapV = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n }\n\n this._onUpdateTextures(textureSize);\n\n if (firstTime) {\n this._instantiateWorker();\n } else {\n if (this._worker) {\n const positions = Float32Array.from(this._splatPositions!);\n const vertexCount = this._vertexCount;\n this._worker.postMessage({ command: GaussianSplattingSortWorkerCommand.POSITIONS, positions, vertexCount }, [positions.buffer]);\n // Re-sync the active interval set in case the source splat count changed.\n this._postIntervalsToWorker();\n } else if (this._gpuMode) {\n this._markGpuSourceDirty();\n }\n this._postToWorker(true);\n }\n }\n }\n\n /**\n * Checks whether the GPU textures can be incrementally updated for a new addPart operation,\n * avoiding a full texture re-upload for existing splats.\n * Requires that the GPU textures already exist and the texture height won't change.\n * @param previousVertexCount - The number of splats previously committed to GPU\n * @param vertexCount - The new total number of splats\n * @param requiredShTextureCount - SH texture count this update requires (the merged `sh.length`), 0 when no SH\n * @returns true when only the new splat region needs to be uploaded\n */\n protected _canReuseCachedData(previousVertexCount: number, vertexCount: number, requiredShTextureCount: number = 0): boolean {\n if (previousVertexCount <= 0 || previousVertexCount > vertexCount) {\n return false;\n }\n if (this._splatPositions === null || this._cachedBoundingMin === null || this._cachedBoundingMax === null) {\n return false;\n }\n if (this._covariancesATexture === null) {\n return false;\n }\n // Switching to (or resizing) a render-backed atlas requires a full rebuild so the affected textures are\n // recreated as MRT attachments — the incremental sub-upload path cannot convert them. These must mirror the\n // `needsMrtConversion` checks in _updateTextures: if they disagree, an incremental data prep (which fills only\n // the new splats) would be paired with a full-rebuild upload (which uploads the whole array), zeroing the\n // existing parts. Covers the first streaming reservation, a later part that introduces/grows SH, and rotation.\n if (this._useMrtAtlas && !this._mrtAtlas) {\n return false;\n }\n // Compare against the count this update requires, not `_shMrtAtlasTextureCount` — that field is refreshed\n // only in _updateTextures (skipped on the incremental path), so a higher-degree addPart would pass the guard\n // on a stale count and never grow the SH atlas.\n if (this._useShMrtAtlas && (!this._shMrtAtlas || this._shMrtAtlas.length !== requiredShTextureCount)) {\n return false;\n }\n if (this._useRotMrtAtlas && !this._rotMrtAtlas) {\n return false;\n }\n // Can only do an incremental GPU update if texture height doesn't need to grow\n const newTextureSize = this._getTextureSize(vertexCount);\n return newTextureSize.y === this._textureSize.y;\n }\n\n /**\n * Posts updated positions to the sort worker and marks the sort as dirty.\n * Called after processing new splats so the worker can re-sort with the complete position set.\n * Subclasses (e.g. compound) may override to additionally post part-index data.\n */\n protected _notifyWorkerNewData(): void {\n if (this._worker) {\n const positions = Float32Array.from(this._splatPositions!);\n const vertexCount = this._vertexCount;\n this._worker.postMessage({ command: GaussianSplattingSortWorkerCommand.POSITIONS, positions, vertexCount }, [positions.buffer]);\n // The source splat count may have changed (e.g. addPart): re-sync the worker's active\n // interval set so it covers the current splats instead of a stale (smaller) range.\n this._postIntervalsToWorker();\n } else if (this._gpuMode) {\n this._markGpuSourceDirty();\n }\n this._sortIsDirty = true;\n }\n\n /**\n * Patches only a contiguous range of source-splat centers in the sort worker, instead of re-copying and\n * transferring the entire position buffer (which is hundreds of MB for large streamed datasets and caused\n * a multi-frame freeze on every LOD decode). The worker must already hold a full-size position buffer (from\n * the initial {@link GaussianSplattingSortWorkerCommand.POSITIONS} message at worker creation). Marks the\n * sort dirty so the new splats are sorted in; the caller is responsible for any interval/range refresh.\n * @param splatOffset first splat index of the updated range\n * @param splatCount number of splats in the updated range\n */\n protected _postWorkerPositionsRange(splatOffset: number, splatCount: number): void {\n if (this._gpuMode && splatCount > 0) {\n this._markGpuSourceDirty();\n this._sortIsDirty = true;\n return;\n }\n if (!this._worker || !this._splatPositions || splatCount <= 0) {\n return;\n }\n const floatOffset = splatOffset * 4;\n // Copy just the changed region (stride 4) so the main thread keeps its own _splatPositions intact.\n const data = this._splatPositions.slice(floatOffset, floatOffset + splatCount * 4);\n this._worker.postMessage({ command: GaussianSplattingSortWorkerCommand.POSITIONS_UPDATE, offset: floatOffset, data }, [data.buffer]);\n this._sortIsDirty = true;\n }\n\n /**\n * Decodes raw `.splat` bytes (32 bytes/splat) into a contiguous sub-range of the already-allocated atlas,\n * uploading only the affected texels (never touching neighboring parts' texels) and patching just that\n * range of positions in the sort worker. Used to populate a region reserved by\n * {@link GaussianSplattingMesh.reserveStreamingPart} — the CPU path a streaming engine uses when GPU\n * decode/readback is unavailable, and the seam that verifies reservation + interleaving before the\n * streaming engine exists.\n *\n * The atlas textures and `_splatPositions` must already be sized to cover `[globalOffset, globalOffset+count)`\n * (guaranteed after `reserveStreamingPart`). Bounds of the written centers are accumulated into `min`/`max`\n * when provided (so the caller can grow the owning part's bounding info).\n * @param globalOffset first atlas splat index to write\n * @param count number of splats to write\n * @param splatsData raw `.splat` bytes for `count` splats (stride 32)\n * @param min optional running min accumulator for the written centers\n * @param max optional running max accumulator for the written centers\n */\n protected _writeStreamingSplats(globalOffset: number, count: number, splatsData: ArrayBuffer | ArrayBufferView, min?: Vector3, max?: Vector3): void {\n if (!this._splatPositions) {\n return;\n }\n // Validate the range against the atlas and the input length (independent of GPU state): an out-of-range\n // offset/count would write over another part's texels or allocate a huge transient (the CPU arrays are\n // atlas-indexed up to `end`); a short input would read past its end.\n const capacity = this._splatPositions.length / 4;\n const uBuffer = GaussianSplattingMeshBase._GetSplatDataBytes(splatsData);\n if (!Number.isInteger(globalOffset) || !Number.isInteger(count) || globalOffset < 0 || count < 0 || globalOffset + count > capacity) {\n throw new Error(`_writeStreamingSplats: range [${globalOffset}, ${globalOffset + count}) is outside the atlas bounds [0, ${capacity})`);\n }\n if (uBuffer.length < count * 32) {\n throw new Error(`_writeStreamingSplats: splatsData has ${uBuffer.length} bytes, need ${count * 32} for ${count} splats (stride 32)`);\n }\n if (count === 0 || !this._covariancesATexture) {\n return;\n }\n const textureSize = this._getTextureSize(this._vertexCount);\n const width = textureSize.x;\n const covBSItemSize = this._useRGBACovariants ? 4 : 2;\n const end = globalOffset + count;\n\n const fBuffer = GaussianSplattingMeshBase._GetSplatDataFloats(splatsData);\n\n // Transients are sized to `count`, not `end` (globalOffset + count): sizing by atlas position would allocate\n // tens of MB for a small write near a large atlas's tail. dstIndex still addresses the atlas _splatPositions.\n const covA = new Uint16Array(count * 4);\n const covB = new Uint16Array(count * covBSItemSize);\n const colorArray = new Uint8Array(count * 4);\n const localMin = min ?? new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\n const localMax = max ?? new Vector3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);\n for (let i = 0; i < count; i++) {\n this._makeSplat(globalOffset + i, fBuffer, uBuffer, covA, covB, colorArray, localMin, localMax, this._flipY, i, i);\n }\n\n // Retain the written bytes so future full rebuilds / picking see the region's real data.\n if (this._splatsData) {\n const dst = new Uint8Array(GaussianSplattingMeshBase._GetSplatDataBytes(this._splatsData).buffer);\n dst.set(uBuffer.subarray(0, count * 32), globalOffset * 32);\n }\n\n // Upload only the written texels, one contiguous per-row run at a time (rectangular sub-uploads never\n // clobber texels outside [globalOffset, end), so neighboring parts on a shared boundary row are safe).\n const positions = this._splatPositions;\n let gi = globalOffset;\n while (gi < end) {\n const row = Math.floor(gi / width);\n const runEnd = Math.min(end, (row + 1) * width);\n const col = gi - row * width;\n const runLen = runEnd - gi;\n // covA/covB/colorArray are count-sized (0-based), so rebase by globalOffset; positions stays global.\n const li = gi - globalOffset;\n this._updateTextureFromDataRect(this._covariancesATexture!, new Uint16Array(covA.buffer, li * 4 * 2, runLen * 4), col, row, runLen, 1);\n this._updateTextureFromDataRect(this._covariancesBTexture!, new Uint16Array(covB.buffer, li * covBSItemSize * 2, runLen * covBSItemSize), col, row, runLen, 1);\n this._updateTextureFromDataRect(this._centersTexture!, new Float32Array(positions.buffer, gi * 4 * 4, runLen * 4), col, row, runLen, 1);\n this._updateTextureFromDataRect(this._colorsTexture!, new Uint8Array(colorArray.buffer, li * 4, runLen * 4), col, row, runLen, 1);\n gi = runEnd;\n }\n\n this._postWorkerPositionsRange(globalOffset, count);\n }\n\n private *_updateData(\n data: ArrayBuffer,\n isAsync: boolean,\n sh?: Uint8Array[],\n partIndices?: Uint8Array,\n { flipY = false, previousVertexCount = 0 }: IUpdateOptions = {},\n shDegree?: number\n ): Coroutine<void> {\n if (!this._covariancesATexture) {\n this._readyToDisplay = false;\n }\n this._flipY = flipY;\n this._splatDataRevision++;\n this._splatDataPending = true;\n this._gpuProgressiveCount = GaussianSplattingMeshBase.ProgressiveUpdateAmount ? 0 : null;\n\n const uBuffer = new Uint8Array(data);\n const fBuffer = new Float32Array(uBuffer.buffer);\n\n // Optionally store the raw splat buffer as an ArrayBuffer. This is the source reference\n // used by _addPartsInternal when a full texture rebuild is needed. Use uBuffer.buffer as\n // the canonical backing store — it is always a tightly packed ArrayBuffer containing\n // exactly the bytes we processed, avoiding issues with ArrayBufferView.byteOffset.\n if (this._keepInRam || this._alwaysRetainSplatsData) {\n this._splatsData = uBuffer.buffer;\n this._shData = sh ? sh.map((arr) => new Uint8Array(arr)) : null;\n } else {\n this._splatsData = null;\n this._shData = null;\n }\n\n const vertexCount = uBuffer.length / GaussianSplattingMeshBase._RowOutputLength;\n if (vertexCount != this._vertexCount) {\n // The source set changed: drop any active range filter so the buffers resize to the full\n // set. Callers (e.g. streaming LOD) re-apply their ranges after the data is committed.\n this._activeSplatRanges = null;\n this._activeSplatRangeKey = \"\";\n this._activeSplatRenderCount = 0;\n this._updateSplatIndexBuffer(vertexCount);\n }\n this._vertexCount = vertexCount;\n this._maxShDegree = sh ? (shDegree ?? 0) : 0;\n this._shDegree = this._maxShDegree;\n\n const textureSize = this._getTextureSize(vertexCount);\n const textureLength = textureSize.x * textureSize.y;\n const lineCountUpdate = GaussianSplattingMeshBase.ProgressiveUpdateAmount ?? textureSize.y;\n\n // Delegate part index storage to subclasses (e.g. GaussianSplattingMesh compound mode).\n if (partIndices) {\n this._onIndexDataReceived(partIndices, textureLength);\n }\n\n const minimum = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\n const maximum = new Vector3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);\n\n const covBSItemSize = this._useRGBACovariants ? 4 : 2;\n const covA = new Uint16Array(textureLength * 4);\n const covB = new Uint16Array(covBSItemSize * textureLength);\n const colorArray = new Uint8Array(textureLength * 4);\n\n // Incremental path: only upload the rows that contain new splats, leaving the already-committed\n // GPU region untouched. Falls through to the full-rebuild path when textures don't exist yet\n // or the texture height needs to grow.\n const incremental = this._canReuseCachedData(previousVertexCount, vertexCount, sh?.length ?? 0);\n\n if (!incremental) {\n this._splatSizeMin = Infinity;\n this._splatSizeMax = -Infinity;\n }\n\n // The first texture line/texel that must be (re-)processed and uploaded.\n // For a full rebuild this is 0. For an incremental update it is the row boundary just before\n // previousVertexCount so that any partial old row is re-processed as a complete row.\n const firstNewLine = incremental ? Math.floor(previousVertexCount / textureSize.x) : 0;\n const firstNewTexel = firstNewLine * textureSize.x;\n\n // Preserve old positions before replacing the array (incremental only)\n const oldPositions = this._splatPositions;\n this._splatPositions = new Float32Array(4 * textureLength);\n\n if (incremental) {\n this._splatPositions.set(oldPositions!.subarray(0, previousVertexCount * 4));\n minimum.copyFrom(this._cachedBoundingMin!);\n maximum.copyFrom(this._cachedBoundingMax!);\n // Let subclasses handle any incremental-specific setup (e.g. ensuring part-index textures)\n this._onIncrementalUpdateStart(textureSize);\n }\n\n if (GaussianSplattingMeshBase.ProgressiveUpdateAmount) {\n // Full rebuild: create GPU textures upfront with empty data; the loop fills them in batches via _updateSubTextures\n if (!incremental) {\n this._updateTextures(covA, covB, colorArray, sh);\n }\n this.setEnabled(true);\n\n const partCount = Math.ceil(textureSize.y / lineCountUpdate);\n for (let partIndex = 0; partIndex < partCount; partIndex++) {\n const updateLine = partIndex * lineCountUpdate;\n const batchEndLine = Math.min(updateLine + lineCountUpdate, textureSize.y);\n\n // Skip batches that lie entirely within the already-committed GPU region\n if (batchEndLine <= firstNewLine) {\n continue;\n }\n\n // Clip upload start to firstNewLine to avoid overwriting committed data with zeros\n const uploadStartLine = Math.max(updateLine, firstNewLine);\n const uploadStartTexel = uploadStartLine * textureSize.x;\n const batchEndTexel = batchEndLine * textureSize.x;\n\n for (let splatIdx = uploadStartTexel; splatIdx < batchEndTexel; splatIdx++) {\n if (splatIdx < vertexCount) {\n this._makeSplat(splatIdx, fBuffer, uBuffer, covA, covB, colorArray, minimum, maximum, flipY);\n } else {\n this._makeEmptySplat(splatIdx, covA, covB, colorArray);\n }\n }\n\n this._updateSubTextures(this._splatPositions, covA, covB, colorArray, uploadStartLine, batchEndLine - uploadStartLine, sh);\n this.getBoundingInfo().reConstruct(minimum, maximum, this.getWorldMatrix());\n if (this._gpuMode) {\n this._gpuProgressiveCount = Math.min(batchEndTexel, vertexCount);\n this._markGpuSourceDirty();\n // The batch loop already accumulated the bounds of the uploaded centers.\n (this._gpuBoundsMin ??= new Vector3()).copyFrom(minimum);\n (this._gpuBoundsMax ??= new Vector3()).copyFrom(maximum);\n this._gpuBoundsDirty = false;\n }\n if (isAsync) {\n yield;\n }\n }\n\n this._notifyWorkerNewData();\n } else {\n // Process splats from firstNewTexel: re-processes the partial old row (incremental) or processes everything from 0 (full rebuild)\n for (let i = firstNewTexel; i < vertexCount; i++) {\n this._makeSplat(i, fBuffer, uBuffer, covA, covB, colorArray, minimum, maximum, flipY);\n if (isAsync && i % GaussianSplattingMeshBase._SplatBatchSize === 0) {\n yield;\n }\n }\n\n // Incremental pads the full texture; full rebuild pads only to the next 16-splat boundary\n const paddedEnd = incremental ? textureLength : (vertexCount + 15) & ~0xf;\n for (let i = vertexCount; i < paddedEnd; i++) {\n this._makeEmptySplat(i, covA, covB, colorArray);\n }\n\n if (incremental) {\n // Partial upload: only rows from firstNewLine onwards; existing rows stay on GPU\n this._updateSubTextures(this._splatPositions, covA, covB, colorArray, firstNewLine, textureSize.y - firstNewLine, sh);\n this.getBoundingInfo().reConstruct(minimum, maximum, this.getWorldMatrix());\n this.setEnabled(true);\n this._notifyWorkerNewData();\n } else {\n // Full upload: create or replace all GPU textures\n this._updateTextures(covA, covB, colorArray, sh);\n this.getBoundingInfo().reConstruct(minimum, maximum, this.getWorldMatrix());\n this.setEnabled(true);\n this._sortIsDirty = true;\n }\n }\n\n // Cache bounding box for the next incremental addPart call\n this._cachedBoundingMin = minimum.clone();\n this._cachedBoundingMax = maximum.clone();\n\n this._splatDataPending = false;\n this._gpuProgressiveCount = null;\n this._postToWorker(true);\n }\n\n /**\n * Update asynchronously the buffer\n * @param data array buffer containing center, color, orientation and scale of splats\n * @param sh optional array of uint8 array for SH data\n * @param partIndices optional array of uint8 for rig node indices\n * @param shDegree optional SH degree of the data\n * @returns a promise\n */\n public async updateDataAsync(data: ArrayBuffer, sh?: Uint8Array[], partIndices?: Uint8Array, shDegree?: number): Promise<void> {\n return await runCoroutineAsync(this._updateData(data, true, sh, partIndices, undefined, shDegree), createYieldingScheduler());\n }\n\n /**\n * @experimental\n * Update data from GS (position, orientation, color, scaling)\n * @param data array that contain all the datas\n * @param sh optional array of uint8 array for SH data\n * @param options optional informations on how to treat data (needs to be 3rd for backward compatibility)\n * @param partIndices optional array of uint8 for rig node indices\n * @param shDegree optional SH degree of the data\n */\n public updateData(data: ArrayBuffer, sh?: Uint8Array[], options: IUpdateOptions = { flipY: true }, partIndices?: Uint8Array, shDegree?: number): void {\n runCoroutineSync(this._updateData(data, false, sh, partIndices, options, shDegree));\n }\n\n /**\n * Refreshes the bounding info, taking into account all the thin instances defined\n * @returns the current Gaussian Splatting\n */\n public override refreshBoundingInfo(): Mesh {\n this.thinInstanceRefreshBoundingInfo(false);\n return this;\n }\n\n // in case size is different\n protected _updateSplatIndexBuffer(vertexCount: number): void {\n const renderedSplatCount = this._activeSplatRanges ? this._activeSplatRenderCount : vertexCount;\n const paddedVertexCount = Math.max((renderedSplatCount + 15) & ~0xf, 16);\n\n const gpuEligible = this._isGpuSortEligible(vertexCount);\n if (!this._gpuMode && gpuEligible) {\n this._enterGpuMode();\n } else if (this._gpuMode && !gpuEligible) {\n this._exitGpuMode();\n }\n if (this._gpuMode) {\n // The sort output holds the indices: no CPU index buffer is needed.\n this._gpuPaddedCount = paddedVertexCount;\n this.forcedInstanceCount = Math.max(paddedVertexCount >> 4, 1);\n return;\n }\n\n const previousIndex = this._splatIndex;\n\n if (!previousIndex || paddedVertexCount !== previousIndex.length) {\n this._splatIndex = new Float32Array(paddedVertexCount);\n\n // update meshes for knowns cameras\n this._cameraViewInfos.forEach((cameraViewInfos) => {\n cameraViewInfos.mesh.thinInstanceSetBuffer(\"splatIndex\", this._splatIndex, 16, false);\n });\n }\n\n const splatIndex = this._splatIndex!;\n\n // Populate the buffer with the current active source indices (identity when unfiltered) so every\n // rendered slot points at a valid splat. This is the synchronous (no async sort worker) path; the\n // worker path instead defers the index-buffer swap until a matching sort lands (see _onWorkerCreated).\n if (this._activeSplatRanges) {\n let index = 0;\n for (let rangeIndex = 0; rangeIndex < this._activeSplatRanges.length; rangeIndex += 2) {\n const start = this._activeSplatRanges[rangeIndex];\n const count = this._activeSplatRanges[rangeIndex + 1];\n for (let sourceIndex = start; sourceIndex < start + count; sourceIndex++) {\n splatIndex[index++] = sourceIndex;\n }\n }\n // Pad with `vertexCount` itself, not 0: splat 0 is real data, not a reserved empty slot, and\n // range filtering can leave it fully visible — see gaussianSplattingSortWorker.ts.\n for (; index < paddedVertexCount; index++) {\n splatIndex[index] = vertexCount;\n }\n } else {\n for (let i = 0; i < paddedVertexCount; i++) {\n splatIndex[i] = i;\n }\n }\n\n // Update depthMix\n if ((!this._depthMix || paddedVertexCount !== this._depthMix.length) && !IsNative) {\n this._depthMix = new BigInt64Array(paddedVertexCount);\n }\n\n this.forcedInstanceCount = Math.max(paddedVertexCount >> 4, 1);\n }\n\n protected _updateTextureFromData = (texture: BaseTexture, data: ArrayBufferView, width: number, lineStart: number, lineCount: number) => {\n const engine = this._getTextureDataUpdateEngine();\n const internalTexture = texture.getInternalTexture()!;\n // NativeEngine and NullEngine support complete raw uploads, but not sub-texture uploads.\n if (!engine._gl && !engine.isWebGPU && lineStart === 0 && lineCount === internalTexture.height) {\n engine.updateRawTexture(internalTexture, data, internalTexture.format, internalTexture.invertY, null, internalTexture.type, internalTexture._useSRGBBuffer);\n return;\n }\n engine.updateTextureData(internalTexture, data, 0, lineStart, width, lineCount, 0, 0, false);\n };\n\n protected _updateTextureFromDataRect = (texture: BaseTexture, data: ArrayBufferView, xOffset: number, yOffset: number, width: number, height: number) => {\n const engine = this._getTextureDataUpdateEngine();\n engine.updateTextureData(texture.getInternalTexture()!, data, xOffset, yOffset, width, height, 0, 0, false);\n };\n\n protected _getTextureDataUpdateEngine(): ITextureDataUpdateCapableEngine {\n return this.getEngine() as unknown as ITextureDataUpdateCapableEngine;\n }\n\n protected _updateShTextureData(texture: BaseTexture, shData: Uint8Array, textureWidth: number, lineStart: number, lineCount: number): void {\n const engine = this._getTextureDataUpdateEngine();\n\n // NativeEngine/NullEngine, updateTextureData unsupported\n if (!engine._gl && !engine.isWebGPU) {\n const internalTexture = texture.getInternalTexture()!;\n const expectedByteLength = textureWidth * internalTexture.height * 16;\n let uploadData: Uint32Array;\n if (shData.byteLength === expectedByteLength && shData.byteOffset % Uint32Array.BYTES_PER_ELEMENT === 0) {\n uploadData = new Uint32Array(shData.buffer, shData.byteOffset, shData.byteLength / Uint32Array.BYTES_PER_ELEMENT);\n } else {\n const padded = new Uint8Array(expectedByteLength);\n padded.set(shData.subarray(0, Math.min(shData.byteLength, expectedByteLength)));\n uploadData = new Uint32Array(padded.buffer);\n }\n engine.updateRawTexture(internalTexture, uploadData, internalTexture.format, internalTexture.invertY, null, internalTexture.type, internalTexture._useSRGBBuffer);\n return;\n }\n\n const bytesPerTexel = 16;\n const componentsPerTexel = 4;\n const startTexel = lineStart * textureWidth;\n const availableTexelCount = Math.floor(shData.byteLength / bytesPerTexel);\n\n if (startTexel >= availableTexelCount) {\n return;\n }\n\n let texelCount = Math.min(lineCount * textureWidth, availableTexelCount - startTexel);\n if (texelCount <= 0) {\n return;\n }\n\n const createView = (byteOffset: number, viewTexelCount: number) => {\n return new Uint32Array(shData.buffer, shData.byteOffset + byteOffset, viewTexelCount * componentsPerTexel);\n };\n\n const fullRowCount = Math.floor(texelCount / textureWidth);\n if (fullRowCount > 0) {\n const fullRowTexelCount = fullRowCount * textureWidth;\n this._updateTextureFromData(texture, createView(startTexel * bytesPerTexel, fullRowTexelCount), textureWidth, lineStart, fullRowCount);\n texelCount -= fullRowTexelCount;\n }\n\n if (texelCount > 0) {\n const partialRowOffset = (startTexel + fullRowCount * textureWidth) * bytesPerTexel;\n this._updateTextureFromDataRect(texture, createView(partialRowOffset, texelCount), 0, lineStart + fullRowCount, texelCount, 1);\n }\n }\n\n protected _updateSubTextures(centers: Float32Array, covA: Uint16Array, covB: Uint16Array, colors: Uint8Array, lineStart: number, lineCount: number, sh?: Uint8Array[]): void {\n const textureSize = this._getTextureSize(this._vertexCount);\n const covBSItemSize = this._useRGBACovariants ? 4 : 2;\n const texelStart = lineStart * textureSize.x;\n const texelCount = lineCount * textureSize.x;\n const covAView = new Uint16Array(covA.buffer, texelStart * 4 * Uint16Array.BYTES_PER_ELEMENT, texelCount * 4);\n const covBView = new Uint16Array(covB.buffer, texelStart * covBSItemSize * Uint16Array.BYTES_PER_ELEMENT, texelCount * covBSItemSize);\n const colorsView = new Uint8Array(colors.buffer, texelStart * 4, texelCount * 4);\n const centersView = new Float32Array(centers.buffer, texelStart * 4 * Float32Array.BYTES_PER_ELEMENT, texelCount * 4);\n this._updateTextureFromData(this._covariancesATexture!, covAView, textureSize.x, lineStart, lineCount);\n this._updateTextureFromData(this._covariancesBTexture!, covBView, textureSize.x, lineStart, lineCount);\n this._updateTextureFromData(this._centersTexture!, centersView, textureSize.x, lineStart, lineCount);\n this._updateTextureFromData(this._colorsTexture!, colorsView, textureSize.x, lineStart, lineCount);\n if (this._rotationsATexture && this._rotationDataA) {\n const rotAView = new Uint16Array(this._rotationDataA.buffer, texelStart * 4 * Uint16Array.BYTES_PER_ELEMENT, texelCount * 4);\n const rotBView = new Uint16Array(this._rotationDataB!.buffer, texelStart * 4 * Uint16Array.BYTES_PER_ELEMENT, texelCount * 4);\n const rotScaleView = new Uint16Array(this._rotationScaleData!.buffer, texelStart * 4 * Uint16Array.BYTES_PER_ELEMENT, texelCount * 4);\n this._updateTextureFromData(this._rotationsATexture, rotAView, textureSize.x, lineStart, lineCount);\n this._updateTextureFromData(this._rotationsBTexture!, rotBView, textureSize.x, lineStart, lineCount);\n this._updateTextureFromData(this._rotationScaleTexture!, rotScaleView, textureSize.x, lineStart, lineCount);\n }\n if (sh) {\n for (let i = 0; i < sh.length; i++) {\n this._updateShTextureData(this._shTextures![i], sh[i], textureSize.x, lineStart, lineCount);\n }\n }\n }\n\n protected _instantiateWorker(): void {\n if (!this._vertexCount) {\n return;\n }\n // The identity index buffer must exist even when no sort worker is needed: every render path\n // (including the Native one) reads it, and a null buffer breaks the Native bindings.\n this._updateSplatIndexBuffer(this._vertexCount);\n if (this._gpuMode) {\n // The sort runs on the GPU: no worker. The sorter picks up the (new) source before its next sort.\n this._markGpuSourceDirty();\n this._sortIsDirty = true;\n this._canPostToWorker = true;\n return;\n }\n this._workerPending = false;\n if (this._disableDepthSort) {\n return;\n }\n\n // no worker in native\n if (IsNative) {\n return;\n }\n\n // Start the worker thread\n this._worker?.terminate();\n // Reset the posting gate so the new worker can immediately receive sort requests.\n // If the previous worker was terminated mid-sort it would never have set _canPostToWorker\n // back to true, leaving the sort permanently frozen on the new worker.\n this._canPostToWorker = true;\n this._worker = new Worker(\n URL.createObjectURL(\n new Blob([\"(\", GaussianSplattingSortWorker.toString(), \")(self)\"], {\n type: \"application/javascript\",\n })\n )\n );\n\n const positions = Float32Array.from(this._splatPositions!);\n const vertexCount = this._vertexCount;\n\n this._worker.postMessage({ command: GaussianSplattingSortWorkerCommand.POSITIONS, positions, vertexCount }, [positions.buffer]);\n // The main thread owns the active interval set: send it explicitly (covering all indices when\n // no LOD filter is active) rather than letting the worker assume the full source set.\n this._postIntervalsToWorker();\n this._onWorkerCreated(this._worker!);\n\n this._worker.onerror = () => {\n // If the worker throws an unhandled error, unlock the posting gate so the next frame can retry the sort.\n this._canPostToWorker = true;\n };\n\n this._worker.onmessage = (e) => {\n // Size the result against the active (rendered) splat count, which may be a subset of the\n // full source set when an interval/LOD filter is active.\n const renderedPadded = Math.max((this.renderedSplatCount + 15) & ~0xf, 16);\n\n // Discard the result and trigger a fresh sort if it no longer matches the current active set:\n // either the active count changed since it was posted, or it was computed for a stale range\n // version (the active ranges changed while it was in flight). Applying it would render indices\n // that belong to a different active set.\n if (e.data.depthMix.length != renderedPadded || e.data.rangeVersion !== this._activeRangeVersion) {\n // Only re-enable posting and trigger a re-sort if the buffer is available.\n // If byteLength === 0 the buffer is already in-flight for a newer sort;\n // that sort's onmessage will handle things when it returns.\n if (this._depthMix.buffer.byteLength > 0) {\n this._canPostToWorker = true;\n this._postToWorker(true);\n this._sortIsDirty = false;\n }\n return;\n }\n\n this._depthMix = e.data.depthMix;\n const cameraId = e.data.cameraId;\n const sortRequestId = e.data.sortRequestId;\n\n // The index buffer swap is deferred to here so the previous fully-sorted state stays on screen\n // until this matching sort lands. Resize it now (the active count may have grown/shrunk since the\n // last applied sort) and rebind it for every known camera.\n if (!this._splatIndex || this._splatIndex.length !== renderedPadded) {\n this._splatIndex = new Float32Array(renderedPadded);\n this._cameraViewInfos.forEach((info) => {\n info.mesh.thinInstanceSetBuffer(\"splatIndex\", this._splatIndex, 16, false);\n info.splatIndexBufferSet = true;\n });\n }\n\n const indexMix = new Uint32Array(e.data.depthMix.buffer);\n if (this._splatIndex) {\n for (let j = 0; j < renderedPadded; j++) {\n this._splatIndex[j] = indexMix[2 * j];\n }\n }\n this.forcedInstanceCount = Math.max(renderedPadded >> 4, 1);\n this._commitDelayedTextureUpdate();\n\n // get mesh for camera and update its instance buffer\n const cameraViewInfos = this._cameraViewInfos.get(cameraId);\n if (cameraViewInfos) {\n if (cameraViewInfos.splatIndexBufferSet) {\n cameraViewInfos.mesh.thinInstanceBufferUpdated(\"splatIndex\");\n } else {\n cameraViewInfos.mesh.thinInstanceSetBuffer(\"splatIndex\", this._splatIndex, 16, false);\n cameraViewInfos.splatIndexBufferSet = true;\n }\n cameraViewInfos.sortAppliedId = sortRequestId;\n }\n this._canPostToWorker = true;\n this._readyToDisplay = true;\n // sort is dirty when GS is visible for progressive update with a this message arriving but positions were partially filled\n // another update needs to be kicked. The kick can't happen just when the position buffer is ready because _canPostToWorker might be false.\n if (this._sortIsDirty) {\n this._postToWorker(true);\n this._sortIsDirty = false;\n }\n };\n }\n\n protected _getTextureSize(length: number): Vector2 {\n const engine = this._scene.getEngine();\n const width = engine.getCaps().maxTextureSize;\n\n let height = 1;\n\n if (engine.version === 1 && !engine.isWebGPU) {\n while (width * height < length) {\n height *= 2;\n }\n // See the WebGL2/WebGPU branch below for why this guarantees an extra row when `length`\n // exactly fills every row. A power-of-2 height has to double to add any slack at all.\n // Usually this is a no-op since it is rare that the asset exactly contains a power-of-2\n // number of splats.\n if (length > 0 && width * height === length) {\n height *= 2;\n }\n } else {\n height = Math.ceil(length / width);\n // When `length` exactly fills every row, force one extra (fully zeroed) row so the atlas\n // always has at least one genuinely-empty splat slot past the real data, at index `length`.\n // The sort worker (gaussianSplattingSortWorker.ts) relies on that slot always existing to\n // safely pad the 16-aligned draw order — without it, the only \"spare\" index would be the\n // last real splat, which range-filtering (setSplatIndexRanges/opacity/size culling) can\n // leave fully visible and opaque, reproducing the same \"stuck in front\" bug on that splat.\n if (length > 0 && height * width === length) {\n height += 1;\n }\n }\n\n if (height > width) {\n Logger.Error(\"GaussianSplatting texture size: (\" + width + \", \" + height + \"), maxTextureSize: \" + width);\n height = width;\n }\n\n return new Vector2(width, height);\n }\n\n /**\n * Called after the sort worker has been created and the initial positions message has been sent.\n * Override in subclasses to post any additional setup messages the worker needs (e.g. group\n * indices, per-part matrices, etc.).\n * @param _worker the newly created worker\n */\n protected _onWorkerCreated(_worker: Worker): void {}\n\n /**\n * Called by the material to bind any extra shader uniforms that are specific to this mesh type.\n * The base implementation is a no-op; override in subclasses to bind additional data.\n * @param _effect the shader effect that is being bound\n * @internal\n */\n public bindExtraEffectUniforms(_effect: Effect): void {}\n\n /**\n * Processes all splats from a source GaussianSplattingMesh directly into the destination\n * texture arrays starting at dstOffset. This is the core of the texture-direct compound API:\n * no merged CPU buffer is ever created; each source mesh is written straight into its region.\n *\n * @param source - The source mesh whose splats are appended\n * @param dstOffset - The destination splat index at which writing starts\n * @param covA - Destination covA array (full texture size)\n * @param covB - Destination covB array (full texture size)\n * @param colorArray - Destination color array (full texture size)\n * @param sh - Destination SH arrays (full texture size), or undefined\n * @param minimum - Accumulated bounding min (updated in-place)\n * @param maximum - Accumulated bounding max (updated in-place)\n * @internal Use GaussianSplattingMesh.addPart instead\n */\n protected _appendSourceToArrays(\n source: GaussianSplattingMeshBase,\n dstOffset: number,\n covA: Uint16Array,\n covB: Uint16Array,\n colorArray: Uint8Array,\n sh: Uint8Array[] | undefined,\n minimum: Vector3,\n maximum: Vector3\n ): void {\n const srcCount = source._vertexCount;\n const bytesPerTexel = 16;\n const srcRaw = source._splatsData;\n if (!srcRaw || srcCount === 0) {\n return;\n }\n const uBuffer = GaussianSplattingMeshBase._GetSplatDataBytes(srcRaw);\n const fBuffer = GaussianSplattingMeshBase._GetSplatDataFloats(srcRaw);\n\n for (let i = 0; i < srcCount; i++) {\n this._makeSplat(dstOffset + i, fBuffer, uBuffer, covA, covB, colorArray, minimum, maximum, false, i);\n }\n\n // Copy SH data if both source and destination have it\n if (sh && source._shData) {\n for (let texIdx = 0; texIdx < sh.length; texIdx++) {\n if (texIdx < source._shData.length) {\n sh[texIdx].set(source._shData[texIdx].subarray(0, srcCount * bytesPerTexel), dstOffset * bytesPerTexel);\n }\n }\n }\n }\n\n /**\n * Modifies the splats according to the passed transformation matrix.\n * @param transform defines the transform matrix to use\n * @returns the current mesh\n */\n public override bakeTransformIntoVertices(transform: DeepImmutable<Matrix>): Mesh {\n const arrayBuffer = this.splatsData;\n if (!arrayBuffer) {\n Logger.Error(\"Cannot bake transform into vertices if splatsData is not kept in RAM\");\n return this;\n }\n\n // Check for uniform scaling\n const m = transform.m;\n const scaleX = Math.sqrt(m[0] * m[0] + m[1] * m[1] + m[2] * m[2]);\n const scaleY = Math.sqrt(m[4] * m[4] + m[5] * m[5] + m[6] * m[6]);\n const scaleZ = Math.sqrt(m[8] * m[8] + m[9] * m[9] + m[10] * m[10]);\n const epsilon = 0.001;\n if (Math.abs(scaleX - scaleY) > epsilon || Math.abs(scaleX - scaleZ) > epsilon) {\n Logger.Error(\"Gaussian Splatting bakeTransformIntoVertices does not support non-uniform scaling\");\n return this;\n }\n\n const uBuffer = new Uint8Array(arrayBuffer);\n const fBuffer = new Float32Array(arrayBuffer);\n\n const temp = TmpVectors.Vector3[0];\n let index: number;\n const quaternion = TmpVectors.Quaternion[0];\n const transformedQuaternion = TmpVectors.Quaternion[1];\n transform.decompose(temp, transformedQuaternion, temp);\n for (index = 0; index < this._vertexCount; index++) {\n const floatIndex = index * 8; // 8 floats per splat (center.x, center.y, center.z, scale.x, scale.y, scale.z, ...)\n Vector3.TransformCoordinatesFromFloatsToRef(fBuffer[floatIndex], fBuffer[floatIndex + 1], fBuffer[floatIndex + 2], transform, temp);\n fBuffer[floatIndex] = temp.x;\n fBuffer[floatIndex + 1] = temp.y;\n fBuffer[floatIndex + 2] = temp.z;\n\n // Apply uniform scaling to splat scales\n fBuffer[floatIndex + 3] *= scaleX;\n fBuffer[floatIndex + 4] *= scaleX;\n fBuffer[floatIndex + 5] *= scaleX;\n\n // Unpack quaternion from uint8array (matching _GetSplat packing convention)\n quaternion.set(\n (uBuffer[32 * index + 28 + 1] - 127.5) / 127.5,\n (uBuffer[32 * index + 28 + 2] - 127.5) / 127.5,\n (uBuffer[32 * index + 28 + 3] - 127.5) / 127.5,\n (uBuffer[32 * index + 28 + 0] - 127.5) / 127.5\n );\n quaternion.normalize();\n\n // If there is a negative scaling, we need to flip the quaternion to keep the correct handedness\n if (this.scaling.x < 0) {\n quaternion.x = -quaternion.x;\n quaternion.w = -quaternion.w;\n }\n if (this.scaling.y < 0) {\n quaternion.y = -quaternion.y;\n quaternion.w = -quaternion.w;\n }\n if (this.scaling.z < 0) {\n quaternion.z = -quaternion.z;\n quaternion.w = -quaternion.w;\n }\n\n // Transform the quaternion\n transformedQuaternion.multiplyToRef(quaternion, quaternion);\n quaternion.normalize();\n\n // Pack quaternion back to uint8array (matching _GetSplat packing convention)\n uBuffer[32 * index + 28 + 0] = Math.round(quaternion.w * 127.5 + 127.5);\n uBuffer[32 * index + 28 + 1] = Math.round(quaternion.x * 127.5 + 127.5);\n uBuffer[32 * index + 28 + 2] = Math.round(quaternion.y * 127.5 + 127.5);\n uBuffer[32 * index + 28 + 3] = Math.round(quaternion.z * 127.5 + 127.5);\n }\n\n this.updateData(arrayBuffer, this.shData ?? undefined, { flipY: false });\n\n return this;\n }\n}\n\n/**\n * Allocates SH texture buffers pre-filled with 128 (the neutral encoding of ~0.0 in the\n * shader's decompose() function). Padding bytes beyond the actual coefficients in the last\n * texture are read as higher-order SH bands when the mesh is added to a compound with a\n * higher degree; zero would decode to -1.0 instead, producing wrong colors.\n * @param textureCount number of SH textures to allocate\n * @param bytesEach byte size of each texture buffer\n * @returns array of initialized Uint8Array buffers\n */\nexport function AllocateShBuffers(textureCount: number, bytesEach: number): Uint8Array[] {\n const result: Uint8Array[] = [];\n for (let i = 0; i < textureCount; i++) {\n const arr = new Uint8Array(bytesEach);\n arr.fill(128);\n result.push(arr);\n }\n return result;\n}\n"]}
|