@onerjs/core 9.0.1 → 9.0.3
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/Animations/animationGroup.pure.js.map +1 -1
- 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/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/texture.pure.js +7 -1
- package/Materials/Textures/texture.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":"meshoptCompression.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Compression/meshoptCompression.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"meshoptCompression.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Compression/meshoptCompression.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAS9C,IAAI,eAAe,GAAG,CAAC,CAAC;AACxB,IAAI,aAAa,GAA4C,IAAI,CAAC;AAiBlE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO,kBAAkB;IAoB3B;;OAEG;IACI,MAAM,KAAK,OAAO;QACrB,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE,CAAC;YAC/B,kBAAkB,CAAC,QAAQ,GAAG,IAAI,kBAAkB,EAAE,CAAC;QAC3D,CAAC;QAED,OAAO,kBAAkB,CAAC,QAAQ,CAAC;IACvC,CAAC;IAED;;OAEG;IACH;QAhCiB,sBAAiB,GAAY,OAAO,OAAO,KAAK,WAAW,IAAI,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;QAiCpG,sEAAsE;QACtE,oEAAoE;QACpE,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACzB,OAAO;QACX,CAAC;QAED,MAAM,OAAO,GAAG,kBAAkB,CAAC,aAAa,CAAC,OAAO,CAAC;QAEzD,0CAA0C;QAC1C,IAAI,CAAC,qBAAqB,GAAG,KAAK,CAAC,sBAAsB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;YAC7E,4DAA4D;YAC5D,OAAO,cAAc,CAAC,KAAK,CAAC;QAChC,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACI,OAAO;QACV,OAAO,IAAI,CAAC,qBAAqB,CAAC;IACtC,CAAC;IAED;;;;;;;;;OASG;IACI,KAAK,CAAC,qBAAqB,CAAC,MAAkB,EAAE,KAAa,EAAE,MAAc,EAAE,IAA4C,EAAE,MAAe;QAC/I,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACzB,OAAO,OAAO,CAAC,aAAc,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QACvE,CAAC;QACD,MAAM,IAAI,CAAC,qBAAsB,CAAC;QAClC,IAAI,eAAe,KAAK,CAAC,EAAE,CAAC;YACxB,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAC7B,eAAe,GAAG,CAAC,CAAC;QACxB,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QAC/F,oGAAoG;QACpG,IAAI,aAAa,KAAK,IAAI,EAAE,CAAC;YACzB,YAAY,CAAC,aAAa,CAAC,CAAC;QAChC,CAAC;QACD,aAAa,GAAG,UAAU,CAAC,GAAG,EAAE;YAC5B,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAC7B,eAAe,GAAG,CAAC,CAAC;YACpB,aAAa,GAAG,IAAI,CAAC;QACzB,CAAC,EAAE,IAAI,CAAC,CAAC;QACT,OAAO,MAAM,CAAC;IAClB,CAAC;;AAnFD;;;;;;;GAOG;AACW,gCAAa,GAAqC;IAC5D,OAAO,EAAE;QACL,GAAG,EAAE,GAAG,KAAK,CAAC,cAAc,qBAAqB;KACpD;CACJ,AAJ0B,CAIzB;AAEa,2BAAQ,GAAiC,IAAI,AAArC,CAAsC","sourcesContent":["import { Tools } from \"../../Misc/tools.pure\";\r\nimport { type IDisposable } from \"../../scene\";\r\nimport { type Nullable } from \"../../types\";\r\nimport { type INative } from \"../../Engines/Native/nativeInterfaces\";\r\n\r\ndeclare let MeshoptDecoder: any;\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\ndeclare const _native: INative;\r\n\r\nlet NumberOfWorkers = 0;\r\nlet WorkerTimeout: Nullable<ReturnType<typeof setTimeout>> = null;\r\n\r\n/**\r\n * Configuration for meshoptimizer compression\r\n */\r\nexport interface IMeshoptCompressionConfiguration {\r\n /**\r\n * Configuration for the decoder.\r\n */\r\n decoder: {\r\n /**\r\n * The url to the meshopt decoder library.\r\n */\r\n url: string;\r\n };\r\n}\r\n\r\n/**\r\n * Meshopt compression (https://github.com/zeux/meshoptimizer)\r\n *\r\n * This class wraps the meshopt library from https://github.com/zeux/meshoptimizer/tree/master/js.\r\n *\r\n * **Encoder**\r\n *\r\n * The encoder is not currently implemented.\r\n *\r\n * **Decoder**\r\n *\r\n * By default, the configuration points to a copy of the meshopt files on the Babylon.js preview CDN (e.g. https://preview.babylonjs.com/meshopt_decoder.js).\r\n *\r\n * To update the configuration, use the following code:\r\n * ```javascript\r\n * MeshoptCompression.Configuration = {\r\n * decoder: {\r\n * url: \"<url to the meshopt decoder library>\"\r\n * }\r\n * };\r\n * ```\r\n */\r\nexport class MeshoptCompression implements IDisposable {\r\n private _decoderModulePromise?: Promise<any>;\r\n private readonly _useNativeDecoder: boolean = typeof _native !== \"undefined\" && !!_native.decodeMeshopt;\r\n\r\n /**\r\n * The configuration. Defaults to the following:\r\n * ```javascript\r\n * decoder: {\r\n * url: \"https://cdn.babylonjs.com/meshopt_decoder.js\"\r\n * }\r\n * ```\r\n */\r\n public static Configuration: IMeshoptCompressionConfiguration = {\r\n decoder: {\r\n url: `${Tools._DefaultCdnUrl}/meshopt_decoder.js`,\r\n },\r\n };\r\n\r\n private static _Default: Nullable<MeshoptCompression> = null;\r\n\r\n /**\r\n * Default instance for the meshoptimizer object.\r\n */\r\n public static get Default(): MeshoptCompression {\r\n if (!MeshoptCompression._Default) {\r\n MeshoptCompression._Default = new MeshoptCompression();\r\n }\r\n\r\n return MeshoptCompression._Default;\r\n }\r\n\r\n /**\r\n * Constructor\r\n */\r\n constructor() {\r\n // When the native meshopt decoder is available (Babylon Native), skip\r\n // loading the WebAssembly module entirely and decode synchronously.\r\n if (this._useNativeDecoder) {\r\n return;\r\n }\r\n\r\n const decoder = MeshoptCompression.Configuration.decoder;\r\n\r\n // eslint-disable-next-line github/no-then\r\n this._decoderModulePromise = Tools.LoadBabylonScriptAsync(decoder.url).then(() => {\r\n // Wait for WebAssembly compilation before resolving promise\r\n return MeshoptDecoder.ready;\r\n });\r\n }\r\n\r\n /**\r\n * Stop all async operations and release resources.\r\n */\r\n public dispose(): void {\r\n delete this._decoderModulePromise;\r\n }\r\n\r\n /**\r\n * Decode meshopt data.\r\n * @see https://github.com/zeux/meshoptimizer/tree/master/js#decoder\r\n * @param source The input data.\r\n * @param count The number of elements.\r\n * @param stride The stride in bytes.\r\n * @param mode The compression mode.\r\n * @param filter The compression filter.\r\n * @returns a Promise<Uint8Array> that resolves to the decoded data\r\n */\r\n public async decodeGltfBufferAsync(source: Uint8Array, count: number, stride: number, mode: \"ATTRIBUTES\" | \"TRIANGLES\" | \"INDICES\", filter?: string): Promise<Uint8Array> {\r\n if (this._useNativeDecoder) {\r\n return _native.decodeMeshopt!(source, count, stride, mode, filter);\r\n }\r\n await this._decoderModulePromise!;\r\n if (NumberOfWorkers === 0) {\r\n MeshoptDecoder.useWorkers(1);\r\n NumberOfWorkers = 1;\r\n }\r\n const result = await MeshoptDecoder.decodeGltfBufferAsync(count, stride, source, mode, filter);\r\n // a simple debounce to avoid switching back and forth between workers and no workers while decoding\r\n if (WorkerTimeout !== null) {\r\n clearTimeout(WorkerTimeout);\r\n }\r\n WorkerTimeout = setTimeout(() => {\r\n MeshoptDecoder.useWorkers(0);\r\n NumberOfWorkers = 0;\r\n WorkerTimeout = null;\r\n }, 1000);\r\n return result;\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
import { type Nullable } from "../../types.js";
|
|
2
|
+
import { type AbstractEngine } from "../../Engines/abstractEngine.pure.js";
|
|
3
|
+
import { type WebGPUEngine } from "../../Engines/webgpuEngine.pure.js";
|
|
4
|
+
import { type Matrix } from "../../Maths/math.vector.pure.js";
|
|
5
|
+
import { type BaseTexture } from "../../Materials/Textures/baseTexture.pure.js";
|
|
6
|
+
import { ComputeShader } from "../../Compute/computeShader.pure.js";
|
|
7
|
+
import { StorageBuffer } from "../../Buffers/storageBuffer.js";
|
|
8
|
+
import { type VertexBuffer } from "../../Buffers/buffer.pure.js";
|
|
9
|
+
/**
|
|
10
|
+
* Anything exposing a Babylon.js column-major 4x4 matrix array (a Matrix, for instance).
|
|
11
|
+
*/
|
|
12
|
+
export type GaussianSplattingGpuSortMatrix = Pick<Matrix, "m">;
|
|
13
|
+
/**
|
|
14
|
+
* Inputs describing the splat data the GPU sorter reads. The sorter only reads textures: it never owns them.
|
|
15
|
+
*/
|
|
16
|
+
export interface IGaussianSplattingGpuSortSource {
|
|
17
|
+
/**
|
|
18
|
+
* Number of splats in the mesh (the value used as the "empty splat" index padding the sorted output).
|
|
19
|
+
*/
|
|
20
|
+
vertexCount: number;
|
|
21
|
+
/**
|
|
22
|
+
* Width in texels of the data textures (splat index i lives at texel (i % width, floor(i / width))).
|
|
23
|
+
*/
|
|
24
|
+
textureWidth: number;
|
|
25
|
+
/**
|
|
26
|
+
* RGBA32F texture whose xyz hold the splat centers. For SOG data, the RGBA8 "means low" texture.
|
|
27
|
+
*/
|
|
28
|
+
centersTexture: BaseTexture;
|
|
29
|
+
/**
|
|
30
|
+
* SOG (quantized means) inputs. When set, centers are decoded like the Gaussian Splatting vertex shader does.
|
|
31
|
+
*/
|
|
32
|
+
sog?: {
|
|
33
|
+
/**
|
|
34
|
+
* RGBA8 "means high" texture.
|
|
35
|
+
*/
|
|
36
|
+
meansHighTexture: BaseTexture;
|
|
37
|
+
/**
|
|
38
|
+
* Quantization range minimum (xyz) of the log-encoded means.
|
|
39
|
+
*/
|
|
40
|
+
meansMin: ArrayLike<number>;
|
|
41
|
+
/**
|
|
42
|
+
* Quantization range maximum (xyz) of the log-encoded means.
|
|
43
|
+
*/
|
|
44
|
+
meansMax: ArrayLike<number>;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Compound meshes: R8 texture (same layout as the centers) holding each splat's part index. Used together with {@link GaussianSplattingGpuSorter.setPartMatrices}.
|
|
48
|
+
*/
|
|
49
|
+
partIndicesTexture?: BaseTexture;
|
|
50
|
+
/**
|
|
51
|
+
* Optional local-space bounding box minimum of the splat centers, used to derive the depth range when none is given to {@link GaussianSplattingGpuSorter.sort}.
|
|
52
|
+
* Not needed for SOG data (derived from the means range).
|
|
53
|
+
*/
|
|
54
|
+
boundsMin?: ArrayLike<number>;
|
|
55
|
+
/**
|
|
56
|
+
* Optional local-space bounding box maximum of the splat centers.
|
|
57
|
+
*/
|
|
58
|
+
boundsMax?: ArrayLike<number>;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Options of {@link GaussianSplattingGpuSorter.sort}.
|
|
62
|
+
*/
|
|
63
|
+
export interface IGaussianSplattingGpuSortOptions {
|
|
64
|
+
/**
|
|
65
|
+
* Whether the scene is right-handed. Matches the CPU sort worker: the depth is negated so larger always means farther.
|
|
66
|
+
*/
|
|
67
|
+
rightHanded?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* World position of the camera. When omitted, the translation of the view matrix is used, which is equivalent.
|
|
70
|
+
*/
|
|
71
|
+
cameraPosition?: ArrayLike<number>;
|
|
72
|
+
/**
|
|
73
|
+
* Depth interval covering every active splat, in the sign-adjusted depth space (larger = farther). The 2^keyBits sort keys span this interval,
|
|
74
|
+
* so a tight interval improves the precision. When omitted, it is derived from the source bounds.
|
|
75
|
+
*/
|
|
76
|
+
depthRange?: {
|
|
77
|
+
min: number;
|
|
78
|
+
max: number;
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Number of keys bits clamped to the supported range.
|
|
83
|
+
* @param keyBits requested number of sort key bits
|
|
84
|
+
* @returns the clamped, integral number of key bits
|
|
85
|
+
* @internal
|
|
86
|
+
*/
|
|
87
|
+
export declare function _ClampGpuSortKeyBits(keyBits: number): number;
|
|
88
|
+
/**
|
|
89
|
+
* Number of radix passes needed to sort keys of a given size.
|
|
90
|
+
* @param keyBits number of bits of the sort keys
|
|
91
|
+
* @returns the number of 4-bit radix passes
|
|
92
|
+
* @internal
|
|
93
|
+
*/
|
|
94
|
+
export declare function _GetGpuSortPassCount(keyBits: number): number;
|
|
95
|
+
/**
|
|
96
|
+
* Count of output slots: the active count rounded up to a multiple of 16 (16 splats per instance), at least 16.
|
|
97
|
+
* @param activeCount number of splats to render
|
|
98
|
+
* @returns the padded count
|
|
99
|
+
* @internal
|
|
100
|
+
*/
|
|
101
|
+
export declare function _GetGpuSortPaddedCount(activeCount: number): number;
|
|
102
|
+
/**
|
|
103
|
+
* Packs flat `[start0, count0, start1, count1, ...]` splat intervals for the key shader. Each GPU entry is `(exclusive prefix of the counts, start)`.
|
|
104
|
+
* Empty intervals are dropped and intervals are clamped to `[0, vertexCount)`.
|
|
105
|
+
* @param intervals flat source-splat intervals (start, count pairs)
|
|
106
|
+
* @param vertexCount number of splats in the mesh
|
|
107
|
+
* @returns the packed entries, the number of entries and the total number of active splats
|
|
108
|
+
* @internal
|
|
109
|
+
*/
|
|
110
|
+
export declare function _PackGpuSortIntervals(intervals: ArrayLike<number>, vertexCount: number): {
|
|
111
|
+
data: Uint32Array;
|
|
112
|
+
count: number;
|
|
113
|
+
total: number;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Computes the coefficients of the depth of a splat center: `depth = dot(coef.xyz, center) + coef.w`, in the same space and sign convention as the CPU sort worker
|
|
117
|
+
* (the signed distance along the camera forward axis, negated in right-handed scenes, so a larger value is farther).
|
|
118
|
+
* @param world world matrix (array of 16 numbers) transforming the splat center
|
|
119
|
+
* @param view view matrix (array of 16 numbers)
|
|
120
|
+
* @param depthSign 1 for left-handed scenes, -1 for right-handed scenes
|
|
121
|
+
* @param cameraPosition world camera position, or null to use the view matrix translation
|
|
122
|
+
* @param out receives the 4 coefficients
|
|
123
|
+
* @param offset index of the first coefficient in out
|
|
124
|
+
* @param worldOffset index of the first element of the world matrix in world (defaults to 0), so a matrix can be read from a flat array without creating a view
|
|
125
|
+
* @internal
|
|
126
|
+
*/
|
|
127
|
+
export declare function _ComputeGpuSortDepthCoefficients(world: ArrayLike<number>, view: ArrayLike<number>, depthSign: number, cameraPosition: Nullable<ArrayLike<number>>, out: Float32Array, offset: number, worldOffset?: number): void;
|
|
128
|
+
/**
|
|
129
|
+
* Computes the interval of depths reached by the points of a box, for one or several sets of depth coefficients.
|
|
130
|
+
* @param coefficients depth coefficients (4 per set)
|
|
131
|
+
* @param setCount number of coefficient sets
|
|
132
|
+
* @param boundsMin box minimum (xyz)
|
|
133
|
+
* @param boundsMax box maximum (xyz)
|
|
134
|
+
* @param result optional object receiving the interval, to avoid an allocation when called every frame
|
|
135
|
+
* @returns the min and max depths (the result object when provided)
|
|
136
|
+
* @internal
|
|
137
|
+
*/
|
|
138
|
+
export declare function _ComputeGpuSortDepthRange(coefficients: ArrayLike<number>, setCount: number, boundsMin: ArrayLike<number>, boundsMax: ArrayLike<number>, result?: {
|
|
139
|
+
min: number;
|
|
140
|
+
max: number;
|
|
141
|
+
}): {
|
|
142
|
+
min: number;
|
|
143
|
+
max: number;
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* Scale converting a depth distance to a sort key: `key = (depthMax - depth) * scale`, so the farthest splat gets key 0 (sorted first).
|
|
147
|
+
* @param depthMin smallest depth
|
|
148
|
+
* @param depthMax largest depth
|
|
149
|
+
* @param keyBits number of bits of the sort keys
|
|
150
|
+
* @returns the scale, 0 when the depth range is degenerate (all keys are 0, like the CPU worker)
|
|
151
|
+
* @internal
|
|
152
|
+
*/
|
|
153
|
+
export declare function _ComputeGpuSortKeyScale(depthMin: number, depthMax: number, keyBits: number): number;
|
|
154
|
+
/**
|
|
155
|
+
* Inverse of the SOG means log-transform, applied to a quantization range bound.
|
|
156
|
+
* @param value log-encoded value
|
|
157
|
+
* @returns the decoded value
|
|
158
|
+
* @internal
|
|
159
|
+
*/
|
|
160
|
+
export declare function _DecodeGpuSortSogMean(value: number): number;
|
|
161
|
+
/**
|
|
162
|
+
* Gets the number of splats a GPU sorter can handle on an engine: limited by the maximum storage buffer binding size (4 bytes per splat),
|
|
163
|
+
* and by 2^24 so that source indices are exactly representable as float32 in the instanced vertex buffer.
|
|
164
|
+
* @param engine the engine
|
|
165
|
+
* @returns the maximum number of splats (a multiple of 16)
|
|
166
|
+
*/
|
|
167
|
+
export declare function GetGaussianSplattingGpuSorterMaxSplatCount(engine: AbstractEngine): number;
|
|
168
|
+
/**
|
|
169
|
+
* Per-view GPU buffer receiving a sorted splat index list. It can be bound as the four instanced `splatIndex0` ... `splatIndex3` vertex attributes
|
|
170
|
+
* of the Gaussian Splatting vertex shader (16 splats per instance), in place of the CPU-uploaded index buffer.
|
|
171
|
+
*
|
|
172
|
+
* Create it with {@link GaussianSplattingGpuSorter.createOutput}. After each successful sort, if {@link buffersVersion} changed,
|
|
173
|
+
* the vertex buffers were recreated (the output grew) and must be bound again.
|
|
174
|
+
*/
|
|
175
|
+
export declare class GaussianSplattingGpuSortOutput {
|
|
176
|
+
private _engine;
|
|
177
|
+
private _label;
|
|
178
|
+
private _storageBuffer;
|
|
179
|
+
private _vertexBuffers;
|
|
180
|
+
private _wrapper;
|
|
181
|
+
private _capacity;
|
|
182
|
+
private _buffersVersion;
|
|
183
|
+
/** @internal */
|
|
184
|
+
_sortedPaddedCount: number;
|
|
185
|
+
/** @internal */
|
|
186
|
+
_paramsBuffer: StorageBuffer;
|
|
187
|
+
/** @internal */
|
|
188
|
+
_coefsBuffer: Nullable<StorageBuffer>;
|
|
189
|
+
/** @internal */
|
|
190
|
+
_coefsCapacity: number;
|
|
191
|
+
/** @internal */
|
|
192
|
+
_keysCs: Nullable<ComputeShader>;
|
|
193
|
+
/** @internal */
|
|
194
|
+
_keysCsSog: boolean;
|
|
195
|
+
/** @internal */
|
|
196
|
+
_keysCsCompound: boolean;
|
|
197
|
+
/** @internal Texture views used by the keys context, which may change without replacing their BaseTexture objects. */
|
|
198
|
+
_keysCsCentersView: Nullable<GPUTextureView>;
|
|
199
|
+
/** @internal */
|
|
200
|
+
_keysCsMeansHighView: Nullable<GPUTextureView>;
|
|
201
|
+
/** @internal */
|
|
202
|
+
_keysCsPartIndicesView: Nullable<GPUTextureView>;
|
|
203
|
+
/** @internal */
|
|
204
|
+
_outputCs: ComputeShader;
|
|
205
|
+
/** @internal Sorter binding version the compute shaders of this output were last bound with. */
|
|
206
|
+
_boundSorterVersion: number;
|
|
207
|
+
/** @internal Buffers version of the output storage buffer the output shader was last bound with. */
|
|
208
|
+
_boundBuffersVersion: number;
|
|
209
|
+
/** @internal */
|
|
210
|
+
_boundCoefsBuffer: Nullable<StorageBuffer>;
|
|
211
|
+
/** @internal */
|
|
212
|
+
_boundKeysCs: Nullable<ComputeShader>;
|
|
213
|
+
/** @internal */
|
|
214
|
+
_lastSortError: boolean;
|
|
215
|
+
/** @internal */
|
|
216
|
+
_onDisposed: Nullable<() => void>;
|
|
217
|
+
private _disposed;
|
|
218
|
+
/**
|
|
219
|
+
* @param engine the WebGPU engine
|
|
220
|
+
* @param label debug label
|
|
221
|
+
* @internal
|
|
222
|
+
*/
|
|
223
|
+
constructor(engine: WebGPUEngine, label: string);
|
|
224
|
+
/**
|
|
225
|
+
* The buffer holding the sorted splat indices as float32 (back-to-front), padded to a multiple of 16 with the empty splat index.
|
|
226
|
+
*/
|
|
227
|
+
get buffer(): Nullable<StorageBuffer>;
|
|
228
|
+
/**
|
|
229
|
+
* The 4 instanced vertex buffers `splatIndex0` ... `splatIndex3` (vec4 each, stride 16 floats) viewing {@link buffer}.
|
|
230
|
+
*/
|
|
231
|
+
get vertexBuffers(): readonly VertexBuffer[];
|
|
232
|
+
/**
|
|
233
|
+
* Number of output slots written by the last successful sort: a multiple of 16 (0 before the first successful sort).
|
|
234
|
+
*/
|
|
235
|
+
get paddedCount(): number;
|
|
236
|
+
/**
|
|
237
|
+
* Number of instances to draw (16 splats per instance) after the last successful sort.
|
|
238
|
+
*/
|
|
239
|
+
get instanceCount(): number;
|
|
240
|
+
/**
|
|
241
|
+
* Incremented each time the underlying buffer and vertex buffers are recreated.
|
|
242
|
+
*/
|
|
243
|
+
get buffersVersion(): number;
|
|
244
|
+
/**
|
|
245
|
+
* Creates (or grows) the GPU buffer so it can hold the given number of slots.
|
|
246
|
+
* @param paddedCount number of slots
|
|
247
|
+
* @param maxCapacity maximum capacity allowed by the device limits
|
|
248
|
+
* @internal
|
|
249
|
+
*/
|
|
250
|
+
_ensureCapacity(paddedCount: number, maxCapacity: number): void;
|
|
251
|
+
/**
|
|
252
|
+
* Releases the GPU resources.
|
|
253
|
+
*/
|
|
254
|
+
dispose(): void;
|
|
255
|
+
private _releaseBuffers;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* WebGPU compute depth sorter for Gaussian Splatting. It reproduces the ordering of the CPU sort worker (back-to-front counting sort) entirely on the GPU,
|
|
259
|
+
* and writes the sorted splat indices in a vertex buffer ready to be used as the instanced `splatIndex` attributes ({@link GaussianSplattingGpuSortOutput}).
|
|
260
|
+
*
|
|
261
|
+
* Pipeline of a sort (all dispatches are enqueued on the engine's command encoder, without any CPU readback):
|
|
262
|
+
* 1. keys: for each active splat, compute the view depth and quantize it to a `keyBits`-bit key (farthest = smallest). Supports splat intervals,
|
|
263
|
+
* compound parts (per-part matrices) and SOG decoded means.
|
|
264
|
+
* 2. a stable LSD radix sort with 4-bit digits, `ceil(keyBits / 4)` passes of count, scan (2 levels) and scatter. No subgroup operation is required.
|
|
265
|
+
* 3. output: writes the sorted indices as float32, padding to a multiple of 16 with `vertexCount`.
|
|
266
|
+
*
|
|
267
|
+
* Usage constraints:
|
|
268
|
+
* - {@link sort} ends the current render pass: call it outside of any render pass (e.g. in `onBeforeRenderObservable` / `onBeforeCameraRenderObservable`).
|
|
269
|
+
* - Uniform-like data is written with queue writes, which take effect before the whole frame's commands. So call {@link sort} at most once per output and per frame, and do not
|
|
270
|
+
* change the source, the intervals or the part matrices between two sorts of the same frame.
|
|
271
|
+
* - If the textures given to {@link setSource} are recreated, call {@link setSource} again.
|
|
272
|
+
* - The compute shaders and the WebGPU compute engine extension are loaded by {@link GaussianSplattingGpuSorter.LoadDependenciesAsync}: await it before the first {@link sort}.
|
|
273
|
+
* Until it has completed, {@link sort} returns false without enqueuing anything.
|
|
274
|
+
* @experimental
|
|
275
|
+
*/
|
|
276
|
+
export declare class GaussianSplattingGpuSorter {
|
|
277
|
+
private static _DependenciesReady;
|
|
278
|
+
private static _DependenciesPromise;
|
|
279
|
+
private readonly _engine;
|
|
280
|
+
private readonly _name;
|
|
281
|
+
private readonly _keyBits;
|
|
282
|
+
private readonly _passCount;
|
|
283
|
+
private readonly _maxSplatCount;
|
|
284
|
+
private readonly _maxIntervalCount;
|
|
285
|
+
private _vertexCount;
|
|
286
|
+
private _textureWidth;
|
|
287
|
+
private _centersTexture;
|
|
288
|
+
private _meansHighTexture;
|
|
289
|
+
private _partIndicesTexture;
|
|
290
|
+
private readonly _meansMin;
|
|
291
|
+
private readonly _meansMax;
|
|
292
|
+
private _boundsMin;
|
|
293
|
+
private _boundsMax;
|
|
294
|
+
private _partMatrices;
|
|
295
|
+
private _partCount;
|
|
296
|
+
private _rawIntervals;
|
|
297
|
+
private _packedIntervals;
|
|
298
|
+
private _intervalCount;
|
|
299
|
+
private _intervalsDirty;
|
|
300
|
+
private _intervalsValid;
|
|
301
|
+
private _activeCount;
|
|
302
|
+
private _bindingsVersion;
|
|
303
|
+
private _sortShadersBoundVersion;
|
|
304
|
+
private _capacity;
|
|
305
|
+
private _keysA;
|
|
306
|
+
private _keysB;
|
|
307
|
+
private _valsA;
|
|
308
|
+
private _valsB;
|
|
309
|
+
private _sumTable;
|
|
310
|
+
private _intervalsBuffer;
|
|
311
|
+
private _intervalsCapacity;
|
|
312
|
+
private readonly _chunkSums;
|
|
313
|
+
private readonly _passParams;
|
|
314
|
+
private _passParamsActiveCount;
|
|
315
|
+
private readonly _passData;
|
|
316
|
+
private readonly _countCs;
|
|
317
|
+
private readonly _scatterCs;
|
|
318
|
+
private readonly _scanLocalCs;
|
|
319
|
+
private readonly _scanSumsCs;
|
|
320
|
+
private readonly _paramsData;
|
|
321
|
+
private readonly _paramsU32;
|
|
322
|
+
private readonly _paramsF32;
|
|
323
|
+
private _coefs;
|
|
324
|
+
private readonly _depthRange;
|
|
325
|
+
private readonly _outputs;
|
|
326
|
+
private _disposed;
|
|
327
|
+
/**
|
|
328
|
+
* Whether GPU sorting is available on an engine: a WebGPU engine with compute shader support.
|
|
329
|
+
* @param engine the engine
|
|
330
|
+
* @returns true if a {@link GaussianSplattingGpuSorter} can be created
|
|
331
|
+
*/
|
|
332
|
+
static IsSupported(engine: AbstractEngine): boolean;
|
|
333
|
+
/**
|
|
334
|
+
* Gets the maximum number of splats the sorter can sort on an engine.
|
|
335
|
+
* @param engine the engine
|
|
336
|
+
* @returns the maximum splat count
|
|
337
|
+
*/
|
|
338
|
+
static GetMaxSupportedSplatCount(engine: AbstractEngine): number;
|
|
339
|
+
/**
|
|
340
|
+
* Registers the WebGPU compute engine extension and loads the compute shaders of the sorter. The result is cached: calling it again returns the same promise.
|
|
341
|
+
* It must have completed before the first {@link sort} (which returns false until then). If loading fails, the promise rejects and the next call retries.
|
|
342
|
+
* @returns a promise resolved when the dependencies are ready
|
|
343
|
+
*/
|
|
344
|
+
static LoadDependenciesAsync(): Promise<void>;
|
|
345
|
+
/**
|
|
346
|
+
* Creates a GPU sorter. Shaders are compiled asynchronously: {@link sort} returns false until they are ready.
|
|
347
|
+
* Await {@link GaussianSplattingGpuSorter.LoadDependenciesAsync} before the first {@link sort}.
|
|
348
|
+
* @param engine the WebGPU engine
|
|
349
|
+
* @param name debug name
|
|
350
|
+
* @param keyBits number of bits of the depth sort keys (8 to 24, default 16). Each 4 bits cost one radix pass; 16 bits is enough for most scenes.
|
|
351
|
+
*/
|
|
352
|
+
constructor(engine: AbstractEngine, name?: string, keyBits?: number);
|
|
353
|
+
/**
|
|
354
|
+
* Number of splats rendered after applying the intervals (the number of keys sorted).
|
|
355
|
+
*/
|
|
356
|
+
get activeCount(): number;
|
|
357
|
+
/**
|
|
358
|
+
* Number of output slots (activeCount rounded up to a multiple of 16).
|
|
359
|
+
*/
|
|
360
|
+
get paddedCount(): number;
|
|
361
|
+
/**
|
|
362
|
+
* Number of bits of the depth sort keys.
|
|
363
|
+
*/
|
|
364
|
+
get keyBits(): number;
|
|
365
|
+
/**
|
|
366
|
+
* Sets the splat data to sort.
|
|
367
|
+
* @param source the source textures and layout
|
|
368
|
+
* @returns false (and logs an error) if the source or active interval count exceeds {@link GaussianSplattingGpuSorter.GetMaxSupportedSplatCount}
|
|
369
|
+
*/
|
|
370
|
+
setSource(source: IGaussianSplattingGpuSortSource): boolean;
|
|
371
|
+
/**
|
|
372
|
+
* Sets the transform of each part of a compound mesh. Used instead of the world matrix given to {@link sort} when a part indices texture was set in {@link setSource}.
|
|
373
|
+
* The matrices are copied: call this again when they change.
|
|
374
|
+
* @param matrices one matrix per part, or a flat array of 16 floats per part, or null for a non-compound mesh
|
|
375
|
+
*/
|
|
376
|
+
setPartMatrices(matrices: Nullable<ReadonlyArray<GaussianSplattingGpuSortMatrix> | ArrayLike<number>>): void;
|
|
377
|
+
/**
|
|
378
|
+
* Restricts the sort to ranges of source splats, like the CPU worker's `intervals` message.
|
|
379
|
+
* @param intervals flat `[start0, count0, start1, count1, ...]` (start, COUNT pairs), or null to sort every splat
|
|
380
|
+
* @returns false (and logs an error) if the packed intervals or padded active count exceed the scan or device storage-buffer limits.
|
|
381
|
+
* Overlapping intervals count each occurrence. Sorting is disabled until valid intervals or a valid source are set.
|
|
382
|
+
*/
|
|
383
|
+
setIntervals(intervals: Nullable<ArrayLike<number>>): boolean;
|
|
384
|
+
/**
|
|
385
|
+
* Creates an output receiving the sorted indices of one view. Use one output per camera that is sorted independently.
|
|
386
|
+
* @returns the new output
|
|
387
|
+
*/
|
|
388
|
+
createOutput(): GaussianSplattingGpuSortOutput;
|
|
389
|
+
/**
|
|
390
|
+
* Enqueues the sort of the active splats for a view. Call it outside of any render pass, once per output and per frame.
|
|
391
|
+
* @param output the output receiving the sorted indices
|
|
392
|
+
* @param worldMatrix world matrix of the mesh (ignored for compound meshes, which use the part matrices)
|
|
393
|
+
* @param viewMatrix view matrix of the camera
|
|
394
|
+
* @param options handedness, camera position and depth range
|
|
395
|
+
* @returns false if nothing was enqueued (unsupported active intervals, shaders still compiling, no source, or no depth range), true otherwise
|
|
396
|
+
*/
|
|
397
|
+
sort(output: GaussianSplattingGpuSortOutput, worldMatrix: GaussianSplattingGpuSortMatrix, viewMatrix: GaussianSplattingGpuSortMatrix, options?: IGaussianSplattingGpuSortOptions): boolean;
|
|
398
|
+
/**
|
|
399
|
+
* Releases all the GPU resources, including the outputs created by {@link createOutput}.
|
|
400
|
+
*/
|
|
401
|
+
dispose(): void;
|
|
402
|
+
private _refreshIntervals;
|
|
403
|
+
private _releaseSortBuffers;
|
|
404
|
+
private _ensureCapacity;
|
|
405
|
+
private _ensureIntervalsBuffer;
|
|
406
|
+
private _ensureCoefsBuffer;
|
|
407
|
+
private _getKeysComputeShader;
|
|
408
|
+
private _bindResources;
|
|
409
|
+
private _bindSortShaders;
|
|
410
|
+
private _isReady;
|
|
411
|
+
private _writeParams;
|
|
412
|
+
private _writeIntervals;
|
|
413
|
+
private _writePassParams;
|
|
414
|
+
private _dispatchSort;
|
|
415
|
+
}
|