@onerjs/core 8.56.4 → 9.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Animations/animatable.core.js +36 -0
- package/Animations/animatable.core.js.map +1 -1
- package/Animations/animationGroup.pure.d.ts +61 -1
- package/Animations/animationGroup.pure.js +191 -2
- package/Animations/animationGroup.pure.js.map +1 -1
- package/Animations/index.d.ts +1 -0
- package/Animations/index.js +1 -0
- package/Animations/index.js.map +1 -1
- package/Animations/pure.d.ts +1 -0
- package/Animations/pure.js +1 -0
- package/Animations/pure.js.map +1 -1
- package/Animations/rootMotion.d.ts +560 -0
- package/Animations/rootMotion.js +1709 -0
- package/Animations/rootMotion.js.map +1 -0
- package/Animations/runtimeAnimation.d.ts +57 -0
- package/Animations/runtimeAnimation.js +127 -3
- package/Animations/runtimeAnimation.js.map +1 -1
- package/Cameras/arcRotateCamera.pure.d.ts +2 -0
- package/Cameras/arcRotateCamera.pure.js +2 -0
- package/Cameras/arcRotateCamera.pure.js.map +1 -1
- package/Cameras/targetCamera.pure.d.ts +2 -0
- package/Cameras/targetCamera.pure.js +13 -2
- package/Cameras/targetCamera.pure.js.map +1 -1
- package/Collisions/gpuPicker.js +5 -5
- package/Collisions/gpuPicker.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.query.pure.js +4 -2
- package/Engines/AbstractEngine/abstractEngine.query.pure.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.query.types.d.ts +11 -2
- package/Engines/AbstractEngine/abstractEngine.query.types.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.renderPass.pure.js +1 -0
- package/Engines/AbstractEngine/abstractEngine.renderPass.pure.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.pure.js +63 -0
- package/Engines/Extensions/engine.multiRender.pure.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.types.d.ts +13 -0
- package/Engines/Extensions/engine.multiRender.types.js.map +1 -1
- package/Engines/Extensions/engine.prefilteredCubeTexture.pure.js +2 -2
- package/Engines/Extensions/engine.prefilteredCubeTexture.pure.js.map +1 -1
- package/Engines/Extensions/engine.prefilteredCubeTexture.types.d.ts +2 -1
- package/Engines/Extensions/engine.prefilteredCubeTexture.types.js.map +1 -1
- package/Engines/Extensions/index.d.ts +1 -0
- package/Engines/Extensions/index.js +1 -0
- package/Engines/Extensions/index.js.map +1 -1
- package/Engines/Extensions/pure.d.ts +1 -1
- package/Engines/Extensions/pure.js +1 -1
- package/Engines/Extensions/pure.js.map +1 -1
- package/Engines/Native/Extensions/nativeEngine.cubeTexture.pure.js +88 -39
- package/Engines/Native/Extensions/nativeEngine.cubeTexture.pure.js.map +1 -1
- package/Engines/Native/Extensions/nativeEngine.cubeTexture.types.d.ts +20 -2
- package/Engines/Native/Extensions/nativeEngine.cubeTexture.types.js.map +1 -1
- package/Engines/Native/nativeHardwareTexture.d.ts +8 -1
- package/Engines/Native/nativeHardwareTexture.js +7 -0
- package/Engines/Native/nativeHardwareTexture.js.map +1 -1
- package/Engines/Native/nativeHelpers.js +56 -1
- package/Engines/Native/nativeHelpers.js.map +1 -1
- package/Engines/Native/nativeInterfaces.d.ts +37 -8
- package/Engines/Native/nativeInterfaces.js.map +1 -1
- package/Engines/Native/nativeRenderTargetWrapper.d.ts +40 -0
- package/Engines/Native/nativeRenderTargetWrapper.js +265 -5
- package/Engines/Native/nativeRenderTargetWrapper.js.map +1 -1
- package/Engines/Processors/shaderCodeCursor.d.ts +1 -0
- package/Engines/Processors/shaderCodeCursor.js +40 -3
- package/Engines/Processors/shaderCodeCursor.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.pure.js +4 -0
- package/Engines/WebGPU/Extensions/engine.multiRender.pure.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.types.d.ts +13 -0
- package/Engines/WebGPU/Extensions/engine.multiRender.types.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.query.pure.js +11 -3
- package/Engines/WebGPU/Extensions/engine.query.pure.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.pure.js +1 -0
- package/Engines/WebGPU/Extensions/engine.renderTarget.pure.js.map +1 -1
- package/Engines/WebGPU/Extensions/index.d.ts +1 -0
- package/Engines/WebGPU/Extensions/index.js +1 -0
- package/Engines/WebGPU/Extensions/index.js.map +1 -1
- package/Engines/WebGPU/Extensions/pure.d.ts +1 -1
- package/Engines/WebGPU/Extensions/pure.js +1 -1
- package/Engines/WebGPU/Extensions/pure.js.map +1 -1
- package/Engines/WebGPU/webgpuBundleList.d.ts +2 -0
- package/Engines/WebGPU/webgpuBundleList.js +4 -0
- package/Engines/WebGPU/webgpuBundleList.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js +5 -2
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
- package/Engines/WebGPU/webgpuHardwareTexture.js +3 -1
- package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuOcclusionQuery.js +1 -1
- package/Engines/WebGPU/webgpuOcclusionQuery.js.map +1 -1
- package/Engines/WebGPU/webgpuSnapshotRendering.d.ts +4 -0
- package/Engines/WebGPU/webgpuSnapshotRendering.js +40 -7
- package/Engines/WebGPU/webgpuSnapshotRendering.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.d.ts +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.js +2 -2
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureManager.d.ts +2 -0
- package/Engines/WebGPU/webgpuTextureManager.js +286 -13
- package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
- package/Engines/abstractEngine.pure.d.ts +17 -1
- package/Engines/abstractEngine.pure.js +17 -5
- package/Engines/abstractEngine.pure.js.map +1 -1
- package/Engines/constants.d.ts +4 -0
- package/Engines/constants.js +4 -0
- package/Engines/constants.js.map +1 -1
- package/Engines/engine.pure.d.ts +0 -1
- package/Engines/engine.pure.js +0 -7
- package/Engines/engine.pure.js.map +1 -1
- package/Engines/nativeEngine.pure.js +1 -1
- package/Engines/nativeEngine.pure.js.map +1 -1
- package/Engines/thinEngine.pure.d.ts +15 -0
- package/Engines/thinEngine.pure.js +61 -14
- package/Engines/thinEngine.pure.js.map +1 -1
- package/Engines/thinNativeEngine.pure.d.ts +218 -17
- package/Engines/thinNativeEngine.pure.js +1438 -165
- package/Engines/thinNativeEngine.pure.js.map +1 -1
- package/Engines/thinWebGPUEngine.d.ts +4 -0
- package/Engines/thinWebGPUEngine.js +16 -2
- package/Engines/thinWebGPUEngine.js.map +1 -1
- package/Engines/webgpuEngine.pure.d.ts +17 -3
- package/Engines/webgpuEngine.pure.js +56 -13
- package/Engines/webgpuEngine.pure.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.pure.js +2 -2
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.pure.js.map +1 -1
- package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.pure.d.ts +10 -0
- package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.pure.js +24 -12
- package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.pure.d.ts +11 -2
- package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.pure.js +1 -1
- package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.pure.d.ts +7 -0
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.pure.js +43 -0
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.pure.d.ts +9 -1
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.pure.js +6 -8
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.pure.d.ts +2 -0
- package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.pure.js +5 -1
- package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.pure.d.ts +2 -0
- package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.pure.js +5 -1
- package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.pure.d.ts +9 -0
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.pure.js +34 -9
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.pure.d.ts +2 -0
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.pure.js +4 -0
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.d.ts +18 -4
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.js +24 -6
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.pure.js +19 -7
- package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.pure.js +3 -3
- package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.d.ts +20 -2
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.js +85 -25
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.pure.d.ts +16 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.pure.js +64 -14
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.pure.d.ts +12 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.pure.js +8 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.pure.js +4 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.pure.d.ts +12 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.pure.js +5 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.pure.js +64 -16
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.pure.d.ts +2 -0
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.pure.js +14 -2
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.pure.d.ts +5 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.pure.js +23 -8
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.pure.js.map +1 -1
- package/FlowGraph/CustomTypes/flowGraphInteger.pure.d.ts +5 -0
- package/FlowGraph/CustomTypes/flowGraphInteger.pure.js +7 -0
- package/FlowGraph/CustomTypes/flowGraphInteger.pure.js.map +1 -1
- package/FlowGraph/CustomTypes/flowGraphMatrix.d.ts +10 -0
- package/FlowGraph/CustomTypes/flowGraphMatrix.js +14 -0
- package/FlowGraph/CustomTypes/flowGraphMatrix.js.map +1 -1
- package/FlowGraph/flowGraph.d.ts +6 -1
- package/FlowGraph/flowGraph.js +41 -9
- package/FlowGraph/flowGraph.js.map +1 -1
- package/FlowGraph/flowGraphAnimationHelpers.d.ts +24 -0
- package/FlowGraph/flowGraphAnimationHelpers.js +21 -0
- package/FlowGraph/flowGraphAnimationHelpers.js.map +1 -0
- package/FlowGraph/flowGraphBlock.js +3 -0
- package/FlowGraph/flowGraphBlock.js.map +1 -1
- package/FlowGraph/flowGraphConnection.d.ts +7 -0
- package/FlowGraph/flowGraphConnection.js +7 -0
- package/FlowGraph/flowGraphConnection.js.map +1 -1
- package/FlowGraph/flowGraphContext.d.ts +2 -1
- package/FlowGraph/flowGraphContext.js +5 -3
- package/FlowGraph/flowGraphContext.js.map +1 -1
- package/FlowGraph/flowGraphCoordinator.d.ts +15 -1
- package/FlowGraph/flowGraphCoordinator.js +47 -16
- package/FlowGraph/flowGraphCoordinator.js.map +1 -1
- package/FlowGraph/flowGraphEventBlock.d.ts +5 -0
- package/FlowGraph/flowGraphEventBlock.js +7 -0
- package/FlowGraph/flowGraphEventBlock.js.map +1 -1
- package/FlowGraph/flowGraphHostResolver.d.ts +2 -1
- package/FlowGraph/flowGraphHostResolver.js.map +1 -1
- package/FlowGraph/flowGraphParser.js +60 -2
- package/FlowGraph/flowGraphParser.js.map +1 -1
- package/FlowGraph/flowGraphValidator.js +0 -4
- package/FlowGraph/flowGraphValidator.js.map +1 -1
- package/FlowGraph/index.d.ts +2 -0
- package/FlowGraph/index.js +2 -0
- package/FlowGraph/index.js.map +1 -1
- package/FlowGraph/pure.d.ts +2 -0
- package/FlowGraph/pure.js +2 -0
- package/FlowGraph/pure.js.map +1 -1
- package/FlowGraph/serialization.d.ts +4 -2
- package/FlowGraph/serialization.js +12 -24
- package/FlowGraph/serialization.js.map +1 -1
- package/FlowGraph/typeDefinitions.d.ts +9 -1
- package/FlowGraph/typeDefinitions.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.d.ts +5 -0
- package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.js +8 -0
- package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.pure.d.ts +87 -0
- package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.pure.js +295 -0
- package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.pure.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/pure.d.ts +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/pure.js +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/pure.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +4 -4
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.d.ts +5 -1
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.js +13 -1
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.js.map +1 -1
- package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.d.ts +1 -0
- package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.js +4 -0
- package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.pure.d.ts +54 -0
- package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.pure.js +155 -0
- package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.pure.js.map +1 -0
- package/FrameGraph/Node/Blocks/Textures/pure.d.ts +1 -0
- package/FrameGraph/Node/Blocks/Textures/pure.js +1 -0
- package/FrameGraph/Node/Blocks/Textures/pure.js.map +1 -1
- package/FrameGraph/Node/Blocks/allBlocks.pure.js +4 -0
- package/FrameGraph/Node/Blocks/allBlocks.pure.js.map +1 -1
- package/FrameGraph/Node/Blocks/index.d.ts +2 -0
- package/FrameGraph/Node/Blocks/index.js +2 -0
- package/FrameGraph/Node/Blocks/index.js.map +1 -1
- package/FrameGraph/Node/Blocks/inputBlock.pure.js +20 -1
- package/FrameGraph/Node/Blocks/inputBlock.pure.js.map +1 -1
- package/FrameGraph/Node/Blocks/pure.d.ts +2 -0
- package/FrameGraph/Node/Blocks/pure.js +2 -0
- package/FrameGraph/Node/Blocks/pure.js.map +1 -1
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.d.ts +4 -2
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.js +4 -2
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraph.js +1 -1
- package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
- package/FrameGraph/Tasks/Layers/selectionOutlineTask.js +1 -0
- package/FrameGraph/Tasks/Layers/selectionOutlineTask.js.map +1 -1
- package/FrameGraph/Tasks/Misc/cullObjectsTask.js +5 -1
- package/FrameGraph/Tasks/Misc/cullObjectsTask.js.map +1 -1
- package/FrameGraph/Tasks/Misc/lightingVolumeTask.js +1 -0
- package/FrameGraph/Tasks/Misc/lightingVolumeTask.js.map +1 -1
- package/FrameGraph/Tasks/Misc/minMaxReducerTask.d.ts +62 -0
- package/FrameGraph/Tasks/Misc/minMaxReducerTask.js +159 -0
- package/FrameGraph/Tasks/Misc/minMaxReducerTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/meshBlendingTask.d.ts +69 -0
- package/FrameGraph/Tasks/PostProcesses/meshBlendingTask.js +223 -0
- package/FrameGraph/Tasks/PostProcesses/meshBlendingTask.js.map +1 -0
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +25 -3
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +72 -34
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js +3 -1
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
- package/FrameGraph/frameGraph.d.ts +4 -0
- package/FrameGraph/frameGraph.js +14 -0
- package/FrameGraph/frameGraph.js.map +1 -1
- package/FrameGraph/frameGraphObjectList.d.ts +6 -1
- package/FrameGraph/frameGraphObjectList.js.map +1 -1
- package/FrameGraph/frameGraphRenderContext.d.ts +3 -1
- package/FrameGraph/frameGraphRenderContext.js +5 -5
- package/FrameGraph/frameGraphRenderContext.js.map +1 -1
- package/FrameGraph/index.d.ts +2 -0
- package/FrameGraph/index.js +2 -0
- package/FrameGraph/index.js.map +1 -1
- package/FrameGraph/pure.d.ts +2 -0
- package/FrameGraph/pure.js +2 -0
- package/FrameGraph/pure.js.map +1 -1
- package/Inputs/scene.inputManager.d.ts +4 -0
- package/Inputs/scene.inputManager.js +50 -8
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Lights/Clustered/clusteredLightingSceneComponent.pure.d.ts +5 -0
- package/Lights/Clustered/clusteredLightingSceneComponent.pure.js +22 -1
- package/Lights/Clustered/clusteredLightingSceneComponent.pure.js.map +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.pure.js +7 -3
- package/Lights/Shadows/cascadedShadowGenerator.pure.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.d.ts +7 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.js +8 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.pure.d.ts +54 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.pure.js +81 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.pure.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.d.ts +7 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.js +8 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.pure.d.ts +60 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.pure.js +90 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.pure.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.d.ts +31 -0
- package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js +103 -5
- package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js +6 -6
- package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.d.ts +26 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js +153 -49
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.d.ts +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.js +4 -0
- package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.pure.d.ts +83 -0
- package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.pure.js +191 -0
- package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.pure.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.d.ts +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.js +4 -0
- package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.pure.d.ts +62 -0
- package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.pure.js +125 -0
- package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.pure.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.pure.js +5 -5
- package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.pure.js.map +1 -1
- package/Materials/GaussianSplatting/pure.d.ts +4 -0
- package/Materials/GaussianSplatting/pure.js +4 -0
- package/Materials/GaussianSplatting/pure.js.map +1 -1
- package/Materials/Node/Blocks/Dual/imageSourceBlock.pure.d.ts +1 -0
- package/Materials/Node/Blocks/Dual/imageSourceBlock.pure.js +12 -0
- package/Materials/Node/Blocks/Dual/imageSourceBlock.pure.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.pure.js +11 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.pure.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/prePassOutputBlock.pure.js +17 -2
- package/Materials/Node/Blocks/Fragment/prePassOutputBlock.pure.js.map +1 -1
- package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.pure.js +2 -2
- package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.pure.js.map +1 -1
- package/Materials/Node/nodeMaterial.pure.d.ts +4 -0
- package/Materials/Node/nodeMaterial.pure.js +4 -0
- package/Materials/Node/nodeMaterial.pure.js.map +1 -1
- package/Materials/Node/nodeMaterialBuildState.d.ts +1 -1
- package/Materials/Node/nodeMaterialBuildState.js +25 -3
- package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
- package/Materials/PBR/openpbrMaterial.pure.d.ts +2 -0
- package/Materials/PBR/pbrBaseMaterial.pure.d.ts +2 -0
- package/Materials/Textures/Procedurals/proceduralTexture.pure.d.ts +14 -14
- package/Materials/Textures/Procedurals/proceduralTexture.pure.js +37 -13
- package/Materials/Textures/Procedurals/proceduralTexture.pure.js.map +1 -1
- package/Materials/Textures/baseTexture.pure.js +3 -0
- package/Materials/Textures/baseTexture.pure.js.map +1 -1
- package/Materials/Textures/cubeTexture.pure.js +1 -1
- package/Materials/Textures/cubeTexture.pure.js.map +1 -1
- package/Materials/Textures/internalTexture.d.ts +8 -1
- package/Materials/Textures/internalTexture.js +9 -2
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/Textures/mirrorTexture.pure.js +3 -1
- package/Materials/Textures/mirrorTexture.pure.js.map +1 -1
- package/Materials/Textures/rawTexture2DArray.functions.d.ts +3 -3
- package/Materials/Textures/rawTexture2DArray.functions.js.map +1 -1
- package/Materials/Textures/rawTexture3D.d.ts +1 -1
- package/Materials/Textures/rawTexture3D.js +1 -1
- package/Materials/Textures/rawTexture3D.js.map +1 -1
- package/Materials/Textures/texture.pure.js +1 -1
- package/Materials/Textures/texture.pure.js.map +1 -1
- package/Materials/Textures/textureHelper.functions.d.ts +14 -0
- package/Materials/Textures/textureHelper.functions.js +24 -0
- package/Materials/Textures/textureHelper.functions.js.map +1 -1
- package/Materials/ditheredTileFadeMaterialPlugin.d.ts +210 -0
- package/Materials/ditheredTileFadeMaterialPlugin.js +509 -0
- package/Materials/ditheredTileFadeMaterialPlugin.js.map +1 -0
- package/Materials/effectRenderer.pure.d.ts +4 -0
- package/Materials/effectRenderer.pure.js +3 -2
- package/Materials/effectRenderer.pure.js.map +1 -1
- package/Materials/index.d.ts +5 -0
- package/Materials/index.js +5 -0
- package/Materials/index.js.map +1 -1
- package/Materials/material.pure.js +25 -12
- package/Materials/material.pure.js.map +1 -1
- package/Materials/materialHelper.geometryrendering.d.ts +46 -1
- package/Materials/materialHelper.geometryrendering.js +105 -8
- package/Materials/materialHelper.geometryrendering.js.map +1 -1
- package/Materials/prepass.defines.d.ts +2 -0
- package/Materials/prepass.defines.js +2 -0
- package/Materials/prepass.defines.js.map +1 -1
- package/Materials/pure.d.ts +5 -0
- package/Materials/pure.js +5 -0
- package/Materials/pure.js.map +1 -1
- package/Materials/standardMaterial.pure.d.ts +10 -0
- package/Materials/standardMaterial.pure.js +30 -5
- package/Materials/standardMaterial.pure.js.map +1 -1
- package/Meshes/Builders/polygonBuilder.pure.d.ts +4 -0
- package/Meshes/Builders/polygonBuilder.pure.js +3 -0
- package/Meshes/Builders/polygonBuilder.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianPointSplattingController.d.ts +8 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingController.js +11 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingController.js.map +1 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingController.pure.d.ts +231 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingController.pure.js +1212 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingController.pure.js.map +1 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.d.ts +14 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.js +15 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.js.map +1 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.pure.d.ts +285 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.pure.js +812 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.pure.js.map +1 -0
- package/Meshes/GaussianSplatting/gaussianSplatting.functions.d.ts +19 -0
- package/Meshes/GaussianSplatting/gaussianSplatting.functions.js +23 -0
- package/Meshes/GaussianSplatting/gaussianSplatting.functions.js.map +1 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +1 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +2 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.d.ts +163 -14
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js +239 -24
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +34 -4
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +125 -25
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/pure.d.ts +2 -0
- package/Meshes/GaussianSplatting/pure.js +2 -0
- package/Meshes/GaussianSplatting/pure.js.map +1 -1
- package/Meshes/Node/Blocks/booleanGeometryBlock.pure.js +25 -11
- package/Meshes/Node/Blocks/booleanGeometryBlock.pure.js.map +1 -1
- package/Meshes/abstractMesh.pure.d.ts +30 -0
- package/Meshes/abstractMesh.pure.js +54 -0
- package/Meshes/abstractMesh.pure.js.map +1 -1
- package/Meshes/index.d.ts +2 -0
- package/Meshes/index.js +2 -0
- package/Meshes/index.js.map +1 -1
- package/Meshes/instancedMesh.pure.d.ts +5 -0
- package/Meshes/instancedMesh.pure.js +12 -0
- package/Meshes/instancedMesh.pure.js.map +1 -1
- package/Meshes/mesh.pure.js +23 -8
- package/Meshes/mesh.pure.js.map +1 -1
- package/Meshes/meshBlendingTag.d.ts +47 -0
- package/Meshes/meshBlendingTag.js +64 -0
- package/Meshes/meshBlendingTag.js.map +1 -0
- package/Meshes/polygonMesh.js +2 -2
- package/Meshes/polygonMesh.js.map +1 -1
- package/Meshes/pure.d.ts +2 -0
- package/Meshes/pure.js +2 -0
- package/Meshes/pure.js.map +1 -1
- package/Meshes/subMesh.pure.d.ts +11 -2
- package/Meshes/subMesh.pure.js +20 -5
- package/Meshes/subMesh.pure.js.map +1 -1
- package/Meshes/thinInstanceMesh.pure.js +1 -0
- package/Meshes/thinInstanceMesh.pure.js.map +1 -1
- package/Misc/andOrNotEvaluator.js +4 -0
- package/Misc/andOrNotEvaluator.js.map +1 -1
- package/Misc/fileTools.pure.js +21 -0
- package/Misc/fileTools.pure.js.map +1 -1
- package/Misc/minMaxReducer.pure.d.ts +6 -0
- package/Misc/minMaxReducer.pure.js +10 -0
- package/Misc/minMaxReducer.pure.js.map +1 -1
- package/Misc/snapshotRenderingHelper.js +2 -2
- package/Misc/snapshotRenderingHelper.js.map +1 -1
- package/Misc/thinMinMaxReducer.d.ts +19 -2
- package/Misc/thinMinMaxReducer.js +74 -21
- package/Misc/thinMinMaxReducer.js.map +1 -1
- package/Misc/tools.pure.js +1 -1
- package/Misc/tools.pure.js.map +1 -1
- package/Particles/Node/Blocks/Update/updateNoiseBlock.pure.js +19 -7
- package/Particles/Node/Blocks/Update/updateNoiseBlock.pure.js.map +1 -1
- package/Particles/Node/Blocks/particleSourceTextureBlock.pure.js +3 -2
- package/Particles/Node/Blocks/particleSourceTextureBlock.pure.js.map +1 -1
- package/Particles/gpuParticleSystem.pure.d.ts +4 -0
- package/Particles/gpuParticleSystem.pure.js +101 -32
- package/Particles/gpuParticleSystem.pure.js.map +1 -1
- package/Particles/particle.js +3 -2
- package/Particles/particle.js.map +1 -1
- package/Particles/solidParticleSystem.js +7 -1
- package/Particles/solidParticleSystem.js.map +1 -1
- package/Particles/thinParticleSystem.function.d.ts +6 -0
- package/Particles/thinParticleSystem.function.js +144 -88
- package/Particles/thinParticleSystem.function.js.map +1 -1
- package/Particles/thinParticleSystem.pure.d.ts +8 -0
- package/Particles/thinParticleSystem.pure.js +154 -28
- package/Particles/thinParticleSystem.pure.js.map +1 -1
- package/Particles/webgl2ParticleSystem.pure.d.ts +1 -0
- package/Particles/webgl2ParticleSystem.pure.js +12 -4
- package/Particles/webgl2ParticleSystem.pure.js.map +1 -1
- package/Physics/v2/ragdoll.d.ts +2 -4
- package/Physics/v2/ragdoll.js +11 -4
- package/Physics/v2/ragdoll.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.pure.js +7 -0
- package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.pure.js.map +1 -1
- package/PostProcesses/index.d.ts +2 -0
- package/PostProcesses/index.js +2 -0
- package/PostProcesses/index.js.map +1 -1
- package/PostProcesses/meshBlendingBlueNoise.d.ts +15 -0
- package/PostProcesses/meshBlendingBlueNoise.js +77 -0
- package/PostProcesses/meshBlendingBlueNoise.js.map +1 -0
- package/PostProcesses/meshBlendingPostProcess.d.ts +131 -0
- package/PostProcesses/meshBlendingPostProcess.js +315 -0
- package/PostProcesses/meshBlendingPostProcess.js.map +1 -0
- package/PostProcesses/pure.d.ts +2 -0
- package/PostProcesses/pure.js +2 -0
- package/PostProcesses/pure.js.map +1 -1
- package/PostProcesses/thinMeshBlendingPostProcess.d.ts +339 -0
- package/PostProcesses/thinMeshBlendingPostProcess.js +771 -0
- package/PostProcesses/thinMeshBlendingPostProcess.js.map +1 -0
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js +6 -6
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.d.ts +12 -0
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js +50 -25
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js.map +1 -1
- package/Rendering/boundingBoxRenderer.pure.js +2 -1
- package/Rendering/boundingBoxRenderer.pure.js.map +1 -1
- package/Rendering/depthRenderer.pure.d.ts +9 -0
- package/Rendering/depthRenderer.pure.js +15 -4
- package/Rendering/depthRenderer.pure.js.map +1 -1
- package/Rendering/edgesRenderer.pure.d.ts +4 -2
- package/Rendering/edgesRenderer.pure.js +11 -2
- package/Rendering/edgesRenderer.pure.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObject.d.ts +14 -0
- package/Rendering/fluidRenderer/fluidRenderingObject.js +26 -0
- package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.d.ts +13 -3
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js +22 -9
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js +3 -0
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js.map +1 -1
- package/Rendering/geometryBufferRenderer.pure.d.ts +38 -4
- package/Rendering/geometryBufferRenderer.pure.js +130 -18
- package/Rendering/geometryBufferRenderer.pure.js.map +1 -1
- package/Rendering/objectRenderer.d.ts +7 -1
- package/Rendering/objectRenderer.js +45 -7
- package/Rendering/objectRenderer.js.map +1 -1
- package/Rendering/outlineRenderer.pure.js +6 -2
- package/Rendering/outlineRenderer.pure.js.map +1 -1
- package/Rendering/prePassRenderer.pure.js +3 -3
- package/Rendering/prePassRenderer.pure.js.map +1 -1
- package/Rendering/renderingManager.d.ts +1 -1
- package/Rendering/renderingManager.js +5 -4
- package/Rendering/renderingManager.js.map +1 -1
- package/Shaders/ShadersInclude/defaultFragmentAlpha.d.ts +5 -0
- package/Shaders/ShadersInclude/defaultFragmentAlpha.js +34 -0
- package/Shaders/ShadersInclude/defaultFragmentAlpha.js.map +1 -0
- package/Shaders/ShadersInclude/gaussianSplatting.js +3 -1
- package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
- package/Shaders/ShadersInclude/gaussianSplattingVertexDeclaration.js +5 -1
- package/Shaders/ShadersInclude/gaussianSplattingVertexDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/geometryRenderingFragment.d.ts +5 -0
- package/Shaders/ShadersInclude/geometryRenderingFragment.js +74 -0
- package/Shaders/ShadersInclude/geometryRenderingFragment.js.map +1 -0
- package/Shaders/ShadersInclude/lightsFragmentFunctions.js +27 -3
- package/Shaders/ShadersInclude/lightsFragmentFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/mrtFragmentDeclaration.js +89 -0
- package/Shaders/ShadersInclude/mrtFragmentDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/oitDeclaration.js +1 -1
- package/Shaders/ShadersInclude/oitDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrBlockPrePass.js +24 -17
- package/Shaders/ShadersInclude/openpbrBlockPrePass.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockPrePass.js +27 -20
- package/Shaders/ShadersInclude/pbrBlockPrePass.js.map +1 -1
- package/Shaders/ShadersInclude/pbrDebug.js +6 -2
- package/Shaders/ShadersInclude/pbrDebug.js.map +1 -1
- package/Shaders/ShadersInclude/prePassDeclaration.js +95 -2
- package/Shaders/ShadersInclude/prePassDeclaration.js.map +1 -1
- package/Shaders/default.fragment.js +31 -40
- package/Shaders/default.fragment.js.map +1 -1
- package/Shaders/depthOfField.fragment.js +13 -9
- package/Shaders/depthOfField.fragment.js.map +1 -1
- package/Shaders/fluidRenderingParticleDepth.vertex.js +16 -1
- package/Shaders/fluidRenderingParticleDepth.vertex.js.map +1 -1
- package/Shaders/fluidRenderingParticleThickness.vertex.js +16 -1
- package/Shaders/fluidRenderingParticleThickness.vertex.js.map +1 -1
- package/Shaders/gaussianSplatting.fragment.js +63 -3
- package/Shaders/gaussianSplatting.fragment.js.map +1 -1
- package/Shaders/gaussianSplatting.vertex.js +80 -0
- package/Shaders/gaussianSplatting.vertex.js.map +1 -1
- package/Shaders/geometry.fragment.js +17 -11
- package/Shaders/geometry.fragment.js.map +1 -1
- package/Shaders/gpuRenderParticles.fragment.js +43 -1
- package/Shaders/gpuRenderParticles.fragment.js.map +1 -1
- package/Shaders/gpuRenderParticles.vertex.js +96 -16
- package/Shaders/gpuRenderParticles.vertex.js.map +1 -1
- package/Shaders/meshBlending.fragment.d.ts +5 -0
- package/Shaders/meshBlending.fragment.js +519 -0
- package/Shaders/meshBlending.fragment.js.map +1 -0
- package/Shaders/minmaxRedux.fragment.js +6 -1
- package/Shaders/minmaxRedux.fragment.js.map +1 -1
- package/Shaders/particles.fragment.js +43 -1
- package/Shaders/particles.fragment.js.map +1 -1
- package/Shaders/particles.vertex.js +84 -3
- package/Shaders/particles.vertex.js.map +1 -1
- package/Shaders/sprites.fragment.js +52 -2
- package/Shaders/sprites.fragment.js.map +1 -1
- package/Shaders/sprites.vertex.js +62 -1
- package/Shaders/sprites.vertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/defaultFragmentAlpha.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/defaultFragmentAlpha.js +33 -0
- package/ShadersWGSL/ShadersInclude/defaultFragmentAlpha.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/gaussianPointSplatting.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/gaussianPointSplatting.js +65 -0
- package/ShadersWGSL/ShadersInclude/gaussianPointSplatting.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/gaussianPointSplattingScan.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/gaussianPointSplattingScan.js +17 -0
- package/ShadersWGSL/ShadersInclude/gaussianPointSplattingScan.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/gaussianSplatting.d.ts +1 -0
- package/ShadersWGSL/ShadersInclude/gaussianSplatting.js +6 -78
- package/ShadersWGSL/ShadersInclude/gaussianSplatting.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/gaussianSplattingFragmentDeclaration.js +2 -2
- package/ShadersWGSL/ShadersInclude/gaussianSplattingFragmentDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/gaussianSplattingShared.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/gaussianSplattingShared.js +79 -0
- package/ShadersWGSL/ShadersInclude/gaussianSplattingShared.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/geometryRenderingFragment.d.ts +6 -0
- package/ShadersWGSL/ShadersInclude/geometryRenderingFragment.js +76 -0
- package/ShadersWGSL/ShadersInclude/geometryRenderingFragment.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/lightFragment.js +1 -1
- package/ShadersWGSL/ShadersInclude/lightFragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js +27 -3
- package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/meshBlendTagFragmentOutput.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/meshBlendTagFragmentOutput.js +18 -0
- package/ShadersWGSL/ShadersInclude/meshBlendTagFragmentOutput.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.d.ts +1 -0
- package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.js +11 -25
- package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.d.ts +1 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js +11 -25
- package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrDebug.js +5 -1
- package/ShadersWGSL/ShadersInclude/pbrDebug.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/prePassDeclaration.js +6 -1
- package/ShadersWGSL/ShadersInclude/prePassDeclaration.js.map +1 -1
- package/ShadersWGSL/default.fragment.js +17 -48
- package/ShadersWGSL/default.fragment.js.map +1 -1
- package/ShadersWGSL/fluidRenderingParticleDepth.vertex.js +15 -2
- package/ShadersWGSL/fluidRenderingParticleDepth.vertex.js.map +1 -1
- package/ShadersWGSL/fluidRenderingParticleThickness.vertex.js +15 -2
- package/ShadersWGSL/fluidRenderingParticleThickness.vertex.js.map +1 -1
- package/ShadersWGSL/gaussianPointSplattingBlit.fragment.d.ts +5 -0
- package/ShadersWGSL/gaussianPointSplattingBlit.fragment.js +22 -0
- package/ShadersWGSL/gaussianPointSplattingBlit.fragment.js.map +1 -0
- package/ShadersWGSL/gaussianPointSplattingBlit.vertex.d.ts +5 -0
- package/ShadersWGSL/gaussianPointSplattingBlit.vertex.js +19 -0
- package/ShadersWGSL/gaussianPointSplattingBlit.vertex.js.map +1 -0
- package/ShadersWGSL/gaussianPointSplattingDepthBlit.fragment.d.ts +5 -0
- package/ShadersWGSL/gaussianPointSplattingDepthBlit.fragment.js +21 -0
- package/ShadersWGSL/gaussianPointSplattingDepthBlit.fragment.js.map +1 -0
- package/ShadersWGSL/gaussianSplatting.fragment.js +63 -2
- package/ShadersWGSL/gaussianSplatting.fragment.js.map +1 -1
- package/ShadersWGSL/gaussianSplatting.vertex.js +82 -1
- package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
- package/ShadersWGSL/gaussianSplattingDepth.vertex.js +2 -1
- package/ShadersWGSL/gaussianSplattingDepth.vertex.js.map +1 -1
- package/ShadersWGSL/gaussianSplattingVoxel.vertex.js +2 -1
- package/ShadersWGSL/gaussianSplattingVoxel.vertex.js.map +1 -1
- package/ShadersWGSL/geometry.fragment.js +37 -2
- package/ShadersWGSL/geometry.fragment.js.map +1 -1
- package/ShadersWGSL/gpsHiZBuild.compute.d.ts +5 -0
- package/ShadersWGSL/gpsHiZBuild.compute.js +16 -0
- package/ShadersWGSL/gpsHiZBuild.compute.js.map +1 -0
- package/ShadersWGSL/gpsPartition.compute.d.ts +5 -0
- package/ShadersWGSL/gpsPartition.compute.js +27 -0
- package/ShadersWGSL/gpsPartition.compute.js.map +1 -0
- package/ShadersWGSL/gpsPreprocess.compute.d.ts +5 -0
- package/ShadersWGSL/gpsPreprocess.compute.js +86 -0
- package/ShadersWGSL/gpsPreprocess.compute.js.map +1 -0
- package/ShadersWGSL/gpsResolve.compute.d.ts +5 -0
- package/ShadersWGSL/gpsResolve.compute.js +41 -0
- package/ShadersWGSL/gpsResolve.compute.js.map +1 -0
- package/ShadersWGSL/gpsScanAdd.compute.d.ts +5 -0
- package/ShadersWGSL/gpsScanAdd.compute.js +22 -0
- package/ShadersWGSL/gpsScanAdd.compute.js.map +1 -0
- package/ShadersWGSL/gpsScanBlocks.compute.d.ts +5 -0
- package/ShadersWGSL/gpsScanBlocks.compute.js +23 -0
- package/ShadersWGSL/gpsScanBlocks.compute.js.map +1 -0
- package/ShadersWGSL/gpsScanSums.compute.d.ts +5 -0
- package/ShadersWGSL/gpsScanSums.compute.js +30 -0
- package/ShadersWGSL/gpsScanSums.compute.js.map +1 -0
- package/ShadersWGSL/gpsSplat.compute.d.ts +5 -0
- package/ShadersWGSL/gpsSplat.compute.js +37 -0
- package/ShadersWGSL/gpsSplat.compute.js.map +1 -0
- package/ShadersWGSL/gpuRenderParticles.fragment.js +47 -2
- package/ShadersWGSL/gpuRenderParticles.fragment.js.map +1 -1
- package/ShadersWGSL/gpuRenderParticles.vertex.js +110 -7
- package/ShadersWGSL/gpuRenderParticles.vertex.js.map +1 -1
- package/ShadersWGSL/meshBlending.fragment.d.ts +5 -0
- package/ShadersWGSL/meshBlending.fragment.js +576 -0
- package/ShadersWGSL/meshBlending.fragment.js.map +1 -0
- package/ShadersWGSL/minmaxRedux.fragment.js +20 -3
- package/ShadersWGSL/minmaxRedux.fragment.js.map +1 -1
- package/ShadersWGSL/openpbr.fragment.js +2 -1
- package/ShadersWGSL/openpbr.fragment.js.map +1 -1
- package/ShadersWGSL/particles.fragment.js +45 -1
- package/ShadersWGSL/particles.fragment.js.map +1 -1
- package/ShadersWGSL/particles.vertex.js +86 -4
- package/ShadersWGSL/particles.vertex.js.map +1 -1
- package/ShadersWGSL/pbr.fragment.js +2 -1
- package/ShadersWGSL/pbr.fragment.js.map +1 -1
- package/ShadersWGSL/sprites.fragment.js +56 -2
- package/ShadersWGSL/sprites.fragment.js.map +1 -1
- package/ShadersWGSL/sprites.vertex.js +62 -1
- package/ShadersWGSL/sprites.vertex.js.map +1 -1
- package/Sprites/spriteManager.d.ts +13 -0
- package/Sprites/spriteManager.js +15 -0
- package/Sprites/spriteManager.js.map +1 -1
- package/Sprites/spriteRenderer.d.ts +24 -1
- package/Sprites/spriteRenderer.js +368 -50
- package/Sprites/spriteRenderer.js.map +1 -1
- package/Sprites/thinSprite.d.ts +4 -0
- package/Sprites/thinSprite.js +4 -0
- package/Sprites/thinSprite.js.map +1 -1
- package/States/alphaCullingState.d.ts +3 -1
- package/States/alphaCullingState.js +18 -3
- package/States/alphaCullingState.js.map +1 -1
- package/XR/features/WebXRSpaceWarp.pure.js +2 -1
- package/XR/features/WebXRSpaceWarp.pure.js.map +1 -1
- package/XR/webXRDefaultExperience.d.ts +5 -1
- package/XR/webXRDefaultExperience.js.map +1 -1
- package/XR/webXREnterExitUI.d.ts +2 -1
- package/XR/webXREnterExitUI.js.map +1 -1
- package/assetContainer.d.ts +1 -0
- package/assetContainer.js +5 -1
- package/assetContainer.js.map +1 -1
- package/package.json +1 -1
- package/scene.pure.d.ts +36 -2
- package/scene.pure.js +63 -4
- package/scene.pure.js.map +1 -1
|
@@ -0,0 +1,1212 @@
|
|
|
1
|
+
/** This file must only contain pure code and pure imports */
|
|
2
|
+
import { Scene } from "../../scene.pure.js";
|
|
3
|
+
import { Matrix, Quaternion } from "../../Maths/math.vector.pure.js";
|
|
4
|
+
import { Material } from "../../Materials/material.pure.js";
|
|
5
|
+
import { GaussianSplattingMaterial } from "../../Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js";
|
|
6
|
+
|
|
7
|
+
import { Mesh } from "../mesh.pure.js";
|
|
8
|
+
import { VertexData } from "../mesh.vertexData.js";
|
|
9
|
+
import { Logger } from "../../Misc/logger.js";
|
|
10
|
+
import { ToHalfFloat } from "../../Misc/textureTools.js";
|
|
11
|
+
import { GaussianPointSplattingRenderer, _GetPackedShBytesPerSplat, _HasGaussianPointSplattingProjectedDepth } from "./gaussianPointSplattingRenderer.pure.js";
|
|
12
|
+
import { GaussianPointSplattingBlitMaterial } from "../../Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.pure.js";
|
|
13
|
+
import { GaussianPointSplattingDepthBlitMaterial } from "../../Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.pure.js";
|
|
14
|
+
import { GaussianSplattingDebugMaterialPlugin } from "../../Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js";
|
|
15
|
+
import { GaussianSplattingSolidColorMaterialPlugin } from "../../Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.pure.js";
|
|
16
|
+
import { GaussianSplattingSizeMaterialPlugin } from "../../Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.pure.js";
|
|
17
|
+
import { GaussianSplattingOverdrawMaterialPlugin } from "../../Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.pure.js";
|
|
18
|
+
import { RegisterEnginesWebGPUExtensionsEngineComputeShader } from "../../Engines/WebGPU/Extensions/engine.computeShader.pure.js";
|
|
19
|
+
import { _SetGaussianPointSplattingControllerFactory, } from "./gaussianSplattingMesh.pure.js";
|
|
20
|
+
const _BytesPerSplat = 32;
|
|
21
|
+
// Loaded on demand to keep this module side-effect free; the wrapper imports them eagerly.
|
|
22
|
+
let _DependenciesReady = false;
|
|
23
|
+
let _DependenciesPromise = null;
|
|
24
|
+
let _DependenciesFailed = false;
|
|
25
|
+
async function _LoadDependenciesAsync() {
|
|
26
|
+
try {
|
|
27
|
+
await Promise.all([
|
|
28
|
+
import("../../ShadersWGSL/gpsPreprocess.compute.js"),
|
|
29
|
+
import("../../ShadersWGSL/gpsScanBlocks.compute.js"),
|
|
30
|
+
import("../../ShadersWGSL/gpsScanSums.compute.js"),
|
|
31
|
+
import("../../ShadersWGSL/gpsScanAdd.compute.js"),
|
|
32
|
+
import("../../ShadersWGSL/gpsPartition.compute.js"),
|
|
33
|
+
import("../../ShadersWGSL/gpsSplat.compute.js"),
|
|
34
|
+
import("../../ShadersWGSL/gpsResolve.compute.js"),
|
|
35
|
+
import("../../ShadersWGSL/gpsHiZBuild.compute.js"),
|
|
36
|
+
import("../../ShadersWGSL/gaussianPointSplattingBlit.vertex.js"),
|
|
37
|
+
import("../../ShadersWGSL/gaussianPointSplattingBlit.fragment.js"),
|
|
38
|
+
import("../../ShadersWGSL/gaussianPointSplattingDepthBlit.fragment.js"),
|
|
39
|
+
]);
|
|
40
|
+
_DependenciesReady = true;
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
_DependenciesFailed = true;
|
|
44
|
+
_DependenciesPromise = null;
|
|
45
|
+
Logger.Error(`GaussianSplattingMesh: failed to load point-splatting shaders: ${String(error)}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function _LoadDependencies() {
|
|
49
|
+
if (!_DependenciesReady && !_DependenciesPromise) {
|
|
50
|
+
_DependenciesFailed = false;
|
|
51
|
+
_DependenciesPromise = _LoadDependenciesAsync();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const _F32Scratch = /*#__PURE__*/ new Float32Array(1);
|
|
55
|
+
const _U32Scratch = /*#__PURE__*/ new Uint32Array(_F32Scratch.buffer);
|
|
56
|
+
/**
|
|
57
|
+
* Packs two floats as half-floats into one u32 (a in the low 16 bits).
|
|
58
|
+
* @param a value for the low 16 bits
|
|
59
|
+
* @param b value for the high 16 bits
|
|
60
|
+
* @returns the packed u32
|
|
61
|
+
*/
|
|
62
|
+
function _Pack2HalfFloat(a, b) {
|
|
63
|
+
return (ToHalfFloat(a) | (ToHalfFloat(b) << 16)) >>> 0;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Owns the WebGPU compute point-splatting path of one {@link GaussianSplattingMesh}: decode, dispatch,
|
|
67
|
+
* auto render scale, and the compositors that blit the result into the scene.
|
|
68
|
+
*
|
|
69
|
+
* The mesh never imports this module, so bundles without point splatting do not include it. It is enabled
|
|
70
|
+
* by {@link RegisterGaussianPointSplattingController}, which the side-effect wrapper calls.
|
|
71
|
+
*/
|
|
72
|
+
export class GaussianPointSplattingController {
|
|
73
|
+
/**
|
|
74
|
+
* Creates a point-splatting controller for a Gaussian Splatting mesh.
|
|
75
|
+
* @param mesh the mesh whose splat data this controller renders
|
|
76
|
+
*/
|
|
77
|
+
constructor(mesh) {
|
|
78
|
+
this._colorMode = false;
|
|
79
|
+
this._depthMode = false;
|
|
80
|
+
this._projectionClipRange = new Float64Array(2);
|
|
81
|
+
this._scale = 1;
|
|
82
|
+
this._renderScale = "auto";
|
|
83
|
+
this._occlusionCulling = false;
|
|
84
|
+
// Auto scale: N is measured once per generation, on a non-reset frame (the reset frame has no Hi-Z cull
|
|
85
|
+
// and over-counts), then frozen so a converged image never mixes two render scales.
|
|
86
|
+
this._autoN = 2;
|
|
87
|
+
this._autoMeasuredGeneration = -1;
|
|
88
|
+
this._lastRenderedGeneration = -1;
|
|
89
|
+
this._autoRequestId = 0;
|
|
90
|
+
this._budgetReadPending = false;
|
|
91
|
+
this._resultReady = false;
|
|
92
|
+
this._colorHistoryReady = false;
|
|
93
|
+
this._colorUsesCameraTransform = false;
|
|
94
|
+
this._cameraFrameId = -1;
|
|
95
|
+
this._cameraId = -1;
|
|
96
|
+
/** Whether the latest compute run succeeded; unlike `_resultReady`, not cleared at frame start. */
|
|
97
|
+
this._progressReady = false;
|
|
98
|
+
this._computedWidth = 0;
|
|
99
|
+
this._computedHeight = 0;
|
|
100
|
+
// Counters of the last dispatch, surfaced by `progress`.
|
|
101
|
+
this._progressFrameCount = 0;
|
|
102
|
+
this._progressGeneration = -1;
|
|
103
|
+
this._progressCycleLength = 0;
|
|
104
|
+
this._streamingWarned = false;
|
|
105
|
+
this._sourceWarned = false;
|
|
106
|
+
this._workloadWarned = false;
|
|
107
|
+
this._invalidProjectionWarned = false;
|
|
108
|
+
this._renderer = null;
|
|
109
|
+
this._blit = null;
|
|
110
|
+
this._blitMesh = null;
|
|
111
|
+
this._depthBlit = null;
|
|
112
|
+
this._depthBlitMesh = null;
|
|
113
|
+
this._computeObserver = null;
|
|
114
|
+
this._cameraObserver = null;
|
|
115
|
+
this._restoreObserver = null;
|
|
116
|
+
this._splatCount = 0;
|
|
117
|
+
this._partCount = 1;
|
|
118
|
+
this._decodedPartCount = 0;
|
|
119
|
+
this._decodedRevision = -1;
|
|
120
|
+
this._decodedShDegree = -1;
|
|
121
|
+
this._partLocalMin = new Float32Array(3);
|
|
122
|
+
this._partLocalMax = new Float32Array(3);
|
|
123
|
+
this._partScratch = new Float32Array(40);
|
|
124
|
+
this._decodedSplatsData = null;
|
|
125
|
+
this._vpMatrix = new Matrix();
|
|
126
|
+
this._cameraVpMatrix = new Matrix();
|
|
127
|
+
this._inverseProjection = new Matrix();
|
|
128
|
+
this._outputSize = { width: 1, height: 1 };
|
|
129
|
+
this._depthSpan = [0, 0];
|
|
130
|
+
this._mesh = mesh;
|
|
131
|
+
this._scene = mesh.getScene();
|
|
132
|
+
}
|
|
133
|
+
/** {@inheritDoc IGaussianPointSplattingController.colorRenderMode} */
|
|
134
|
+
get colorRenderMode() {
|
|
135
|
+
return this._colorMode;
|
|
136
|
+
}
|
|
137
|
+
set colorRenderMode(value) {
|
|
138
|
+
if (value === this._colorMode) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
if (value && !this._scene.getEngine().isWebGPU) {
|
|
142
|
+
Logger.Warn("GaussianSplattingMesh: point-splatting render mode requires a WebGPU engine; ignoring.");
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
this._colorMode = value;
|
|
146
|
+
if (!value) {
|
|
147
|
+
this._colorHistoryReady = false;
|
|
148
|
+
}
|
|
149
|
+
if (value) {
|
|
150
|
+
this._ensureCompute();
|
|
151
|
+
this._enableColorBlit();
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
this._blitMesh?.setEnabled(false);
|
|
155
|
+
this._releaseComputeIfIdle();
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
/** {@inheritDoc IGaussianPointSplattingController.depthRenderMode} */
|
|
159
|
+
get depthRenderMode() {
|
|
160
|
+
return this._depthMode;
|
|
161
|
+
}
|
|
162
|
+
set depthRenderMode(value) {
|
|
163
|
+
if (value === this._depthMode) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
if (value && !this._scene.getEngine().isWebGPU) {
|
|
167
|
+
Logger.Warn("GaussianSplattingMesh: point-splatting depth render mode requires a WebGPU engine; ignoring.");
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
this._depthMode = value;
|
|
171
|
+
if (value) {
|
|
172
|
+
this._ensureCompute();
|
|
173
|
+
this._enableDepthBlit();
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
this._depthBlitMesh?.setEnabled(false);
|
|
177
|
+
this._releaseComputeIfIdle();
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
/** {@inheritDoc IGaussianPointSplattingController.progress} */
|
|
181
|
+
get progress() {
|
|
182
|
+
if (!this._computeActive || !this._progressReady || !this._renderer) {
|
|
183
|
+
return null;
|
|
184
|
+
}
|
|
185
|
+
return {
|
|
186
|
+
renderedFrameCount: this._progressFrameCount,
|
|
187
|
+
accumulationVersion: this._progressGeneration,
|
|
188
|
+
pixelCycleLength: this._progressCycleLength,
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
/** True while either point-splatting mode is on, i.e. while the shared compute must run. */
|
|
192
|
+
get _computeActive() {
|
|
193
|
+
return (this._colorMode || this._depthMode) && !_DependenciesFailed && !this._mesh._pointStreamingUnsupported && !this._hasUnsupportedSource;
|
|
194
|
+
}
|
|
195
|
+
/** GPU-only SOG and standalone streams have no retained splats for the compute decoder. */
|
|
196
|
+
get _hasUnsupportedSource() {
|
|
197
|
+
return this._mesh.useSog || (!this._mesh._splatsData && this._mesh.getTotalVertices() > 0);
|
|
198
|
+
}
|
|
199
|
+
/** {@inheritDoc IGaussianPointSplattingController.pointScale} */
|
|
200
|
+
get pointScale() {
|
|
201
|
+
return this._scale;
|
|
202
|
+
}
|
|
203
|
+
set pointScale(value) {
|
|
204
|
+
if (value === this._scale) {
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
this._scale = value;
|
|
208
|
+
if (this._renderer) {
|
|
209
|
+
this._renderer.pointScale = value;
|
|
210
|
+
this._renderer.resetAccumulation();
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
/** {@inheritDoc IGaussianPointSplattingController.occlusionCulling} */
|
|
214
|
+
get occlusionCulling() {
|
|
215
|
+
return this._occlusionCulling;
|
|
216
|
+
}
|
|
217
|
+
set occlusionCulling(value) {
|
|
218
|
+
if (value === this._occlusionCulling) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
this._occlusionCulling = value;
|
|
222
|
+
if (this._renderer) {
|
|
223
|
+
this._renderer.occlusionCulling = value;
|
|
224
|
+
this._renderer.resetAccumulation();
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
/** Lazily builds the compute shared by the color and depth modes. Idempotent. */
|
|
228
|
+
_ensureCompute() {
|
|
229
|
+
const engine = this._scene.getEngine();
|
|
230
|
+
_LoadDependencies();
|
|
231
|
+
if (!this._renderer) {
|
|
232
|
+
// ComputeShader creates its compute context on construction, so the engine extension goes first.
|
|
233
|
+
RegisterEnginesWebGPUExtensionsEngineComputeShader();
|
|
234
|
+
this._renderer = new GaussianPointSplattingRenderer(engine);
|
|
235
|
+
this._renderer.pointScale = this._scale;
|
|
236
|
+
this._renderer.occlusionCulling = this._occlusionCulling;
|
|
237
|
+
this._decodedSplatsData = null;
|
|
238
|
+
}
|
|
239
|
+
if (!this._mesh._pointStreamingUnsupported && !this._hasUnsupportedSource && this._isWorkloadSupported()) {
|
|
240
|
+
this._syncData();
|
|
241
|
+
}
|
|
242
|
+
if (!this._computeObserver) {
|
|
243
|
+
this._computeObserver = this._scene.onBeforeRenderObservable.add(() => {
|
|
244
|
+
this._resultReady = false;
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
if (!this._cameraObserver) {
|
|
248
|
+
this._cameraObserver = this._scene.onBeforeCameraRenderObservable.add((camera) => {
|
|
249
|
+
this._cameraFrameId = this._scene.getFrameId();
|
|
250
|
+
this._cameraId = camera.uniqueId;
|
|
251
|
+
this._cameraVpMatrix.copyFrom(this._scene.getTransformMatrix());
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
if (!this._restoreObserver) {
|
|
255
|
+
this._restoreObserver = engine.onContextRestoredObservable.add(() => {
|
|
256
|
+
// Rebuilt storage buffers are empty, including the image sentinel and cached splat uploads.
|
|
257
|
+
this._releaseComputeResources();
|
|
258
|
+
this._releaseBlitResources();
|
|
259
|
+
this._ensureCompute();
|
|
260
|
+
if (this._colorMode) {
|
|
261
|
+
this._enableColorBlit();
|
|
262
|
+
}
|
|
263
|
+
if (this._depthMode) {
|
|
264
|
+
this._enableDepthBlit();
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
/** Tears down the shared compute once neither point-splatting mode needs it anymore. */
|
|
270
|
+
_releaseComputeIfIdle() {
|
|
271
|
+
if (this._colorMode || this._depthMode) {
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
if (this._computeObserver) {
|
|
275
|
+
this._scene.onBeforeRenderObservable.remove(this._computeObserver);
|
|
276
|
+
this._computeObserver = null;
|
|
277
|
+
}
|
|
278
|
+
if (this._cameraObserver) {
|
|
279
|
+
this._scene.onBeforeCameraRenderObservable.remove(this._cameraObserver);
|
|
280
|
+
this._cameraObserver = null;
|
|
281
|
+
}
|
|
282
|
+
if (this._restoreObserver) {
|
|
283
|
+
this._scene.getEngine().onContextRestoredObservable.remove(this._restoreObserver);
|
|
284
|
+
this._restoreObserver = null;
|
|
285
|
+
}
|
|
286
|
+
this._releaseComputeResources();
|
|
287
|
+
}
|
|
288
|
+
_releaseComputeResources() {
|
|
289
|
+
this._autoRequestId++;
|
|
290
|
+
this._renderer?.dispose();
|
|
291
|
+
this._renderer = null;
|
|
292
|
+
this._decodedSplatsData = null;
|
|
293
|
+
this._resultReady = false;
|
|
294
|
+
this._colorHistoryReady = false;
|
|
295
|
+
this._cameraFrameId = -1;
|
|
296
|
+
this._progressReady = false;
|
|
297
|
+
this._budgetReadPending = false;
|
|
298
|
+
this._autoN = 2;
|
|
299
|
+
this._autoMeasuredGeneration = -1;
|
|
300
|
+
this._lastRenderedGeneration = -1;
|
|
301
|
+
}
|
|
302
|
+
_releaseBlitResources() {
|
|
303
|
+
this._blit?.dispose();
|
|
304
|
+
this._blitMesh?.dispose();
|
|
305
|
+
this._depthBlit?.dispose();
|
|
306
|
+
this._depthBlitMesh?.dispose();
|
|
307
|
+
this._blit = null;
|
|
308
|
+
this._blitMesh = null;
|
|
309
|
+
this._depthBlit = null;
|
|
310
|
+
this._depthBlitMesh = null;
|
|
311
|
+
}
|
|
312
|
+
/** Builds a fullscreen compositor triangle. It is disabled and drawn manually, so its clip-space
|
|
313
|
+
* geometry never leaks into other geometry passes.
|
|
314
|
+
* @param name the compositor mesh name
|
|
315
|
+
* @param material the blit material to render it with
|
|
316
|
+
* @returns the created compositor mesh
|
|
317
|
+
*/
|
|
318
|
+
_createBlitMesh(name, material) {
|
|
319
|
+
const blitMesh = new Mesh(name, this._scene);
|
|
320
|
+
const vd = new VertexData();
|
|
321
|
+
vd.positions = [-1, -1, 0, 3, -1, 0, -1, 3, 0];
|
|
322
|
+
vd.indices = [0, 1, 2];
|
|
323
|
+
vd.applyToMesh(blitMesh);
|
|
324
|
+
blitMesh.material = material;
|
|
325
|
+
blitMesh.doNotSerialize = true;
|
|
326
|
+
blitMesh.isPickable = false;
|
|
327
|
+
blitMesh.doNotSyncBoundingInfo = true;
|
|
328
|
+
blitMesh.setEnabled(false);
|
|
329
|
+
blitMesh.reservedDataStore = { hidden: true };
|
|
330
|
+
blitMesh.computeWorldMatrix(true);
|
|
331
|
+
return blitMesh;
|
|
332
|
+
}
|
|
333
|
+
/** Lazily builds the color compositor. */
|
|
334
|
+
_enableColorBlit() {
|
|
335
|
+
if (!this._blit) {
|
|
336
|
+
this._blit = new GaussianPointSplattingBlitMaterial(this._mesh.name + "_blit", this._scene);
|
|
337
|
+
// Internal compositor bound to storage buffers, which cannot round-trip through serialization.
|
|
338
|
+
this._blit.doNotSerialize = true;
|
|
339
|
+
}
|
|
340
|
+
if (!this._blitMesh) {
|
|
341
|
+
this._blitMesh = this._createBlitMesh(this._mesh.name + "_blitMesh", this._blit);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
/** Lazily builds the depth compositor. */
|
|
345
|
+
_enableDepthBlit() {
|
|
346
|
+
if (!this._depthBlit) {
|
|
347
|
+
this._depthBlit = new GaussianPointSplattingDepthBlitMaterial(this._mesh.name + "_depthBlit", this._scene);
|
|
348
|
+
// Internal compositor bound to storage buffers, which cannot round-trip through serialization.
|
|
349
|
+
this._depthBlit.doNotSerialize = true;
|
|
350
|
+
}
|
|
351
|
+
if (!this._depthBlitMesh) {
|
|
352
|
+
this._depthBlitMesh = this._createBlitMesh(this._mesh.name + "_depthBlitMesh", this._depthBlit);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* Checks the mesh's current data and output size against the device buffer limits, before anything is
|
|
357
|
+
* decoded or allocated. Warns once when they do not fit.
|
|
358
|
+
* @returns whether the workload fits
|
|
359
|
+
*/
|
|
360
|
+
_isWorkloadSupported() {
|
|
361
|
+
const data = this._mesh._splatsData;
|
|
362
|
+
const count = data ? (data.byteLength / _BytesPerSplat) | 0 : 0;
|
|
363
|
+
const shDegree = this._mesh._shData?.length ? this._mesh._shDegree : 0;
|
|
364
|
+
const { width, height } = this._getOutputSize();
|
|
365
|
+
if (this._renderer.supportsWorkload(count, shDegree, width, height)) {
|
|
366
|
+
return true;
|
|
367
|
+
}
|
|
368
|
+
if (!this._workloadWarned) {
|
|
369
|
+
this._workloadWarned = true;
|
|
370
|
+
Logger.Warn(`GaussianSplattingMesh: point splatting needs storage buffers larger than this device allows (${count} splats at ${width}x${height}); falling back to the classic renderer.`);
|
|
371
|
+
}
|
|
372
|
+
return false;
|
|
373
|
+
}
|
|
374
|
+
/** Re-decodes the splat data if it changed since the last decode. */
|
|
375
|
+
_syncData() {
|
|
376
|
+
// A partially filled atlas would decode unfinished entries as opaque splats at the origin.
|
|
377
|
+
if (this._mesh._splatDataPending) {
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
const data = this._mesh._splatsData;
|
|
381
|
+
const vc = data ? (data.byteLength / _BytesPerSplat) | 0 : 0;
|
|
382
|
+
const pc = this._mesh.isCompound ? this._mesh.partCount : 1;
|
|
383
|
+
const revision = this._mesh._splatDataRevision;
|
|
384
|
+
const shDegree = this._mesh._shDegree;
|
|
385
|
+
if (data === this._decodedSplatsData &&
|
|
386
|
+
vc === this._splatCount &&
|
|
387
|
+
pc === this._decodedPartCount &&
|
|
388
|
+
revision === this._decodedRevision &&
|
|
389
|
+
shDegree === this._decodedShDegree) {
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
this._decodedSplatsData = data;
|
|
393
|
+
this._decodedPartCount = pc;
|
|
394
|
+
this._decodedRevision = revision;
|
|
395
|
+
this._decodedShDegree = shDegree;
|
|
396
|
+
if (!data || vc === 0) {
|
|
397
|
+
this._splatCount = 0;
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
this._decode(data);
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Decodes raw `.splat` bytes into local-space per-Gaussian buffers. Mirrors the classic `_makeSplat`,
|
|
404
|
+
* including the `* 2` on the scale, which `gpsPreprocess` cancels on the projected covariance.
|
|
405
|
+
* @param splatsData raw `.splat` bytes for this mesh's splats
|
|
406
|
+
*/
|
|
407
|
+
_decode(splatsData) {
|
|
408
|
+
const bytes = new Uint8Array(splatsData);
|
|
409
|
+
const floats = new Float32Array(splatsData);
|
|
410
|
+
const count = (bytes.length / _BytesPerSplat) | 0;
|
|
411
|
+
const inputs = this._mesh._getPointDecodeInputs();
|
|
412
|
+
const positions = inputs.positions;
|
|
413
|
+
const flipY = inputs.flipY ? -1 : 1;
|
|
414
|
+
const partIndices = this._mesh.isCompound ? inputs.partIndices : null;
|
|
415
|
+
let partCount = this._mesh.isCompound ? this._mesh.partCount : 1;
|
|
416
|
+
if (partIndices) {
|
|
417
|
+
for (let i = 0; i < count; i++) {
|
|
418
|
+
if (partIndices[i] + 1 > partCount) {
|
|
419
|
+
partCount = partIndices[i] + 1;
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
const means = new Float32Array(count * 4);
|
|
424
|
+
const cov3d = new Uint32Array(count * 4);
|
|
425
|
+
const colorOpacity = new Uint32Array(count);
|
|
426
|
+
const sh = this._packSh(this._mesh._shData ?? undefined, this._mesh._shDegree, count);
|
|
427
|
+
const quaternion = new Quaternion();
|
|
428
|
+
const rotation = new Matrix();
|
|
429
|
+
const scale = new Matrix();
|
|
430
|
+
const rs = new Matrix();
|
|
431
|
+
const pMin = new Float32Array(partCount * 3).fill(Infinity);
|
|
432
|
+
const pMax = new Float32Array(partCount * 3).fill(-Infinity);
|
|
433
|
+
const activeRanges = inputs.activeRanges;
|
|
434
|
+
const activeMask = activeRanges ? new Uint8Array(count) : null;
|
|
435
|
+
if (activeRanges && activeMask) {
|
|
436
|
+
for (let r = 0; r < activeRanges.length; r += 2) {
|
|
437
|
+
activeMask.fill(1, activeRanges[r], Math.min(count, activeRanges[r] + activeRanges[r + 1]));
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
for (let i = 0; i < count; i++) {
|
|
441
|
+
const active = !activeMask || activeMask[i] !== 0;
|
|
442
|
+
// Appended parts may use a different Y convention from the mesh's original updateData.
|
|
443
|
+
const mx = positions ? positions[4 * i] : floats[8 * i];
|
|
444
|
+
const my = positions ? positions[4 * i + 1] : floats[8 * i + 1] * flipY;
|
|
445
|
+
const mz = positions ? positions[4 * i + 2] : floats[8 * i + 2];
|
|
446
|
+
const qb = _BytesPerSplat * i + 28;
|
|
447
|
+
quaternion.set((bytes[qb + 1] - 127.5) / 127.5, (bytes[qb + 2] - 127.5) / 127.5, (bytes[qb + 3] - 127.5) / 127.5, -(bytes[qb + 0] - 127.5) / 127.5);
|
|
448
|
+
quaternion.normalize();
|
|
449
|
+
quaternion.toRotationMatrix(rotation);
|
|
450
|
+
Matrix.ScalingToRef(floats[8 * i + 3] * 2, floats[8 * i + 4] * 2, floats[8 * i + 5] * 2, scale);
|
|
451
|
+
rotation.multiplyToRef(scale, rs);
|
|
452
|
+
const m = rs.m;
|
|
453
|
+
const part = partIndices ? partIndices[i] : 0;
|
|
454
|
+
means[4 * i + 0] = mx;
|
|
455
|
+
means[4 * i + 1] = my;
|
|
456
|
+
means[4 * i + 2] = mz;
|
|
457
|
+
means[4 * i + 3] = part;
|
|
458
|
+
const b = part * 3;
|
|
459
|
+
if (active && mx < pMin[b]) {
|
|
460
|
+
pMin[b] = mx;
|
|
461
|
+
}
|
|
462
|
+
if (active && my < pMin[b + 1]) {
|
|
463
|
+
pMin[b + 1] = my;
|
|
464
|
+
}
|
|
465
|
+
if (active && mz < pMin[b + 2]) {
|
|
466
|
+
pMin[b + 2] = mz;
|
|
467
|
+
}
|
|
468
|
+
if (active && mx > pMax[b]) {
|
|
469
|
+
pMax[b] = mx;
|
|
470
|
+
}
|
|
471
|
+
if (active && my > pMax[b + 1]) {
|
|
472
|
+
pMax[b + 1] = my;
|
|
473
|
+
}
|
|
474
|
+
if (active && mz > pMax[b + 2]) {
|
|
475
|
+
pMax[b + 2] = mz;
|
|
476
|
+
}
|
|
477
|
+
// Sigma = (R*S)(R*S)^T, stored as f16 divided by max|component| to keep precision at any scale.
|
|
478
|
+
const s00 = m[0] * m[0] + m[1] * m[1] + m[2] * m[2];
|
|
479
|
+
const s01 = m[0] * m[4] + m[1] * m[5] + m[2] * m[6];
|
|
480
|
+
const s02 = m[0] * m[8] + m[1] * m[9] + m[2] * m[10];
|
|
481
|
+
const s11 = m[4] * m[4] + m[5] * m[5] + m[6] * m[6];
|
|
482
|
+
const s12 = m[4] * m[8] + m[5] * m[9] + m[6] * m[10];
|
|
483
|
+
const s22 = m[8] * m[8] + m[9] * m[9] + m[10] * m[10];
|
|
484
|
+
let factor = Math.max(Math.abs(s00), Math.abs(s01), Math.abs(s02), Math.abs(s11), Math.abs(s12), Math.abs(s22));
|
|
485
|
+
if (!(factor > 0)) {
|
|
486
|
+
factor = 1;
|
|
487
|
+
}
|
|
488
|
+
const inv = 1 / factor;
|
|
489
|
+
cov3d[4 * i + 0] = _Pack2HalfFloat(s00 * inv, s01 * inv);
|
|
490
|
+
cov3d[4 * i + 1] = _Pack2HalfFloat(s02 * inv, s11 * inv);
|
|
491
|
+
cov3d[4 * i + 2] = _Pack2HalfFloat(s12 * inv, s22 * inv);
|
|
492
|
+
_F32Scratch[0] = factor;
|
|
493
|
+
cov3d[4 * i + 3] = _U32Scratch[0];
|
|
494
|
+
const cb = _BytesPerSplat * i + 24;
|
|
495
|
+
colorOpacity[i] = bytes[cb] | (bytes[cb + 1] << 8) | (bytes[cb + 2] << 16) | ((active ? bytes[cb + 3] : 0) << 24);
|
|
496
|
+
}
|
|
497
|
+
this._splatCount = count;
|
|
498
|
+
this._partCount = partCount;
|
|
499
|
+
this._partLocalMin = pMin;
|
|
500
|
+
this._partLocalMax = pMax;
|
|
501
|
+
if (this._partScratch.length !== partCount * 40) {
|
|
502
|
+
this._partScratch = new Float32Array(partCount * 40);
|
|
503
|
+
}
|
|
504
|
+
this._renderer.updateSplats(means, cov3d, colorOpacity, sh, this._mesh._shDegree, count);
|
|
505
|
+
}
|
|
506
|
+
/**
|
|
507
|
+
* Packs the loader's 8-bit SH bytes into u32 words per splat.
|
|
508
|
+
* @param shData packed per-splat SH textures, one per 16 scalar components, or undefined
|
|
509
|
+
* @param shDegree spherical-harmonics degree (0-4)
|
|
510
|
+
* @param count number of splats
|
|
511
|
+
* @returns u32-packed SH bytes, or null when SH is absent
|
|
512
|
+
*/
|
|
513
|
+
_packSh(shData, shDegree, count) {
|
|
514
|
+
if (!shData || shData.length === 0 || shDegree < 1) {
|
|
515
|
+
return null;
|
|
516
|
+
}
|
|
517
|
+
const stride = _GetPackedShBytesPerSplat(shDegree);
|
|
518
|
+
const scalars = (shDegree === 1 ? 3 : shDegree === 2 ? 8 : shDegree === 3 ? 15 : 24) * 3;
|
|
519
|
+
const bytes = new Uint8Array(count * stride);
|
|
520
|
+
for (let i = 0; i < count; i++) {
|
|
521
|
+
const dst = i * stride;
|
|
522
|
+
for (let k = 0; k < scalars; k++) {
|
|
523
|
+
const tex = shData[(k / 16) | 0];
|
|
524
|
+
bytes[dst + k] = tex[i * 16 + (k % 16)];
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
return new Uint32Array(bytes.buffer);
|
|
528
|
+
}
|
|
529
|
+
/** Uploads this frame's per-part world matrix, visibility and debug-plugin rows. */
|
|
530
|
+
_uploadParts() {
|
|
531
|
+
this._renderer.debugActive = this._packParts() ? 1 : 0;
|
|
532
|
+
this._renderer.setPartData(this._partScratch, this._partCount);
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* Packs current part inputs without changing the renderer's accumulation or dispatch buffers.
|
|
536
|
+
* @returns whether the debug plugin is active
|
|
537
|
+
*/
|
|
538
|
+
_packParts() {
|
|
539
|
+
const count = this._partCount;
|
|
540
|
+
if (this._partScratch.length !== count * 40) {
|
|
541
|
+
this._partScratch = new Float32Array(count * 40);
|
|
542
|
+
}
|
|
543
|
+
const scratch = this._partScratch;
|
|
544
|
+
const compound = this._mesh.isCompound;
|
|
545
|
+
// Runs before the scene evaluates world matrices, so transforms changed this frame must be forced.
|
|
546
|
+
const meshWorld = this._mesh.computeWorldMatrix(true);
|
|
547
|
+
if (compound) {
|
|
548
|
+
this._mesh._syncPartProxyWorldMatrices();
|
|
549
|
+
}
|
|
550
|
+
// The classic material multiplies every splat's opacity by material.alpha.
|
|
551
|
+
const alpha = this._mesh.material?.alpha ?? 1;
|
|
552
|
+
const plugin = this._mesh.material?.pluginManager?.getPlugin("GaussianSplattingDebug");
|
|
553
|
+
const pluginType = plugin?.constructor;
|
|
554
|
+
const debugActive = plugin instanceof GaussianSplattingDebugMaterialPlugin && pluginType === GaussianSplattingDebugMaterialPlugin && plugin.isDebugActive;
|
|
555
|
+
let lut = null;
|
|
556
|
+
let lutStride = 0;
|
|
557
|
+
if (plugin && debugActive) {
|
|
558
|
+
const resolved = plugin.getResolvedPartData(count, this._scene.getEngine());
|
|
559
|
+
lut = resolved.data;
|
|
560
|
+
lutStride = resolved.maxPartCount;
|
|
561
|
+
}
|
|
562
|
+
for (let i = 0; i < count; i++) {
|
|
563
|
+
const worldM = (compound ? this._mesh.getWorldMatrixForPart(i) : meshWorld).m;
|
|
564
|
+
const vis = compound ? this._mesh.getPartVisibility(i) : this._mesh.visibility;
|
|
565
|
+
const o = i * 40;
|
|
566
|
+
scratch.set(worldM, o);
|
|
567
|
+
scratch[o + 16] = vis * alpha;
|
|
568
|
+
scratch[o + 17] = 0;
|
|
569
|
+
scratch[o + 18] = 0;
|
|
570
|
+
scratch[o + 19] = 0;
|
|
571
|
+
// The LUT is row-major: row r, part i at (stride*r + i)*4.
|
|
572
|
+
if (lut) {
|
|
573
|
+
for (let r = 0; r < 5; r++) {
|
|
574
|
+
const src = (lutStride * r + i) * 4;
|
|
575
|
+
const dst = o + 20 + r * 4;
|
|
576
|
+
scratch[dst] = lut[src];
|
|
577
|
+
scratch[dst + 1] = lut[src + 1];
|
|
578
|
+
scratch[dst + 2] = lut[src + 2];
|
|
579
|
+
scratch[dst + 3] = lut[src + 3];
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
else {
|
|
583
|
+
scratch[o + 20] = -1e9;
|
|
584
|
+
scratch[o + 21] = -1e9;
|
|
585
|
+
scratch[o + 22] = -1e9;
|
|
586
|
+
scratch[o + 23] = 1e9;
|
|
587
|
+
scratch[o + 24] = 1e9;
|
|
588
|
+
scratch[o + 25] = 1e9;
|
|
589
|
+
scratch[o + 26] = 0;
|
|
590
|
+
scratch[o + 27] = 1;
|
|
591
|
+
scratch[o + 28] = 0;
|
|
592
|
+
scratch[o + 29] = 1e9;
|
|
593
|
+
scratch[o + 30] = 1;
|
|
594
|
+
scratch[o + 31] = 0;
|
|
595
|
+
scratch[o + 32] = 1;
|
|
596
|
+
scratch[o + 33] = 1;
|
|
597
|
+
scratch[o + 34] = 1;
|
|
598
|
+
scratch[o + 35] = 1;
|
|
599
|
+
scratch[o + 36] = 1;
|
|
600
|
+
scratch[o + 37] = 0;
|
|
601
|
+
scratch[o + 38] = 0;
|
|
602
|
+
scratch[o + 39] = 0;
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
return debugActive;
|
|
606
|
+
}
|
|
607
|
+
/**
|
|
608
|
+
* Protects point-color history from pass-specific inputs while allowing shared camera motion.
|
|
609
|
+
* @returns whether depth can share the current color inputs without a pass-specific accumulation reset
|
|
610
|
+
*/
|
|
611
|
+
_depthInputsMatchColorHistory() {
|
|
612
|
+
const renderer = this._renderer;
|
|
613
|
+
if (!this._colorHistoryReady || !renderer) {
|
|
614
|
+
return true;
|
|
615
|
+
}
|
|
616
|
+
const material = this._mesh.material;
|
|
617
|
+
// Camera motion advances both passes; only custom color matrices must match the retained frame.
|
|
618
|
+
const colorTransform = this._colorUsesCameraTransform ? this._getCameraTransform() : this._vpMatrix;
|
|
619
|
+
if (this._decodedSplatsData !== this._mesh._splatsData ||
|
|
620
|
+
this._decodedRevision !== this._mesh._splatDataRevision ||
|
|
621
|
+
this._decodedShDegree !== this._mesh._shDegree ||
|
|
622
|
+
!colorTransform?.equalsWithEpsilon(this._scene.getTransformMatrix(), 1e-5) ||
|
|
623
|
+
renderer.kernelSize !== (material.kernelSize || GaussianSplattingMaterial.KernelSize) ||
|
|
624
|
+
renderer.minPixelSize !== material.minPixelSize ||
|
|
625
|
+
renderer.compensation !== material.compensation) {
|
|
626
|
+
return false;
|
|
627
|
+
}
|
|
628
|
+
const debugActive = this._packParts() ? 1 : 0;
|
|
629
|
+
return renderer.debugActive === debugActive && renderer._matchesPartData(this._partScratch, this._partCount);
|
|
630
|
+
}
|
|
631
|
+
/**
|
|
632
|
+
* Uses the scene's main camera matrix before render targets can refresh the camera's projection cache.
|
|
633
|
+
* @returns the current camera transform, or null if a different camera owns the render target
|
|
634
|
+
*/
|
|
635
|
+
_getCameraTransform() {
|
|
636
|
+
if (this._cameraFrameId === this._scene.getFrameId()) {
|
|
637
|
+
return this._cameraId === this._scene.activeCamera?.uniqueId ? this._cameraVpMatrix : null;
|
|
638
|
+
}
|
|
639
|
+
return this._scene.activeCamera?.getTransformationMatrix() ?? null;
|
|
640
|
+
}
|
|
641
|
+
/**
|
|
642
|
+
* Reads the forward clipping interval of a projection whose depth is independent of x/y.
|
|
643
|
+
* @param projection the supplied projection matrix
|
|
644
|
+
* @returns the reused near/far interval (zero far means infinite), or null for unsupported intervals
|
|
645
|
+
*/
|
|
646
|
+
_getProjectionClipRange(projection) {
|
|
647
|
+
const engine = this._scene.getEngine();
|
|
648
|
+
const m = projection.m;
|
|
649
|
+
const nearDepth = engine.useReverseDepthBuffer ? 1 : engine.isNDCHalfZRange ? 0 : -1;
|
|
650
|
+
const farDepth = engine.useReverseDepthBuffer ? (engine.isNDCHalfZRange ? 0 : -1) : 1;
|
|
651
|
+
const sign = this._scene.useRightHandedSystem ? -1 : 1;
|
|
652
|
+
const near = (sign * (m[14] - nearDepth * m[15])) / (nearDepth * m[11] - m[10]);
|
|
653
|
+
const farDenominator = farDepth * m[11] - m[10];
|
|
654
|
+
const far = farDenominator === 0 ? Infinity : (sign * (m[14] - farDepth * m[15])) / farDenominator;
|
|
655
|
+
if (!Number.isFinite(near) || !(far > near) || !(far > 0)) {
|
|
656
|
+
return null;
|
|
657
|
+
}
|
|
658
|
+
this._projectionClipRange[0] = near;
|
|
659
|
+
this._projectionClipRange[1] = far === Infinity ? 0 : far;
|
|
660
|
+
return this._projectionClipRange;
|
|
661
|
+
}
|
|
662
|
+
/**
|
|
663
|
+
* Computes the model's view-depth span from its part AABB corners.
|
|
664
|
+
* @param viewM column-major view matrix
|
|
665
|
+
* @param near camera near plane
|
|
666
|
+
* @param far camera far plane; 0 means infinite
|
|
667
|
+
* @param clampToCamera whether to clamp the interval to the standard camera near/far planes
|
|
668
|
+
* @returns the model's [viewZMin, viewZMax] this frame
|
|
669
|
+
*/
|
|
670
|
+
_viewZSpan(viewM, near, far, clampToCamera = true) {
|
|
671
|
+
let vzMin = Infinity;
|
|
672
|
+
let vzMax = -Infinity;
|
|
673
|
+
const scratch = this._partScratch;
|
|
674
|
+
for (let p = 0; p < this._partCount; p++) {
|
|
675
|
+
const wb = p * 40;
|
|
676
|
+
const lb = p * 3;
|
|
677
|
+
const minx = this._partLocalMin[lb];
|
|
678
|
+
if (!isFinite(minx)) {
|
|
679
|
+
continue;
|
|
680
|
+
}
|
|
681
|
+
const miny = this._partLocalMin[lb + 1];
|
|
682
|
+
const minz = this._partLocalMin[lb + 2];
|
|
683
|
+
const maxx = this._partLocalMax[lb];
|
|
684
|
+
const maxy = this._partLocalMax[lb + 1];
|
|
685
|
+
const maxz = this._partLocalMax[lb + 2];
|
|
686
|
+
for (let c = 0; c < 8; c++) {
|
|
687
|
+
const lx = c & 1 ? maxx : minx;
|
|
688
|
+
const ly = c & 2 ? maxy : miny;
|
|
689
|
+
const lz = c & 4 ? maxz : minz;
|
|
690
|
+
const wx = scratch[wb + 0] * lx + scratch[wb + 4] * ly + scratch[wb + 8] * lz + scratch[wb + 12];
|
|
691
|
+
const wy = scratch[wb + 1] * lx + scratch[wb + 5] * ly + scratch[wb + 9] * lz + scratch[wb + 13];
|
|
692
|
+
const wz = scratch[wb + 2] * lx + scratch[wb + 6] * ly + scratch[wb + 10] * lz + scratch[wb + 14];
|
|
693
|
+
// View-space forward depth is positive for both handedness conventions.
|
|
694
|
+
const viewZ = viewM[2] * wx + viewM[6] * wy + viewM[10] * wz + viewM[14];
|
|
695
|
+
const vz = this._scene.useRightHandedSystem ? -viewZ : viewZ;
|
|
696
|
+
if (vz < vzMin) {
|
|
697
|
+
vzMin = vz;
|
|
698
|
+
}
|
|
699
|
+
if (vz > vzMax) {
|
|
700
|
+
vzMax = vz;
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
const minClip = clampToCamera ? near : -Infinity;
|
|
705
|
+
const maxClip = clampToCamera && far > 0 ? far : Infinity;
|
|
706
|
+
vzMin = Math.max(minClip, vzMin);
|
|
707
|
+
vzMax = Math.min(maxClip, vzMax);
|
|
708
|
+
if (!isFinite(vzMin) || vzMax < vzMin) {
|
|
709
|
+
// Nothing visible; any finite span works.
|
|
710
|
+
this._depthSpan[0] = near;
|
|
711
|
+
this._depthSpan[1] = far > near ? far : near + 1;
|
|
712
|
+
}
|
|
713
|
+
else if (vzMax === vzMin) {
|
|
714
|
+
// Flat or single-splat model: widen a band around the actual depth. Collapsing to [near, ...]
|
|
715
|
+
// instead would place the surface at the near plane and break the depth test and depth map.
|
|
716
|
+
const epsilon = Math.max(Math.abs(vzMin) * 1e-3, 1e-4);
|
|
717
|
+
this._depthSpan[0] = Math.max(minClip, vzMin - epsilon);
|
|
718
|
+
this._depthSpan[1] = vzMax + epsilon;
|
|
719
|
+
}
|
|
720
|
+
else {
|
|
721
|
+
this._depthSpan[0] = vzMin;
|
|
722
|
+
this._depthSpan[1] = vzMax;
|
|
723
|
+
}
|
|
724
|
+
return this._depthSpan;
|
|
725
|
+
}
|
|
726
|
+
/**
|
|
727
|
+
* Returns a stride coprime to `total` near the golden ratio, so `i*stride % total` is a decorrelated permutation.
|
|
728
|
+
* @param total the cycle length (number of sub-cells, N*N)
|
|
729
|
+
* @returns a stride coprime to total
|
|
730
|
+
*/
|
|
731
|
+
_coprimeStride(total) {
|
|
732
|
+
if (total <= 2) {
|
|
733
|
+
return 1;
|
|
734
|
+
}
|
|
735
|
+
let s = Math.max(1, Math.round(total * 0.6180339887));
|
|
736
|
+
let a = s;
|
|
737
|
+
let b = total;
|
|
738
|
+
while (b !== 0) {
|
|
739
|
+
const remainder = a % b;
|
|
740
|
+
a = b;
|
|
741
|
+
b = remainder;
|
|
742
|
+
}
|
|
743
|
+
while (a !== 1) {
|
|
744
|
+
s++;
|
|
745
|
+
a = s;
|
|
746
|
+
b = total;
|
|
747
|
+
while (b !== 0) {
|
|
748
|
+
const remainder = a % b;
|
|
749
|
+
a = b;
|
|
750
|
+
b = remainder;
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
return s;
|
|
754
|
+
}
|
|
755
|
+
/** Per-frame point target for the `"auto"` render scale: desktop 15M, iOS 9M, other mobile 6M.
|
|
756
|
+
* @returns the target emitted-point count per frame */
|
|
757
|
+
_budget() {
|
|
758
|
+
const isMobile = !!this._scene.getEngine().hostInformation?.isMobile;
|
|
759
|
+
if (!isMobile) {
|
|
760
|
+
return 15000000;
|
|
761
|
+
}
|
|
762
|
+
if (typeof navigator !== "undefined" && navigator.userAgent && /iPad|iPhone|iPod/.test(navigator.userAgent)) {
|
|
763
|
+
return 9000000;
|
|
764
|
+
}
|
|
765
|
+
return 6000000;
|
|
766
|
+
}
|
|
767
|
+
/**
|
|
768
|
+
* Reads back the point count and derives the auto render factor N from the device budget.
|
|
769
|
+
* @param currentN the render factor N used for the frame being measured
|
|
770
|
+
* @param generation the accumulation generation the measured frame belongs to
|
|
771
|
+
* @param freeze whether the measured frame had occlusion culling active, so N may be fixed for `generation`
|
|
772
|
+
*/
|
|
773
|
+
_updateAutoScale(currentN, generation, freeze) {
|
|
774
|
+
if (this._budgetReadPending || !this._renderer) {
|
|
775
|
+
return;
|
|
776
|
+
}
|
|
777
|
+
this._budgetReadPending = true;
|
|
778
|
+
void this._convergeAutoScaleAsync(currentN, generation, freeze, this._autoRequestId);
|
|
779
|
+
}
|
|
780
|
+
async _convergeAutoScaleAsync(currentN, generation, freeze, requestId) {
|
|
781
|
+
const renderer = this._renderer;
|
|
782
|
+
if (!renderer) {
|
|
783
|
+
return;
|
|
784
|
+
}
|
|
785
|
+
try {
|
|
786
|
+
const total = await renderer.readPointCountAsync();
|
|
787
|
+
if (renderer !== this._renderer || !this._computeActive || requestId !== this._autoRequestId || this._renderScale !== "auto") {
|
|
788
|
+
return;
|
|
789
|
+
}
|
|
790
|
+
if (total > 0) {
|
|
791
|
+
// Points scale as N^-2.
|
|
792
|
+
const fullPoints = total * currentN * currentN;
|
|
793
|
+
const target = Math.max(1, Math.min(8, Math.ceil(Math.sqrt(fullPoints / this._budget()))));
|
|
794
|
+
// Evaluated before the reset below, which would make every sample look stale.
|
|
795
|
+
const stale = !freeze || renderer.accumulationVersion !== generation;
|
|
796
|
+
const factorChanged = target !== this._autoN;
|
|
797
|
+
this._autoN = target;
|
|
798
|
+
if (factorChanged) {
|
|
799
|
+
// N must not change within a generation.
|
|
800
|
+
renderer.resetAccumulation();
|
|
801
|
+
}
|
|
802
|
+
if (stale) {
|
|
803
|
+
return;
|
|
804
|
+
}
|
|
805
|
+
// Re-measuring would reproduce this estimate, so at most one corrective reset happens.
|
|
806
|
+
this._autoMeasuredGeneration = renderer.accumulationVersion;
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
catch (error) {
|
|
810
|
+
if (renderer === this._renderer && this._computeActive) {
|
|
811
|
+
Logger.Error(`GaussianSplattingMesh: point-splatting budget readback failed: ${String(error)}`);
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
finally {
|
|
815
|
+
if (renderer === this._renderer) {
|
|
816
|
+
this._budgetReadPending = false;
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
/** Returns the current depth map's size, or the camera's color target size for other passes.
|
|
821
|
+
* The returned object is reused between calls.
|
|
822
|
+
* @param colorTarget whether to return color dimensions regardless of the current pass
|
|
823
|
+
* @returns The current target dimensions in pixels.
|
|
824
|
+
*/
|
|
825
|
+
_getOutputSize(colorTarget = false) {
|
|
826
|
+
const engine = this._scene.getEngine();
|
|
827
|
+
const camera = this._scene.activeCamera;
|
|
828
|
+
const postProcess = this._scene.postProcessesEnabled ? camera?._getFirstPostProcess() : null;
|
|
829
|
+
const outputRenderTarget = camera?.outputRenderTarget;
|
|
830
|
+
let width;
|
|
831
|
+
let height;
|
|
832
|
+
const depthMap = this._depthMode && !colorTarget ? this._getCurrentDepthRenderer()?.getDepthMap() : null;
|
|
833
|
+
if (depthMap) {
|
|
834
|
+
width = depthMap.getRenderWidth();
|
|
835
|
+
height = depthMap.getRenderHeight();
|
|
836
|
+
}
|
|
837
|
+
else if (postProcess && postProcess.width > 0 && postProcess.height > 0) {
|
|
838
|
+
width = postProcess.width;
|
|
839
|
+
height = postProcess.height;
|
|
840
|
+
}
|
|
841
|
+
else if (outputRenderTarget) {
|
|
842
|
+
width = outputRenderTarget.getRenderWidth();
|
|
843
|
+
height = outputRenderTarget.getRenderHeight();
|
|
844
|
+
}
|
|
845
|
+
else {
|
|
846
|
+
width = engine.getRenderWidth(true);
|
|
847
|
+
height = engine.getRenderHeight(true);
|
|
848
|
+
}
|
|
849
|
+
this._outputSize.width = Math.max(1, width);
|
|
850
|
+
this._outputSize.height = Math.max(1, height);
|
|
851
|
+
return this._outputSize;
|
|
852
|
+
}
|
|
853
|
+
/** Refreshes inputs baked into the point result, including changes made by per-pass mesh callbacks. */
|
|
854
|
+
_syncRenderInputs() {
|
|
855
|
+
this._syncData();
|
|
856
|
+
if (this._splatCount === 0) {
|
|
857
|
+
return;
|
|
858
|
+
}
|
|
859
|
+
const material = this._mesh.material;
|
|
860
|
+
const kernelSize = material?.kernelSize || GaussianSplattingMaterial.KernelSize;
|
|
861
|
+
const minPixelSize = material ? material.minPixelSize : GaussianSplattingMaterial.MinPixelSize;
|
|
862
|
+
const compensation = material?.compensation ?? GaussianSplattingMaterial.Compensation;
|
|
863
|
+
const renderer = this._renderer;
|
|
864
|
+
if (renderer.kernelSize !== kernelSize || renderer.minPixelSize !== minPixelSize || renderer.compensation !== compensation) {
|
|
865
|
+
renderer.kernelSize = kernelSize;
|
|
866
|
+
renderer.minPixelSize = minPixelSize;
|
|
867
|
+
renderer.compensation = compensation;
|
|
868
|
+
renderer.resetAccumulation();
|
|
869
|
+
}
|
|
870
|
+
this._uploadParts();
|
|
871
|
+
}
|
|
872
|
+
/** Runs compute immediately before a point compositor and binds the result to both blit materials. */
|
|
873
|
+
_runCompute() {
|
|
874
|
+
this._resultReady = false;
|
|
875
|
+
this._progressReady = false;
|
|
876
|
+
if ((this._colorMode || this._depthMode) && this._mesh._pointStreamingUnsupported && !this._streamingWarned) {
|
|
877
|
+
this._streamingWarned = true;
|
|
878
|
+
Logger.Warn("GaussianSplattingMesh: point splatting does not support streamed parts (their splats are GPU-decoded and never reach the retained CPU splat data); falling back to the classic renderer.");
|
|
879
|
+
}
|
|
880
|
+
if ((this._colorMode || this._depthMode) && this._hasUnsupportedSource && !this._sourceWarned) {
|
|
881
|
+
this._sourceWarned = true;
|
|
882
|
+
Logger.Warn("GaussianSplattingMesh: point splatting requires retained CPU splat data; GPU-only SOG textures and streams use the classic renderer.");
|
|
883
|
+
}
|
|
884
|
+
if (!this._computeActive || !this._mesh.isEnabled() || !this._renderer || !_DependenciesReady || this._hasUnsupportedView()) {
|
|
885
|
+
return;
|
|
886
|
+
}
|
|
887
|
+
if (!this._isWorkloadSupported()) {
|
|
888
|
+
return;
|
|
889
|
+
}
|
|
890
|
+
this._syncRenderInputs();
|
|
891
|
+
if (this._splatCount === 0) {
|
|
892
|
+
return;
|
|
893
|
+
}
|
|
894
|
+
const camera = this._scene.activeCamera;
|
|
895
|
+
const engine = this._scene.getEngine();
|
|
896
|
+
// Render at 1/N resolution and reconstruct full resolution over N^2 jittered frames.
|
|
897
|
+
const { width: fullW, height: fullH } = this._getOutputSize();
|
|
898
|
+
const scaleOpt = this._renderScale;
|
|
899
|
+
const upsampleN = scaleOpt === "auto" ? this._autoN : Math.max(1, Math.min(8, Math.round(1 / Math.max(scaleOpt, 1e-3))));
|
|
900
|
+
const width = Math.max(1, Math.ceil(fullW / upsampleN));
|
|
901
|
+
const height = Math.max(1, Math.ceil(fullH / upsampleN));
|
|
902
|
+
// Driven by the renderer's frame count, which also seeds sampling, so skipped frames cannot desync them.
|
|
903
|
+
const total = upsampleN * upsampleN;
|
|
904
|
+
const j = ((this._renderer.renderedFrameCount % total) * this._coprimeStride(total)) % total;
|
|
905
|
+
const jitterX = j % upsampleN;
|
|
906
|
+
const jitterY = Math.floor(j / upsampleN);
|
|
907
|
+
const view = this._scene.getViewMatrix();
|
|
908
|
+
const projection = this._scene.getProjectionMatrix();
|
|
909
|
+
const determinant = projection.determinant();
|
|
910
|
+
if (!Number.isFinite(determinant) || determinant === 0) {
|
|
911
|
+
if (!this._invalidProjectionWarned) {
|
|
912
|
+
this._invalidProjectionWarned = true;
|
|
913
|
+
Logger.Error("GaussianSplattingMesh: the camera projection matrix is not finite and invertible; point splatting skips the mesh.");
|
|
914
|
+
}
|
|
915
|
+
return;
|
|
916
|
+
}
|
|
917
|
+
this._invalidProjectionWarned = false;
|
|
918
|
+
projection.invertToRef(this._inverseProjection);
|
|
919
|
+
this._vpMatrix.copyFrom(this._scene.getTransformMatrix());
|
|
920
|
+
const focalX = (fullW * projection.m[0]) / (2 * upsampleN);
|
|
921
|
+
const focalY = (fullH * projection.m[5]) / (2 * upsampleN);
|
|
922
|
+
const camPos = camera.globalPosition;
|
|
923
|
+
this._renderer.rightHandedSystem = this._scene.useRightHandedSystem;
|
|
924
|
+
this._renderer.isOrthographic = Math.abs(projection.m[15] - 1) < 0.001;
|
|
925
|
+
const gsMaterial = this._mesh.material;
|
|
926
|
+
const projectedDepth = _HasGaussianPointSplattingProjectedDepth(projection);
|
|
927
|
+
const clipRange = projectedDepth ? null : this._getProjectionClipRange(projection);
|
|
928
|
+
const nearZ = clipRange?.[0] ?? camera.minZ;
|
|
929
|
+
const farZ = clipRange?.[1] ?? (camera.ignoreCameraMaxZ ? 0 : camera.maxZ);
|
|
930
|
+
const [vzMin, vzMax] = this._viewZSpan(view.m, nearZ, farZ, !projectedDepth);
|
|
931
|
+
this._renderer.setCamera(view, this._vpMatrix, nearZ, farZ, focalX, focalY, camPos.x, camPos.y, camPos.z, vzMin, vzMax);
|
|
932
|
+
this._renderer.setProjectionMatrix(projection, this._inverseProjection, engine.useReverseDepthBuffer);
|
|
933
|
+
if (!this._renderer.renderToBuffer(width, height, fullW, fullH, upsampleN, jitterX, jitterY)) {
|
|
934
|
+
return;
|
|
935
|
+
}
|
|
936
|
+
this._resultReady = true;
|
|
937
|
+
this._progressReady = true;
|
|
938
|
+
this._computedWidth = fullW;
|
|
939
|
+
this._computedHeight = fullH;
|
|
940
|
+
// Snapshot now: a later reset would pair a new generation with the old cycle length.
|
|
941
|
+
this._progressFrameCount = this._renderer.renderedFrameCount;
|
|
942
|
+
this._progressGeneration = this._renderer.accumulationVersion;
|
|
943
|
+
this._progressCycleLength = this._renderer.pixelCycleLength;
|
|
944
|
+
const generation = this._renderer.accumulationVersion;
|
|
945
|
+
const wasMoving = generation !== this._lastRenderedGeneration;
|
|
946
|
+
this._lastRenderedGeneration = generation;
|
|
947
|
+
if (scaleOpt === "auto" && this._autoMeasuredGeneration !== generation) {
|
|
948
|
+
this._updateAutoScale(upsampleN, generation, !wasMoving);
|
|
949
|
+
}
|
|
950
|
+
const accum = this._renderer.accumBuffer;
|
|
951
|
+
const accumDepth = this._renderer.accumDepthBuffer;
|
|
952
|
+
if (accum && accumDepth) {
|
|
953
|
+
if (this._colorMode && this._blit) {
|
|
954
|
+
this._blit.setAccumBuffer(accum);
|
|
955
|
+
this._blit.setAccumDepthBuffer(accumDepth);
|
|
956
|
+
this._blit.setResolution(this._renderer.outputWidth, this._renderer.outputHeight);
|
|
957
|
+
this._blit.setInverseProjection(this._inverseProjection);
|
|
958
|
+
// Match the classic material's log depth so the composite depth-tests like the classic path.
|
|
959
|
+
this._blit.setLogarithmicDepthConstant(gsMaterial?.useLogarithmicDepth ? 2.0 / (Math.log(camera.maxZ + 1.0) / Math.LN2) : 0);
|
|
960
|
+
}
|
|
961
|
+
if (this._depthMode && this._depthBlit) {
|
|
962
|
+
this._depthBlit.setAccumBuffer(accum);
|
|
963
|
+
this._depthBlit.setAccumDepthBuffer(accumDepth);
|
|
964
|
+
this._depthBlit.setResolution(this._renderer.outputWidth, this._renderer.outputHeight);
|
|
965
|
+
this._depthBlit.setInverseProjection(this._inverseProjection);
|
|
966
|
+
// Same normalization as GaussianSplattingMaterial._BindEffectUniforms.
|
|
967
|
+
let minZ, maxZ;
|
|
968
|
+
if (camera.mode === 1) {
|
|
969
|
+
minZ = !engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? 0 : 1;
|
|
970
|
+
maxZ = engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? 0 : 1;
|
|
971
|
+
}
|
|
972
|
+
else {
|
|
973
|
+
minZ = engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? camera.minZ : engine.isNDCHalfZRange ? 0 : camera.minZ;
|
|
974
|
+
maxZ = engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? 0 : camera.maxZ;
|
|
975
|
+
}
|
|
976
|
+
this._depthBlit.setDepthValues(minZ, minZ + maxZ);
|
|
977
|
+
this._depthBlit.setReverseDepth(engine.useReverseDepthBuffer);
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
/**
|
|
982
|
+
* True when the frame renders a view the point path cannot reproduce: several active cameras, rig
|
|
983
|
+
* cameras (stereo, XR, multiview), floating origin, unsupported projection clipping intervals, or scene/material clip planes.
|
|
984
|
+
* The classic path renders those instead.
|
|
985
|
+
* @returns whether point splatting must fall back to the classic path this frame
|
|
986
|
+
*/
|
|
987
|
+
_hasUnsupportedView() {
|
|
988
|
+
const scene = this._scene;
|
|
989
|
+
const camera = scene.activeCamera;
|
|
990
|
+
if (!camera || scene.floatingOriginMode) {
|
|
991
|
+
return true;
|
|
992
|
+
}
|
|
993
|
+
const projection = camera.getProjectionMatrix();
|
|
994
|
+
if (!_HasGaussianPointSplattingProjectedDepth(projection) && !this._getProjectionClipRange(projection)) {
|
|
995
|
+
return true;
|
|
996
|
+
}
|
|
997
|
+
const material = this._mesh.material;
|
|
998
|
+
return ((scene.activeCameras?.length ?? 0) > 1 ||
|
|
999
|
+
camera._rigCameras.length > 0 ||
|
|
1000
|
+
!!(material?.clipPlane || material?.clipPlane2 || material?.clipPlane3 || material?.clipPlane4 || material?.clipPlane5 || material?.clipPlane6) ||
|
|
1001
|
+
!!(scene.clipPlane || scene.clipPlane2 || scene.clipPlane3 || scene.clipPlane4 || scene.clipPlane5 || scene.clipPlane6));
|
|
1002
|
+
}
|
|
1003
|
+
/**
|
|
1004
|
+
* True only for the camera's main forward color pass.
|
|
1005
|
+
* @returns whether the current render pass is the camera's main forward color pass
|
|
1006
|
+
*/
|
|
1007
|
+
_isMainColorPass() {
|
|
1008
|
+
const engine = this._scene.getEngine();
|
|
1009
|
+
const cam = this._scene.activeCamera;
|
|
1010
|
+
const mainId = cam?.outputRenderTarget?.renderPassId ?? cam?.renderPassId ?? 0;
|
|
1011
|
+
return engine.currentRenderPassId === mainId && !this._mesh.getMaterialForRenderPass(engine.currentRenderPassId);
|
|
1012
|
+
}
|
|
1013
|
+
/**
|
|
1014
|
+
* The active camera's scene depth renderer while it is rendering; other depth passes use the classic path.
|
|
1015
|
+
* @returns the depth renderer owning the current render pass, or null
|
|
1016
|
+
*/
|
|
1017
|
+
_getCurrentDepthRenderer() {
|
|
1018
|
+
const depthRenderers = this._scene._depthRenderer;
|
|
1019
|
+
const camera = this._scene.activeCamera;
|
|
1020
|
+
if (!depthRenderers || !camera) {
|
|
1021
|
+
return null;
|
|
1022
|
+
}
|
|
1023
|
+
const renderer = depthRenderers[camera.uniqueId];
|
|
1024
|
+
if (!renderer || !renderer.enabled) {
|
|
1025
|
+
return null;
|
|
1026
|
+
}
|
|
1027
|
+
return renderer.getDepthMap().renderPassIds.indexOf(this._scene.getEngine().currentRenderPassId) !== -1 ? renderer : null;
|
|
1028
|
+
}
|
|
1029
|
+
/**
|
|
1030
|
+
* True only while rendering the active camera's scene depth renderer.
|
|
1031
|
+
* @returns whether the current render pass is the active camera's depth renderer pass
|
|
1032
|
+
*/
|
|
1033
|
+
_isDepthPass() {
|
|
1034
|
+
return !!this._getCurrentDepthRenderer();
|
|
1035
|
+
}
|
|
1036
|
+
/** {@inheritDoc IGaussianPointSplattingController.dispose} */
|
|
1037
|
+
dispose() {
|
|
1038
|
+
if (this._computeObserver) {
|
|
1039
|
+
this._scene.onBeforeRenderObservable.remove(this._computeObserver);
|
|
1040
|
+
this._computeObserver = null;
|
|
1041
|
+
}
|
|
1042
|
+
if (this._cameraObserver) {
|
|
1043
|
+
this._scene.onBeforeCameraRenderObservable.remove(this._cameraObserver);
|
|
1044
|
+
this._cameraObserver = null;
|
|
1045
|
+
}
|
|
1046
|
+
if (this._restoreObserver) {
|
|
1047
|
+
this._scene.getEngine().onContextRestoredObservable.remove(this._restoreObserver);
|
|
1048
|
+
this._restoreObserver = null;
|
|
1049
|
+
}
|
|
1050
|
+
this._releaseComputeResources();
|
|
1051
|
+
this._releaseBlitResources();
|
|
1052
|
+
this._colorMode = false;
|
|
1053
|
+
this._depthMode = false;
|
|
1054
|
+
}
|
|
1055
|
+
/** {@inheritDoc IGaussianPointSplattingController.renderScale} */
|
|
1056
|
+
get renderScale() {
|
|
1057
|
+
return this._renderScale;
|
|
1058
|
+
}
|
|
1059
|
+
set renderScale(value) {
|
|
1060
|
+
if (value === this._renderScale) {
|
|
1061
|
+
return;
|
|
1062
|
+
}
|
|
1063
|
+
this._renderScale = value;
|
|
1064
|
+
this._autoRequestId++;
|
|
1065
|
+
this._autoMeasuredGeneration = -1;
|
|
1066
|
+
this._renderer?.resetAccumulation();
|
|
1067
|
+
}
|
|
1068
|
+
/** {@inheritDoc IGaussianPointSplattingController.invalidateDecodedSplats} */
|
|
1069
|
+
invalidateDecodedSplats() {
|
|
1070
|
+
this._decodedSplatsData = null;
|
|
1071
|
+
this._renderer?.resetAccumulation();
|
|
1072
|
+
}
|
|
1073
|
+
/**
|
|
1074
|
+
* Checks only plugin implementations whose enabled behavior is reproduced, or whose disabled behavior is neutral.
|
|
1075
|
+
* @returns whether the source material's plugins are compatible with point color
|
|
1076
|
+
*/
|
|
1077
|
+
_supportsSourceMaterialPlugins() {
|
|
1078
|
+
const plugins = this._mesh.material?.pluginManager?._plugins;
|
|
1079
|
+
if (!plugins) {
|
|
1080
|
+
return true;
|
|
1081
|
+
}
|
|
1082
|
+
for (const plugin of plugins) {
|
|
1083
|
+
const pluginType = plugin.constructor;
|
|
1084
|
+
if ((pluginType === GaussianSplattingDebugMaterialPlugin && plugin instanceof GaussianSplattingDebugMaterialPlugin) ||
|
|
1085
|
+
(pluginType === GaussianSplattingSolidColorMaterialPlugin && plugin instanceof GaussianSplattingSolidColorMaterialPlugin && !plugin.isEnabled) ||
|
|
1086
|
+
(pluginType === GaussianSplattingSizeMaterialPlugin && plugin instanceof GaussianSplattingSizeMaterialPlugin && !plugin.isEnabled) ||
|
|
1087
|
+
(pluginType === GaussianSplattingOverdrawMaterialPlugin && plugin instanceof GaussianSplattingOverdrawMaterialPlugin && !plugin.isEnabled)) {
|
|
1088
|
+
continue;
|
|
1089
|
+
}
|
|
1090
|
+
return false;
|
|
1091
|
+
}
|
|
1092
|
+
return true;
|
|
1093
|
+
}
|
|
1094
|
+
/** {@inheritDoc IGaussianPointSplattingController.handlesCurrentPass} */
|
|
1095
|
+
get handlesCurrentPass() {
|
|
1096
|
+
const passMaterial = this._mesh.getMaterialForRenderPass(this._scene.getEngine().currentRenderPassId);
|
|
1097
|
+
const depthRenderer = this._depthMode ? this._getCurrentDepthRenderer() : null;
|
|
1098
|
+
const viewport = this._scene.activeCamera?.viewport;
|
|
1099
|
+
const fullViewport = !!viewport && viewport.x === 0 && viewport.y === 0 && viewport.width === 1 && viewport.height === 1;
|
|
1100
|
+
let depthPass = !!depthRenderer && (fullViewport || depthRenderer.getDepthMap().ignoreCameraViewport) && !this._scene.forceWireframe && !this._scene.forcePointsCloud;
|
|
1101
|
+
// The depth renderer always installs its own classic GS depth material for its pass; only a
|
|
1102
|
+
// user override set through setMaterialForRendering keeps the classic path.
|
|
1103
|
+
if (passMaterial && !depthRenderer?._isGaussianSplattingDepthMaterial(passMaterial)) {
|
|
1104
|
+
return false;
|
|
1105
|
+
}
|
|
1106
|
+
const fog = this._scene.fogEnabled && this._scene.fogMode !== Scene.FOGMODE_NONE && this._mesh.applyFog && !!this._mesh.material?.fogEnabled;
|
|
1107
|
+
const colorSupported = this._colorMode &&
|
|
1108
|
+
fullViewport &&
|
|
1109
|
+
this._mesh.material?.alphaMode === 2 &&
|
|
1110
|
+
this._mesh.material.needAlphaBlendingForMesh(this._mesh) &&
|
|
1111
|
+
!this._mesh.material.needAlphaTestingForMesh(this._mesh) &&
|
|
1112
|
+
this._mesh._getRenderingFillMode(this._mesh.material.fillMode) === Material.TriangleFillMode &&
|
|
1113
|
+
// Custom source shaders, including subclass overrides and NodeMaterial graphs, are not evaluated by compute.
|
|
1114
|
+
this._mesh.material.constructor === GaussianSplattingMaterial &&
|
|
1115
|
+
this._supportsSourceMaterialPlugins() &&
|
|
1116
|
+
!fog;
|
|
1117
|
+
if (depthPass && depthRenderer && colorSupported) {
|
|
1118
|
+
const depthMap = depthRenderer.getDepthMap();
|
|
1119
|
+
const colorSize = this._getOutputSize(true);
|
|
1120
|
+
// One renderer cannot retain accumulation while alternating incompatible pixel grids.
|
|
1121
|
+
depthPass = depthMap.getRenderWidth() === colorSize.width && depthMap.getRenderHeight() === colorSize.height && this._depthInputsMatchColorHistory();
|
|
1122
|
+
}
|
|
1123
|
+
const colorPass = colorSupported && this._isMainColorPass();
|
|
1124
|
+
return (colorPass || depthPass) && this._computeActive && !this._hasUnsupportedView() && (!this._renderer || this._isWorkloadSupported());
|
|
1125
|
+
}
|
|
1126
|
+
/**
|
|
1127
|
+
* Composites supported camera color or depth passes from the point-splatting result.
|
|
1128
|
+
* The pass waits without drawing classic splats while compute or compositor shaders are compiling.
|
|
1129
|
+
* @param enableAlphaMode whether the color compositor should enable alpha blending
|
|
1130
|
+
* @returns whether the point path handled the current pass, including waiting for shader readiness
|
|
1131
|
+
*/
|
|
1132
|
+
drawColorPass(enableAlphaMode) {
|
|
1133
|
+
if (!this.handlesCurrentPass) {
|
|
1134
|
+
if (!this._computeActive) {
|
|
1135
|
+
this._runCompute();
|
|
1136
|
+
}
|
|
1137
|
+
return false;
|
|
1138
|
+
}
|
|
1139
|
+
const colorPass = this._colorMode && this._isMainColorPass();
|
|
1140
|
+
const depthPass = this._depthMode && this._isDepthPass();
|
|
1141
|
+
const { width, height } = this._getOutputSize();
|
|
1142
|
+
if (this._resultReady && this._renderer) {
|
|
1143
|
+
this._syncRenderInputs();
|
|
1144
|
+
if (this._renderer.accumulationVersion !== this._progressGeneration) {
|
|
1145
|
+
this._resultReady = false;
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
// Compute only after the pass has established its actual matrices. Matching color/depth passes share it.
|
|
1149
|
+
if (!this._resultReady || !this._vpMatrix.equalsWithEpsilon(this._scene.getTransformMatrix(), 1e-5) || this._computedWidth !== width || this._computedHeight !== height) {
|
|
1150
|
+
this._runCompute();
|
|
1151
|
+
}
|
|
1152
|
+
if (!this._resultReady) {
|
|
1153
|
+
return true;
|
|
1154
|
+
}
|
|
1155
|
+
if (colorPass) {
|
|
1156
|
+
this._colorHistoryReady = true;
|
|
1157
|
+
this._colorUsesCameraTransform = this._getCameraTransform()?.equalsWithEpsilon(this._vpMatrix, 1e-5) ?? false;
|
|
1158
|
+
}
|
|
1159
|
+
if (colorPass && this._blitMesh && this._blitMesh.subMeshes.length > 0 && this._blit?.isReady(this._blitMesh, false, this._blitMesh.subMeshes[0])) {
|
|
1160
|
+
const blitMesh = this._blitMesh;
|
|
1161
|
+
const material = this._mesh.material;
|
|
1162
|
+
if (material) {
|
|
1163
|
+
this._blit.disableColorWrite = material.disableColorWrite;
|
|
1164
|
+
this._blit.disableDepthWrite = material.disableDepthWrite;
|
|
1165
|
+
this._blit.forceDepthWrite = material.forceDepthWrite;
|
|
1166
|
+
this._blit.depthFunction = material.depthFunction;
|
|
1167
|
+
this._blit.zOffset = material.zOffset;
|
|
1168
|
+
this._blit.zOffsetUnits = material.zOffsetUnits;
|
|
1169
|
+
// Copy directly to avoid SerializationHelper allocations in each color draw.
|
|
1170
|
+
const source = material.stencil;
|
|
1171
|
+
const stencil = this._blit.stencil;
|
|
1172
|
+
stencil.enabled = source.enabled;
|
|
1173
|
+
stencil.mask = source.mask;
|
|
1174
|
+
stencil.func = source.func;
|
|
1175
|
+
stencil.funcRef = source.funcRef;
|
|
1176
|
+
stencil.funcMask = source.funcMask;
|
|
1177
|
+
stencil.opStencilFail = source.opStencilFail;
|
|
1178
|
+
stencil.opDepthFail = source.opDepthFail;
|
|
1179
|
+
stencil.opStencilDepthPass = source.opStencilDepthPass;
|
|
1180
|
+
stencil.backFunc = source.backFunc;
|
|
1181
|
+
stencil.backOpStencilFail = source.backOpStencilFail;
|
|
1182
|
+
stencil.backOpDepthFail = source.backOpDepthFail;
|
|
1183
|
+
stencil.backOpStencilDepthPass = source.backOpStencilDepthPass;
|
|
1184
|
+
}
|
|
1185
|
+
// Render in replacement mode so the disabled compositor still draws itself.
|
|
1186
|
+
blitMesh.render(blitMesh.subMeshes[0], enableAlphaMode, blitMesh);
|
|
1187
|
+
return true;
|
|
1188
|
+
}
|
|
1189
|
+
if (depthPass && this._depthBlitMesh) {
|
|
1190
|
+
const depthBlitMesh = this._depthBlitMesh;
|
|
1191
|
+
if (depthBlitMesh.subMeshes.length > 0 && this._depthBlit?.isReady(depthBlitMesh, false, depthBlitMesh.subMeshes[0])) {
|
|
1192
|
+
// The depth renderer may have left alpha blending on.
|
|
1193
|
+
this._scene.getEngine().setAlphaMode(0);
|
|
1194
|
+
depthBlitMesh.render(depthBlitMesh.subMeshes[0], false, depthBlitMesh);
|
|
1195
|
+
return true;
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
return true;
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
let _Registered = false;
|
|
1202
|
+
/**
|
|
1203
|
+
* Enables the point-splatting properties of {@link GaussianSplattingMesh}. Idempotent.
|
|
1204
|
+
*/
|
|
1205
|
+
export function RegisterGaussianPointSplattingController() {
|
|
1206
|
+
if (_Registered) {
|
|
1207
|
+
return;
|
|
1208
|
+
}
|
|
1209
|
+
_Registered = true;
|
|
1210
|
+
_SetGaussianPointSplattingControllerFactory((mesh) => new GaussianPointSplattingController(mesh));
|
|
1211
|
+
}
|
|
1212
|
+
//# sourceMappingURL=gaussianPointSplattingController.pure.js.map
|