@babylonjs/core 6.39.0 → 6.41.0
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/Actions/action.js +3 -1
- package/Actions/action.js.map +1 -1
- package/Actions/condition.js +1 -0
- package/Actions/condition.js.map +1 -1
- package/Actions/directActions.d.ts +2 -2
- package/Actions/directActions.js +2 -2
- package/Actions/directActions.js.map +1 -1
- package/Animations/pathCursor.js +1 -0
- package/Animations/pathCursor.js.map +1 -1
- package/Animations/runtimeAnimation.js +3 -3
- package/Animations/runtimeAnimation.js.map +1 -1
- package/Audio/audioEngine.js +5 -0
- package/Audio/audioEngine.js.map +1 -1
- package/Behaviors/Cameras/autoRotationBehavior.d.ts +3 -0
- package/Behaviors/Cameras/autoRotationBehavior.js +3 -0
- package/Behaviors/Cameras/autoRotationBehavior.js.map +1 -1
- package/Behaviors/Meshes/pointerDragBehavior.d.ts +1 -0
- package/Behaviors/Meshes/pointerDragBehavior.js +2 -0
- package/Behaviors/Meshes/pointerDragBehavior.js.map +1 -1
- package/Bones/bone.d.ts +2 -0
- package/Bones/bone.js +2 -0
- package/Bones/bone.js.map +1 -1
- package/Cameras/Inputs/BaseCameraPointersInput.d.ts +2 -2
- package/Cameras/Inputs/BaseCameraPointersInput.js +2 -2
- package/Cameras/Inputs/BaseCameraPointersInput.js.map +1 -1
- package/Cameras/Inputs/arcRotateCameraPointersInput.d.ts +9 -9
- package/Cameras/Inputs/arcRotateCameraPointersInput.js +9 -9
- package/Cameras/Inputs/arcRotateCameraPointersInput.js.map +1 -1
- package/Cameras/Inputs/followCameraKeyboardMoveInput.d.ts +3 -0
- package/Cameras/Inputs/followCameraKeyboardMoveInput.js +3 -0
- package/Cameras/Inputs/followCameraKeyboardMoveInput.js.map +1 -1
- package/Cameras/arcRotateCamera.d.ts +2 -0
- package/Cameras/arcRotateCamera.js +2 -0
- package/Cameras/arcRotateCamera.js.map +1 -1
- package/Cameras/camera.d.ts +2 -0
- package/Cameras/camera.js +4 -0
- package/Cameras/camera.js.map +1 -1
- package/Cameras/followCamera.d.ts +1 -0
- package/Cameras/followCamera.js +1 -0
- package/Cameras/followCamera.js.map +1 -1
- package/Debug/debugLayer.d.ts +4 -1
- package/Debug/debugLayer.js +4 -1
- package/Debug/debugLayer.js.map +1 -1
- package/Debug/physicsViewer.d.ts +1 -0
- package/Debug/physicsViewer.js +3 -2
- package/Debug/physicsViewer.js.map +1 -1
- package/Decorators/nodeDecorator.d.ts +5 -4
- package/Decorators/nodeDecorator.js +5 -4
- package/Decorators/nodeDecorator.js.map +1 -1
- package/DeviceInput/eventFactory.d.ts +2 -0
- package/DeviceInput/eventFactory.js +3 -0
- package/DeviceInput/eventFactory.js.map +1 -1
- package/DeviceInput/webDeviceInputSystem.js +3 -0
- package/DeviceInput/webDeviceInputSystem.js.map +1 -1
- package/Engines/Extensions/engine.multiview.js +2 -0
- package/Engines/Extensions/engine.multiview.js.map +1 -1
- package/Engines/Native/nativeDataStream.d.ts +32 -0
- package/Engines/Native/nativeDataStream.js +32 -0
- package/Engines/Native/nativeDataStream.js.map +1 -1
- package/Engines/Native/nativePipelineContext.d.ts +0 -3
- package/Engines/Native/nativePipelineContext.js +0 -3
- package/Engines/Native/nativePipelineContext.js.map +1 -1
- package/Engines/WebGL/webGLPipelineContext.d.ts +0 -3
- package/Engines/WebGL/webGLPipelineContext.js +0 -3
- package/Engines/WebGL/webGLPipelineContext.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.readTexture.js +1 -0
- package/Engines/WebGPU/Extensions/engine.readTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheBindGroups.d.ts +1 -0
- package/Engines/WebGPU/webgpuCacheBindGroups.js +1 -0
- package/Engines/WebGPU/webgpuCacheBindGroups.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js +3 -0
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
- package/Engines/WebGPU/webgpuPipelineContext.d.ts +0 -3
- package/Engines/WebGPU/webgpuPipelineContext.js +0 -3
- package/Engines/WebGPU/webgpuPipelineContext.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessingContext.js +1 -0
- package/Engines/WebGPU/webgpuShaderProcessingContext.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.d.ts +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +11 -2
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.js +22 -0
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureManager.js +2 -1
- package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
- package/Engines/engine.js +1 -0
- package/Engines/engine.js.map +1 -1
- package/Engines/nativeEngine.d.ts +4 -0
- package/Engines/nativeEngine.js +5 -0
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/thinEngine.js +7 -3
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +1 -1
- package/Engines/webgpuEngine.js +17 -1
- package/Engines/webgpuEngine.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.d.ts +207 -2
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js +207 -6
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.d.ts +15 -0
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js +9 -0
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.d.ts +4 -0
- package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js +4 -0
- package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.d.ts +17 -1
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js +14 -1
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.d.ts +9 -0
- package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.js +9 -0
- package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphCoordinateTransformBlock.d.ts +5 -0
- package/FlowGraph/Blocks/Data/flowGraphCoordinateTransformBlock.js +5 -0
- package/FlowGraph/Blocks/Data/flowGraphCoordinateTransformBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.d.ts +16 -1
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js +13 -1
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.d.ts +12 -1
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js +12 -1
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.d.ts +18 -0
- package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.js +9 -0
- package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.d.ts +12 -0
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js +9 -0
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.d.ts +15 -1
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js +12 -1
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.d.ts +18 -2
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js +15 -4
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.d.ts +6 -0
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js +6 -0
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.d.ts +6 -0
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.js +6 -0
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.d.ts +5 -2
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js +4 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.d.ts +15 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js +12 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.d.ts +4 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js +3 -0
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.d.ts +3 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.js +3 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.d.ts +3 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js +3 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.d.ts +3 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js +3 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.d.ts +14 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js +11 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.d.ts +3 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.js +3 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.d.ts +3 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js +3 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.d.ts +15 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js +12 -4
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.d.ts +14 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.js +11 -4
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.d.ts +15 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js +12 -4
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.d.ts +3 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js +3 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.d.ts +6 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js +6 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.d.ts +15 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js +12 -3
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.d.ts +18 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js +15 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.d.ts +6 -0
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js +6 -0
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.d.ts +14 -2
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js +11 -4
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.d.ts +15 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js +12 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.d.ts +14 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js +11 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js.map +1 -1
- package/FlowGraph/flowGraph.d.ts +16 -8
- package/FlowGraph/flowGraph.js +13 -8
- package/FlowGraph/flowGraph.js.map +1 -1
- package/FlowGraph/flowGraphBlock.d.ts +54 -5
- package/FlowGraph/flowGraphBlock.js +50 -11
- package/FlowGraph/flowGraphBlock.js.map +1 -1
- package/FlowGraph/flowGraphConnection.d.ts +10 -6
- package/FlowGraph/flowGraphConnection.js +10 -6
- package/FlowGraph/flowGraphConnection.js.map +1 -1
- package/FlowGraph/flowGraphContext.d.ts +10 -8
- package/FlowGraph/flowGraphContext.js +10 -8
- package/FlowGraph/flowGraphContext.js.map +1 -1
- package/FlowGraph/flowGraphCoordinator.d.ts +27 -1
- package/FlowGraph/flowGraphCoordinator.js +18 -2
- package/FlowGraph/flowGraphCoordinator.js.map +1 -1
- package/FlowGraph/flowGraphDataConnection.d.ts +26 -1
- package/FlowGraph/flowGraphDataConnection.js +23 -1
- package/FlowGraph/flowGraphDataConnection.js.map +1 -1
- package/FlowGraph/flowGraphExecutionBlock.d.ts +27 -1
- package/FlowGraph/flowGraphExecutionBlock.js +22 -4
- package/FlowGraph/flowGraphExecutionBlock.js.map +1 -1
- package/FlowGraph/flowGraphRichTypes.d.ts +24 -1
- package/FlowGraph/flowGraphRichTypes.js +18 -1
- package/FlowGraph/flowGraphRichTypes.js.map +1 -1
- package/FlowGraph/flowGraphSignalConnection.d.ts +2 -0
- package/FlowGraph/flowGraphSignalConnection.js +2 -0
- package/FlowGraph/flowGraphSignalConnection.js.map +1 -1
- package/Gamepads/gamepad.d.ts +2 -2
- package/Gamepads/gamepad.js +2 -2
- package/Gamepads/gamepad.js.map +1 -1
- package/Gamepads/gamepadSceneComponent.js +2 -0
- package/Gamepads/gamepadSceneComponent.js.map +1 -1
- package/Gizmos/axisScaleGizmo.d.ts +2 -0
- package/Gizmos/axisScaleGizmo.js +2 -0
- package/Gizmos/axisScaleGizmo.js.map +1 -1
- package/Gizmos/boundingBoxGizmo.d.ts +19 -0
- package/Gizmos/boundingBoxGizmo.js +36 -15
- package/Gizmos/boundingBoxGizmo.js.map +1 -1
- package/Gizmos/cameraGizmo.js +1 -0
- package/Gizmos/cameraGizmo.js.map +1 -1
- package/Gizmos/gizmo.js +1 -0
- package/Gizmos/gizmo.js.map +1 -1
- package/Gizmos/gizmoManager.d.ts +18 -0
- package/Gizmos/gizmoManager.js +34 -0
- package/Gizmos/gizmoManager.js.map +1 -1
- package/Gizmos/lightGizmo.d.ts +1 -0
- package/Gizmos/lightGizmo.js +1 -0
- package/Gizmos/lightGizmo.js.map +1 -1
- package/Gizmos/planeRotationGizmo.d.ts +2 -0
- package/Gizmos/planeRotationGizmo.js +2 -0
- package/Gizmos/planeRotationGizmo.js.map +1 -1
- package/Gizmos/positionGizmo.d.ts +11 -0
- package/Gizmos/positionGizmo.js +19 -0
- package/Gizmos/positionGizmo.js.map +1 -1
- package/Gizmos/rotationGizmo.d.ts +14 -0
- package/Gizmos/rotationGizmo.js +14 -0
- package/Gizmos/rotationGizmo.js.map +1 -1
- package/Gizmos/scaleGizmo.d.ts +18 -1
- package/Gizmos/scaleGizmo.js +19 -1
- package/Gizmos/scaleGizmo.js.map +1 -1
- package/Helpers/environmentHelper.d.ts +4 -2
- package/Helpers/environmentHelper.js +4 -2
- package/Helpers/environmentHelper.js.map +1 -1
- package/Layers/effectLayer.d.ts +1 -0
- package/Layers/effectLayer.js +1 -0
- package/Layers/effectLayer.js.map +1 -1
- package/Layers/glowLayer.d.ts +3 -1
- package/Layers/glowLayer.js +3 -1
- package/Layers/glowLayer.js.map +1 -1
- package/Layers/highlightLayer.d.ts +3 -2
- package/Layers/highlightLayer.js +3 -2
- package/Layers/highlightLayer.js.map +1 -1
- package/Lights/light.d.ts +1 -1
- package/Lights/light.js +1 -1
- package/Lights/light.js.map +1 -1
- package/Loading/sceneLoader.js +4 -0
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/Background/backgroundMaterial.d.ts +2 -2
- package/Materials/Background/backgroundMaterial.js +10 -9
- package/Materials/Background/backgroundMaterial.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.d.ts +72 -0
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.js +231 -0
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -0
- package/Materials/GreasedLine/greasedLinePluginMaterial.d.ts +0 -1
- package/Materials/GreasedLine/greasedLinePluginMaterial.js +0 -1
- package/Materials/GreasedLine/greasedLinePluginMaterial.js.map +1 -1
- package/Materials/GreasedLine/greasedLineSimpleMaterial.d.ts +0 -1
- package/Materials/GreasedLine/greasedLineSimpleMaterial.js +0 -1
- package/Materials/GreasedLine/greasedLineSimpleMaterial.js.map +1 -1
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.d.ts +2 -1
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js +1 -1
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragCoordBlock.js +1 -0
- package/Materials/Node/Blocks/Fragment/fragCoordBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/frontFacingBlock.js +1 -0
- package/Materials/Node/Blocks/Fragment/frontFacingBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/screenSizeBlock.js +1 -0
- package/Materials/Node/Blocks/Fragment/screenSizeBlock.js.map +1 -1
- package/Materials/Node/Blocks/Teleport/teleportInBlock.d.ts +3 -1
- package/Materials/Node/Blocks/Teleport/teleportInBlock.js +3 -1
- package/Materials/Node/Blocks/Teleport/teleportInBlock.js.map +1 -1
- package/Materials/Node/Blocks/triPlanarBlock.d.ts +1 -0
- package/Materials/Node/Blocks/triPlanarBlock.js +1 -0
- package/Materials/Node/Blocks/triPlanarBlock.js.map +1 -1
- package/Materials/Node/Blocks/worleyNoise3DBlock.d.ts +2 -0
- package/Materials/Node/Blocks/worleyNoise3DBlock.js +2 -0
- package/Materials/Node/Blocks/worleyNoise3DBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.d.ts +10 -3
- package/Materials/Node/nodeMaterial.js +23 -15
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterialBlock.d.ts +3 -1
- package/Materials/Node/nodeMaterialBlock.js +4 -1
- package/Materials/Node/nodeMaterialBlock.js.map +1 -1
- package/Materials/Node/nodeMaterialBlockConnectionPoint.js +1 -0
- package/Materials/Node/nodeMaterialBlockConnectionPoint.js.map +1 -1
- package/Materials/Node/nodeMaterialBuildStateSharedData.js +1 -0
- package/Materials/Node/nodeMaterialBuildStateSharedData.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.d.ts +7 -6
- package/Materials/PBR/pbrBaseMaterial.js +15 -13
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/PBR/pbrMaterial.d.ts +2 -1
- package/Materials/PBR/pbrMaterial.js +2 -1
- package/Materials/PBR/pbrMaterial.js.map +1 -1
- package/Materials/PBR/pbrMetallicRoughnessMaterial.d.ts +4 -1
- package/Materials/PBR/pbrMetallicRoughnessMaterial.js +4 -1
- package/Materials/PBR/pbrMetallicRoughnessMaterial.js.map +1 -1
- package/Materials/PBR/pbrSpecularGlossinessMaterial.d.ts +4 -1
- package/Materials/PBR/pbrSpecularGlossinessMaterial.js +4 -1
- package/Materials/PBR/pbrSpecularGlossinessMaterial.js.map +1 -1
- package/Materials/Textures/Loaders/envTextureLoader.js +1 -0
- package/Materials/Textures/Loaders/envTextureLoader.js.map +1 -1
- package/Materials/Textures/Loaders/hdrTextureLoader.js +1 -0
- package/Materials/Textures/Loaders/hdrTextureLoader.js.map +1 -1
- package/Materials/Textures/Loaders/tgaTextureLoader.js +1 -0
- package/Materials/Textures/Loaders/tgaTextureLoader.js.map +1 -1
- package/Materials/Textures/Packer/packer.d.ts +0 -1
- package/Materials/Textures/Packer/packer.js +0 -1
- package/Materials/Textures/Packer/packer.js.map +1 -1
- package/Materials/Textures/colorGradingTexture.d.ts +4 -1
- package/Materials/Textures/colorGradingTexture.js +4 -1
- package/Materials/Textures/colorGradingTexture.js.map +1 -1
- package/Materials/Textures/equiRectangularCubeTexture.d.ts +1 -0
- package/Materials/Textures/equiRectangularCubeTexture.js +1 -0
- package/Materials/Textures/equiRectangularCubeTexture.js.map +1 -1
- package/Materials/Textures/hdrCubeTexture.d.ts +3 -2
- package/Materials/Textures/hdrCubeTexture.js +3 -2
- package/Materials/Textures/hdrCubeTexture.js.map +1 -1
- package/Materials/Textures/htmlElementTexture.d.ts +1 -1
- package/Materials/Textures/htmlElementTexture.js +1 -1
- package/Materials/Textures/htmlElementTexture.js.map +1 -1
- package/Materials/drawWrapper.d.ts +15 -0
- package/Materials/drawWrapper.js +15 -0
- package/Materials/drawWrapper.js.map +1 -1
- package/Materials/effect.d.ts +0 -16
- package/Materials/effect.js +0 -16
- package/Materials/effect.js.map +1 -1
- package/Materials/effectRenderer.js +0 -1
- package/Materials/effectRenderer.js.map +1 -1
- package/Materials/index.d.ts +1 -0
- package/Materials/index.js +1 -0
- package/Materials/index.js.map +1 -1
- package/Materials/material.d.ts +4 -2
- package/Materials/material.decalMapConfiguration.d.ts +0 -5
- package/Materials/material.decalMapConfiguration.js +5 -5
- package/Materials/material.decalMapConfiguration.js.map +1 -1
- package/Materials/material.js +15 -12
- package/Materials/material.js.map +1 -1
- package/Materials/materialHelper.d.ts +1 -1
- package/Materials/materialHelper.js +4 -3
- package/Materials/materialHelper.js.map +1 -1
- package/Materials/materialPluginManager.js +1 -0
- package/Materials/materialPluginManager.js.map +1 -1
- package/Materials/pushMaterial.d.ts +2 -2
- package/Materials/pushMaterial.js +9 -6
- package/Materials/pushMaterial.js.map +1 -1
- package/Materials/shaderMaterial.js +10 -16
- package/Materials/shaderMaterial.js.map +1 -1
- package/Materials/standardMaterial.d.ts +2 -2
- package/Materials/standardMaterial.js +10 -9
- package/Materials/standardMaterial.js.map +1 -1
- package/Materials/uniformBuffer.js +2 -1
- package/Materials/uniformBuffer.js.map +1 -1
- package/Maths/math.path.d.ts +2 -1
- package/Maths/math.path.js +2 -1
- package/Maths/math.path.js.map +1 -1
- package/Maths/math.vector.d.ts +11 -4
- package/Maths/math.vector.js +11 -4
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/Builders/boxBuilder.d.ts +0 -33
- package/Meshes/Builders/boxBuilder.js +0 -33
- package/Meshes/Builders/boxBuilder.js.map +1 -1
- package/Meshes/Builders/cylinderBuilder.d.ts +0 -31
- package/Meshes/Builders/cylinderBuilder.js +0 -31
- package/Meshes/Builders/cylinderBuilder.js.map +1 -1
- package/Meshes/Builders/decalBuilder.d.ts +0 -7
- package/Meshes/Builders/decalBuilder.js +0 -7
- package/Meshes/Builders/decalBuilder.js.map +1 -1
- package/Meshes/Builders/discBuilder.d.ts +0 -13
- package/Meshes/Builders/discBuilder.js +0 -13
- package/Meshes/Builders/discBuilder.js.map +1 -1
- package/Meshes/Builders/geodesicBuilder.d.ts +0 -13
- package/Meshes/Builders/geodesicBuilder.js +0 -13
- package/Meshes/Builders/geodesicBuilder.js.map +1 -1
- package/Meshes/Builders/hemisphereBuilder.d.ts +0 -3
- package/Meshes/Builders/hemisphereBuilder.js +1 -3
- package/Meshes/Builders/hemisphereBuilder.js.map +1 -1
- package/Meshes/Builders/icoSphereBuilder.d.ts +0 -19
- package/Meshes/Builders/icoSphereBuilder.js +0 -19
- package/Meshes/Builders/icoSphereBuilder.js.map +1 -1
- package/Meshes/Builders/latheBuilder.d.ts +0 -12
- package/Meshes/Builders/latheBuilder.js +0 -12
- package/Meshes/Builders/latheBuilder.js.map +1 -1
- package/Meshes/Builders/linesBuilder.d.ts +0 -26
- package/Meshes/Builders/linesBuilder.js +0 -26
- package/Meshes/Builders/linesBuilder.js.map +1 -1
- package/Meshes/Builders/planeBuilder.d.ts +0 -14
- package/Meshes/Builders/planeBuilder.js +0 -14
- package/Meshes/Builders/planeBuilder.js.map +1 -1
- package/Meshes/Builders/polygonBuilder.d.ts +0 -21
- package/Meshes/Builders/polygonBuilder.js +0 -21
- package/Meshes/Builders/polygonBuilder.js.map +1 -1
- package/Meshes/Builders/polyhedronBuilder.d.ts +0 -25
- package/Meshes/Builders/polyhedronBuilder.js +0 -25
- package/Meshes/Builders/polyhedronBuilder.js.map +1 -1
- package/Meshes/Builders/ribbonBuilder.d.ts +0 -22
- package/Meshes/Builders/ribbonBuilder.js +0 -22
- package/Meshes/Builders/ribbonBuilder.js.map +1 -1
- package/Meshes/Builders/shapeBuilder.d.ts +0 -32
- package/Meshes/Builders/shapeBuilder.js +0 -32
- package/Meshes/Builders/shapeBuilder.js.map +1 -1
- package/Meshes/Builders/sphereBuilder.d.ts +0 -22
- package/Meshes/Builders/sphereBuilder.js +0 -22
- package/Meshes/Builders/sphereBuilder.js.map +1 -1
- package/Meshes/Builders/textBuilder.d.ts +26 -5
- package/Meshes/Builders/textBuilder.js +26 -5
- package/Meshes/Builders/textBuilder.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +84 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +288 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -0
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js +7 -0
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js.map +1 -1
- package/Meshes/Node/Blocks/geometryCurveBlock.d.ts +92 -0
- package/Meshes/Node/Blocks/geometryCurveBlock.js +292 -0
- package/Meshes/Node/Blocks/geometryCurveBlock.js.map +1 -0
- package/Meshes/Node/Blocks/geometryDesaturateBlock.d.ts +30 -0
- package/Meshes/Node/Blocks/geometryDesaturateBlock.js +62 -0
- package/Meshes/Node/Blocks/geometryDesaturateBlock.js.map +1 -0
- package/Meshes/Node/Blocks/noiseBlock.d.ts +5 -3
- package/Meshes/Node/Blocks/noiseBlock.js +5 -3
- package/Meshes/Node/Blocks/noiseBlock.js.map +1 -1
- package/Meshes/Node/index.d.ts +2 -0
- package/Meshes/Node/index.js +2 -0
- package/Meshes/Node/index.js.map +1 -1
- package/Meshes/Node/nodeGeometry.d.ts +6 -2
- package/Meshes/Node/nodeGeometry.js +7 -2
- package/Meshes/Node/nodeGeometry.js.map +1 -1
- package/Meshes/Node/nodeGeometryBlockConnectionPoint.js +1 -0
- package/Meshes/Node/nodeGeometryBlockConnectionPoint.js.map +1 -1
- package/Meshes/Node/nodeGeometryBuildState.js +1 -0
- package/Meshes/Node/nodeGeometryBuildState.js.map +1 -1
- package/Meshes/abstractMesh.d.ts +1 -0
- package/Meshes/abstractMesh.js +4 -0
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/csg.d.ts +7 -1
- package/Meshes/csg.js +9 -1
- package/Meshes/csg.js.map +1 -1
- package/Meshes/index.d.ts +1 -0
- package/Meshes/index.js +1 -0
- package/Meshes/index.js.map +1 -1
- package/Meshes/instancedMesh.d.ts +7 -3
- package/Meshes/instancedMesh.js +7 -3
- package/Meshes/instancedMesh.js.map +1 -1
- package/Meshes/linesMesh.d.ts +3 -2
- package/Meshes/linesMesh.js +3 -2
- package/Meshes/linesMesh.js.map +1 -1
- package/Meshes/mesh.d.ts +1 -0
- package/Meshes/mesh.js +5 -4
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/mesh.vertexData.d.ts +0 -145
- package/Meshes/mesh.vertexData.js +0 -145
- package/Meshes/mesh.vertexData.js.map +1 -1
- package/Meshes/transformNode.d.ts +1 -1
- package/Meshes/transformNode.js +1 -1
- package/Meshes/transformNode.js.map +1 -1
- package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.d.ts +1 -0
- package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js +1 -0
- package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js.map +1 -1
- package/Misc/HighDynamicRange/hdr.js +7 -0
- package/Misc/HighDynamicRange/hdr.js.map +1 -1
- package/Misc/HighDynamicRange/panoramaToCubemap.js +2 -0
- package/Misc/HighDynamicRange/panoramaToCubemap.js.map +1 -1
- package/Misc/assetsManager.d.ts +3 -0
- package/Misc/assetsManager.js +3 -0
- package/Misc/assetsManager.js.map +1 -1
- package/Misc/basis.js +1 -0
- package/Misc/basis.js.map +1 -1
- package/Misc/decorators.d.ts +1 -0
- package/Misc/decorators.js +2 -1
- package/Misc/decorators.js.map +1 -1
- package/Misc/fileTools.js +2 -0
- package/Misc/fileTools.js.map +1 -1
- package/Misc/filesInput.d.ts +7 -2
- package/Misc/filesInput.js +7 -2
- package/Misc/filesInput.js.map +1 -1
- package/Misc/greasedLineTools.d.ts +1 -0
- package/Misc/greasedLineTools.js +1 -0
- package/Misc/greasedLineTools.js.map +1 -1
- package/Misc/textureTools.d.ts +2 -0
- package/Misc/textureTools.js +2 -0
- package/Misc/textureTools.js.map +1 -1
- package/Misc/timer.d.ts +2 -1
- package/Misc/timer.js +1 -0
- package/Misc/timer.js.map +1 -1
- package/Misc/tools.d.ts +2 -2
- package/Misc/tools.js +6 -2
- package/Misc/tools.js.map +1 -1
- package/Misc/videoRecorder.js +4 -0
- package/Misc/videoRecorder.js.map +1 -1
- package/Misc/webRequest.js +1 -1
- package/Misc/webRequest.js.map +1 -1
- package/Morph/morphTargetManager.d.ts +11 -0
- package/Morph/morphTargetManager.js +22 -2
- package/Morph/morphTargetManager.js.map +1 -1
- package/Particles/EmitterTypes/customParticleEmitter.js +10 -2
- package/Particles/EmitterTypes/customParticleEmitter.js.map +1 -1
- package/Particles/EmitterTypes/cylinderParticleEmitter.d.ts +3 -1
- package/Particles/EmitterTypes/cylinderParticleEmitter.js +7 -1
- package/Particles/EmitterTypes/cylinderParticleEmitter.js.map +1 -1
- package/Particles/IParticleSystem.d.ts +2 -2
- package/Particles/IParticleSystem.js.map +1 -1
- package/Particles/gpuParticleSystem.js +1 -0
- package/Particles/gpuParticleSystem.js.map +1 -1
- package/Particles/particleSystem.d.ts +1 -2
- package/Particles/particleSystem.js +5 -1
- package/Particles/particleSystem.js.map +1 -1
- package/Particles/solidParticleSystem.d.ts +1 -1
- package/Particles/solidParticleSystem.js +1 -1
- package/Particles/solidParticleSystem.js.map +1 -1
- package/Physics/castingResult.d.ts +66 -0
- package/Physics/castingResult.js +61 -0
- package/Physics/castingResult.js.map +1 -0
- package/Physics/index.d.ts +4 -0
- package/Physics/index.js +4 -0
- package/Physics/index.js.map +1 -1
- package/Physics/physicsHelper.d.ts +1 -0
- package/Physics/physicsHelper.js +1 -0
- package/Physics/physicsHelper.js.map +1 -1
- package/Physics/physicsPointProximityQuery.d.ts +28 -0
- package/Physics/physicsPointProximityQuery.js +2 -0
- package/Physics/physicsPointProximityQuery.js.map +1 -0
- package/Physics/physicsRaycastResult.d.ts +2 -44
- package/Physics/physicsRaycastResult.js +7 -38
- package/Physics/physicsRaycastResult.js.map +1 -1
- package/Physics/physicsShapeCastQuery.d.ts +32 -0
- package/Physics/physicsShapeCastQuery.js +2 -0
- package/Physics/physicsShapeCastQuery.js.map +1 -0
- package/Physics/physicsShapeProximityCastQuery.d.ts +32 -0
- package/Physics/physicsShapeProximityCastQuery.js +2 -0
- package/Physics/physicsShapeProximityCastQuery.js.map +1 -0
- package/Physics/proximityCastResult.d.ts +20 -0
- package/Physics/proximityCastResult.js +31 -0
- package/Physics/proximityCastResult.js.map +1 -0
- package/Physics/shapeCastResult.d.ts +16 -0
- package/Physics/shapeCastResult.js +24 -0
- package/Physics/shapeCastResult.js.map +1 -0
- package/Physics/v1/Plugins/ammoJSPlugin.d.ts +5 -0
- package/Physics/v1/Plugins/ammoJSPlugin.js +6 -0
- package/Physics/v1/Plugins/ammoJSPlugin.js.map +1 -1
- package/Physics/v1/physicsEngine.d.ts +2 -0
- package/Physics/v1/physicsEngine.js +2 -0
- package/Physics/v1/physicsEngine.js.map +1 -1
- package/Physics/v1/physicsImpostor.d.ts +0 -1
- package/Physics/v1/physicsImpostor.js +0 -1
- package/Physics/v1/physicsImpostor.js.map +1 -1
- package/Physics/v2/IPhysicsEnginePlugin.d.ts +1 -0
- package/Physics/v2/IPhysicsEnginePlugin.js.map +1 -1
- package/Physics/v2/Plugins/havokPlugin.d.ts +40 -6
- package/Physics/v2/Plugins/havokPlugin.js +118 -17
- package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
- package/Physics/v2/physicsBody.d.ts +8 -0
- package/Physics/v2/physicsBody.js +18 -4
- package/Physics/v2/physicsBody.js.map +1 -1
- package/Physics/v2/physicsConstraint.d.ts +0 -2
- package/Physics/v2/physicsConstraint.js +0 -2
- package/Physics/v2/physicsConstraint.js.map +1 -1
- package/Physics/v2/physicsEngine.d.ts +1 -2
- package/Physics/v2/physicsEngine.js +2 -2
- package/Physics/v2/physicsEngine.js.map +1 -1
- package/Physics/v2/physicsShape.d.ts +2 -0
- package/Physics/v2/physicsShape.js +5 -0
- package/Physics/v2/physicsShape.js.map +1 -1
- package/PostProcesses/motionBlurPostProcess.d.ts +1 -0
- package/PostProcesses/motionBlurPostProcess.js +1 -0
- package/PostProcesses/motionBlurPostProcess.js.map +1 -1
- package/PostProcesses/postProcess.d.ts +0 -1
- package/PostProcesses/postProcess.js +0 -1
- package/PostProcesses/postProcess.js.map +1 -1
- package/Rendering/depthRendererSceneComponent.js +1 -0
- package/Rendering/depthRendererSceneComponent.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObject.d.ts +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObject.js +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.d.ts +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.d.ts +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js.map +1 -1
- package/Rendering/geometryBufferRenderer.d.ts +2 -2
- package/Rendering/geometryBufferRenderer.js +2 -2
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Rendering/index.d.ts +0 -1
- package/Rendering/index.js +0 -1
- package/Rendering/index.js.map +1 -1
- package/Rendering/renderingGroup.d.ts +0 -1
- package/Rendering/renderingGroup.js +3 -4
- package/Rendering/renderingGroup.js.map +1 -1
- package/Rendering/renderingManager.d.ts +1 -1
- package/Rendering/renderingManager.js +1 -1
- package/Rendering/renderingManager.js.map +1 -1
- package/Rendering/subSurfaceConfiguration.d.ts +1 -0
- package/Rendering/subSurfaceConfiguration.js +1 -0
- package/Rendering/subSurfaceConfiguration.js.map +1 -1
- package/Shaders/ShadersInclude/gaussianSplattingUboDeclaration.d.ts +7 -0
- package/Shaders/ShadersInclude/gaussianSplattingUboDeclaration.js +13 -0
- package/Shaders/ShadersInclude/gaussianSplattingUboDeclaration.js.map +1 -0
- package/Shaders/ShadersInclude/gaussianSplattingVertexDeclaration.d.ts +5 -0
- package/Shaders/ShadersInclude/gaussianSplattingVertexDeclaration.js +10 -0
- package/Shaders/ShadersInclude/gaussianSplattingVertexDeclaration.js.map +1 -0
- package/Shaders/ShadersInclude/morphTargetsVertex.js +8 -5
- package/Shaders/ShadersInclude/morphTargetsVertex.js.map +1 -1
- package/Shaders/ShadersInclude/morphTargetsVertexDeclaration.js +2 -0
- package/Shaders/ShadersInclude/morphTargetsVertexDeclaration.js.map +1 -1
- package/Shaders/gaussianSplatting.fragment.d.ts +11 -0
- package/Shaders/gaussianSplatting.fragment.js +27 -0
- package/Shaders/gaussianSplatting.fragment.js.map +1 -0
- package/Shaders/gaussianSplatting.vertex.d.ts +13 -0
- package/Shaders/gaussianSplatting.vertex.js +49 -0
- package/Shaders/gaussianSplatting.vertex.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/morphTargetsVertex.js +5 -1
- package/ShadersWGSL/ShadersInclude/morphTargetsVertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/morphTargetsVertexDeclaration.js +2 -0
- package/ShadersWGSL/ShadersInclude/morphTargetsVertexDeclaration.js.map +1 -1
- package/XR/features/WebXRAbstractFeature.d.ts +3 -1
- package/XR/features/WebXRAbstractFeature.js +20 -4
- package/XR/features/WebXRAbstractFeature.js.map +1 -1
- package/XR/features/WebXRAnchorSystem.d.ts +1 -0
- package/XR/features/WebXRAnchorSystem.js +1 -0
- package/XR/features/WebXRAnchorSystem.js.map +1 -1
- package/XR/features/WebXRControllerTeleportation.js +9 -2
- package/XR/features/WebXRControllerTeleportation.js.map +1 -1
- package/XR/features/WebXREyeTracking.js +1 -1
- package/XR/features/WebXREyeTracking.js.map +1 -1
- package/XR/features/WebXRHandTracking.d.ts +4 -1
- package/XR/features/WebXRHandTracking.js +17 -4
- package/XR/features/WebXRHandTracking.js.map +1 -1
- package/XR/features/WebXRHitTest.js +1 -1
- package/XR/features/WebXRHitTest.js.map +1 -1
- package/XR/features/WebXRNearInteraction.d.ts +6 -3
- package/XR/features/WebXRNearInteraction.js +30 -15
- package/XR/features/WebXRNearInteraction.js.map +1 -1
- package/XR/features/WebXRPlaneDetector.d.ts +2 -0
- package/XR/features/WebXRPlaneDetector.js +2 -0
- package/XR/features/WebXRPlaneDetector.js.map +1 -1
- package/XR/features/WebXRRawCameraAccess.d.ts +2 -0
- package/XR/features/WebXRRawCameraAccess.js +2 -0
- package/XR/features/WebXRRawCameraAccess.js.map +1 -1
- package/XR/motionController/webXROculusTouchMotionController.d.ts +1 -0
- package/XR/motionController/webXROculusTouchMotionController.js +1 -0
- package/XR/motionController/webXROculusTouchMotionController.js.map +1 -1
- package/XR/webXRCamera.d.ts +3 -0
- package/XR/webXRCamera.js +27 -14
- package/XR/webXRCamera.js.map +1 -1
- package/XR/webXRExperienceHelper.js +1 -0
- package/XR/webXRExperienceHelper.js.map +1 -1
- package/XR/webXRInput.js +1 -1
- package/XR/webXRInput.js.map +1 -1
- package/XR/webXRInputSource.d.ts +3 -1
- package/XR/webXRInputSource.js +6 -3
- package/XR/webXRInputSource.js.map +1 -1
- package/XR/webXRSessionManager.d.ts +13 -0
- package/XR/webXRSessionManager.js +21 -1
- package/XR/webXRSessionManager.js.map +1 -1
- package/assetContainer.d.ts +4 -1
- package/assetContainer.js +4 -1
- package/assetContainer.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +1 -0
- package/scene.js +11 -0
- package/scene.js.map +1 -1
- package/Rendering/GaussianSplatting/gaussianSplatting.d.ts +0 -81
- package/Rendering/GaussianSplatting/gaussianSplatting.js +0 -400
- package/Rendering/GaussianSplatting/gaussianSplatting.js.map +0 -1
- package/Rendering/GaussianSplatting/index.d.ts +0 -1
- package/Rendering/GaussianSplatting/index.js +0 -2
- package/Rendering/GaussianSplatting/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"physicsShape.js","sourceRoot":"","sources":["../../../../../dev/core/src/Physics/v2/physicsShape.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG1D,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAuBlF;;;;GAIG;AACH,MAAM,OAAO,YAAY;IAkBrB;;;;;;;;;;;;OAYG;IACH,YAAY,OAA2B,EAAE,KAAY;;QA9BrD;;WAEG;QACI,gBAAW,GAAQ,SAAS,CAAC;QAU5B,eAAU,GAAY,KAAK,CAAC;QAE5B,gBAAW,GAAG,KAAK,CAAC;QAgBxB,IAAI,CAAC,KAAK,EAAE;YACR,OAAO;SACV;QACD,MAAM,aAAa,GAAG,KAAK,CAAC,gBAAgB,EAAE,CAAC;QAC/C,IAAI,CAAC,aAAa,EAAE;YAChB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;SACnD;QACD,IAAI,aAAa,CAAC,gBAAgB,EAAE,IAAI,CAAC,EAAE;YACvC,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;SACvE;QACD,MAAM,aAAa,GAAG,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AAU,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IAC9E,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,qBAAsB,SAAQ,YAAY;IACnD;;;OAGG;IACH,YAAY,KAAY;QACpB,KAAK,CAAC,EAAE,IAAI,EAAE,gBAAgB,CAAC,SAAS,EAAE,UAAU,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IACvE,CAAC;CACJ","sourcesContent":["import type { TransformNode } from \"../../Meshes/transformNode\";\r\nimport type { AbstractMesh } from \"../../Meshes/abstractMesh\";\r\nimport type { BoundingBox } from \"../../Culling/boundingBox\";\r\nimport { PhysicsShapeType } from \"./IPhysicsEnginePlugin\";\r\nimport type { IPhysicsEnginePluginV2, PhysicsShapeParameters } from \"./IPhysicsEnginePlugin\";\r\nimport type { PhysicsMaterial } from \"./physicsMaterial\";\r\nimport { Matrix, Vector3, Quaternion, TmpVectors } from \"../../Maths/math.vector\";\r\n\r\nimport type { Mesh } from \"../../Meshes/mesh\";\r\nimport type { Scene } from \"../../scene\";\r\n\r\n/**\r\n * Options for creating a physics shape\r\n */\r\nexport interface PhysicShapeOptions {\r\n /**\r\n * The type of the shape. This can be one of the following: SPHERE, BOX, CAPSULE, CYLINDER, CONVEX_HULL, MESH, HEIGHTFIELD, CONTAINER\r\n */\r\n type?: PhysicsShapeType;\r\n /**\r\n * The parameters of the shape. Varies depending of the shape type.\r\n */\r\n parameters?: PhysicsShapeParameters;\r\n /**\r\n * Reference to an already existing physics shape in the plugin.\r\n */\r\n pluginData?: any;\r\n}\r\n\r\n/**\r\n * PhysicsShape class.\r\n * This class is useful for creating a physics shape that can be used in a physics engine.\r\n * A Physic Shape determine how collision are computed. It must be attached to a body.\r\n */\r\nexport class PhysicsShape {\r\n /**\r\n * V2 Physics plugin private data for single shape\r\n */\r\n public _pluginData: any = undefined;\r\n /**\r\n * The V2 plugin used to create and manage this Physics Body\r\n */\r\n private _physicsPlugin: IPhysicsEnginePluginV2;\r\n\r\n private _type: PhysicsShapeType;\r\n\r\n private _material: PhysicsMaterial;\r\n\r\n private _isTrigger: boolean = false;\r\n\r\n private _isDisposed = false;\r\n\r\n /**\r\n * Constructs a new physics shape.\r\n * @param options The options for the physics shape. These are:\r\n * * type: The type of the shape. This can be one of the following: SPHERE, BOX, CAPSULE, CYLINDER, CONVEX_HULL, MESH, HEIGHTFIELD, CONTAINER\r\n * * parameters: The parameters of the shape.\r\n * * pluginData: The plugin data of the shape. This is used if you already have a reference to the object on the plugin side.\r\n * You need to specify either type or pluginData.\r\n * @param scene The scene the shape belongs to.\r\n *\r\n * This code is useful for creating a new physics shape with the given type, options, and scene.\r\n * It also checks that the physics engine and plugin version are correct.\r\n * If not, it throws an error. This ensures that the shape is created with the correct parameters and is compatible with the physics engine.\r\n */\r\n constructor(options: PhysicShapeOptions, scene: Scene) {\r\n if (!scene) {\r\n return;\r\n }\r\n const physicsEngine = scene.getPhysicsEngine();\r\n if (!physicsEngine) {\r\n throw new Error(\"No Physics Engine available.\");\r\n }\r\n if (physicsEngine.getPluginVersion() != 2) {\r\n throw new Error(\"Plugin version is incorrect. Expected version 2.\");\r\n }\r\n const physicsPlugin = physicsEngine.getPhysicsPlugin();\r\n if (!physicsPlugin) {\r\n throw new Error(\"No Physics Plugin available.\");\r\n }\r\n this._physicsPlugin = physicsPlugin as IPhysicsEnginePluginV2;\r\n\r\n if (options.pluginData !== undefined && options.pluginData !== null) {\r\n this._pluginData = options.pluginData;\r\n this._type = this._physicsPlugin.getShapeType(this);\r\n } else if (options.type !== undefined && options.type !== null) {\r\n this._type = options.type;\r\n const parameters = options.parameters ?? {};\r\n this._physicsPlugin.initShape(this, options.type, parameters);\r\n }\r\n }\r\n\r\n /**\r\n * Returns the string \"PhysicsShape\".\r\n * @returns \"PhysicsShape\"\r\n */\r\n public getClassName() {\r\n return \"PhysicsShape\";\r\n }\r\n\r\n /**\r\n * Returns the type of the physics shape.\r\n * @returns The type of the physics shape.\r\n */\r\n public get type(): PhysicsShapeType {\r\n return this._type;\r\n }\r\n\r\n /**\r\n * Set the membership mask of a shape. This is a bitfield of arbitrary\r\n * \"categories\" to which the shape is a member. This is used in combination\r\n * with the collide mask to determine if this shape should collide with\r\n * another.\r\n *\r\n * @param membershipMask Bitfield of categories of this shape.\r\n */\r\n public set filterMembershipMask(membershipMask: number) {\r\n this._physicsPlugin.setShapeFilterMembershipMask(this, membershipMask);\r\n }\r\n\r\n /**\r\n * Get the membership mask of a shape.\r\n * @returns Bitmask of categories which this shape is a member of.\r\n */\r\n public get filterMembershipMask(): number {\r\n return this._physicsPlugin.getShapeFilterMembershipMask(this);\r\n }\r\n\r\n /**\r\n * Sets the collide mask of a shape. This is a bitfield of arbitrary\r\n * \"categories\" to which this shape collides with. Given two shapes,\r\n * the engine will check if the collide mask and membership overlap:\r\n * shapeA.filterMembershipMask & shapeB.filterCollideMask\r\n *\r\n * If this value is zero (i.e. shapeB only collides with categories\r\n * which shapeA is _not_ a member of) then the shapes will not collide.\r\n *\r\n * Note, the engine will also perform the same test with shapeA and\r\n * shapeB swapped; the shapes will not collide if either shape has\r\n * a collideMask which prevents collision with the other shape.\r\n *\r\n * @param collideMask Bitmask of categories this shape should collide with\r\n */\r\n public set filterCollideMask(collideMask: number) {\r\n this._physicsPlugin.setShapeFilterCollideMask(this, collideMask);\r\n }\r\n\r\n /**\r\n *\r\n * @returns Bitmask of categories that this shape should collide with\r\n */\r\n public get filterCollideMask(): number {\r\n return this._physicsPlugin.getShapeFilterCollideMask(this);\r\n }\r\n /**\r\n *\r\n * @param material\r\n */\r\n public set material(material: PhysicsMaterial) {\r\n this._physicsPlugin.setMaterial(this, material);\r\n this._material = material;\r\n }\r\n\r\n /**\r\n * Returns the material of the physics shape.\r\n * @returns The material of the physics shape.\r\n */\r\n public get material(): PhysicsMaterial {\r\n return this._material;\r\n }\r\n\r\n /**\r\n * Sets the density of the physics shape.\r\n * @param density The density of the physics shape.\r\n */\r\n public set density(density: number) {\r\n this._physicsPlugin.setDensity(this, density);\r\n }\r\n\r\n /**\r\n * Returns the density of the physics shape.\r\n * @returns The density of the physics shape.\r\n */\r\n public get density(): number {\r\n return this._physicsPlugin.getDensity(this);\r\n }\r\n\r\n /**\r\n * Utility to add a child shape to this container,\r\n * automatically computing the relative transform between\r\n * the container shape and the child instance.\r\n *\r\n * @param parentTransform The transform node associated with this shape\r\n * @param newChild The new PhysicsShape to add\r\n * @param childTransform The transform node associated with the child shape\r\n */\r\n public addChildFromParent(parentTransform: TransformNode, newChild: PhysicsShape, childTransform: TransformNode): void {\r\n const childToWorld = childTransform.computeWorldMatrix(true);\r\n const parentToWorld = parentTransform.computeWorldMatrix(true);\r\n const childToParent = TmpVectors.Matrix[0];\r\n childToWorld.multiplyToRef(Matrix.Invert(parentToWorld), childToParent);\r\n const translation = TmpVectors.Vector3[0];\r\n const rotation = TmpVectors.Quaternion[0];\r\n const scale = TmpVectors.Vector3[1];\r\n childToParent.decompose(scale, rotation, translation);\r\n this._physicsPlugin.addChild(this, newChild, translation, rotation, scale);\r\n }\r\n\r\n /**\r\n * Adds a child shape to a container with an optional transform\r\n * @param newChild The new PhysicsShape to add\r\n * @param translation Optional position of the child shape relative to this shape\r\n * @param rotation Optional rotation of the child shape relative to this shape\r\n * @param scale Optional scale of the child shape relative to this shape\r\n */\r\n public addChild(newChild: PhysicsShape, translation?: Vector3, rotation?: Quaternion, scale?: Vector3): void {\r\n this._physicsPlugin.addChild(this, newChild, translation, rotation, scale);\r\n }\r\n\r\n /**\r\n * Removes a child shape from this shape.\r\n * @param childIndex The index of the child shape to remove\r\n */\r\n public removeChild(childIndex: number): void {\r\n this._physicsPlugin.removeChild(this, childIndex);\r\n }\r\n\r\n /**\r\n * Returns the number of children of a physics shape.\r\n * @returns The number of children of a physics shape.\r\n */\r\n public getNumChildren(): number {\r\n return this._physicsPlugin.getNumChildren(this);\r\n }\r\n\r\n /**\r\n * Returns the bounding box of the physics shape.\r\n * @returns The bounding box of the physics shape.\r\n */\r\n public getBoundingBox(): BoundingBox {\r\n return this._physicsPlugin.getBoundingBox(this);\r\n }\r\n\r\n public set isTrigger(isTrigger: boolean) {\r\n if (this._isTrigger === isTrigger) {\r\n return;\r\n }\r\n this._isTrigger = isTrigger;\r\n this._physicsPlugin.setTrigger(this, isTrigger);\r\n }\r\n\r\n public get isTrigger(): boolean {\r\n return this._isTrigger;\r\n }\r\n\r\n /**\r\n * Dispose the shape and release its associated resources.\r\n */\r\n public dispose() {\r\n if (this._isDisposed) {\r\n return;\r\n }\r\n this._physicsPlugin.disposeShape(this);\r\n this._isDisposed = true;\r\n }\r\n}\r\n\r\n/**\r\n * Helper object to create a sphere shape\r\n */\r\nexport class PhysicsShapeSphere extends PhysicsShape {\r\n /**\r\n * Constructor for the Sphere Shape\r\n * @param center local center of the sphere\r\n * @param radius radius\r\n * @param scene scene to attach to\r\n */\r\n constructor(center: Vector3, radius: number, scene: Scene) {\r\n super({ type: PhysicsShapeType.SPHERE, parameters: { center: center, radius: radius } }, scene);\r\n }\r\n\r\n /**\r\n * Derive an approximate sphere from the mesh.\r\n * @param mesh node from which to derive the sphere shape\r\n * @returns PhysicsShapeSphere\r\n */\r\n static FromMesh(mesh: AbstractMesh) {\r\n const bounds = mesh.getBoundingInfo();\r\n const centerLocal = bounds.boundingSphere.center;\r\n const he = bounds.boundingBox.extendSize;\r\n const radius = Math.max(he.x, he.y, he.z);\r\n return new PhysicsShapeSphere(centerLocal, radius, mesh.getScene());\r\n }\r\n}\r\n\r\n/**\r\n * Helper object to create a capsule shape\r\n */\r\nexport class PhysicsShapeCapsule extends PhysicsShape {\r\n /**\r\n *\r\n * @param pointA Starting point that defines the capsule segment\r\n * @param pointB ending point of that same segment\r\n * @param radius radius\r\n * @param scene scene to attach to\r\n */\r\n constructor(pointA: Vector3, pointB: Vector3, radius: number, scene: Scene) {\r\n super({ type: PhysicsShapeType.CAPSULE, parameters: { pointA: pointA, pointB: pointB, radius: radius } }, scene);\r\n }\r\n\r\n /**\r\n * Derive an approximate capsule from the mesh. Note, this is\r\n * not the optimal bounding capsule.\r\n * @param mesh Node from which to derive a cylinder shape\r\n */\r\n static FromMesh(mesh: AbstractMesh): PhysicsShapeCapsule {\r\n const boundsLocal = mesh.getBoundingInfo();\r\n const radius = boundsLocal.boundingBox.extendSize.x;\r\n const pointFromCenter = new Vector3(0, boundsLocal.boundingBox.extendSize.y - radius, 0);\r\n const pointA = boundsLocal.boundingBox.center.add(pointFromCenter);\r\n const pointB = boundsLocal.boundingBox.center.subtract(pointFromCenter);\r\n return new PhysicsShapeCapsule(pointA, pointB, radius, mesh.getScene());\r\n }\r\n}\r\n\r\n/**\r\n * Helper object to create a cylinder shape\r\n */\r\nexport class PhysicsShapeCylinder extends PhysicsShape {\r\n /**\r\n *\r\n * @param pointA Starting point that defines the cylinder segment\r\n * @param pointB ending point of that same segment\r\n * @param radius radius\r\n * @param scene scene to attach to\r\n */\r\n constructor(pointA: Vector3, pointB: Vector3, radius: number, scene: Scene) {\r\n super({ type: PhysicsShapeType.CYLINDER, parameters: { pointA: pointA, pointB: pointB, radius: radius } }, scene);\r\n }\r\n\r\n /**\r\n * Derive an approximate cylinder from the mesh. Note, this is\r\n * not the optimal bounding cylinder.\r\n * @param mesh Node from which to derive a cylinder shape\r\n */\r\n static FromMesh(mesh: AbstractMesh): PhysicsShapeCylinder {\r\n const boundsLocal = mesh.getBoundingInfo();\r\n const radius = boundsLocal.boundingBox.extendSize.x;\r\n const pointFromCenter = new Vector3(0, boundsLocal.boundingBox.extendSize.y, 0);\r\n const pointA = boundsLocal.boundingBox.center.add(pointFromCenter);\r\n const pointB = boundsLocal.boundingBox.center.subtract(pointFromCenter);\r\n return new PhysicsShapeCylinder(pointA, pointB, radius, mesh.getScene());\r\n }\r\n}\r\n\r\n/**\r\n * Helper object to create a box shape\r\n */\r\nexport class PhysicsShapeBox extends PhysicsShape {\r\n /**\r\n *\r\n * @param center local center of the box\r\n * @param rotation local orientation\r\n * @param extents size of the box in each direction\r\n * @param scene scene to attach to\r\n */\r\n constructor(center: Vector3, rotation: Quaternion, extents: Vector3, scene: Scene) {\r\n super({ type: PhysicsShapeType.BOX, parameters: { center: center, rotation: rotation, extents: extents } }, scene);\r\n }\r\n\r\n /**\r\n *\r\n * @param mesh\r\n * @returns PhysicsShapeBox\r\n */\r\n static FromMesh(mesh: AbstractMesh): PhysicsShapeBox {\r\n const bounds = mesh.getBoundingInfo();\r\n const centerLocal = bounds.boundingBox.center;\r\n const extents = bounds.boundingBox.extendSize.scale(2.0); //<todo.eoin extendSize seems to really be half-extents?\r\n return new PhysicsShapeBox(centerLocal, Quaternion.Identity(), extents, mesh.getScene());\r\n }\r\n}\r\n\r\n/**\r\n * Helper object to create a convex hull shape\r\n */\r\nexport class PhysicsShapeConvexHull extends PhysicsShape {\r\n /**\r\n *\r\n * @param mesh the mesh to be used as topology infos for the convex hull\r\n * @param scene scene to attach to\r\n */\r\n constructor(mesh: Mesh, scene: Scene) {\r\n super({ type: PhysicsShapeType.CONVEX_HULL, parameters: { mesh: mesh } }, scene);\r\n }\r\n}\r\n\r\n/**\r\n * Helper object to create a mesh shape\r\n */\r\nexport class PhysicsShapeMesh extends PhysicsShape {\r\n /**\r\n *\r\n * @param mesh the mesh topology that will be used to create the shape\r\n * @param scene scene to attach to\r\n */\r\n constructor(mesh: Mesh, scene: Scene) {\r\n super({ type: PhysicsShapeType.MESH, parameters: { mesh: mesh } }, scene);\r\n }\r\n}\r\n\r\n/**\r\n * A shape container holds a variable number of shapes. Use AddChild to append to newly created parent container.\r\n */\r\nexport class PhysicsShapeContainer extends PhysicsShape {\r\n /**\r\n * Constructor of the Shape container\r\n * @param scene scene to attach to\r\n */\r\n constructor(scene: Scene) {\r\n super({ type: PhysicsShapeType.CONTAINER, parameters: {} }, scene);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"physicsShape.js","sourceRoot":"","sources":["../../../../../dev/core/src/Physics/v2/physicsShape.ts"],"names":[],"mappings":"AAG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IACH,MAAM,CAAC,QAAQ,CAAC,IAAkB;QAC9B,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QACtC,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC;QAC9C,MAAM,OAAO,GAAG,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,wDAAwD;QAClH,OAAO,IAAI,eAAe,CAAC,WAAW,EAAE,UAAU,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC7F,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,YAAY;IACpD;;;;OAIG;IACH,YAAY,IAAU,EAAE,KAAY;QAChC,KAAK,CAAC,EAAE,IAAI,EAAE,gBAAgB,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IACrF,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,YAAY;IAC9C;;;;OAIG;IACH,YAAY,IAAU,EAAE,KAAY;QAChC,KAAK,CAAC,EAAE,IAAI,EAAE,gBAAgB,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IAC9E,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,qBAAsB,SAAQ,YAAY;IACnD;;;OAGG;IACH,YAAY,KAAY;QACpB,KAAK,CAAC,EAAE,IAAI,EAAE,gBAAgB,CAAC,SAAS,EAAE,UAAU,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IACvE,CAAC;CACJ","sourcesContent":["import type { TransformNode } from \"../../Meshes/transformNode\";\r\nimport type { AbstractMesh } from \"../../Meshes/abstractMesh\";\r\nimport type { BoundingBox } from \"../../Culling/boundingBox\";\r\nimport { PhysicsShapeType } from \"./IPhysicsEnginePlugin\";\r\nimport type { IPhysicsEnginePluginV2, PhysicsShapeParameters } from \"./IPhysicsEnginePlugin\";\r\nimport type { PhysicsMaterial } from \"./physicsMaterial\";\r\nimport { Matrix, Vector3, Quaternion, TmpVectors } from \"../../Maths/math.vector\";\r\n\r\nimport type { Mesh } from \"../../Meshes/mesh\";\r\nimport type { Scene } from \"../../scene\";\r\n\r\n/**\r\n * Options for creating a physics shape\r\n */\r\nexport interface PhysicShapeOptions {\r\n /**\r\n * The type of the shape. This can be one of the following: SPHERE, BOX, CAPSULE, CYLINDER, CONVEX_HULL, MESH, HEIGHTFIELD, CONTAINER\r\n */\r\n type?: PhysicsShapeType;\r\n /**\r\n * The parameters of the shape. Varies depending of the shape type.\r\n */\r\n parameters?: PhysicsShapeParameters;\r\n /**\r\n * Reference to an already existing physics shape in the plugin.\r\n */\r\n pluginData?: any;\r\n}\r\n\r\n/**\r\n * PhysicsShape class.\r\n * This class is useful for creating a physics shape that can be used in a physics engine.\r\n * A Physic Shape determine how collision are computed. It must be attached to a body.\r\n */\r\nexport class PhysicsShape {\r\n /**\r\n * V2 Physics plugin private data for single shape\r\n */\r\n public _pluginData: any = undefined;\r\n /**\r\n * The V2 plugin used to create and manage this Physics Body\r\n */\r\n private _physicsPlugin: IPhysicsEnginePluginV2;\r\n\r\n private _type: PhysicsShapeType;\r\n\r\n private _material: PhysicsMaterial;\r\n\r\n private _isTrigger: boolean = false;\r\n\r\n private _isDisposed = false;\r\n\r\n /**\r\n * Constructs a new physics shape.\r\n * @param options The options for the physics shape. These are:\r\n * * type: The type of the shape. This can be one of the following: SPHERE, BOX, CAPSULE, CYLINDER, CONVEX_HULL, MESH, HEIGHTFIELD, CONTAINER\r\n * * parameters: The parameters of the shape.\r\n * * pluginData: The plugin data of the shape. This is used if you already have a reference to the object on the plugin side.\r\n * You need to specify either type or pluginData.\r\n * @param scene The scene the shape belongs to.\r\n *\r\n * This code is useful for creating a new physics shape with the given type, options, and scene.\r\n * It also checks that the physics engine and plugin version are correct.\r\n * If not, it throws an error. This ensures that the shape is created with the correct parameters and is compatible with the physics engine.\r\n */\r\n constructor(options: PhysicShapeOptions, scene: Scene) {\r\n if (!scene) {\r\n return;\r\n }\r\n const physicsEngine = scene.getPhysicsEngine();\r\n if (!physicsEngine) {\r\n throw new Error(\"No Physics Engine available.\");\r\n }\r\n if (physicsEngine.getPluginVersion() != 2) {\r\n throw new Error(\"Plugin version is incorrect. Expected version 2.\");\r\n }\r\n const physicsPlugin = physicsEngine.getPhysicsPlugin();\r\n if (!physicsPlugin) {\r\n throw new Error(\"No Physics Plugin available.\");\r\n }\r\n this._physicsPlugin = physicsPlugin as IPhysicsEnginePluginV2;\r\n\r\n if (options.pluginData !== undefined && options.pluginData !== null) {\r\n this._pluginData = options.pluginData;\r\n this._type = this._physicsPlugin.getShapeType(this);\r\n } else if (options.type !== undefined && options.type !== null) {\r\n this._type = options.type;\r\n const parameters = options.parameters ?? {};\r\n this._physicsPlugin.initShape(this, options.type, parameters);\r\n }\r\n }\r\n\r\n /**\r\n * Returns the string \"PhysicsShape\".\r\n * @returns \"PhysicsShape\"\r\n */\r\n public getClassName() {\r\n return \"PhysicsShape\";\r\n }\r\n\r\n /**\r\n * Returns the type of the physics shape.\r\n * @returns The type of the physics shape.\r\n */\r\n public get type(): PhysicsShapeType {\r\n return this._type;\r\n }\r\n\r\n /**\r\n * Set the membership mask of a shape. This is a bitfield of arbitrary\r\n * \"categories\" to which the shape is a member. This is used in combination\r\n * with the collide mask to determine if this shape should collide with\r\n * another.\r\n *\r\n * @param membershipMask Bitfield of categories of this shape.\r\n */\r\n public set filterMembershipMask(membershipMask: number) {\r\n this._physicsPlugin.setShapeFilterMembershipMask(this, membershipMask);\r\n }\r\n\r\n /**\r\n * Get the membership mask of a shape.\r\n * @returns Bitmask of categories which this shape is a member of.\r\n */\r\n public get filterMembershipMask(): number {\r\n return this._physicsPlugin.getShapeFilterMembershipMask(this);\r\n }\r\n\r\n /**\r\n * Sets the collide mask of a shape. This is a bitfield of arbitrary\r\n * \"categories\" to which this shape collides with. Given two shapes,\r\n * the engine will check if the collide mask and membership overlap:\r\n * shapeA.filterMembershipMask & shapeB.filterCollideMask\r\n *\r\n * If this value is zero (i.e. shapeB only collides with categories\r\n * which shapeA is _not_ a member of) then the shapes will not collide.\r\n *\r\n * Note, the engine will also perform the same test with shapeA and\r\n * shapeB swapped; the shapes will not collide if either shape has\r\n * a collideMask which prevents collision with the other shape.\r\n *\r\n * @param collideMask Bitmask of categories this shape should collide with\r\n */\r\n public set filterCollideMask(collideMask: number) {\r\n this._physicsPlugin.setShapeFilterCollideMask(this, collideMask);\r\n }\r\n\r\n /**\r\n *\r\n * @returns Bitmask of categories that this shape should collide with\r\n */\r\n public get filterCollideMask(): number {\r\n return this._physicsPlugin.getShapeFilterCollideMask(this);\r\n }\r\n /**\r\n *\r\n * @param material\r\n */\r\n public set material(material: PhysicsMaterial) {\r\n this._physicsPlugin.setMaterial(this, material);\r\n this._material = material;\r\n }\r\n\r\n /**\r\n * Returns the material of the physics shape.\r\n * @returns The material of the physics shape.\r\n */\r\n public get material(): PhysicsMaterial {\r\n if (!this._material) {\r\n this._material = this._physicsPlugin.getMaterial(this);\r\n }\r\n return this._material;\r\n }\r\n\r\n /**\r\n * Sets the density of the physics shape.\r\n * @param density The density of the physics shape.\r\n */\r\n public set density(density: number) {\r\n this._physicsPlugin.setDensity(this, density);\r\n }\r\n\r\n /**\r\n * Returns the density of the physics shape.\r\n * @returns The density of the physics shape.\r\n */\r\n public get density(): number {\r\n return this._physicsPlugin.getDensity(this);\r\n }\r\n\r\n /**\r\n * Utility to add a child shape to this container,\r\n * automatically computing the relative transform between\r\n * the container shape and the child instance.\r\n *\r\n * @param parentTransform The transform node associated with this shape\r\n * @param newChild The new PhysicsShape to add\r\n * @param childTransform The transform node associated with the child shape\r\n */\r\n public addChildFromParent(parentTransform: TransformNode, newChild: PhysicsShape, childTransform: TransformNode): void {\r\n const childToWorld = childTransform.computeWorldMatrix(true);\r\n const parentToWorld = parentTransform.computeWorldMatrix(true);\r\n const childToParent = TmpVectors.Matrix[0];\r\n childToWorld.multiplyToRef(Matrix.Invert(parentToWorld), childToParent);\r\n const translation = TmpVectors.Vector3[0];\r\n const rotation = TmpVectors.Quaternion[0];\r\n const scale = TmpVectors.Vector3[1];\r\n childToParent.decompose(scale, rotation, translation);\r\n this._physicsPlugin.addChild(this, newChild, translation, rotation, scale);\r\n }\r\n\r\n /**\r\n * Adds a child shape to a container with an optional transform\r\n * @param newChild The new PhysicsShape to add\r\n * @param translation Optional position of the child shape relative to this shape\r\n * @param rotation Optional rotation of the child shape relative to this shape\r\n * @param scale Optional scale of the child shape relative to this shape\r\n */\r\n public addChild(newChild: PhysicsShape, translation?: Vector3, rotation?: Quaternion, scale?: Vector3): void {\r\n this._physicsPlugin.addChild(this, newChild, translation, rotation, scale);\r\n }\r\n\r\n /**\r\n * Removes a child shape from this shape.\r\n * @param childIndex The index of the child shape to remove\r\n */\r\n public removeChild(childIndex: number): void {\r\n this._physicsPlugin.removeChild(this, childIndex);\r\n }\r\n\r\n /**\r\n * Returns the number of children of a physics shape.\r\n * @returns The number of children of a physics shape.\r\n */\r\n public getNumChildren(): number {\r\n return this._physicsPlugin.getNumChildren(this);\r\n }\r\n\r\n /**\r\n * Returns the bounding box of the physics shape.\r\n * @returns The bounding box of the physics shape.\r\n */\r\n public getBoundingBox(): BoundingBox {\r\n return this._physicsPlugin.getBoundingBox(this);\r\n }\r\n\r\n public set isTrigger(isTrigger: boolean) {\r\n if (this._isTrigger === isTrigger) {\r\n return;\r\n }\r\n this._isTrigger = isTrigger;\r\n this._physicsPlugin.setTrigger(this, isTrigger);\r\n }\r\n\r\n public get isTrigger(): boolean {\r\n return this._isTrigger;\r\n }\r\n\r\n /**\r\n * Dispose the shape and release its associated resources.\r\n */\r\n public dispose() {\r\n if (this._isDisposed) {\r\n return;\r\n }\r\n this._physicsPlugin.disposeShape(this);\r\n this._isDisposed = true;\r\n }\r\n}\r\n\r\n/**\r\n * Helper object to create a sphere shape\r\n */\r\nexport class PhysicsShapeSphere extends PhysicsShape {\r\n /**\r\n * Constructor for the Sphere Shape\r\n * @param center local center of the sphere\r\n * @param radius radius\r\n * @param scene scene to attach to\r\n */\r\n constructor(center: Vector3, radius: number, scene: Scene) {\r\n super({ type: PhysicsShapeType.SPHERE, parameters: { center: center, radius: radius } }, scene);\r\n }\r\n\r\n /**\r\n * Derive an approximate sphere from the mesh.\r\n * @param mesh node from which to derive the sphere shape\r\n * @returns PhysicsShapeSphere\r\n */\r\n static FromMesh(mesh: AbstractMesh) {\r\n const bounds = mesh.getBoundingInfo();\r\n const centerLocal = bounds.boundingSphere.center;\r\n const he = bounds.boundingBox.extendSize;\r\n const radius = Math.max(he.x, he.y, he.z);\r\n return new PhysicsShapeSphere(centerLocal, radius, mesh.getScene());\r\n }\r\n}\r\n\r\n/**\r\n * Helper object to create a capsule shape\r\n */\r\nexport class PhysicsShapeCapsule extends PhysicsShape {\r\n /**\r\n *\r\n * @param pointA Starting point that defines the capsule segment\r\n * @param pointB ending point of that same segment\r\n * @param radius radius\r\n * @param scene scene to attach to\r\n */\r\n constructor(pointA: Vector3, pointB: Vector3, radius: number, scene: Scene) {\r\n super({ type: PhysicsShapeType.CAPSULE, parameters: { pointA: pointA, pointB: pointB, radius: radius } }, scene);\r\n }\r\n\r\n /**\r\n * Derive an approximate capsule from the mesh. Note, this is\r\n * not the optimal bounding capsule.\r\n * @param mesh Node from which to derive a cylinder shape\r\n * @returns Physics Shape Capsule\r\n */\r\n static FromMesh(mesh: AbstractMesh): PhysicsShapeCapsule {\r\n const boundsLocal = mesh.getBoundingInfo();\r\n const radius = boundsLocal.boundingBox.extendSize.x;\r\n const pointFromCenter = new Vector3(0, boundsLocal.boundingBox.extendSize.y - radius, 0);\r\n const pointA = boundsLocal.boundingBox.center.add(pointFromCenter);\r\n const pointB = boundsLocal.boundingBox.center.subtract(pointFromCenter);\r\n return new PhysicsShapeCapsule(pointA, pointB, radius, mesh.getScene());\r\n }\r\n}\r\n\r\n/**\r\n * Helper object to create a cylinder shape\r\n */\r\nexport class PhysicsShapeCylinder extends PhysicsShape {\r\n /**\r\n *\r\n * @param pointA Starting point that defines the cylinder segment\r\n * @param pointB ending point of that same segment\r\n * @param radius radius\r\n * @param scene scene to attach to\r\n */\r\n constructor(pointA: Vector3, pointB: Vector3, radius: number, scene: Scene) {\r\n super({ type: PhysicsShapeType.CYLINDER, parameters: { pointA: pointA, pointB: pointB, radius: radius } }, scene);\r\n }\r\n\r\n /**\r\n * Derive an approximate cylinder from the mesh. Note, this is\r\n * not the optimal bounding cylinder.\r\n * @param mesh Node from which to derive a cylinder shape\r\n * @returns Physics Shape Cylinder\r\n */\r\n static FromMesh(mesh: AbstractMesh): PhysicsShapeCylinder {\r\n const boundsLocal = mesh.getBoundingInfo();\r\n const radius = boundsLocal.boundingBox.extendSize.x;\r\n const pointFromCenter = new Vector3(0, boundsLocal.boundingBox.extendSize.y, 0);\r\n const pointA = boundsLocal.boundingBox.center.add(pointFromCenter);\r\n const pointB = boundsLocal.boundingBox.center.subtract(pointFromCenter);\r\n return new PhysicsShapeCylinder(pointA, pointB, radius, mesh.getScene());\r\n }\r\n}\r\n\r\n/**\r\n * Helper object to create a box shape\r\n */\r\nexport class PhysicsShapeBox extends PhysicsShape {\r\n /**\r\n *\r\n * @param center local center of the box\r\n * @param rotation local orientation\r\n * @param extents size of the box in each direction\r\n * @param scene scene to attach to\r\n */\r\n constructor(center: Vector3, rotation: Quaternion, extents: Vector3, scene: Scene) {\r\n super({ type: PhysicsShapeType.BOX, parameters: { center: center, rotation: rotation, extents: extents } }, scene);\r\n }\r\n\r\n /**\r\n *\r\n * @param mesh\r\n * @returns PhysicsShapeBox\r\n */\r\n static FromMesh(mesh: AbstractMesh): PhysicsShapeBox {\r\n const bounds = mesh.getBoundingInfo();\r\n const centerLocal = bounds.boundingBox.center;\r\n const extents = bounds.boundingBox.extendSize.scale(2.0); //<todo.eoin extendSize seems to really be half-extents?\r\n return new PhysicsShapeBox(centerLocal, Quaternion.Identity(), extents, mesh.getScene());\r\n }\r\n}\r\n\r\n/**\r\n * Helper object to create a convex hull shape\r\n */\r\nexport class PhysicsShapeConvexHull extends PhysicsShape {\r\n /**\r\n *\r\n * @param mesh the mesh to be used as topology infos for the convex hull\r\n * @param scene scene to attach to\r\n */\r\n constructor(mesh: Mesh, scene: Scene) {\r\n super({ type: PhysicsShapeType.CONVEX_HULL, parameters: { mesh: mesh } }, scene);\r\n }\r\n}\r\n\r\n/**\r\n * Helper object to create a mesh shape\r\n */\r\nexport class PhysicsShapeMesh extends PhysicsShape {\r\n /**\r\n *\r\n * @param mesh the mesh topology that will be used to create the shape\r\n * @param scene scene to attach to\r\n */\r\n constructor(mesh: Mesh, scene: Scene) {\r\n super({ type: PhysicsShapeType.MESH, parameters: { mesh: mesh } }, scene);\r\n }\r\n}\r\n\r\n/**\r\n * A shape container holds a variable number of shapes. Use AddChild to append to newly created parent container.\r\n */\r\nexport class PhysicsShapeContainer extends PhysicsShape {\r\n /**\r\n * Constructor of the Shape container\r\n * @param scene scene to attach to\r\n */\r\n constructor(scene: Scene) {\r\n super({ type: PhysicsShapeType.CONTAINER, parameters: {} }, scene);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"motionBlurPostProcess.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/motionBlurPostProcess.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAInE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAE7E,OAAO,EAAE,uB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C,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,sBAAsB;aACxE,CAAC;YAEF,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;SACzC;IACL,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,MAAM,CAAC,iBAAsB,EAAE,YAAoB,EAAE,KAAY,EAAE,OAAe;QAC5F,OAAO,mBAAmB,CAAC,KAAK,CAC5B,GAAG,EAAE;YACD,OAAO,IAAI,qBAAqB,CAC5B,iBAAiB,CAAC,IAAI,EACtB,KAAK,EACL,iBAAiB,CAAC,OAAO,EACzB,YAAY,EACZ,iBAAiB,CAAC,wBAAwB,EAC1C,KAAK,CAAC,SAAS,EAAE,EACjB,iBAAiB,CAAC,QAAQ,EAC1B,iBAAiB,CAAC,WAAW,EAC7B,KAAK,CACR,CAAC;QACN,CAAC,EACD,iBAAiB,EACjB,KAAK,EACL,OAAO,CACV,CAAC;IACN,CAAC;CACJ;AA1TU;IADN,SAAS,EAAE;6DACsB;AAMlC;IADC,SAAS,EAAE;8DAGX;AAgBD;IADC,SAAS,EAAE;0DAGX;AAkSL,aAAa,CAAC,+BAA+B,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"../types\";\r\nimport { Logger } from \"../Misc/logger\";\r\nimport { Matrix, TmpVectors, Vector2 } from \"../Maths/math.vector\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport type { PostProcessOptions } from \"./postProcess\";\r\nimport { PostProcess } from \"./postProcess\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport { GeometryBufferRenderer } from \"../Rendering/geometryBufferRenderer\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport { MotionBlurConfiguration } from \"../Rendering/motionBlurConfiguration\";\r\nimport type { PrePassRenderer } from \"../Rendering/prePassRenderer\";\r\n\r\nimport \"../Animations/animatable\";\r\nimport \"../Rendering/geometryBufferRendererSceneComponent\";\r\nimport \"../Shaders/motionBlur.fragment\";\r\nimport { serialize, SerializationHelper } from \"../Misc/decorators\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\n\r\nimport type { Engine } from \"../Engines/engine\";\r\nimport type { Scene } from \"../scene\";\r\n\r\n/**\r\n * The Motion Blur Post Process which blurs an image based on the objects velocity in scene.\r\n * Velocity can be affected by each object's rotation, position and scale depending on the transformation speed.\r\n * As an example, all you have to do is to create the post-process:\r\n * var mb = new BABYLON.MotionBlurPostProcess(\r\n * 'mb', // The name of the effect.\r\n * scene, // The scene containing the objects to blur according to their velocity.\r\n * 1.0, // The required width/height ratio to downsize to before computing the render pass.\r\n * camera // The camera to apply the render pass to.\r\n * );\r\n * Then, all objects moving, rotating and/or scaling will be blurred depending on the transformation speed.\r\n */\r\nexport class MotionBlurPostProcess extends PostProcess {\r\n /**\r\n * Defines how much the image is blurred by the movement. Default value is equal to 1\r\n */\r\n @serialize()\r\n public motionStrength: number = 1;\r\n\r\n /**\r\n * Gets the number of iterations are used for motion blur quality. Default value is equal to 32\r\n */\r\n @serialize()\r\n public get motionBlurSamples(): number {\r\n return this._motionBlurSamples;\r\n }\r\n\r\n /**\r\n * Sets the number of iterations to be used for motion blur quality\r\n */\r\n public set motionBlurSamples(samples: number) {\r\n this._motionBlurSamples = samples;\r\n this._updateEffect();\r\n }\r\n\r\n private _motionBlurSamples: number = 32;\r\n\r\n /**\r\n * Gets whether or not the motion blur post-process is in object based mode.\r\n */\r\n @serialize()\r\n public get isObjectBased(): boolean {\r\n return this._isObjectBased;\r\n }\r\n\r\n /**\r\n * Sets whether or not the motion blur post-process is in object based mode.\r\n */\r\n public set isObjectBased(value: boolean) {\r\n if (this._isObjectBased === value) {\r\n return;\r\n }\r\n\r\n this._isObjectBased = value;\r\n this._applyMode();\r\n }\r\n\r\n private _isObjectBased: boolean = true;\r\n\r\n private _forceGeometryBuffer: boolean = false;\r\n private get _geometryBufferRenderer(): Nullable<GeometryBufferRenderer> {\r\n if (!this._forceGeometryBuffer) {\r\n return null;\r\n }\r\n\r\n return this._scene.geometryBufferRenderer;\r\n }\r\n\r\n private get _prePassRenderer(): Nullable<PrePassRenderer> {\r\n if (this._forceGeometryBuffer) {\r\n return null;\r\n }\r\n\r\n return this._scene.prePassRenderer;\r\n }\r\n\r\n private _invViewProjection: Nullable<Matrix> = null;\r\n private _previousViewProjection: Nullable<Matrix> = null;\r\n\r\n /**\r\n * Gets a string identifying the name of the class\r\n * @returns \"MotionBlurPostProcess\" string\r\n */\r\n public getClassName(): string {\r\n return \"MotionBlurPostProcess\";\r\n }\r\n\r\n /**\r\n * Creates a new instance MotionBlurPostProcess\r\n * @param name The name of the effect.\r\n * @param scene The scene containing the objects to blur according to their velocity.\r\n * @param options The required width/height ratio to downsize to before computing the render pass.\r\n * @param camera The camera to apply the render pass to.\r\n * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)\r\n * @param engine The engine which the post process will be applied. (default: current engine)\r\n * @param reusable If the post process can be reused on the same frame. (default: false)\r\n * @param textureType Type of textures used when performing the post process. (default: 0)\r\n * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: true)\r\n * @param forceGeometryBuffer If this post process should use geometry buffer instead of prepass (default: false)\r\n */\r\n constructor(\r\n name: string,\r\n scene: Scene,\r\n options: number | PostProcessOptions,\r\n camera: Nullable<Camera>,\r\n samplingMode?: number,\r\n engine?: Engine,\r\n reusable?: boolean,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n blockCompilation = false,\r\n forceGeometryBuffer = false\r\n ) {\r\n super(\r\n name,\r\n \"motionBlur\",\r\n [\"motionStrength\", \"motionScale\", \"screenSize\", \"inverseViewProjection\", \"prevViewProjection\", \"projection\"],\r\n [\"velocitySampler\", \"depthSampler\"],\r\n options,\r\n camera,\r\n samplingMode,\r\n engine,\r\n reusable,\r\n \"#define GEOMETRY_SUPPORTED\\n#define SAMPLES 64.0\\n#define OBJECT_BASED\",\r\n textureType,\r\n undefined,\r\n null,\r\n blockCompilation\r\n );\r\n\r\n this._forceGeometryBuffer = forceGeometryBuffer;\r\n\r\n // Set up assets\r\n if (this._forceGeometryBuffer) {\r\n scene.enableGeometryBufferRenderer();\r\n\r\n if (this._geometryBufferRenderer) {\r\n this._geometryBufferRenderer.enableVelocity = this._isObjectBased;\r\n }\r\n } else {\r\n scene.enablePrePassRenderer();\r\n\r\n if (this._prePassRenderer) {\r\n this._prePassRenderer.markAsDirty();\r\n this._prePassEffectConfiguration = new MotionBlurConfiguration();\r\n }\r\n }\r\n\r\n this._applyMode();\r\n }\r\n\r\n /**\r\n * Excludes the given skinned mesh from computing bones velocities.\r\n * Computing bones velocities can have a cost and that cost. The cost can be saved by calling this function and by passing the skinned mesh reference to ignore.\r\n * @param skinnedMesh The mesh containing the skeleton to ignore when computing the velocity map.\r\n */\r\n public excludeSkinnedMesh(skinnedMesh: AbstractMesh): void {\r\n if (skinnedMesh.skeleton) {\r\n let list;\r\n if (this._geometryBufferRenderer) {\r\n list = this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity;\r\n } else if (this._prePassRenderer) {\r\n list = this._prePassRenderer.excludedSkinnedMesh;\r\n } else {\r\n return;\r\n }\r\n list.push(skinnedMesh);\r\n }\r\n }\r\n\r\n /**\r\n * Removes the given skinned mesh from the excluded meshes to integrate bones velocities while rendering the velocity map.\r\n * @param skinnedMesh The mesh containing the skeleton that has been ignored previously.\r\n * @see excludeSkinnedMesh to exclude a skinned mesh from bones velocity computation.\r\n */\r\n public removeExcludedSkinnedMesh(skinnedMesh: AbstractMesh): void {\r\n if (skinnedMesh.skeleton) {\r\n let list;\r\n if (this._geometryBufferRenderer) {\r\n list = this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity;\r\n } else if (this._prePassRenderer) {\r\n list = this._prePassRenderer.excludedSkinnedMesh;\r\n } else {\r\n return;\r\n }\r\n\r\n const index = list.indexOf(skinnedMesh);\r\n if (index !== -1) {\r\n list.splice(index, 1);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Disposes the post process.\r\n * @param camera The camera to dispose the post process on.\r\n */\r\n public dispose(camera?: Camera): void {\r\n if (this._geometryBufferRenderer) {\r\n // Clear previous transformation matrices dictionary used to compute objects velocities\r\n this._geometryBufferRenderer._previousTransformationMatrices = {};\r\n this._geometryBufferRenderer._previousBonesTransformationMatrices = {};\r\n this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity = [];\r\n }\r\n\r\n super.dispose(camera);\r\n }\r\n\r\n /**\r\n * Called on the mode changed (object based or screen based).\r\n */\r\n private _applyMode(): void {\r\n if (!this._geometryBufferRenderer && !this._prePassRenderer) {\r\n // We can't get a velocity or depth texture. So, work as a passthrough.\r\n Logger.Warn(\"Multiple Render Target support needed to compute object based motion blur\");\r\n return this.updateEffect();\r\n }\r\n\r\n if (this._geometryBufferRenderer) {\r\n this._geometryBufferRenderer.enableVelocity = this._isObjectBased;\r\n }\r\n\r\n this._updateEffect();\r\n\r\n this._invViewProjection = null;\r\n this._previousViewProjection = null;\r\n\r\n if (this.isObjectBased) {\r\n if (this._prePassRenderer && this._prePassEffectConfiguration) {\r\n this._prePassEffectConfiguration.texturesRequired[0] = Constants.PREPASS_VELOCITY_TEXTURE_TYPE;\r\n }\r\n\r\n this.onApply = (effect: Effect) => this._onApplyObjectBased(effect);\r\n } else {\r\n this._invViewProjection = Matrix.Identity();\r\n this._previousViewProjection = this._scene.getTransformMatrix().clone();\r\n\r\n if (this._prePassRenderer && this._prePassEffectConfiguration) {\r\n this._prePassEffectConfiguration.texturesRequired[0] = Constants.PREPASS_DEPTH_TEXTURE_TYPE;\r\n }\r\n\r\n this.onApply = (effect: Effect) => this._onApplyScreenBased(effect);\r\n }\r\n }\r\n\r\n /**\r\n * Called on the effect is applied when the motion blur post-process is in object based mode.\r\n * @param effect\r\n */\r\n private _onApplyObjectBased(effect: Effect): void {\r\n effect.setVector2(\"screenSize\", new Vector2(this.width, this.height));\r\n\r\n effect.setFloat(\"motionScale\", this._scene.getAnimationRatio());\r\n effect.setFloat(\"motionStrength\", this.motionStrength);\r\n\r\n if (this._geometryBufferRenderer) {\r\n const velocityIndex = this._geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.VELOCITY_TEXTURE_TYPE);\r\n effect.setTexture(\"velocitySampler\", this._geometryBufferRenderer.getGBuffer().textures[velocityIndex]);\r\n } else if (this._prePassRenderer) {\r\n const velocityIndex = this._prePassRenderer.getIndex(Constants.PREPASS_VELOCITY_TEXTURE_TYPE);\r\n effect.setTexture(\"velocitySampler\", this._prePassRenderer.getRenderTarget().textures[velocityIndex]);\r\n }\r\n }\r\n\r\n /**\r\n * Called on the effect is applied when the motion blur post-process is in screen based mode.\r\n * @param effect\r\n */\r\n private _onApplyScreenBased(effect: Effect): void {\r\n const viewProjection = TmpVectors.Matrix[0];\r\n viewProjection.copyFrom(this._scene.getTransformMatrix());\r\n\r\n viewProjection.invertToRef(this._invViewProjection!);\r\n effect.setMatrix(\"inverseViewProjection\", this._invViewProjection!);\r\n\r\n effect.setMatrix(\"prevViewProjection\", this._previousViewProjection!);\r\n this._previousViewProjection!.copyFrom(viewProjection);\r\n\r\n effect.setMatrix(\"projection\", this._scene.getProjectionMatrix());\r\n\r\n effect.setVector2(\"screenSize\", new Vector2(this.width, this.height));\r\n\r\n effect.setFloat(\"motionScale\", this._scene.getAnimationRatio());\r\n effect.setFloat(\"motionStrength\", this.motionStrength);\r\n\r\n if (this._geometryBufferRenderer) {\r\n const depthIndex = this._geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.DEPTH_TEXTURE_TYPE);\r\n effect.setTexture(\"depthSampler\", this._geometryBufferRenderer.getGBuffer().textures[depthIndex]);\r\n } else if (this._prePassRenderer) {\r\n const depthIndex = this._prePassRenderer.getIndex(Constants.PREPASS_DEPTH_TEXTURE_TYPE);\r\n effect.setTexture(\"depthSampler\", this._prePassRenderer.getRenderTarget().textures[depthIndex]);\r\n }\r\n }\r\n\r\n /**\r\n * Called on the effect must be updated (changed mode, samples count, etc.).\r\n */\r\n private _updateEffect(): void {\r\n if (this._geometryBufferRenderer || this._prePassRenderer) {\r\n const defines: string[] = [\r\n \"#define GEOMETRY_SUPPORTED\",\r\n \"#define SAMPLES \" + this._motionBlurSamples.toFixed(1),\r\n this._isObjectBased ? \"#define OBJECT_BASED\" : \"#define SCREEN_BASED\",\r\n ];\r\n\r\n this.updateEffect(defines.join(\"\\n\"));\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public static _Parse(parsedPostProcess: any, targetCamera: Camera, scene: Scene, rootUrl: string): Nullable<MotionBlurPostProcess> {\r\n return SerializationHelper.Parse(\r\n () => {\r\n return new MotionBlurPostProcess(\r\n parsedPostProcess.name,\r\n scene,\r\n parsedPostProcess.options,\r\n targetCamera,\r\n parsedPostProcess.renderTargetSamplingMode,\r\n scene.getEngine(),\r\n parsedPostProcess.reusable,\r\n parsedPostProcess.textureType,\r\n false\r\n );\r\n },\r\n parsedPostProcess,\r\n scene,\r\n rootUrl\r\n );\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.MotionBlurPostProcess\", MotionBlurPostProcess);\r\n"]}
|
|
1
|
+
{"version":3,"file":"motionBlurPostProcess.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/motionBlurPostProcess.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAInE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAE7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAG/E,OAAO,0BAA0B,CAAC;AAClC,OAAO,mDAAmD,CAAC;AA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AC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;SACzC;IACL,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,MAAM,CAAC,iBAAsB,EAAE,YAAoB,EAAE,KAAY,EAAE,OAAe;QAC5F,OAAO,mBAAmB,CAAC,KAAK,CAC5B,GAAG,EAAE;YACD,OAAO,IAAI,qBAAqB,CAC5B,iBAAiB,CAAC,IAAI,EACtB,KAAK,EACL,iBAAiB,CAAC,OAAO,EACzB,YAAY,EACZ,iBAAiB,CAAC,wBAAwB,EAC1C,KAAK,CAAC,SAAS,EAAE,EACjB,iBAAiB,CAAC,QAAQ,EAC1B,iBAAiB,CAAC,WAAW,EAC7B,KAAK,CACR,CAAC;QACN,CAAC,EACD,iBAAiB,EACjB,KAAK,EACL,OAAO,CACV,CAAC;IACN,CAAC;CACJ;AA3TU;IADN,SAAS,EAAE;6DACsB;AAMlC;IADC,SAAS,EAAE;8DAGX;AAgBD;IADC,SAAS,EAAE;0DAGX;AAmSL,aAAa,CAAC,+BAA+B,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"../types\";\r\nimport { Logger } from \"../Misc/logger\";\r\nimport { Matrix, TmpVectors, Vector2 } from \"../Maths/math.vector\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport type { PostProcessOptions } from \"./postProcess\";\r\nimport { PostProcess } from \"./postProcess\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport { GeometryBufferRenderer } from \"../Rendering/geometryBufferRenderer\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport { MotionBlurConfiguration } from \"../Rendering/motionBlurConfiguration\";\r\nimport type { PrePassRenderer } from \"../Rendering/prePassRenderer\";\r\n\r\nimport \"../Animations/animatable\";\r\nimport \"../Rendering/geometryBufferRendererSceneComponent\";\r\nimport \"../Shaders/motionBlur.fragment\";\r\nimport { serialize, SerializationHelper } from \"../Misc/decorators\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\n\r\nimport type { Engine } from \"../Engines/engine\";\r\nimport type { Scene } from \"../scene\";\r\n\r\n/**\r\n * The Motion Blur Post Process which blurs an image based on the objects velocity in scene.\r\n * Velocity can be affected by each object's rotation, position and scale depending on the transformation speed.\r\n * As an example, all you have to do is to create the post-process:\r\n * var mb = new BABYLON.MotionBlurPostProcess(\r\n * 'mb', // The name of the effect.\r\n * scene, // The scene containing the objects to blur according to their velocity.\r\n * 1.0, // The required width/height ratio to downsize to before computing the render pass.\r\n * camera // The camera to apply the render pass to.\r\n * );\r\n * Then, all objects moving, rotating and/or scaling will be blurred depending on the transformation speed.\r\n */\r\nexport class MotionBlurPostProcess extends PostProcess {\r\n /**\r\n * Defines how much the image is blurred by the movement. Default value is equal to 1\r\n */\r\n @serialize()\r\n public motionStrength: number = 1;\r\n\r\n /**\r\n * Gets the number of iterations are used for motion blur quality. Default value is equal to 32\r\n */\r\n @serialize()\r\n public get motionBlurSamples(): number {\r\n return this._motionBlurSamples;\r\n }\r\n\r\n /**\r\n * Sets the number of iterations to be used for motion blur quality\r\n */\r\n public set motionBlurSamples(samples: number) {\r\n this._motionBlurSamples = samples;\r\n this._updateEffect();\r\n }\r\n\r\n private _motionBlurSamples: number = 32;\r\n\r\n /**\r\n * Gets whether or not the motion blur post-process is in object based mode.\r\n */\r\n @serialize()\r\n public get isObjectBased(): boolean {\r\n return this._isObjectBased;\r\n }\r\n\r\n /**\r\n * Sets whether or not the motion blur post-process is in object based mode.\r\n */\r\n public set isObjectBased(value: boolean) {\r\n if (this._isObjectBased === value) {\r\n return;\r\n }\r\n\r\n this._isObjectBased = value;\r\n this._applyMode();\r\n }\r\n\r\n private _isObjectBased: boolean = true;\r\n\r\n private _forceGeometryBuffer: boolean = false;\r\n private get _geometryBufferRenderer(): Nullable<GeometryBufferRenderer> {\r\n if (!this._forceGeometryBuffer) {\r\n return null;\r\n }\r\n\r\n return this._scene.geometryBufferRenderer;\r\n }\r\n\r\n private get _prePassRenderer(): Nullable<PrePassRenderer> {\r\n if (this._forceGeometryBuffer) {\r\n return null;\r\n }\r\n\r\n return this._scene.prePassRenderer;\r\n }\r\n\r\n private _invViewProjection: Nullable<Matrix> = null;\r\n private _previousViewProjection: Nullable<Matrix> = null;\r\n\r\n /**\r\n * Gets a string identifying the name of the class\r\n * @returns \"MotionBlurPostProcess\" string\r\n */\r\n public getClassName(): string {\r\n return \"MotionBlurPostProcess\";\r\n }\r\n\r\n /**\r\n * Creates a new instance MotionBlurPostProcess\r\n * @param name The name of the effect.\r\n * @param scene The scene containing the objects to blur according to their velocity.\r\n * @param options The required width/height ratio to downsize to before computing the render pass.\r\n * @param camera The camera to apply the render pass to.\r\n * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)\r\n * @param engine The engine which the post process will be applied. (default: current engine)\r\n * @param reusable If the post process can be reused on the same frame. (default: false)\r\n * @param textureType Type of textures used when performing the post process. (default: 0)\r\n * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: true)\r\n * @param forceGeometryBuffer If this post process should use geometry buffer instead of prepass (default: false)\r\n */\r\n constructor(\r\n name: string,\r\n scene: Scene,\r\n options: number | PostProcessOptions,\r\n camera: Nullable<Camera>,\r\n samplingMode?: number,\r\n engine?: Engine,\r\n reusable?: boolean,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n blockCompilation = false,\r\n forceGeometryBuffer = false\r\n ) {\r\n super(\r\n name,\r\n \"motionBlur\",\r\n [\"motionStrength\", \"motionScale\", \"screenSize\", \"inverseViewProjection\", \"prevViewProjection\", \"projection\"],\r\n [\"velocitySampler\", \"depthSampler\"],\r\n options,\r\n camera,\r\n samplingMode,\r\n engine,\r\n reusable,\r\n \"#define GEOMETRY_SUPPORTED\\n#define SAMPLES 64.0\\n#define OBJECT_BASED\",\r\n textureType,\r\n undefined,\r\n null,\r\n blockCompilation\r\n );\r\n\r\n this._forceGeometryBuffer = forceGeometryBuffer;\r\n\r\n // Set up assets\r\n if (this._forceGeometryBuffer) {\r\n scene.enableGeometryBufferRenderer();\r\n\r\n if (this._geometryBufferRenderer) {\r\n this._geometryBufferRenderer.enableVelocity = this._isObjectBased;\r\n }\r\n } else {\r\n scene.enablePrePassRenderer();\r\n\r\n if (this._prePassRenderer) {\r\n this._prePassRenderer.markAsDirty();\r\n this._prePassEffectConfiguration = new MotionBlurConfiguration();\r\n }\r\n }\r\n\r\n this._applyMode();\r\n }\r\n\r\n /**\r\n * Excludes the given skinned mesh from computing bones velocities.\r\n * Computing bones velocities can have a cost and that cost. The cost can be saved by calling this function and by passing the skinned mesh reference to ignore.\r\n * @param skinnedMesh The mesh containing the skeleton to ignore when computing the velocity map.\r\n */\r\n public excludeSkinnedMesh(skinnedMesh: AbstractMesh): void {\r\n if (skinnedMesh.skeleton) {\r\n let list;\r\n if (this._geometryBufferRenderer) {\r\n list = this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity;\r\n } else if (this._prePassRenderer) {\r\n list = this._prePassRenderer.excludedSkinnedMesh;\r\n } else {\r\n return;\r\n }\r\n list.push(skinnedMesh);\r\n }\r\n }\r\n\r\n /**\r\n * Removes the given skinned mesh from the excluded meshes to integrate bones velocities while rendering the velocity map.\r\n * @param skinnedMesh The mesh containing the skeleton that has been ignored previously.\r\n * @see excludeSkinnedMesh to exclude a skinned mesh from bones velocity computation.\r\n */\r\n public removeExcludedSkinnedMesh(skinnedMesh: AbstractMesh): void {\r\n if (skinnedMesh.skeleton) {\r\n let list;\r\n if (this._geometryBufferRenderer) {\r\n list = this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity;\r\n } else if (this._prePassRenderer) {\r\n list = this._prePassRenderer.excludedSkinnedMesh;\r\n } else {\r\n return;\r\n }\r\n\r\n const index = list.indexOf(skinnedMesh);\r\n if (index !== -1) {\r\n list.splice(index, 1);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Disposes the post process.\r\n * @param camera The camera to dispose the post process on.\r\n */\r\n public dispose(camera?: Camera): void {\r\n if (this._geometryBufferRenderer) {\r\n // Clear previous transformation matrices dictionary used to compute objects velocities\r\n this._geometryBufferRenderer._previousTransformationMatrices = {};\r\n this._geometryBufferRenderer._previousBonesTransformationMatrices = {};\r\n this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity = [];\r\n }\r\n\r\n super.dispose(camera);\r\n }\r\n\r\n /**\r\n * Called on the mode changed (object based or screen based).\r\n * @returns void\r\n */\r\n private _applyMode() {\r\n if (!this._geometryBufferRenderer && !this._prePassRenderer) {\r\n // We can't get a velocity or depth texture. So, work as a passthrough.\r\n Logger.Warn(\"Multiple Render Target support needed to compute object based motion blur\");\r\n return this.updateEffect();\r\n }\r\n\r\n if (this._geometryBufferRenderer) {\r\n this._geometryBufferRenderer.enableVelocity = this._isObjectBased;\r\n }\r\n\r\n this._updateEffect();\r\n\r\n this._invViewProjection = null;\r\n this._previousViewProjection = null;\r\n\r\n if (this.isObjectBased) {\r\n if (this._prePassRenderer && this._prePassEffectConfiguration) {\r\n this._prePassEffectConfiguration.texturesRequired[0] = Constants.PREPASS_VELOCITY_TEXTURE_TYPE;\r\n }\r\n\r\n this.onApply = (effect: Effect) => this._onApplyObjectBased(effect);\r\n } else {\r\n this._invViewProjection = Matrix.Identity();\r\n this._previousViewProjection = this._scene.getTransformMatrix().clone();\r\n\r\n if (this._prePassRenderer && this._prePassEffectConfiguration) {\r\n this._prePassEffectConfiguration.texturesRequired[0] = Constants.PREPASS_DEPTH_TEXTURE_TYPE;\r\n }\r\n\r\n this.onApply = (effect: Effect) => this._onApplyScreenBased(effect);\r\n }\r\n }\r\n\r\n /**\r\n * Called on the effect is applied when the motion blur post-process is in object based mode.\r\n * @param effect\r\n */\r\n private _onApplyObjectBased(effect: Effect): void {\r\n effect.setVector2(\"screenSize\", new Vector2(this.width, this.height));\r\n\r\n effect.setFloat(\"motionScale\", this._scene.getAnimationRatio());\r\n effect.setFloat(\"motionStrength\", this.motionStrength);\r\n\r\n if (this._geometryBufferRenderer) {\r\n const velocityIndex = this._geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.VELOCITY_TEXTURE_TYPE);\r\n effect.setTexture(\"velocitySampler\", this._geometryBufferRenderer.getGBuffer().textures[velocityIndex]);\r\n } else if (this._prePassRenderer) {\r\n const velocityIndex = this._prePassRenderer.getIndex(Constants.PREPASS_VELOCITY_TEXTURE_TYPE);\r\n effect.setTexture(\"velocitySampler\", this._prePassRenderer.getRenderTarget().textures[velocityIndex]);\r\n }\r\n }\r\n\r\n /**\r\n * Called on the effect is applied when the motion blur post-process is in screen based mode.\r\n * @param effect\r\n */\r\n private _onApplyScreenBased(effect: Effect): void {\r\n const viewProjection = TmpVectors.Matrix[0];\r\n viewProjection.copyFrom(this._scene.getTransformMatrix());\r\n\r\n viewProjection.invertToRef(this._invViewProjection!);\r\n effect.setMatrix(\"inverseViewProjection\", this._invViewProjection!);\r\n\r\n effect.setMatrix(\"prevViewProjection\", this._previousViewProjection!);\r\n this._previousViewProjection!.copyFrom(viewProjection);\r\n\r\n effect.setMatrix(\"projection\", this._scene.getProjectionMatrix());\r\n\r\n effect.setVector2(\"screenSize\", new Vector2(this.width, this.height));\r\n\r\n effect.setFloat(\"motionScale\", this._scene.getAnimationRatio());\r\n effect.setFloat(\"motionStrength\", this.motionStrength);\r\n\r\n if (this._geometryBufferRenderer) {\r\n const depthIndex = this._geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.DEPTH_TEXTURE_TYPE);\r\n effect.setTexture(\"depthSampler\", this._geometryBufferRenderer.getGBuffer().textures[depthIndex]);\r\n } else if (this._prePassRenderer) {\r\n const depthIndex = this._prePassRenderer.getIndex(Constants.PREPASS_DEPTH_TEXTURE_TYPE);\r\n effect.setTexture(\"depthSampler\", this._prePassRenderer.getRenderTarget().textures[depthIndex]);\r\n }\r\n }\r\n\r\n /**\r\n * Called on the effect must be updated (changed mode, samples count, etc.).\r\n */\r\n private _updateEffect(): void {\r\n if (this._geometryBufferRenderer || this._prePassRenderer) {\r\n const defines: string[] = [\r\n \"#define GEOMETRY_SUPPORTED\",\r\n \"#define SAMPLES \" + this._motionBlurSamples.toFixed(1),\r\n this._isObjectBased ? \"#define OBJECT_BASED\" : \"#define SCREEN_BASED\",\r\n ];\r\n\r\n this.updateEffect(defines.join(\"\\n\"));\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public static _Parse(parsedPostProcess: any, targetCamera: Camera, scene: Scene, rootUrl: string): Nullable<MotionBlurPostProcess> {\r\n return SerializationHelper.Parse(\r\n () => {\r\n return new MotionBlurPostProcess(\r\n parsedPostProcess.name,\r\n scene,\r\n parsedPostProcess.options,\r\n targetCamera,\r\n parsedPostProcess.renderTargetSamplingMode,\r\n scene.getEngine(),\r\n parsedPostProcess.reusable,\r\n parsedPostProcess.textureType,\r\n false\r\n );\r\n },\r\n parsedPostProcess,\r\n scene,\r\n rootUrl\r\n );\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.MotionBlurPostProcess\", MotionBlurPostProcess);\r\n"]}
|
|
@@ -134,7 +134,6 @@ export declare class PostProcess {
|
|
|
134
134
|
* Registers a shader code processing with a post process name.
|
|
135
135
|
* @param postProcessName name of the post process. Use null for the fallback shader code processing. This is the shader code processing that will be used in case no specific shader code processing has been associated to a post process name
|
|
136
136
|
* @param customShaderCodeProcessing shader code processing to associate to the post process name
|
|
137
|
-
* @returns
|
|
138
137
|
*/
|
|
139
138
|
static RegisterShaderCodeProcessing(postProcessName: Nullable<string>, customShaderCodeProcessing?: PostProcessCustomShaderCodeProcessing): void;
|
|
140
139
|
private static _GetShaderCodeProcessing;
|
|
@@ -19,7 +19,6 @@ export class PostProcess {
|
|
|
19
19
|
* Registers a shader code processing with a post process name.
|
|
20
20
|
* @param postProcessName name of the post process. Use null for the fallback shader code processing. This is the shader code processing that will be used in case no specific shader code processing has been associated to a post process name
|
|
21
21
|
* @param customShaderCodeProcessing shader code processing to associate to the post process name
|
|
22
|
-
* @returns
|
|
23
22
|
*/
|
|
24
23
|
static RegisterShaderCodeProcessing(postProcessName, customShaderCodeProcessing) {
|
|
25
24
|
if (!customShaderCodeProcessing) {
|