@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
|
@@ -26,6 +26,7 @@ export declare function CreatePolygonVertexData(polygon: Mesh, sideOrientation:
|
|
|
26
26
|
* * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
|
|
27
27
|
* * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4)
|
|
28
28
|
* * Remember you can only change the shape positions, not their number when updating a polygon
|
|
29
|
+
* * The `smoothingThreshold` option defines the dot product threshold for smoothing the normals of adjacent side faces. The default value of 2 disables smoothing
|
|
29
30
|
* @param name defines the name of the mesh
|
|
30
31
|
* @param options defines the options used to create the mesh
|
|
31
32
|
* @param scene defines the hosting scene
|
|
@@ -49,7 +50,9 @@ export declare function CreatePolygon(name: string, options: {
|
|
|
49
50
|
/**
|
|
50
51
|
* Creates an extruded polygon mesh, with depth in the Y direction.
|
|
51
52
|
* * You can set different colors and different images to the top, bottom and extruded side by using the parameters `faceColors` (an array of 3 Color3 elements) and `faceUV` (an array of 3 Vector4 elements)
|
|
53
|
+
* * The `smoothingThreshold` option defines the dot product threshold for smoothing the normals of adjacent side faces. The default value of 2 disables smoothing
|
|
52
54
|
* @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/texturePerBoxFace
|
|
55
|
+
* @see https://playground.babylonjs.com/#TJLZLN#0
|
|
53
56
|
* @param name defines the name of the mesh
|
|
54
57
|
* @param options defines the options used to create the mesh
|
|
55
58
|
* @param scene defines the hosting scene
|
|
@@ -60,6 +63,7 @@ export declare function ExtrudePolygon(name: string, options: {
|
|
|
60
63
|
shape: Vector3[];
|
|
61
64
|
holes?: Vector3[][];
|
|
62
65
|
depth?: number;
|
|
66
|
+
smoothingThreshold?: number;
|
|
63
67
|
faceUV?: Vector4[];
|
|
64
68
|
faceColors?: Color4[];
|
|
65
69
|
updatable?: boolean;
|
|
@@ -128,6 +128,7 @@ export function CreatePolygonVertexData(polygon, sideOrientation, fUV, fColors,
|
|
|
128
128
|
* * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
|
|
129
129
|
* * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4)
|
|
130
130
|
* * Remember you can only change the shape positions, not their number when updating a polygon
|
|
131
|
+
* * The `smoothingThreshold` option defines the dot product threshold for smoothing the normals of adjacent side faces. The default value of 2 disables smoothing
|
|
131
132
|
* @param name defines the name of the mesh
|
|
132
133
|
* @param options defines the options used to create the mesh
|
|
133
134
|
* @param scene defines the hosting scene
|
|
@@ -174,7 +175,9 @@ export function CreatePolygon(name, options, scene = null, earcutInjection = ear
|
|
|
174
175
|
/**
|
|
175
176
|
* Creates an extruded polygon mesh, with depth in the Y direction.
|
|
176
177
|
* * You can set different colors and different images to the top, bottom and extruded side by using the parameters `faceColors` (an array of 3 Color3 elements) and `faceUV` (an array of 3 Vector4 elements)
|
|
178
|
+
* * The `smoothingThreshold` option defines the dot product threshold for smoothing the normals of adjacent side faces. The default value of 2 disables smoothing
|
|
177
179
|
* @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/texturePerBoxFace
|
|
180
|
+
* @see https://playground.babylonjs.com/#TJLZLN#0
|
|
178
181
|
* @param name defines the name of the mesh
|
|
179
182
|
* @param options defines the options used to create the mesh
|
|
180
183
|
* @param scene defines the hosting scene
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polygonBuilder.pure.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Builders/polygonBuilder.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAgB,MAAM,8BAA8B,CAAC;AAE9E,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAO9E;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAAa,EAAE,eAAuB,EAAE,GAAe,EAAE,OAAkB,EAAE,QAAkB,EAAE,OAAiB,EAAE,GAAa;IACrK,MAAM,MAAM,GAAc,GAAG,IAAI,IAAI,KAAK,CAAU,CAAC,CAAC,CAAC;IACvD,MAAM,UAAU,GAAG,OAAO,CAAC;IAC3B,MAAM,MAAM,GAAG,EAAE,CAAC;IAClB,MAAM,IAAI,GAAY,GAAG,IAAI,KAAK,CAAC;IAEnC,0CAA0C;IAC1C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QACzB,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE,CAAC;YAC1B,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACxC,CAAC;QACD,IAA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AEF,IAAI,CAAC,cAAc,GAAG,CAClB,IAAY,EACZ,KAAgB,EAChB,KAAa,EACb,KAAY,EACZ,KAAmB,EACnB,SAAmB,EACnB,eAAwB,EACxB,eAAe,GAAG,MAAM,EACpB,EAAE;QACN,MAAM,OAAO,GAAG;YACZ,KAAK,EAAE,KAAK;YACZ,KAAK,EAAE,KAAK;YACZ,KAAK,EAAE,KAAK;YACZ,SAAS,EAAE,SAAS;YACpB,eAAe,EAAE,eAAe;SACnC,CAAC;QACF,OAAO,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC;IACjE,CAAC,CAAC;AACN,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { Vector2, Vector4, type Vector3 } from \"../../Maths/math.vector.pure\";\r\n\r\nimport { Color4 } from \"../../Maths/math.color.pure\";\r\nimport { Mesh } from \"../mesh.pure\";\r\nimport { VertexData } from \"../mesh.vertexData\";\r\nimport { PolygonMeshBuilder } from \"../polygonMesh\";\r\nimport { type FloatArray, type IndicesArray, type Nullable } from \"../../types\";\r\nimport { VertexBuffer } from \"../../Buffers/buffer.pure\";\r\nimport { EngineStore } from \"../../Engines/engineStore\";\r\nimport { useOpenGLOrientationForUV } from \"../../Compat/compatibilityOptions\";\r\nimport { type Scene } from \"../../scene.pure\";\r\n\r\n/* eslint-disable @typescript-eslint/naming-convention */\r\n\r\ndeclare let earcut: any;\r\n\r\n/**\r\n * Creates the VertexData for an irregular Polygon in the XoZ plane using a mesh built by polygonTriangulation.build()\r\n * All parameters are provided by CreatePolygon as needed\r\n * @param polygon a mesh built from polygonTriangulation.build()\r\n * @param sideOrientation takes the values Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE\r\n * @param fUV an array of Vector4 elements used to set different images to the top, rings and bottom respectively\r\n * @param fColors an array of Color3 elements used to set different colors to the top, rings and bottom respectively\r\n * @param frontUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)\r\n * @param backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)\r\n * @param wrp a boolean, default false, when true and fUVs used texture is wrapped around all sides, when false texture is applied side\r\n * @returns the VertexData of the Polygon\r\n */\r\nexport function CreatePolygonVertexData(polygon: Mesh, sideOrientation: number, fUV?: Vector4[], fColors?: Color4[], frontUVs?: Vector4, backUVs?: Vector4, wrp?: boolean) {\r\n const faceUV: Vector4[] = fUV || new Array<Vector4>(3);\r\n const faceColors = fColors;\r\n const colors = [];\r\n const wrap: boolean = wrp || false;\r\n\r\n // default face colors and UV if undefined\r\n for (let f = 0; f < 3; f++) {\r\n if (faceUV[f] === undefined) {\r\n faceUV[f] = new Vector4(0, 0, 1, 1);\r\n }\r\n if (faceColors && faceColors[f] === undefined) {\r\n faceColors[f] = new Color4(1, 1, 1, 1);\r\n }\r\n }\r\n\r\n const positions = <FloatArray>polygon.getVerticesData(VertexBuffer.PositionKind);\r\n const normals = <FloatArray>polygon.getVerticesData(VertexBuffer.NormalKind);\r\n const uvs = <FloatArray>polygon.getVerticesData(VertexBuffer.UVKind);\r\n const indices = <IndicesArray>polygon.getIndices();\r\n const startIndex = positions.length / 9;\r\n let disp: number;\r\n let distX: number;\r\n let distZ: number;\r\n let dist: number;\r\n let totalLen = 0;\r\n const cumulate = [0];\r\n if (wrap) {\r\n for (let idx = startIndex; idx < positions.length / 3; idx += 4) {\r\n distX = positions[3 * (idx + 2)] - positions[3 * idx];\r\n distZ = positions[3 * (idx + 2) + 2] - positions[3 * idx + 2];\r\n dist = Math.sqrt(distX * distX + distZ * distZ);\r\n totalLen += dist;\r\n cumulate.push(totalLen);\r\n }\r\n }\r\n // set face colours and textures\r\n let idx: number;\r\n let face: number = 0;\r\n for (let index = 0; index < normals.length; index += 3) {\r\n //Edge Face no. 1\r\n if (Math.abs(normals[index + 1]) < 0.001) {\r\n face = 1;\r\n }\r\n //Top Face no. 0\r\n if (Math.abs(normals[index + 1] - 1) < 0.001) {\r\n face = 0;\r\n }\r\n //Bottom Face no. 2\r\n if (Math.abs(normals[index + 1] + 1) < 0.001) {\r\n face = 2;\r\n }\r\n idx = index / 3;\r\n if (face === 1) {\r\n disp = idx - startIndex;\r\n if (disp % 4 < 1.5) {\r\n if (wrap) {\r\n uvs[2 * idx] = faceUV[face].x + ((faceUV[face].z - faceUV[face].x) * cumulate[Math.floor(disp / 4)]) / totalLen;\r\n } else {\r\n uvs[2 * idx] = faceUV[face].x;\r\n }\r\n } else {\r\n if (wrap) {\r\n uvs[2 * idx] = faceUV[face].x + ((faceUV[face].z - faceUV[face].x) * cumulate[Math.floor(disp / 4) + 1]) / totalLen;\r\n } else {\r\n uvs[2 * idx] = faceUV[face].z;\r\n }\r\n }\r\n if (disp % 2 === 0) {\r\n uvs[2 * idx + 1] = useOpenGLOrientationForUV ? 1.0 - faceUV[face].w : faceUV[face].w;\r\n } else {\r\n uvs[2 * idx + 1] = useOpenGLOrientationForUV ? 1.0 - faceUV[face].y : faceUV[face].y;\r\n }\r\n } else {\r\n uvs[2 * idx] = (1 - uvs[2 * idx]) * faceUV[face].x + uvs[2 * idx] * faceUV[face].z;\r\n uvs[2 * idx + 1] = (1 - uvs[2 * idx + 1]) * faceUV[face].y + uvs[2 * idx + 1] * faceUV[face].w;\r\n\r\n if (useOpenGLOrientationForUV) {\r\n uvs[2 * idx + 1] = 1.0 - uvs[2 * idx + 1];\r\n }\r\n }\r\n if (faceColors) {\r\n colors.push(faceColors[face].r, faceColors[face].g, faceColors[face].b, faceColors[face].a);\r\n }\r\n }\r\n\r\n // sides\r\n VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs, frontUVs, backUVs);\r\n\r\n // Result\r\n const vertexData = new VertexData();\r\n vertexData.indices = indices;\r\n vertexData.positions = positions;\r\n vertexData.normals = normals;\r\n vertexData.uvs = uvs;\r\n\r\n if (faceColors) {\r\n const totalColors = sideOrientation === VertexData.DOUBLESIDE ? colors.concat(colors) : colors;\r\n vertexData.colors = totalColors;\r\n }\r\n\r\n return vertexData;\r\n}\r\n\r\n/**\r\n * Creates a polygon mesh\r\n * The polygon's shape will depend on the input parameters and is constructed parallel to a ground mesh\r\n * * The parameter `shape` is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors\r\n * * You can set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE\r\n * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created\r\n * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4)\r\n * * Remember you can only change the shape positions, not their number when updating a polygon\r\n * @param name defines the name of the mesh\r\n * @param options defines the options used to create the mesh\r\n * @param scene defines the hosting scene\r\n * @param earcutInjection can be used to inject your own earcut reference\r\n * @returns the polygon mesh\r\n */\r\nexport function CreatePolygon(\r\n name: string,\r\n options: {\r\n shape: Vector3[];\r\n holes?: Vector3[][];\r\n depth?: number;\r\n smoothingThreshold?: number;\r\n faceUV?: Vector4[];\r\n faceColors?: Color4[];\r\n updatable?: boolean;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n wrap?: boolean;\r\n instance?: Mesh;\r\n },\r\n scene: Nullable<Scene> = null,\r\n earcutInjection = earcut\r\n): Mesh {\r\n options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation);\r\n const shape = options.shape;\r\n const holes = options.holes || [];\r\n const depth = options.depth || 0;\r\n const smoothingThreshold = options.smoothingThreshold || 2;\r\n if (options.instance) {\r\n const vertexData = CreatePolygonVertexData(options.instance, options.sideOrientation, options.faceUV, options.faceColors, options.frontUVs, options.backUVs, options.wrap);\r\n vertexData.applyToMesh(options.instance, options.updatable);\r\n return options.instance;\r\n } else {\r\n const contours: Array<Vector2> = [];\r\n let hole: Array<Vector2>;\r\n\r\n for (let i = 0; i < shape.length; i++) {\r\n contours[i] = new Vector2(shape[i].x, shape[i].z);\r\n }\r\n const epsilon = 0.00000001;\r\n if (contours[0].equalsWithEpsilon(contours[contours.length - 1], epsilon)) {\r\n contours.pop();\r\n }\r\n\r\n const polygonTriangulation = new PolygonMeshBuilder(name, contours, scene || EngineStore.LastCreatedScene!, earcutInjection);\r\n for (let hNb = 0; hNb < holes.length; hNb++) {\r\n hole = [];\r\n for (let hPoint = 0; hPoint < holes[hNb].length; hPoint++) {\r\n hole.push(new Vector2(holes[hNb][hPoint].x, holes[hNb][hPoint].z));\r\n }\r\n polygonTriangulation.addHole(hole);\r\n }\r\n //updatability is set during applyToMesh; setting to true in triangulation build produces errors\r\n const polygon = polygonTriangulation.build(false, depth, smoothingThreshold);\r\n polygon._originalBuilderSideOrientation = options.sideOrientation;\r\n const vertexData = CreatePolygonVertexData(polygon, options.sideOrientation, options.faceUV, options.faceColors, options.frontUVs, options.backUVs, options.wrap);\r\n vertexData.applyToMesh(polygon, options.updatable);\r\n return polygon;\r\n }\r\n}\r\n\r\n/**\r\n * Creates an extruded polygon mesh, with depth in the Y direction.\r\n * * You can set different colors and different images to the top, bottom and extruded side by using the parameters `faceColors` (an array of 3 Color3 elements) and `faceUV` (an array of 3 Vector4 elements)\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/texturePerBoxFace\r\n * @param name defines the name of the mesh\r\n * @param options defines the options used to create the mesh\r\n * @param scene defines the hosting scene\r\n * @param earcutInjection can be used to inject your own earcut reference\r\n * @returns the polygon mesh\r\n */\r\nexport function ExtrudePolygon(\r\n name: string,\r\n options: {\r\n shape: Vector3[];\r\n holes?: Vector3[][];\r\n depth?: number;\r\n faceUV?: Vector4[];\r\n faceColors?: Color4[];\r\n updatable?: boolean;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n wrap?: boolean;\r\n },\r\n scene: Nullable<Scene> = null,\r\n earcutInjection = earcut\r\n): Mesh {\r\n return CreatePolygon(name, options, scene, earcutInjection);\r\n}\r\n/**\r\n * Class containing static functions to help procedurally build meshes\r\n * @deprecated use the functions directly from the module\r\n */\r\nexport const PolygonBuilder = {\r\n ExtrudePolygon,\r\n CreatePolygon,\r\n};\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for polygonBuilder.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterPolygonBuilder(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n VertexData.CreatePolygon = CreatePolygonVertexData;\r\n\r\n Mesh.CreatePolygon = (name: string, shape: Vector3[], scene: Scene, holes?: Vector3[][], updatable?: boolean, sideOrientation?: number, earcutInjection = earcut): Mesh => {\r\n const options = {\r\n shape: shape,\r\n holes: holes,\r\n updatable: updatable,\r\n sideOrientation: sideOrientation,\r\n };\r\n return CreatePolygon(name, options, scene, earcutInjection);\r\n };\r\n\r\n Mesh.ExtrudePolygon = (\r\n name: string,\r\n shape: Vector3[],\r\n depth: number,\r\n scene: Scene,\r\n holes?: Vector3[][],\r\n updatable?: boolean,\r\n sideOrientation?: number,\r\n earcutInjection = earcut\r\n ): Mesh => {\r\n const options = {\r\n shape: shape,\r\n holes: holes,\r\n depth: depth,\r\n updatable: updatable,\r\n sideOrientation: sideOrientation,\r\n };\r\n return ExtrudePolygon(name, options, scene, earcutInjection);\r\n };\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"polygonBuilder.pure.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Builders/polygonBuilder.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAgB,MAAM,8BAA8B,CAAC;AAE9E,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OA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CAAC;AACN,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { Vector2, Vector4, type Vector3 } from \"../../Maths/math.vector.pure\";\r\n\r\nimport { Color4 } from \"../../Maths/math.color.pure\";\r\nimport { Mesh } from \"../mesh.pure\";\r\nimport { VertexData } from \"../mesh.vertexData\";\r\nimport { PolygonMeshBuilder } from \"../polygonMesh\";\r\nimport { type FloatArray, type IndicesArray, type Nullable } from \"../../types\";\r\nimport { VertexBuffer } from \"../../Buffers/buffer.pure\";\r\nimport { EngineStore } from \"../../Engines/engineStore\";\r\nimport { useOpenGLOrientationForUV } from \"../../Compat/compatibilityOptions\";\r\nimport { type Scene } from \"../../scene.pure\";\r\n\r\n/* eslint-disable @typescript-eslint/naming-convention */\r\n\r\ndeclare let earcut: any;\r\n\r\n/**\r\n * Creates the VertexData for an irregular Polygon in the XoZ plane using a mesh built by polygonTriangulation.build()\r\n * All parameters are provided by CreatePolygon as needed\r\n * @param polygon a mesh built from polygonTriangulation.build()\r\n * @param sideOrientation takes the values Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE\r\n * @param fUV an array of Vector4 elements used to set different images to the top, rings and bottom respectively\r\n * @param fColors an array of Color3 elements used to set different colors to the top, rings and bottom respectively\r\n * @param frontUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)\r\n * @param backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)\r\n * @param wrp a boolean, default false, when true and fUVs used texture is wrapped around all sides, when false texture is applied side\r\n * @returns the VertexData of the Polygon\r\n */\r\nexport function CreatePolygonVertexData(polygon: Mesh, sideOrientation: number, fUV?: Vector4[], fColors?: Color4[], frontUVs?: Vector4, backUVs?: Vector4, wrp?: boolean) {\r\n const faceUV: Vector4[] = fUV || new Array<Vector4>(3);\r\n const faceColors = fColors;\r\n const colors = [];\r\n const wrap: boolean = wrp || false;\r\n\r\n // default face colors and UV if undefined\r\n for (let f = 0; f < 3; f++) {\r\n if (faceUV[f] === undefined) {\r\n faceUV[f] = new Vector4(0, 0, 1, 1);\r\n }\r\n if (faceColors && faceColors[f] === undefined) {\r\n faceColors[f] = new Color4(1, 1, 1, 1);\r\n }\r\n }\r\n\r\n const positions = <FloatArray>polygon.getVerticesData(VertexBuffer.PositionKind);\r\n const normals = <FloatArray>polygon.getVerticesData(VertexBuffer.NormalKind);\r\n const uvs = <FloatArray>polygon.getVerticesData(VertexBuffer.UVKind);\r\n const indices = <IndicesArray>polygon.getIndices();\r\n const startIndex = positions.length / 9;\r\n let disp: number;\r\n let distX: number;\r\n let distZ: number;\r\n let dist: number;\r\n let totalLen = 0;\r\n const cumulate = [0];\r\n if (wrap) {\r\n for (let idx = startIndex; idx < positions.length / 3; idx += 4) {\r\n distX = positions[3 * (idx + 2)] - positions[3 * idx];\r\n distZ = positions[3 * (idx + 2) + 2] - positions[3 * idx + 2];\r\n dist = Math.sqrt(distX * distX + distZ * distZ);\r\n totalLen += dist;\r\n cumulate.push(totalLen);\r\n }\r\n }\r\n // set face colours and textures\r\n let idx: number;\r\n let face: number = 0;\r\n for (let index = 0; index < normals.length; index += 3) {\r\n //Edge Face no. 1\r\n if (Math.abs(normals[index + 1]) < 0.001) {\r\n face = 1;\r\n }\r\n //Top Face no. 0\r\n if (Math.abs(normals[index + 1] - 1) < 0.001) {\r\n face = 0;\r\n }\r\n //Bottom Face no. 2\r\n if (Math.abs(normals[index + 1] + 1) < 0.001) {\r\n face = 2;\r\n }\r\n idx = index / 3;\r\n if (face === 1) {\r\n disp = idx - startIndex;\r\n if (disp % 4 < 1.5) {\r\n if (wrap) {\r\n uvs[2 * idx] = faceUV[face].x + ((faceUV[face].z - faceUV[face].x) * cumulate[Math.floor(disp / 4)]) / totalLen;\r\n } else {\r\n uvs[2 * idx] = faceUV[face].x;\r\n }\r\n } else {\r\n if (wrap) {\r\n uvs[2 * idx] = faceUV[face].x + ((faceUV[face].z - faceUV[face].x) * cumulate[Math.floor(disp / 4) + 1]) / totalLen;\r\n } else {\r\n uvs[2 * idx] = faceUV[face].z;\r\n }\r\n }\r\n if (disp % 2 === 0) {\r\n uvs[2 * idx + 1] = useOpenGLOrientationForUV ? 1.0 - faceUV[face].w : faceUV[face].w;\r\n } else {\r\n uvs[2 * idx + 1] = useOpenGLOrientationForUV ? 1.0 - faceUV[face].y : faceUV[face].y;\r\n }\r\n } else {\r\n uvs[2 * idx] = (1 - uvs[2 * idx]) * faceUV[face].x + uvs[2 * idx] * faceUV[face].z;\r\n uvs[2 * idx + 1] = (1 - uvs[2 * idx + 1]) * faceUV[face].y + uvs[2 * idx + 1] * faceUV[face].w;\r\n\r\n if (useOpenGLOrientationForUV) {\r\n uvs[2 * idx + 1] = 1.0 - uvs[2 * idx + 1];\r\n }\r\n }\r\n if (faceColors) {\r\n colors.push(faceColors[face].r, faceColors[face].g, faceColors[face].b, faceColors[face].a);\r\n }\r\n }\r\n\r\n // sides\r\n VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs, frontUVs, backUVs);\r\n\r\n // Result\r\n const vertexData = new VertexData();\r\n vertexData.indices = indices;\r\n vertexData.positions = positions;\r\n vertexData.normals = normals;\r\n vertexData.uvs = uvs;\r\n\r\n if (faceColors) {\r\n const totalColors = sideOrientation === VertexData.DOUBLESIDE ? colors.concat(colors) : colors;\r\n vertexData.colors = totalColors;\r\n }\r\n\r\n return vertexData;\r\n}\r\n\r\n/**\r\n * Creates a polygon mesh\r\n * The polygon's shape will depend on the input parameters and is constructed parallel to a ground mesh\r\n * * The parameter `shape` is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors\r\n * * You can set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE\r\n * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created\r\n * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4)\r\n * * Remember you can only change the shape positions, not their number when updating a polygon\r\n * * The `smoothingThreshold` option defines the dot product threshold for smoothing the normals of adjacent side faces. The default value of 2 disables smoothing\r\n * @param name defines the name of the mesh\r\n * @param options defines the options used to create the mesh\r\n * @param scene defines the hosting scene\r\n * @param earcutInjection can be used to inject your own earcut reference\r\n * @returns the polygon mesh\r\n */\r\nexport function CreatePolygon(\r\n name: string,\r\n options: {\r\n shape: Vector3[];\r\n holes?: Vector3[][];\r\n depth?: number;\r\n smoothingThreshold?: number;\r\n faceUV?: Vector4[];\r\n faceColors?: Color4[];\r\n updatable?: boolean;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n wrap?: boolean;\r\n instance?: Mesh;\r\n },\r\n scene: Nullable<Scene> = null,\r\n earcutInjection = earcut\r\n): Mesh {\r\n options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation);\r\n const shape = options.shape;\r\n const holes = options.holes || [];\r\n const depth = options.depth || 0;\r\n const smoothingThreshold = options.smoothingThreshold || 2;\r\n if (options.instance) {\r\n const vertexData = CreatePolygonVertexData(options.instance, options.sideOrientation, options.faceUV, options.faceColors, options.frontUVs, options.backUVs, options.wrap);\r\n vertexData.applyToMesh(options.instance, options.updatable);\r\n return options.instance;\r\n } else {\r\n const contours: Array<Vector2> = [];\r\n let hole: Array<Vector2>;\r\n\r\n for (let i = 0; i < shape.length; i++) {\r\n contours[i] = new Vector2(shape[i].x, shape[i].z);\r\n }\r\n const epsilon = 0.00000001;\r\n if (contours[0].equalsWithEpsilon(contours[contours.length - 1], epsilon)) {\r\n contours.pop();\r\n }\r\n\r\n const polygonTriangulation = new PolygonMeshBuilder(name, contours, scene || EngineStore.LastCreatedScene!, earcutInjection);\r\n for (let hNb = 0; hNb < holes.length; hNb++) {\r\n hole = [];\r\n for (let hPoint = 0; hPoint < holes[hNb].length; hPoint++) {\r\n hole.push(new Vector2(holes[hNb][hPoint].x, holes[hNb][hPoint].z));\r\n }\r\n polygonTriangulation.addHole(hole);\r\n }\r\n //updatability is set during applyToMesh; setting to true in triangulation build produces errors\r\n const polygon = polygonTriangulation.build(false, depth, smoothingThreshold);\r\n polygon._originalBuilderSideOrientation = options.sideOrientation;\r\n const vertexData = CreatePolygonVertexData(polygon, options.sideOrientation, options.faceUV, options.faceColors, options.frontUVs, options.backUVs, options.wrap);\r\n vertexData.applyToMesh(polygon, options.updatable);\r\n return polygon;\r\n }\r\n}\r\n\r\n/**\r\n * Creates an extruded polygon mesh, with depth in the Y direction.\r\n * * You can set different colors and different images to the top, bottom and extruded side by using the parameters `faceColors` (an array of 3 Color3 elements) and `faceUV` (an array of 3 Vector4 elements)\r\n * * The `smoothingThreshold` option defines the dot product threshold for smoothing the normals of adjacent side faces. The default value of 2 disables smoothing\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/texturePerBoxFace\r\n * @see https://playground.babylonjs.com/#TJLZLN#0\r\n * @param name defines the name of the mesh\r\n * @param options defines the options used to create the mesh\r\n * @param scene defines the hosting scene\r\n * @param earcutInjection can be used to inject your own earcut reference\r\n * @returns the polygon mesh\r\n */\r\nexport function ExtrudePolygon(\r\n name: string,\r\n options: {\r\n shape: Vector3[];\r\n holes?: Vector3[][];\r\n depth?: number;\r\n smoothingThreshold?: number;\r\n faceUV?: Vector4[];\r\n faceColors?: Color4[];\r\n updatable?: boolean;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n wrap?: boolean;\r\n },\r\n scene: Nullable<Scene> = null,\r\n earcutInjection = earcut\r\n): Mesh {\r\n return CreatePolygon(name, options, scene, earcutInjection);\r\n}\r\n/**\r\n * Class containing static functions to help procedurally build meshes\r\n * @deprecated use the functions directly from the module\r\n */\r\nexport const PolygonBuilder = {\r\n ExtrudePolygon,\r\n CreatePolygon,\r\n};\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for polygonBuilder.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterPolygonBuilder(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n VertexData.CreatePolygon = CreatePolygonVertexData;\r\n\r\n Mesh.CreatePolygon = (name: string, shape: Vector3[], scene: Scene, holes?: Vector3[][], updatable?: boolean, sideOrientation?: number, earcutInjection = earcut): Mesh => {\r\n const options = {\r\n shape: shape,\r\n holes: holes,\r\n updatable: updatable,\r\n sideOrientation: sideOrientation,\r\n };\r\n return CreatePolygon(name, options, scene, earcutInjection);\r\n };\r\n\r\n Mesh.ExtrudePolygon = (\r\n name: string,\r\n shape: Vector3[],\r\n depth: number,\r\n scene: Scene,\r\n holes?: Vector3[][],\r\n updatable?: boolean,\r\n sideOrientation?: number,\r\n earcutInjection = earcut\r\n ): Mesh => {\r\n const options = {\r\n shape: shape,\r\n holes: holes,\r\n depth: depth,\r\n updatable: updatable,\r\n sideOrientation: sideOrientation,\r\n };\r\n return ExtrudePolygon(name, options, scene, earcutInjection);\r\n };\r\n}\r\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-exports the pure implementation and registers point splatting on GaussianSplattingMesh.
|
|
3
|
+
* Import gaussianPointSplattingController.pure for tree-shakeable, side-effect-free usage.
|
|
4
|
+
*/
|
|
5
|
+
export * from "./gaussianPointSplattingController.pure.js";
|
|
6
|
+
import "./gaussianPointSplattingRenderer.js";
|
|
7
|
+
import "../../Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.js";
|
|
8
|
+
import "../../Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-exports the pure implementation and registers point splatting on GaussianSplattingMesh.
|
|
3
|
+
* Import gaussianPointSplattingController.pure for tree-shakeable, side-effect-free usage.
|
|
4
|
+
*/
|
|
5
|
+
export * from "./gaussianPointSplattingController.pure.js";
|
|
6
|
+
import { RegisterGaussianPointSplattingController } from "./gaussianPointSplattingController.pure.js";
|
|
7
|
+
RegisterGaussianPointSplattingController();
|
|
8
|
+
import "./gaussianPointSplattingRenderer.js";
|
|
9
|
+
import "../../Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.js";
|
|
10
|
+
import "../../Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.js";
|
|
11
|
+
//# sourceMappingURL=gaussianPointSplattingController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gaussianPointSplattingController.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/GaussianSplatting/gaussianPointSplattingController.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,yCAAyC,CAAC;AAExD,OAAO,EAAE,wCAAwC,EAAE,MAAM,yCAAyC,CAAC;AACnG,wCAAwC,EAAE,CAAC;AAE3C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,sEAAsE,CAAC;AAC9E,OAAO,2EAA2E,CAAC","sourcesContent":["/**\n * Re-exports the pure implementation and registers point splatting on GaussianSplattingMesh.\n * Import gaussianPointSplattingController.pure for tree-shakeable, side-effect-free usage.\n */\nexport * from \"./gaussianPointSplattingController.pure\";\n\nimport { RegisterGaussianPointSplattingController } from \"./gaussianPointSplattingController.pure\";\nRegisterGaussianPointSplattingController();\n\nimport \"./gaussianPointSplattingRenderer\";\nimport \"../../Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial\";\nimport \"../../Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial\";\n"]}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
/** This file must only contain pure code and pure imports */
|
|
2
|
+
import { type Nullable } from "../../types.js";
|
|
3
|
+
import { type GaussianSplattingMesh, type IGaussianPointSplattingController, type IGaussianPointSplattingProgress } from "./gaussianSplattingMesh.pure.js";
|
|
4
|
+
/**
|
|
5
|
+
* Owns the WebGPU compute point-splatting path of one {@link GaussianSplattingMesh}: decode, dispatch,
|
|
6
|
+
* auto render scale, and the compositors that blit the result into the scene.
|
|
7
|
+
*
|
|
8
|
+
* The mesh never imports this module, so bundles without point splatting do not include it. It is enabled
|
|
9
|
+
* by {@link RegisterGaussianPointSplattingController}, which the side-effect wrapper calls.
|
|
10
|
+
*/
|
|
11
|
+
export declare class GaussianPointSplattingController implements IGaussianPointSplattingController {
|
|
12
|
+
private readonly _mesh;
|
|
13
|
+
private readonly _scene;
|
|
14
|
+
/**
|
|
15
|
+
* Creates a point-splatting controller for a Gaussian Splatting mesh.
|
|
16
|
+
* @param mesh the mesh whose splat data this controller renders
|
|
17
|
+
*/
|
|
18
|
+
constructor(mesh: GaussianSplattingMesh);
|
|
19
|
+
private _colorMode;
|
|
20
|
+
private _depthMode;
|
|
21
|
+
private readonly _projectionClipRange;
|
|
22
|
+
private _scale;
|
|
23
|
+
private _renderScale;
|
|
24
|
+
private _occlusionCulling;
|
|
25
|
+
private _autoN;
|
|
26
|
+
private _autoMeasuredGeneration;
|
|
27
|
+
private _lastRenderedGeneration;
|
|
28
|
+
private _autoRequestId;
|
|
29
|
+
private _budgetReadPending;
|
|
30
|
+
private _resultReady;
|
|
31
|
+
private _colorHistoryReady;
|
|
32
|
+
private _colorUsesCameraTransform;
|
|
33
|
+
private _cameraFrameId;
|
|
34
|
+
private _cameraId;
|
|
35
|
+
/** Whether the latest compute run succeeded; unlike `_resultReady`, not cleared at frame start. */
|
|
36
|
+
private _progressReady;
|
|
37
|
+
private _computedWidth;
|
|
38
|
+
private _computedHeight;
|
|
39
|
+
private _progressFrameCount;
|
|
40
|
+
private _progressGeneration;
|
|
41
|
+
private _progressCycleLength;
|
|
42
|
+
private _streamingWarned;
|
|
43
|
+
private _sourceWarned;
|
|
44
|
+
private _workloadWarned;
|
|
45
|
+
private _invalidProjectionWarned;
|
|
46
|
+
private _renderer;
|
|
47
|
+
private _blit;
|
|
48
|
+
private _blitMesh;
|
|
49
|
+
private _depthBlit;
|
|
50
|
+
private _depthBlitMesh;
|
|
51
|
+
private _computeObserver;
|
|
52
|
+
private _cameraObserver;
|
|
53
|
+
private _restoreObserver;
|
|
54
|
+
private _splatCount;
|
|
55
|
+
private _partCount;
|
|
56
|
+
private _decodedPartCount;
|
|
57
|
+
private _decodedRevision;
|
|
58
|
+
private _decodedShDegree;
|
|
59
|
+
private _partLocalMin;
|
|
60
|
+
private _partLocalMax;
|
|
61
|
+
private _partScratch;
|
|
62
|
+
private _decodedSplatsData;
|
|
63
|
+
private readonly _vpMatrix;
|
|
64
|
+
private readonly _cameraVpMatrix;
|
|
65
|
+
private readonly _inverseProjection;
|
|
66
|
+
private readonly _outputSize;
|
|
67
|
+
private readonly _depthSpan;
|
|
68
|
+
/** {@inheritDoc IGaussianPointSplattingController.colorRenderMode} */
|
|
69
|
+
get colorRenderMode(): boolean;
|
|
70
|
+
set colorRenderMode(value: boolean);
|
|
71
|
+
/** {@inheritDoc IGaussianPointSplattingController.depthRenderMode} */
|
|
72
|
+
get depthRenderMode(): boolean;
|
|
73
|
+
set depthRenderMode(value: boolean);
|
|
74
|
+
/** {@inheritDoc IGaussianPointSplattingController.progress} */
|
|
75
|
+
get progress(): Nullable<IGaussianPointSplattingProgress>;
|
|
76
|
+
/** True while either point-splatting mode is on, i.e. while the shared compute must run. */
|
|
77
|
+
private get _computeActive();
|
|
78
|
+
/** GPU-only SOG and standalone streams have no retained splats for the compute decoder. */
|
|
79
|
+
private get _hasUnsupportedSource();
|
|
80
|
+
/** {@inheritDoc IGaussianPointSplattingController.pointScale} */
|
|
81
|
+
get pointScale(): number;
|
|
82
|
+
set pointScale(value: number);
|
|
83
|
+
/** {@inheritDoc IGaussianPointSplattingController.occlusionCulling} */
|
|
84
|
+
get occlusionCulling(): boolean;
|
|
85
|
+
set occlusionCulling(value: boolean);
|
|
86
|
+
/** Lazily builds the compute shared by the color and depth modes. Idempotent. */
|
|
87
|
+
private _ensureCompute;
|
|
88
|
+
/** Tears down the shared compute once neither point-splatting mode needs it anymore. */
|
|
89
|
+
private _releaseComputeIfIdle;
|
|
90
|
+
private _releaseComputeResources;
|
|
91
|
+
private _releaseBlitResources;
|
|
92
|
+
/** Builds a fullscreen compositor triangle. It is disabled and drawn manually, so its clip-space
|
|
93
|
+
* geometry never leaks into other geometry passes.
|
|
94
|
+
* @param name the compositor mesh name
|
|
95
|
+
* @param material the blit material to render it with
|
|
96
|
+
* @returns the created compositor mesh
|
|
97
|
+
*/
|
|
98
|
+
private _createBlitMesh;
|
|
99
|
+
/** Lazily builds the color compositor. */
|
|
100
|
+
private _enableColorBlit;
|
|
101
|
+
/** Lazily builds the depth compositor. */
|
|
102
|
+
private _enableDepthBlit;
|
|
103
|
+
/**
|
|
104
|
+
* Checks the mesh's current data and output size against the device buffer limits, before anything is
|
|
105
|
+
* decoded or allocated. Warns once when they do not fit.
|
|
106
|
+
* @returns whether the workload fits
|
|
107
|
+
*/
|
|
108
|
+
private _isWorkloadSupported;
|
|
109
|
+
/** Re-decodes the splat data if it changed since the last decode. */
|
|
110
|
+
private _syncData;
|
|
111
|
+
/**
|
|
112
|
+
* Decodes raw `.splat` bytes into local-space per-Gaussian buffers. Mirrors the classic `_makeSplat`,
|
|
113
|
+
* including the `* 2` on the scale, which `gpsPreprocess` cancels on the projected covariance.
|
|
114
|
+
* @param splatsData raw `.splat` bytes for this mesh's splats
|
|
115
|
+
*/
|
|
116
|
+
private _decode;
|
|
117
|
+
/**
|
|
118
|
+
* Packs the loader's 8-bit SH bytes into u32 words per splat.
|
|
119
|
+
* @param shData packed per-splat SH textures, one per 16 scalar components, or undefined
|
|
120
|
+
* @param shDegree spherical-harmonics degree (0-4)
|
|
121
|
+
* @param count number of splats
|
|
122
|
+
* @returns u32-packed SH bytes, or null when SH is absent
|
|
123
|
+
*/
|
|
124
|
+
private _packSh;
|
|
125
|
+
/** Uploads this frame's per-part world matrix, visibility and debug-plugin rows. */
|
|
126
|
+
private _uploadParts;
|
|
127
|
+
/**
|
|
128
|
+
* Packs current part inputs without changing the renderer's accumulation or dispatch buffers.
|
|
129
|
+
* @returns whether the debug plugin is active
|
|
130
|
+
*/
|
|
131
|
+
private _packParts;
|
|
132
|
+
/**
|
|
133
|
+
* Protects point-color history from pass-specific inputs while allowing shared camera motion.
|
|
134
|
+
* @returns whether depth can share the current color inputs without a pass-specific accumulation reset
|
|
135
|
+
*/
|
|
136
|
+
private _depthInputsMatchColorHistory;
|
|
137
|
+
/**
|
|
138
|
+
* Uses the scene's main camera matrix before render targets can refresh the camera's projection cache.
|
|
139
|
+
* @returns the current camera transform, or null if a different camera owns the render target
|
|
140
|
+
*/
|
|
141
|
+
private _getCameraTransform;
|
|
142
|
+
/**
|
|
143
|
+
* Reads the forward clipping interval of a projection whose depth is independent of x/y.
|
|
144
|
+
* @param projection the supplied projection matrix
|
|
145
|
+
* @returns the reused near/far interval (zero far means infinite), or null for unsupported intervals
|
|
146
|
+
*/
|
|
147
|
+
private _getProjectionClipRange;
|
|
148
|
+
/**
|
|
149
|
+
* Computes the model's view-depth span from its part AABB corners.
|
|
150
|
+
* @param viewM column-major view matrix
|
|
151
|
+
* @param near camera near plane
|
|
152
|
+
* @param far camera far plane; 0 means infinite
|
|
153
|
+
* @param clampToCamera whether to clamp the interval to the standard camera near/far planes
|
|
154
|
+
* @returns the model's [viewZMin, viewZMax] this frame
|
|
155
|
+
*/
|
|
156
|
+
private _viewZSpan;
|
|
157
|
+
/**
|
|
158
|
+
* Returns a stride coprime to `total` near the golden ratio, so `i*stride % total` is a decorrelated permutation.
|
|
159
|
+
* @param total the cycle length (number of sub-cells, N*N)
|
|
160
|
+
* @returns a stride coprime to total
|
|
161
|
+
*/
|
|
162
|
+
private _coprimeStride;
|
|
163
|
+
/** Per-frame point target for the `"auto"` render scale: desktop 15M, iOS 9M, other mobile 6M.
|
|
164
|
+
* @returns the target emitted-point count per frame */
|
|
165
|
+
private _budget;
|
|
166
|
+
/**
|
|
167
|
+
* Reads back the point count and derives the auto render factor N from the device budget.
|
|
168
|
+
* @param currentN the render factor N used for the frame being measured
|
|
169
|
+
* @param generation the accumulation generation the measured frame belongs to
|
|
170
|
+
* @param freeze whether the measured frame had occlusion culling active, so N may be fixed for `generation`
|
|
171
|
+
*/
|
|
172
|
+
private _updateAutoScale;
|
|
173
|
+
private _convergeAutoScaleAsync;
|
|
174
|
+
/** Returns the current depth map's size, or the camera's color target size for other passes.
|
|
175
|
+
* The returned object is reused between calls.
|
|
176
|
+
* @param colorTarget whether to return color dimensions regardless of the current pass
|
|
177
|
+
* @returns The current target dimensions in pixels.
|
|
178
|
+
*/
|
|
179
|
+
private _getOutputSize;
|
|
180
|
+
/** Refreshes inputs baked into the point result, including changes made by per-pass mesh callbacks. */
|
|
181
|
+
private _syncRenderInputs;
|
|
182
|
+
/** Runs compute immediately before a point compositor and binds the result to both blit materials. */
|
|
183
|
+
private _runCompute;
|
|
184
|
+
/**
|
|
185
|
+
* True when the frame renders a view the point path cannot reproduce: several active cameras, rig
|
|
186
|
+
* cameras (stereo, XR, multiview), floating origin, unsupported projection clipping intervals, or scene/material clip planes.
|
|
187
|
+
* The classic path renders those instead.
|
|
188
|
+
* @returns whether point splatting must fall back to the classic path this frame
|
|
189
|
+
*/
|
|
190
|
+
private _hasUnsupportedView;
|
|
191
|
+
/**
|
|
192
|
+
* True only for the camera's main forward color pass.
|
|
193
|
+
* @returns whether the current render pass is the camera's main forward color pass
|
|
194
|
+
*/
|
|
195
|
+
private _isMainColorPass;
|
|
196
|
+
/**
|
|
197
|
+
* The active camera's scene depth renderer while it is rendering; other depth passes use the classic path.
|
|
198
|
+
* @returns the depth renderer owning the current render pass, or null
|
|
199
|
+
*/
|
|
200
|
+
private _getCurrentDepthRenderer;
|
|
201
|
+
/**
|
|
202
|
+
* True only while rendering the active camera's scene depth renderer.
|
|
203
|
+
* @returns whether the current render pass is the active camera's depth renderer pass
|
|
204
|
+
*/
|
|
205
|
+
private _isDepthPass;
|
|
206
|
+
/** {@inheritDoc IGaussianPointSplattingController.dispose} */
|
|
207
|
+
dispose(): void;
|
|
208
|
+
/** {@inheritDoc IGaussianPointSplattingController.renderScale} */
|
|
209
|
+
get renderScale(): number | "auto";
|
|
210
|
+
set renderScale(value: number | "auto");
|
|
211
|
+
/** {@inheritDoc IGaussianPointSplattingController.invalidateDecodedSplats} */
|
|
212
|
+
invalidateDecodedSplats(): void;
|
|
213
|
+
/**
|
|
214
|
+
* Checks only plugin implementations whose enabled behavior is reproduced, or whose disabled behavior is neutral.
|
|
215
|
+
* @returns whether the source material's plugins are compatible with point color
|
|
216
|
+
*/
|
|
217
|
+
private _supportsSourceMaterialPlugins;
|
|
218
|
+
/** {@inheritDoc IGaussianPointSplattingController.handlesCurrentPass} */
|
|
219
|
+
get handlesCurrentPass(): boolean;
|
|
220
|
+
/**
|
|
221
|
+
* Composites supported camera color or depth passes from the point-splatting result.
|
|
222
|
+
* The pass waits without drawing classic splats while compute or compositor shaders are compiling.
|
|
223
|
+
* @param enableAlphaMode whether the color compositor should enable alpha blending
|
|
224
|
+
* @returns whether the point path handled the current pass, including waiting for shader readiness
|
|
225
|
+
*/
|
|
226
|
+
drawColorPass(enableAlphaMode: boolean): boolean;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Enables the point-splatting properties of {@link GaussianSplattingMesh}. Idempotent.
|
|
230
|
+
*/
|
|
231
|
+
export declare function RegisterGaussianPointSplattingController(): void;
|