@babylonjs/core 6.41.0 → 6.41.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Animations/animatable.js +1 -2
- package/Animations/animatable.js.map +1 -1
- package/Animations/animation.js +4 -6
- package/Animations/animation.js.map +1 -1
- package/Animations/animationGroup.js +3 -3
- package/Animations/animationGroup.js.map +1 -1
- package/Animations/runtimeAnimation.js +1 -1
- package/Animations/runtimeAnimation.js.map +1 -1
- package/Audio/audioEngine.js +3 -5
- package/Audio/audioEngine.js.map +1 -1
- package/Audio/audioSceneComponent.js +1 -2
- package/Audio/audioSceneComponent.js.map +1 -1
- package/Audio/sound.js +48 -74
- package/Audio/sound.js.map +1 -1
- package/Audio/soundTrack.js +6 -12
- package/Audio/soundTrack.js.map +1 -1
- package/BakedVertexAnimation/bakedVertexAnimationManager.js +1 -2
- package/BakedVertexAnimation/bakedVertexAnimationManager.js.map +1 -1
- package/Behaviors/Cameras/autoRotationBehavior.js +1 -1
- package/Behaviors/Cameras/autoRotationBehavior.js.map +1 -1
- package/Behaviors/Meshes/fadeInOutBehavior.js +2 -4
- package/Behaviors/Meshes/fadeInOutBehavior.js.map +1 -1
- package/Behaviors/Meshes/followBehavior.js +1 -2
- package/Behaviors/Meshes/followBehavior.js.map +1 -1
- package/Behaviors/Meshes/handConstraintBehavior.js +2 -2
- package/Behaviors/Meshes/handConstraintBehavior.js.map +1 -1
- package/Bones/bone.js +4 -6
- package/Bones/bone.js.map +1 -1
- package/Bones/skeleton.js +2 -3
- package/Bones/skeleton.js.map +1 -1
- package/Buffers/buffer.align.js +5 -8
- package/Buffers/buffer.align.js.map +1 -1
- package/Buffers/buffer.js +6 -8
- package/Buffers/buffer.js.map +1 -1
- package/Cameras/Inputs/BaseCameraPointersInput.js +3 -4
- package/Cameras/Inputs/BaseCameraPointersInput.js.map +1 -1
- package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js +3 -5
- package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js.map +1 -1
- package/Cameras/Inputs/flyCameraMouseInput.js +2 -2
- package/Cameras/Inputs/flyCameraMouseInput.js.map +1 -1
- package/Cameras/Inputs/freeCameraMouseInput.js +2 -2
- package/Cameras/Inputs/freeCameraMouseInput.js.map +1 -1
- package/Cameras/arcRotateCamera.js +1 -2
- package/Cameras/arcRotateCamera.js.map +1 -1
- package/Cameras/camera.d.ts +5 -0
- package/Cameras/camera.js +18 -11
- package/Cameras/camera.js.map +1 -1
- package/Collisions/pickingInfo.js +1 -1
- package/Collisions/pickingInfo.js.map +1 -1
- package/Compute/computeEffect.js +5 -8
- package/Compute/computeEffect.js.map +1 -1
- package/Compute/computeShader.js +12 -9
- package/Compute/computeShader.js.map +1 -1
- package/Culling/Octrees/octreeSceneComponent.js +1 -2
- package/Culling/Octrees/octreeSceneComponent.js.map +1 -1
- package/Culling/boundingBox.js +2 -3
- package/Culling/boundingBox.js.map +1 -1
- package/Culling/ray.d.ts +6 -1
- package/Culling/ray.js +9 -4
- package/Culling/ray.js.map +1 -1
- package/Debug/debugLayer.js +4 -1
- package/Debug/debugLayer.js.map +1 -1
- package/Debug/directionalLightFrustumViewer.js +7 -9
- package/Debug/directionalLightFrustumViewer.js.map +1 -1
- package/Debug/physicsViewer.js +5 -7
- package/Debug/physicsViewer.js.map +1 -1
- package/Debug/rayHelper.js +1 -2
- package/Debug/rayHelper.js.map +1 -1
- package/Debug/skeletonViewer.js +26 -31
- package/Debug/skeletonViewer.js.map +1 -1
- package/Decorators/nodeDecorator.js +1 -1
- package/Decorators/nodeDecorator.js.map +1 -1
- package/DeviceInput/InputDevices/deviceSourceManager.js +3 -5
- package/DeviceInput/InputDevices/deviceSourceManager.js.map +1 -1
- package/DeviceInput/eventFactory.js +1 -1
- package/DeviceInput/eventFactory.js.map +1 -1
- package/DeviceInput/internalDeviceSourceManager.js +1 -2
- package/DeviceInput/internalDeviceSourceManager.js.map +1 -1
- package/DeviceInput/webDeviceInputSystem.js +9 -12
- package/DeviceInput/webDeviceInputSystem.js.map +1 -1
- package/Engines/Extensions/engine.cubeTexture.js +6 -1
- package/Engines/Extensions/engine.cubeTexture.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.js +3 -4
- package/Engines/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/Extensions/engine.rawTexture.js +4 -4
- package/Engines/Extensions/engine.rawTexture.js.map +1 -1
- package/Engines/Extensions/engine.readTexture.js +2 -3
- package/Engines/Extensions/engine.readTexture.js.map +1 -1
- package/Engines/Extensions/engine.renderTarget.js +9 -5
- package/Engines/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/Extensions/engine.renderTargetCube.js +9 -1
- package/Engines/Extensions/engine.renderTargetCube.js.map +1 -1
- package/Engines/Extensions/engine.views.js +1 -2
- package/Engines/Extensions/engine.views.js.map +1 -1
- package/Engines/Processors/shaderCodeNode.js +6 -7
- package/Engines/Processors/shaderCodeNode.js.map +1 -1
- package/Engines/Processors/shaderProcessor.js +6 -11
- package/Engines/Processors/shaderProcessor.js.map +1 -1
- package/Engines/WebGL/webGLHardwareTexture.js +1 -2
- package/Engines/WebGL/webGLHardwareTexture.js.map +1 -1
- package/Engines/WebGL/webGLRenderTargetWrapper.js +3 -5
- package/Engines/WebGL/webGLRenderTargetWrapper.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.cubeTexture.js +9 -2
- package/Engines/WebGPU/Extensions/engine.cubeTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.dynamicTexture.js +1 -2
- package/Engines/WebGPU/Extensions/engine.dynamicTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.js +5 -6
- package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.query.js +2 -4
- package/Engines/WebGPU/Extensions/engine.query.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.rawTexture.js +4 -4
- package/Engines/WebGPU/Extensions/engine.rawTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js +11 -5
- package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTargetCube.js +11 -3
- package/Engines/WebGPU/Extensions/engine.renderTargetCube.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.storageBuffer.js +2 -3
- package/Engines/WebGPU/Extensions/engine.storageBuffer.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.textureSampler.js +1 -2
- package/Engines/WebGPU/Extensions/engine.textureSampler.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.videoTexture.js +1 -2
- package/Engines/WebGPU/Extensions/engine.videoTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuBufferManager.js +1 -1
- package/Engines/WebGPU/webgpuBufferManager.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheBindGroups.js +6 -7
- package/Engines/WebGPU/webgpuCacheBindGroups.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js +15 -20
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheSampler.js +10 -5
- package/Engines/WebGPU/webgpuCacheSampler.js.map +1 -1
- package/Engines/WebGPU/webgpuClearQuad.js +2 -3
- package/Engines/WebGPU/webgpuClearQuad.js.map +1 -1
- package/Engines/WebGPU/webgpuComputePipelineContext.js +1 -2
- package/Engines/WebGPU/webgpuComputePipelineContext.js.map +1 -1
- package/Engines/WebGPU/webgpuDepthCullingState.js +2 -2
- package/Engines/WebGPU/webgpuDepthCullingState.js.map +1 -1
- package/Engines/WebGPU/webgpuDrawContext.js +1 -2
- package/Engines/WebGPU/webgpuDrawContext.js.map +1 -1
- package/Engines/WebGPU/webgpuHardwareTexture.js +4 -6
- package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuMaterialContext.js +2 -3
- package/Engines/WebGPU/webgpuMaterialContext.js.map +1 -1
- package/Engines/WebGPU/webgpuOcclusionQuery.js +3 -5
- package/Engines/WebGPU/webgpuOcclusionQuery.js.map +1 -1
- package/Engines/WebGPU/webgpuPipelineContext.js +2 -4
- package/Engines/WebGPU/webgpuPipelineContext.js.map +1 -1
- package/Engines/WebGPU/webgpuQuerySet.js +1 -1
- package/Engines/WebGPU/webgpuQuerySet.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessingContext.js +2 -4
- package/Engines/WebGPU/webgpuShaderProcessingContext.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js +2 -4
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +5 -4
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
- package/Engines/WebGPU/webgpuStencilStateComposer.js +1 -2
- package/Engines/WebGPU/webgpuStencilStateComposer.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureManager.js +40 -43
- package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
- package/Engines/WebGPU/webgpuTimestampQuery.js +12 -7
- package/Engines/WebGPU/webgpuTimestampQuery.js.map +1 -1
- package/Engines/WebGPU/webgpuTintWASM.js +4 -1
- package/Engines/WebGPU/webgpuTintWASM.js.map +1 -1
- package/Engines/engine.js +4 -7
- package/Engines/engine.js.map +1 -1
- package/Engines/nativeEngine.js +16 -22
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/nullEngine.js +9 -1
- package/Engines/nullEngine.js.map +1 -1
- package/Engines/renderTargetWrapper.js +11 -16
- package/Engines/renderTargetWrapper.js.map +1 -1
- package/Engines/thinEngine.js +32 -44
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +77 -95
- package/Engines/webgpuEngine.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js +2 -3
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js +3 -6
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js +1 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js +1 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js +2 -4
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js.map +1 -1
- package/FlowGraph/flowGraph.js +1 -2
- package/FlowGraph/flowGraph.js.map +1 -1
- package/FlowGraph/flowGraphBlock.js +2 -4
- package/FlowGraph/flowGraphBlock.js.map +1 -1
- package/FlowGraph/flowGraphContext.js +1 -2
- package/FlowGraph/flowGraphContext.js.map +1 -1
- package/FlowGraph/flowGraphCoordinator.js +4 -7
- package/FlowGraph/flowGraphCoordinator.js.map +1 -1
- package/FlowGraph/flowGraphSignalConnection.js +1 -2
- package/FlowGraph/flowGraphSignalConnection.js.map +1 -1
- package/FlowGraph/serialization.js +2 -3
- package/FlowGraph/serialization.js.map +1 -1
- package/Gamepads/gamepadManager.js +1 -1
- package/Gamepads/gamepadManager.js.map +1 -1
- package/Gizmos/axisDragGizmo.js +2 -4
- package/Gizmos/axisDragGizmo.js.map +1 -1
- package/Gizmos/axisScaleGizmo.js +5 -8
- package/Gizmos/axisScaleGizmo.js.map +1 -1
- package/Gizmos/boundingBoxGizmo.js +1 -1
- package/Gizmos/boundingBoxGizmo.js.map +1 -1
- package/Gizmos/cameraGizmo.js +2 -3
- package/Gizmos/cameraGizmo.js.map +1 -1
- package/Gizmos/gizmo.js +4 -7
- package/Gizmos/gizmo.js.map +1 -1
- package/Gizmos/gizmoManager.js +3 -4
- package/Gizmos/gizmoManager.js.map +1 -1
- package/Gizmos/planeDragGizmo.js +2 -4
- package/Gizmos/planeDragGizmo.js.map +1 -1
- package/Gizmos/planeRotationGizmo.js +2 -4
- package/Gizmos/planeRotationGizmo.js.map +1 -1
- package/Helpers/environmentHelper.js +8 -2
- package/Helpers/environmentHelper.js.map +1 -1
- package/Helpers/videoDome.js +1 -2
- package/Helpers/videoDome.js.map +1 -1
- package/Inputs/scene.inputManager.js +8 -10
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Layers/effectLayer.js +16 -10
- package/Layers/effectLayer.js.map +1 -1
- package/Layers/glowLayer.js +16 -6
- package/Layers/glowLayer.js.map +1 -1
- package/Layers/highlightLayer.js +12 -3
- package/Layers/highlightLayer.js.map +1 -1
- package/Layers/layer.js +1 -2
- package/Layers/layer.js.map +1 -1
- package/LensFlares/lensFlareSystem.js +1 -2
- package/LensFlares/lensFlareSystem.js.map +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.js +21 -25
- package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
- package/Lights/Shadows/shadowGenerator.js +18 -21
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Lights/light.js +2 -4
- package/Lights/light.js.map +1 -1
- package/Lights/shadowLight.js +1 -1
- package/Lights/shadowLight.js.map +1 -1
- package/Loading/Plugins/babylonFileLoader.js +1 -2
- package/Loading/Plugins/babylonFileLoader.js.map +1 -1
- package/Loading/sceneLoader.js +1 -1
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/GreasedLine/greasedLinePluginMaterial.js +26 -32
- package/Materials/GreasedLine/greasedLinePluginMaterial.js.map +1 -1
- package/Materials/GreasedLine/greasedLineSimpleMaterial.js +22 -27
- package/Materials/GreasedLine/greasedLineSimpleMaterial.js.map +1 -1
- package/Materials/Node/Blocks/Dual/clipPlanesBlock.js +6 -7
- package/Materials/Node/Blocks/Dual/clipPlanesBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/imageSourceBlock.js +1 -2
- package/Materials/Node/Blocks/Dual/imageSourceBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js +1 -2
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/sceneDepthBlock.js +1 -1
- package/Materials/Node/Blocks/Dual/sceneDepthBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/textureBlock.js +10 -16
- package/Materials/Node/Blocks/Dual/textureBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/TBNBlock.js +2 -3
- package/Materials/Node/Blocks/Fragment/TBNBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js +1 -2
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js +2 -4
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js.map +1 -1
- package/Materials/Node/Blocks/Input/inputBlock.js +1 -2
- package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js +24 -26
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/iridescenceBlock.js +3 -3
- package/Materials/Node/Blocks/PBR/iridescenceBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +45 -49
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/reflectionBlock.js +1 -2
- package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/refractionBlock.js +1 -2
- package/Materials/Node/Blocks/PBR/refractionBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/sheenBlock.js +13 -13
- package/Materials/Node/Blocks/PBR/sheenBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/subSurfaceBlock.js +27 -28
- package/Materials/Node/Blocks/PBR/subSurfaceBlock.js.map +1 -1
- package/Materials/Node/Blocks/Teleport/teleportOutBlock.js +1 -2
- package/Materials/Node/Blocks/Teleport/teleportOutBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/instancesBlock.js +2 -2
- package/Materials/Node/Blocks/Vertex/instancesBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js +43 -33
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js.map +1 -1
- package/Materials/Node/Blocks/biPlanarBlock.js +1 -2
- package/Materials/Node/Blocks/biPlanarBlock.js.map +1 -1
- package/Materials/Node/Blocks/cloudBlock.js +2 -3
- package/Materials/Node/Blocks/cloudBlock.js.map +1 -1
- package/Materials/Node/Blocks/colorMergerBlock.js +4 -5
- package/Materials/Node/Blocks/colorMergerBlock.js.map +1 -1
- package/Materials/Node/Blocks/customBlock.js +4 -6
- package/Materials/Node/Blocks/customBlock.js.map +1 -1
- package/Materials/Node/Blocks/meshAttributeExistsBlock.js +2 -4
- package/Materials/Node/Blocks/meshAttributeExistsBlock.js.map +1 -1
- package/Materials/Node/Blocks/triPlanarBlock.js +14 -23
- package/Materials/Node/Blocks/triPlanarBlock.js.map +1 -1
- package/Materials/Node/Blocks/vectorMergerBlock.js +4 -5
- package/Materials/Node/Blocks/vectorMergerBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.js +16 -11
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterialBlock.js +3 -4
- package/Materials/Node/nodeMaterialBlock.js.map +1 -1
- package/Materials/Node/nodeMaterialBuildState.js +1 -1
- package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.js +25 -28
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/PBR/pbrClearCoatConfiguration.js +6 -9
- package/Materials/PBR/pbrClearCoatConfiguration.js.map +1 -1
- package/Materials/PBR/pbrIridescenceConfiguration.js +4 -7
- package/Materials/PBR/pbrIridescenceConfiguration.js.map +1 -1
- package/Materials/PBR/pbrSheenConfiguration.js +4 -7
- package/Materials/PBR/pbrSheenConfiguration.js.map +1 -1
- package/Materials/Textures/Loaders/envTextureLoader.js +2 -2
- package/Materials/Textures/Loaders/envTextureLoader.js.map +1 -1
- package/Materials/Textures/Packer/packer.js +13 -14
- package/Materials/Textures/Packer/packer.js.map +1 -1
- package/Materials/Textures/Procedurals/noiseProceduralTexture.js +1 -2
- package/Materials/Textures/Procedurals/noiseProceduralTexture.js.map +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.js +19 -11
- package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
- package/Materials/Textures/baseTexture.js +2 -4
- package/Materials/Textures/baseTexture.js.map +1 -1
- package/Materials/Textures/cubeTexture.js +7 -13
- package/Materials/Textures/cubeTexture.js.map +1 -1
- package/Materials/Textures/dynamicTexture.js +1 -2
- package/Materials/Textures/dynamicTexture.js.map +1 -1
- package/Materials/Textures/hdrCubeTexture.js +2 -4
- package/Materials/Textures/hdrCubeTexture.js.map +1 -1
- package/Materials/Textures/htmlElementTexture.js +5 -3
- package/Materials/Textures/htmlElementTexture.js.map +1 -1
- package/Materials/Textures/internalTexture.js +3 -5
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/Textures/mirrorTexture.js +3 -6
- package/Materials/Textures/mirrorTexture.js.map +1 -1
- package/Materials/Textures/multiRenderTarget.js +5 -8
- package/Materials/Textures/multiRenderTarget.js.map +1 -1
- package/Materials/Textures/rawTexture.js +1 -1
- package/Materials/Textures/rawTexture.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.js +22 -34
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/Textures/texture.js +16 -21
- package/Materials/Textures/texture.js.map +1 -1
- package/Materials/Textures/thinRenderTargetTexture.js +2 -4
- package/Materials/Textures/thinRenderTargetTexture.js.map +1 -1
- package/Materials/Textures/thinTexture.js +1 -1
- package/Materials/Textures/thinTexture.js.map +1 -1
- package/Materials/Textures/videoTexture.js +12 -10
- package/Materials/Textures/videoTexture.js.map +1 -1
- package/Materials/clipPlaneMaterialHelper.js +18 -21
- package/Materials/clipPlaneMaterialHelper.js.map +1 -1
- package/Materials/drawWrapper.js +2 -4
- package/Materials/drawWrapper.js.map +1 -1
- package/Materials/effect.d.ts +4 -0
- package/Materials/effect.js +18 -18
- package/Materials/effect.js.map +1 -1
- package/Materials/effectRenderer.js +2 -3
- package/Materials/effectRenderer.js.map +1 -1
- package/Materials/material.decalMapConfiguration.js +3 -3
- package/Materials/material.decalMapConfiguration.js.map +1 -1
- package/Materials/material.detailMapConfiguration.js +1 -2
- package/Materials/material.detailMapConfiguration.js.map +1 -1
- package/Materials/material.js +7 -4
- package/Materials/material.js.map +1 -1
- package/Materials/materialDefines.js +5 -6
- package/Materials/materialDefines.js.map +1 -1
- package/Materials/materialHelper.d.ts +1 -1
- package/Materials/materialHelper.js +3 -4
- package/Materials/materialHelper.js.map +1 -1
- package/Materials/materialPluginManager.js +3 -5
- package/Materials/materialPluginManager.js.map +1 -1
- package/Materials/meshDebugPluginMaterial.js +13 -14
- package/Materials/meshDebugPluginMaterial.js.map +1 -1
- package/Materials/multiMaterial.js +1 -2
- package/Materials/multiMaterial.js.map +1 -1
- package/Materials/shaderMaterial.d.ts +1 -1
- package/Materials/shaderMaterial.js +64 -32
- package/Materials/shaderMaterial.js.map +1 -1
- package/Materials/shadowDepthWrapper.js +24 -23
- package/Materials/shadowDepthWrapper.js.map +1 -1
- package/Materials/standardMaterial.js +10 -12
- package/Materials/standardMaterial.js.map +1 -1
- package/Materials/uniformBuffer.js +1 -1
- package/Materials/uniformBuffer.js.map +1 -1
- package/Maths/math.vector.js +1 -2
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/Builders/decalBuilder.js +26 -29
- package/Meshes/Builders/decalBuilder.js.map +1 -1
- package/Meshes/Builders/greasedLineBuilder.js +16 -16
- package/Meshes/Builders/greasedLineBuilder.js.map +1 -1
- package/Meshes/Builders/groundBuilder.d.ts +5 -1
- package/Meshes/Builders/groundBuilder.js +13 -2
- package/Meshes/Builders/groundBuilder.js.map +1 -1
- package/Meshes/Builders/textBuilder.js +2 -3
- package/Meshes/Builders/textBuilder.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +9 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +141 -12
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineBaseMesh.js +8 -11
- package/Meshes/GreasedLine/greasedLineBaseMesh.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineMesh.js +3 -5
- package/Meshes/GreasedLine/greasedLineMesh.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js +13 -18
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js.map +1 -1
- package/Meshes/Node/Blocks/Teleport/teleportOutBlock.js +1 -2
- package/Meshes/Node/Blocks/Teleport/teleportOutBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryTrigonometryBlock.d.ts +18 -18
- package/Meshes/Node/Blocks/geometryTrigonometryBlock.js +18 -18
- package/Meshes/Node/Blocks/geometryTrigonometryBlock.js.map +1 -1
- package/Meshes/Node/nodeGeometry.js +6 -3
- package/Meshes/Node/nodeGeometry.js.map +1 -1
- package/Meshes/Node/nodeGeometryBlock.js +1 -1
- package/Meshes/Node/nodeGeometryBlock.js.map +1 -1
- package/Meshes/Node/nodeGeometryBlockConnectionPoint.js +1 -2
- package/Meshes/Node/nodeGeometryBlockConnectionPoint.js.map +1 -1
- package/Meshes/Node/nodeGeometryBuildState.js +1 -2
- package/Meshes/Node/nodeGeometryBuildState.js.map +1 -1
- package/Meshes/abstractMesh.js +6 -10
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/csg.js +1 -2
- package/Meshes/csg.js.map +1 -1
- package/Meshes/geometry.js +1 -1
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/instancedMesh.js +5 -10
- package/Meshes/instancedMesh.js.map +1 -1
- package/Meshes/mesh.js +13 -22
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/mesh.vertexData.js +3 -4
- package/Meshes/mesh.vertexData.js.map +1 -1
- package/Meshes/meshUVSpaceRenderer.js +18 -15
- package/Meshes/meshUVSpaceRenderer.js.map +1 -1
- package/Meshes/subMesh.js +8 -14
- package/Meshes/subMesh.js.map +1 -1
- package/Meshes/thinInstanceMesh.js +12 -18
- package/Meshes/thinInstanceMesh.js.map +1 -1
- package/Meshes/trailMesh.js +2 -3
- package/Meshes/trailMesh.js.map +1 -1
- package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js +1 -2
- package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js.map +1 -1
- package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.js +9 -14
- package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.js.map +1 -1
- package/Misc/PerformanceViewer/performanceViewerCollector.js +2 -3
- package/Misc/PerformanceViewer/performanceViewerCollector.js.map +1 -1
- package/Misc/arrayTools.js +1 -1
- package/Misc/arrayTools.js.map +1 -1
- package/Misc/basis.js +2 -3
- package/Misc/basis.js.map +1 -1
- package/Misc/dataStorage.js +1 -1
- package/Misc/dataStorage.js.map +1 -1
- package/Misc/deepCopier.js +1 -1
- package/Misc/deepCopier.js.map +1 -1
- package/Misc/environmentTextureTools.js +3 -4
- package/Misc/environmentTextureTools.js.map +1 -1
- package/Misc/equirectangularCapture.js +2 -3
- package/Misc/equirectangularCapture.js.map +1 -1
- package/Misc/fileTools.js +4 -4
- package/Misc/fileTools.js.map +1 -1
- package/Misc/greasedLineTools.js +3 -5
- package/Misc/greasedLineTools.js.map +1 -1
- package/Misc/logger.js +1 -2
- package/Misc/logger.js.map +1 -1
- package/Misc/minMaxReducer.js +2 -3
- package/Misc/minMaxReducer.js.map +1 -1
- package/Misc/pressureObserverWrapper.js +5 -8
- package/Misc/pressureObserverWrapper.js.map +1 -1
- package/Misc/sceneRecorder.js +1 -1
- package/Misc/sceneRecorder.js.map +1 -1
- package/Misc/screenshotTools.js +1 -1
- package/Misc/screenshotTools.js.map +1 -1
- package/Misc/textureTools.js +5 -5
- package/Misc/textureTools.js.map +1 -1
- package/Misc/timer.js +3 -5
- package/Misc/timer.js.map +1 -1
- package/Misc/tools.d.ts +3 -2
- package/Misc/tools.js +6 -5
- package/Misc/tools.js.map +1 -1
- package/Misc/trajectoryClassifier.js +3 -3
- package/Misc/trajectoryClassifier.js.map +1 -1
- package/Misc/videoRecorder.js +6 -4
- package/Misc/videoRecorder.js.map +1 -1
- package/Misc/virtualJoystick.js +4 -1
- package/Misc/virtualJoystick.js.map +1 -1
- package/Morph/morphTargetManager.js +1 -2
- package/Morph/morphTargetManager.js.map +1 -1
- package/Particles/EmitterTypes/meshParticleEmitter.js +1 -2
- package/Particles/EmitterTypes/meshParticleEmitter.js.map +1 -1
- package/Particles/baseParticleSystem.d.ts +4 -0
- package/Particles/baseParticleSystem.js +4 -0
- package/Particles/baseParticleSystem.js.map +1 -1
- package/Particles/computeShaderParticleSystem.js +3 -6
- package/Particles/computeShaderParticleSystem.js.map +1 -1
- package/Particles/gpuParticleSystem.d.ts +2 -2
- package/Particles/gpuParticleSystem.js +30 -20
- package/Particles/gpuParticleSystem.js.map +1 -1
- package/Particles/particleSystem.d.ts +3 -2
- package/Particles/particleSystem.js +33 -30
- package/Particles/particleSystem.js.map +1 -1
- package/Particles/particleSystemComponent.js +2 -3
- package/Particles/particleSystemComponent.js.map +1 -1
- package/Particles/pointsCloudSystem.js +5 -8
- package/Particles/pointsCloudSystem.js.map +1 -1
- package/Particles/solidParticleSystem.js +5 -7
- package/Particles/solidParticleSystem.js.map +1 -1
- package/Particles/webgl2ParticleSystem.js +1 -2
- package/Particles/webgl2ParticleSystem.js.map +1 -1
- package/Physics/castingResult.js +1 -1
- package/Physics/castingResult.js.map +1 -1
- package/Physics/joinedPhysicsEngineComponent.js +2 -2
- package/Physics/joinedPhysicsEngineComponent.js.map +1 -1
- package/Physics/physicsHelper.js +19 -21
- package/Physics/physicsHelper.js.map +1 -1
- package/Physics/v2/IPhysicsEnginePlugin.d.ts +20 -0
- package/Physics/v2/IPhysicsEnginePlugin.js.map +1 -1
- package/Physics/v2/Plugins/havokPlugin.js +48 -35
- package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
- package/Physics/v2/physicsAggregate.js +10 -12
- package/Physics/v2/physicsAggregate.js.map +1 -1
- package/Physics/v2/physicsBody.js +2 -4
- package/Physics/v2/physicsBody.js.map +1 -1
- package/Physics/v2/physicsShape.js +1 -2
- package/Physics/v2/physicsShape.js.map +1 -1
- package/Physics/v2/ragdoll.js +6 -8
- package/Physics/v2/ragdoll.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js +6 -8
- package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js +14 -22
- package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js.map +1 -1
- package/PostProcesses/colorCorrectionPostProcess.js +1 -1
- package/PostProcesses/colorCorrectionPostProcess.js.map +1 -1
- package/PostProcesses/postProcess.js +28 -34
- package/PostProcesses/postProcess.js.map +1 -1
- package/PostProcesses/postProcessManager.js +4 -6
- package/PostProcesses/postProcessManager.js.map +1 -1
- package/PostProcesses/screenSpaceReflectionPostProcess.js +2 -2
- package/PostProcesses/screenSpaceReflectionPostProcess.js.map +1 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.js +4 -7
- package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
- package/PostProcesses/vrMultiviewToSingleviewPostProcess.js +1 -1
- package/PostProcesses/vrMultiviewToSingleviewPostProcess.js.map +1 -1
- package/Probes/reflectionProbe.js +2 -4
- package/Probes/reflectionProbe.js.map +1 -1
- package/Rendering/GlobalIllumination/giRSMManager.js +22 -19
- package/Rendering/GlobalIllumination/giRSMManager.js.map +1 -1
- package/Rendering/boundingBoxRenderer.js +2 -3
- package/Rendering/boundingBoxRenderer.js.map +1 -1
- package/Rendering/depthPeelingRenderer.js +2 -4
- package/Rendering/depthPeelingRenderer.js.map +1 -1
- package/Rendering/depthPeelingSceneComponent.js +2 -4
- package/Rendering/depthPeelingSceneComponent.js.map +1 -1
- package/Rendering/depthRenderer.js +10 -13
- package/Rendering/depthRenderer.js.map +1 -1
- package/Rendering/edgesRenderer.js +8 -11
- package/Rendering/edgesRenderer.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderer.js +6 -11
- package/Rendering/fluidRenderer/fluidRenderer.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObject.js +3 -5
- package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js +2 -4
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js +30 -36
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingTextures.js +5 -7
- package/Rendering/fluidRenderer/fluidRenderingTextures.js.map +1 -1
- package/Rendering/geometryBufferRenderer.js +3 -2
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Rendering/outlineRenderer.js +5 -4
- package/Rendering/outlineRenderer.js.map +1 -1
- package/Rendering/prePassRenderer.js +3 -6
- package/Rendering/prePassRenderer.js.map +1 -1
- package/Rendering/reflectiveShadowMap.d.ts +1 -0
- package/Rendering/reflectiveShadowMap.js +5 -5
- package/Rendering/reflectiveShadowMap.js.map +1 -1
- package/Shaders/color.fragment.d.ts +2 -0
- package/Shaders/color.fragment.js +4 -0
- package/Shaders/color.fragment.js.map +1 -1
- package/Shaders/color.vertex.d.ts +2 -0
- package/Shaders/color.vertex.js +7 -0
- package/Shaders/color.vertex.js.map +1 -1
- package/Shaders/gpuRenderParticles.fragment.d.ts +2 -0
- package/Shaders/gpuRenderParticles.fragment.js +4 -0
- package/Shaders/gpuRenderParticles.fragment.js.map +1 -1
- package/Shaders/gpuRenderParticles.vertex.d.ts +2 -0
- package/Shaders/gpuRenderParticles.vertex.js +5 -1
- package/Shaders/gpuRenderParticles.vertex.js.map +1 -1
- package/Shaders/particles.fragment.d.ts +2 -0
- package/Shaders/particles.fragment.js +4 -0
- package/Shaders/particles.fragment.js.map +1 -1
- package/Shaders/particles.vertex.d.ts +2 -0
- package/Shaders/particles.vertex.js +5 -1
- package/Shaders/particles.vertex.js.map +1 -1
- package/Sprites/spriteManager.js +1 -2
- package/Sprites/spriteManager.js.map +1 -1
- package/Sprites/spriteRenderer.js +5 -7
- package/Sprites/spriteRenderer.js.map +1 -1
- package/States/stencilStateComposer.js +2 -4
- package/States/stencilStateComposer.js.map +1 -1
- package/XR/features/WebXRAbstractFeature.js +6 -2
- package/XR/features/WebXRAbstractFeature.js.map +1 -1
- package/XR/features/WebXRAnchorSystem.js +1 -2
- package/XR/features/WebXRAnchorSystem.js.map +1 -1
- package/XR/features/WebXRControllerMovement.js +6 -7
- package/XR/features/WebXRControllerMovement.js.map +1 -1
- package/XR/features/WebXRControllerPhysics.js +17 -10
- package/XR/features/WebXRControllerPhysics.js.map +1 -1
- package/XR/features/WebXRControllerPointerSelection.js +1 -2
- package/XR/features/WebXRControllerPointerSelection.js.map +1 -1
- package/XR/features/WebXRControllerTeleportation.d.ts +1 -0
- package/XR/features/WebXRControllerTeleportation.js +6 -3
- package/XR/features/WebXRControllerTeleportation.js.map +1 -1
- package/XR/features/WebXRDepthSensing.js +3 -5
- package/XR/features/WebXRDepthSensing.js.map +1 -1
- package/XR/features/WebXRHandTracking.d.ts +1 -0
- package/XR/features/WebXRHandTracking.js +31 -28
- package/XR/features/WebXRHandTracking.js.map +1 -1
- package/XR/features/WebXRLayers.js +9 -11
- package/XR/features/WebXRLayers.js.map +1 -1
- package/XR/features/WebXRLightEstimation.js +3 -6
- package/XR/features/WebXRLightEstimation.js.map +1 -1
- package/XR/features/WebXRMeshDetector.js +2 -4
- package/XR/features/WebXRMeshDetector.js.map +1 -1
- package/XR/features/WebXRNearInteraction.js +21 -18
- package/XR/features/WebXRNearInteraction.js.map +1 -1
- package/XR/features/WebXRPlaneDetector.js +1 -2
- package/XR/features/WebXRPlaneDetector.js.map +1 -1
- package/XR/features/WebXRRawCameraAccess.js +2 -3
- package/XR/features/WebXRRawCameraAccess.js.map +1 -1
- package/XR/features/WebXRSpaceWarp.js +1 -1
- package/XR/features/WebXRSpaceWarp.js.map +1 -1
- package/XR/motionController/webXRAbstractMotionController.js +4 -1
- package/XR/motionController/webXRAbstractMotionController.js.map +1 -1
- package/XR/native/nativeXRFrame.js +1 -2
- package/XR/native/nativeXRFrame.js.map +1 -1
- package/XR/webXRCamera.js +1 -2
- package/XR/webXRCamera.js.map +1 -1
- package/XR/webXRDefaultExperience.js +28 -6
- package/XR/webXRDefaultExperience.js.map +1 -1
- package/XR/webXRExperienceHelper.js +5 -7
- package/XR/webXRExperienceHelper.js.map +1 -1
- package/XR/webXRFeaturesManager.js +4 -1
- package/XR/webXRFeaturesManager.js.map +1 -1
- package/XR/webXRInput.js +6 -1
- package/XR/webXRInput.js.map +1 -1
- package/XR/webXRInputSource.js +1 -2
- package/XR/webXRInputSource.js.map +1 -1
- package/XR/webXRSessionManager.js +16 -29
- package/XR/webXRSessionManager.js.map +1 -1
- package/assetContainer.js +4 -1
- package/assetContainer.js.map +1 -1
- package/package.json +1 -1
- package/scene.js +18 -17
- package/scene.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseParticleSystem.js","sourceRoot":"","sources":["../../../../dev/core/src/Particles/baseParticleSystem.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAGxD,OAAO,EAAE,mCAAmC,EAAE,MAAM,2CAA2C,CAAC;AAGhG,OAAO,EACH,kBAA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EAAE,UAAmB;QACtG,MAAM,eAAe,GAAG,IAAI,kBAAkB,EAAE,CAAC;QACjD,IAAI,CAAC,mBAAmB,GAAG,eAAe,CAAC;QAC3C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,OAAO,eAAe,CAAC;IAC3B,CAAC;;AAhzBD;;GAEG;AACW,mCAAgB,GAAG,CAAC,AAAJ,CAAK;AACnC;;GAEG;AACW,qCAAkB,GAAG,CAAC,AAAJ,CAAK;AACrC;;GAEG;AACW,gCAAa,GAAG,CAAC,AAAJ,CAAK;AAChC;;GAEG;AACW,qCAAkB,GAAG,CAAC,AAAJ,CAAK;AAErC;;GAEG;AACW,wCAAqB,GAAG,CAAC,AAAJ,CAAK","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nimport type { Nullable } from \"../types\";\r\nimport { Vector2, Vector3 } from \"../Maths/math.vector\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport type { ImageProcessingConfiguration } from \"../Materials/imageProcessingConfiguration\";\r\nimport { ImageProcessingConfigurationDefines } from \"../Materials/imageProcessingConfiguration\";\r\nimport type { ColorGradient, FactorGradient, Color3Gradient, IValueGradient } from \"../Misc/gradients\";\r\nimport type { IParticleEmitterType } from \"../Particles/EmitterTypes/index\";\r\nimport {\r\n BoxParticleEmitter,\r\n PointParticleEmitter,\r\n HemisphericParticleEmitter,\r\n SphereParticleEmitter,\r\n SphereDirectedParticleEmitter,\r\n CylinderParticleEmitter,\r\n CylinderDirectedParticleEmitter,\r\n ConeParticleEmitter,\r\n} from \"../Particles/EmitterTypes/index\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport type { BaseTexture } from \"../Materials/Textures/baseTexture\";\r\nimport { Color4 } from \"../Maths/math.color\";\r\nimport type { ThinEngine } from \"../Engines/thinEngine\";\r\n\r\nimport \"../Engines/Extensions/engine.dynamicBuffer\";\r\nimport type { IClipPlanesHolder } from \"../Misc/interfaces/iClipPlanesHolder\";\r\nimport type { Plane } from \"../Maths/math.plane\";\r\nimport type { Animation } from \"../Animations/animation\";\r\nimport type { Scene } from \"../scene\";\r\nimport type { ProceduralTexture } from \"../Materials/Textures/Procedurals/proceduralTexture\";\r\nimport type { RawTexture } from \"../Materials/Textures/rawTexture\";\r\n\r\n/**\r\n * This represents the base class for particle system in Babylon.\r\n * Particles are often small sprites used to simulate hard-to-reproduce phenomena like fire, smoke, water, or abstract visual effects like magic glitter and faery dust.\r\n * Particles can take different shapes while emitted like box, sphere, cone or you can write your custom function.\r\n * @example https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/particle_system_intro\r\n */\r\nexport class BaseParticleSystem implements IClipPlanesHolder {\r\n /**\r\n * Source color is added to the destination color without alpha affecting the result\r\n */\r\n public static BLENDMODE_ONEONE = 0;\r\n /**\r\n * Blend current color and particle color using particle’s alpha\r\n */\r\n public static BLENDMODE_STANDARD = 1;\r\n /**\r\n * Add current color and particle color multiplied by particle’s alpha\r\n */\r\n public static BLENDMODE_ADD = 2;\r\n /**\r\n * Multiply current color with particle color\r\n */\r\n public static BLENDMODE_MULTIPLY = 3;\r\n\r\n /**\r\n * Multiply current color with particle color then add current color and particle color multiplied by particle’s alpha\r\n */\r\n public static BLENDMODE_MULTIPLYADD = 4;\r\n\r\n /**\r\n * List of animations used by the particle system.\r\n */\r\n public animations: Animation[] = [];\r\n\r\n /**\r\n * Gets or sets the unique id of the particle system\r\n */\r\n public uniqueId: number;\r\n\r\n /**\r\n * The id of the Particle system.\r\n */\r\n public id: string;\r\n\r\n /**\r\n * The friendly name of the Particle system.\r\n */\r\n public name: string;\r\n\r\n /**\r\n * Snippet ID if the particle system was created from the snippet server\r\n */\r\n public snippetId: string;\r\n\r\n /**\r\n * The rendering group used by the Particle system to chose when to render.\r\n */\r\n public renderingGroupId = 0;\r\n\r\n /**\r\n * The emitter represents the Mesh or position we are attaching the particle system to.\r\n */\r\n public emitter: Nullable<AbstractMesh | Vector3> = Vector3.Zero();\r\n\r\n /**\r\n * The maximum number of particles to emit per frame\r\n */\r\n public emitRate = 10;\r\n\r\n /**\r\n * If you want to launch only a few particles at once, that can be done, as well.\r\n */\r\n public manualEmitCount = -1;\r\n\r\n /**\r\n * The overall motion speed (0.01 is default update speed, faster updates = faster animation)\r\n */\r\n public updateSpeed = 0.01;\r\n\r\n /**\r\n * The amount of time the particle system is running (depends of the overall update speed).\r\n */\r\n public targetStopDuration = 0;\r\n\r\n /**\r\n * Specifies whether the particle system will be disposed once it reaches the end of the animation.\r\n */\r\n public disposeOnStop = false;\r\n\r\n /**\r\n * Minimum power of emitting particles.\r\n */\r\n public minEmitPower = 1;\r\n /**\r\n * Maximum power of emitting particles.\r\n */\r\n public maxEmitPower = 1;\r\n\r\n /**\r\n * Minimum life time of emitting particles.\r\n */\r\n public minLifeTime = 1;\r\n /**\r\n * Maximum life time of emitting particles.\r\n */\r\n public maxLifeTime = 1;\r\n\r\n /**\r\n * Minimum Size of emitting particles.\r\n */\r\n public minSize = 1;\r\n /**\r\n * Maximum Size of emitting particles.\r\n */\r\n public maxSize = 1;\r\n\r\n /**\r\n * Minimum scale of emitting particles on X axis.\r\n */\r\n public minScaleX = 1;\r\n /**\r\n * Maximum scale of emitting particles on X axis.\r\n */\r\n public maxScaleX = 1;\r\n\r\n /**\r\n * Minimum scale of emitting particles on Y axis.\r\n */\r\n public minScaleY = 1;\r\n /**\r\n * Maximum scale of emitting particles on Y axis.\r\n */\r\n public maxScaleY = 1;\r\n\r\n /**\r\n * Gets or sets the minimal initial rotation in radians.\r\n */\r\n public minInitialRotation = 0;\r\n /**\r\n * Gets or sets the maximal initial rotation in radians.\r\n */\r\n public maxInitialRotation = 0;\r\n\r\n /**\r\n * Minimum angular speed of emitting particles (Z-axis rotation for each particle).\r\n */\r\n public minAngularSpeed = 0;\r\n /**\r\n * Maximum angular speed of emitting particles (Z-axis rotation for each particle).\r\n */\r\n public maxAngularSpeed = 0;\r\n\r\n /**\r\n * The texture used to render each particle. (this can be a spritesheet)\r\n */\r\n public particleTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * The layer mask we are rendering the particles through.\r\n */\r\n public layerMask: number = 0x0fffffff;\r\n\r\n /**\r\n * This can help using your own shader to render the particle system.\r\n * The according effect will be created\r\n */\r\n public customShader: any = null;\r\n\r\n /**\r\n * By default particle system starts as soon as they are created. This prevents the\r\n * automatic start to happen and let you decide when to start emitting particles.\r\n */\r\n public preventAutoStart: boolean = false;\r\n\r\n /** @internal */\r\n _wasDispatched = false;\r\n\r\n protected _rootUrl = \"\";\r\n private _noiseTexture: Nullable<ProceduralTexture>;\r\n\r\n /**\r\n * Gets or sets a texture used to add random noise to particle positions\r\n */\r\n public get noiseTexture(): Nullable<ProceduralTexture> {\r\n return this._noiseTexture;\r\n }\r\n\r\n public set noiseTexture(value: Nullable<ProceduralTexture>) {\r\n if (this._noiseTexture === value) {\r\n return;\r\n }\r\n\r\n this._noiseTexture = value;\r\n this._reset();\r\n }\r\n\r\n /** Gets or sets the strength to apply to the noise value (default is (10, 10, 10)) */\r\n public noiseStrength = new Vector3(10, 10, 10);\r\n\r\n /**\r\n * Callback triggered when the particle animation is ending.\r\n */\r\n public onAnimationEnd: Nullable<() => void> = null;\r\n\r\n /**\r\n * Blend mode use to render the particle, it can be either ParticleSystem.BLENDMODE_ONEONE or ParticleSystem.BLENDMODE_STANDARD.\r\n */\r\n public blendMode = BaseParticleSystem.BLENDMODE_ONEONE;\r\n\r\n /**\r\n * Forces the particle to write their depth information to the depth buffer. This can help preventing other draw calls\r\n * to override the particles.\r\n */\r\n public forceDepthWrite = false;\r\n\r\n /** Gets or sets a value indicating how many cycles (or frames) must be executed before first rendering (this value has to be set before starting the system). Default is 0 */\r\n public preWarmCycles = 0;\r\n\r\n /** Gets or sets a value indicating the time step multiplier to use in pre-warm mode (default is 1) */\r\n public preWarmStepOffset = 1;\r\n\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled) defines the speed of the sprite loop (default is 1 meaning the animation will play once during the entire particle lifetime)\r\n */\r\n public spriteCellChangeSpeed = 1;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled) defines the first sprite cell to display\r\n */\r\n public startSpriteCellID = 0;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled) defines the last sprite cell to display\r\n */\r\n public endSpriteCellID = 0;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled), defines the sprite cell width to use\r\n */\r\n public spriteCellWidth = 0;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled), defines the sprite cell height to use\r\n */\r\n public spriteCellHeight = 0;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled), defines wether the sprite animation is looping\r\n */\r\n public spriteCellLoop = true;\r\n /**\r\n * This allows the system to random pick the start cell ID between startSpriteCellID and endSpriteCellID\r\n */\r\n public spriteRandomStartCell = false;\r\n\r\n /** Gets or sets a Vector2 used to move the pivot (by default (0,0)) */\r\n public translationPivot = new Vector2(0, 0);\r\n\r\n /** @internal */\r\n public _isAnimationSheetEnabled: boolean;\r\n\r\n /**\r\n * Gets or sets a boolean indicating that hosted animations (in the system.animations array) must be started when system.start() is called\r\n */\r\n public beginAnimationOnStart = false;\r\n\r\n /**\r\n * Gets or sets the frame to start the animation from when beginAnimationOnStart is true\r\n */\r\n public beginAnimationFrom = 0;\r\n\r\n /**\r\n * Gets or sets the frame to end the animation on when beginAnimationOnStart is true\r\n */\r\n public beginAnimationTo = 60;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if animations must loop when beginAnimationOnStart is true\r\n */\r\n public beginAnimationLoop = false;\r\n\r\n /**\r\n * Gets or sets a world offset applied to all particles\r\n */\r\n public worldOffset = new Vector3(0, 0, 0);\r\n\r\n /**\r\n * Gets or sets the active clipplane 1\r\n */\r\n public clipPlane: Nullable<Plane>;\r\n\r\n /**\r\n * Gets or sets the active clipplane 2\r\n */\r\n public clipPlane2: Nullable<Plane>;\r\n\r\n /**\r\n * Gets or sets the active clipplane 3\r\n */\r\n public clipPlane3: Nullable<Plane>;\r\n\r\n /**\r\n * Gets or sets the active clipplane 4\r\n */\r\n public clipPlane4: Nullable<Plane>;\r\n\r\n /**\r\n * Gets or sets the active clipplane 5\r\n */\r\n public clipPlane5: Nullable<Plane>;\r\n\r\n /**\r\n * Gets or sets the active clipplane 6\r\n */\r\n public clipPlane6: Nullable<Plane>;\r\n\r\n /**\r\n * Gets or sets whether an animation sprite sheet is enabled or not on the particle system\r\n */\r\n public get isAnimationSheetEnabled(): boolean {\r\n return this._isAnimationSheetEnabled;\r\n }\r\n\r\n public set isAnimationSheetEnabled(value: boolean) {\r\n if (this._isAnimationSheetEnabled == value) {\r\n return;\r\n }\r\n\r\n this._isAnimationSheetEnabled = value;\r\n\r\n this._reset();\r\n }\r\n\r\n private _useLogarithmicDepth: boolean = false;\r\n\r\n /**\r\n * Gets or sets a boolean enabling the use of logarithmic depth buffers, which is good for wide depth buffers.\r\n */\r\n public get useLogarithmicDepth(): boolean {\r\n return this._useLogarithmicDepth;\r\n }\r\n\r\n public set useLogarithmicDepth(value: boolean) {\r\n this._useLogarithmicDepth = value && this.getScene()!.getEngine().getCaps().fragmentDepthSupported;\r\n }\r\n\r\n /**\r\n * Get hosting scene\r\n * @returns the scene\r\n */\r\n public getScene(): Nullable<Scene> {\r\n return this._scene;\r\n }\r\n\r\n /**\r\n * You can use gravity if you want to give an orientation to your particles.\r\n */\r\n public gravity = Vector3.Zero();\r\n\r\n protected _colorGradients: Nullable<Array<ColorGradient>> = null;\r\n protected _sizeGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _lifeTimeGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _angularSpeedGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _velocityGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _limitVelocityGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _dragGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _emitRateGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _startSizeGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _rampGradients: Nullable<Array<Color3Gradient>> = null;\r\n protected _colorRemapGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _alphaRemapGradients: Nullable<Array<FactorGradient>> = null;\r\n\r\n protected _hasTargetStopDurationDependantGradient() {\r\n return (\r\n (this._startSizeGradients && this._startSizeGradients.length > 0) ||\r\n (this._emitRateGradients && this._emitRateGradients.length > 0) ||\r\n (this._lifeTimeGradients && this._lifeTimeGradients.length > 0)\r\n );\r\n }\r\n\r\n /**\r\n * Defines the delay in milliseconds before starting the system (0 by default)\r\n */\r\n public startDelay = 0;\r\n\r\n /**\r\n * Gets the current list of drag gradients.\r\n * You must use addDragGradient and removeDragGradient to update this list\r\n * @returns the list of drag gradients\r\n */\r\n public getDragGradients(): Nullable<Array<FactorGradient>> {\r\n return this._dragGradients;\r\n }\r\n\r\n /** Gets or sets a value indicating the damping to apply if the limit velocity factor is reached */\r\n public limitVelocityDamping = 0.4;\r\n\r\n /**\r\n * Gets the current list of limit velocity gradients.\r\n * You must use addLimitVelocityGradient and removeLimitVelocityGradient to update this list\r\n * @returns the list of limit velocity gradients\r\n */\r\n public getLimitVelocityGradients(): Nullable<Array<FactorGradient>> {\r\n return this._limitVelocityGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of color gradients.\r\n * You must use addColorGradient and removeColorGradient to update this list\r\n * @returns the list of color gradients\r\n */\r\n public getColorGradients(): Nullable<Array<ColorGradient>> {\r\n return this._colorGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of size gradients.\r\n * You must use addSizeGradient and removeSizeGradient to update this list\r\n * @returns the list of size gradients\r\n */\r\n public getSizeGradients(): Nullable<Array<FactorGradient>> {\r\n return this._sizeGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of color remap gradients.\r\n * You must use addColorRemapGradient and removeColorRemapGradient to update this list\r\n * @returns the list of color remap gradients\r\n */\r\n public getColorRemapGradients(): Nullable<Array<FactorGradient>> {\r\n return this._colorRemapGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of alpha remap gradients.\r\n * You must use addAlphaRemapGradient and removeAlphaRemapGradient to update this list\r\n * @returns the list of alpha remap gradients\r\n */\r\n public getAlphaRemapGradients(): Nullable<Array<FactorGradient>> {\r\n return this._alphaRemapGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of life time gradients.\r\n * You must use addLifeTimeGradient and removeLifeTimeGradient to update this list\r\n * @returns the list of life time gradients\r\n */\r\n public getLifeTimeGradients(): Nullable<Array<FactorGradient>> {\r\n return this._lifeTimeGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of angular speed gradients.\r\n * You must use addAngularSpeedGradient and removeAngularSpeedGradient to update this list\r\n * @returns the list of angular speed gradients\r\n */\r\n public getAngularSpeedGradients(): Nullable<Array<FactorGradient>> {\r\n return this._angularSpeedGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of velocity gradients.\r\n * You must use addVelocityGradient and removeVelocityGradient to update this list\r\n * @returns the list of velocity gradients\r\n */\r\n public getVelocityGradients(): Nullable<Array<FactorGradient>> {\r\n return this._velocityGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of start size gradients.\r\n * You must use addStartSizeGradient and removeStartSizeGradient to update this list\r\n * @returns the list of start size gradients\r\n */\r\n public getStartSizeGradients(): Nullable<Array<FactorGradient>> {\r\n return this._startSizeGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of emit rate gradients.\r\n * You must use addEmitRateGradient and removeEmitRateGradient to update this list\r\n * @returns the list of emit rate gradients\r\n */\r\n public getEmitRateGradients(): Nullable<Array<FactorGradient>> {\r\n return this._emitRateGradients;\r\n }\r\n\r\n /**\r\n * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.\r\n * This only works when particleEmitterTyps is a BoxParticleEmitter\r\n */\r\n public get direction1(): Vector3 {\r\n if ((<BoxParticleEmitter>this.particleEmitterType).direction1) {\r\n return (<BoxParticleEmitter>this.particleEmitterType).direction1;\r\n }\r\n\r\n return Vector3.Zero();\r\n }\r\n\r\n public set direction1(value: Vector3) {\r\n if ((<BoxParticleEmitter>this.particleEmitterType).direction1) {\r\n (<BoxParticleEmitter>this.particleEmitterType).direction1 = value;\r\n }\r\n }\r\n\r\n /**\r\n * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.\r\n * This only works when particleEmitterTyps is a BoxParticleEmitter\r\n */\r\n public get direction2(): Vector3 {\r\n if ((<BoxParticleEmitter>this.particleEmitterType).direction2) {\r\n return (<BoxParticleEmitter>this.particleEmitterType).direction2;\r\n }\r\n\r\n return Vector3.Zero();\r\n }\r\n\r\n public set direction2(value: Vector3) {\r\n if ((<BoxParticleEmitter>this.particleEmitterType).direction2) {\r\n (<BoxParticleEmitter>this.particleEmitterType).direction2 = value;\r\n }\r\n }\r\n\r\n /**\r\n * Minimum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so.\r\n * This only works when particleEmitterTyps is a BoxParticleEmitter\r\n */\r\n public get minEmitBox(): Vector3 {\r\n if ((<BoxParticleEmitter>this.particleEmitterType).minEmitBox) {\r\n return (<BoxParticleEmitter>this.particleEmitterType).minEmitBox;\r\n }\r\n\r\n return Vector3.Zero();\r\n }\r\n\r\n public set minEmitBox(value: Vector3) {\r\n if ((<BoxParticleEmitter>this.particleEmitterType).minEmitBox) {\r\n (<BoxParticleEmitter>this.particleEmitterType).minEmitBox = value;\r\n }\r\n }\r\n\r\n /**\r\n * Maximum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so.\r\n * This only works when particleEmitterTyps is a BoxParticleEmitter\r\n */\r\n public get maxEmitBox(): Vector3 {\r\n if ((<BoxParticleEmitter>this.particleEmitterType).maxEmitBox) {\r\n return (<BoxParticleEmitter>this.particleEmitterType).maxEmitBox;\r\n }\r\n\r\n return Vector3.Zero();\r\n }\r\n\r\n public set maxEmitBox(value: Vector3) {\r\n if ((<BoxParticleEmitter>this.particleEmitterType).maxEmitBox) {\r\n (<BoxParticleEmitter>this.particleEmitterType).maxEmitBox = value;\r\n }\r\n }\r\n\r\n /**\r\n * Random color of each particle after it has been emitted, between color1 and color2 vectors\r\n */\r\n public color1 = new Color4(1.0, 1.0, 1.0, 1.0);\r\n /**\r\n * Random color of each particle after it has been emitted, between color1 and color2 vectors\r\n */\r\n public color2 = new Color4(1.0, 1.0, 1.0, 1.0);\r\n /**\r\n * Color the particle will have at the end of its lifetime\r\n */\r\n public colorDead = new Color4(0, 0, 0, 1.0);\r\n\r\n /**\r\n * An optional mask to filter some colors out of the texture, or filter a part of the alpha channel\r\n */\r\n public textureMask = new Color4(1.0, 1.0, 1.0, 1.0);\r\n\r\n /**\r\n * The particle emitter type defines the emitter used by the particle system.\r\n * It can be for example box, sphere, or cone...\r\n */\r\n public particleEmitterType: IParticleEmitterType;\r\n\r\n /** @internal */\r\n public _isSubEmitter = false;\r\n\r\n /** @internal */\r\n public _billboardMode = Constants.PARTICLES_BILLBOARDMODE_ALL;\r\n /**\r\n * Gets or sets the billboard mode to use when isBillboardBased = true.\r\n * Value can be: ParticleSystem.BILLBOARDMODE_ALL, ParticleSystem.BILLBOARDMODE_Y, ParticleSystem.BILLBOARDMODE_STRETCHED\r\n */\r\n public get billboardMode(): number {\r\n return this._billboardMode;\r\n }\r\n\r\n public set billboardMode(value: number) {\r\n if (this._billboardMode === value) {\r\n return;\r\n }\r\n\r\n this._billboardMode = value;\r\n this._reset();\r\n }\r\n\r\n /** @internal */\r\n public _isBillboardBased = true;\r\n /**\r\n * Gets or sets a boolean indicating if the particles must be rendered as billboard or aligned with the direction\r\n */\r\n public get isBillboardBased(): boolean {\r\n return this._isBillboardBased;\r\n }\r\n\r\n public set isBillboardBased(value: boolean) {\r\n if (this._isBillboardBased === value) {\r\n return;\r\n }\r\n\r\n this._isBillboardBased = value;\r\n this._reset();\r\n }\r\n\r\n /**\r\n * The scene the particle system belongs to.\r\n */\r\n protected _scene: Nullable<Scene>;\r\n\r\n /**\r\n * The engine the particle system belongs to.\r\n */\r\n protected _engine: ThinEngine;\r\n\r\n /**\r\n * Local cache of defines for image processing.\r\n */\r\n protected _imageProcessingConfigurationDefines = new ImageProcessingConfigurationDefines();\r\n\r\n /**\r\n * Default configuration related to image processing available in the standard Material.\r\n */\r\n protected _imageProcessingConfiguration: Nullable<ImageProcessingConfiguration>;\r\n\r\n /**\r\n * Gets the image processing configuration used either in this material.\r\n */\r\n public get imageProcessingConfiguration(): Nullable<ImageProcessingConfiguration> {\r\n return this._imageProcessingConfiguration;\r\n }\r\n\r\n /**\r\n * Sets the Default image processing configuration used either in the this material.\r\n *\r\n * If sets to null, the scene one is in use.\r\n */\r\n public set imageProcessingConfiguration(value: Nullable<ImageProcessingConfiguration>) {\r\n this._attachImageProcessingConfiguration(value);\r\n }\r\n\r\n /**\r\n * Attaches a new image processing configuration to the Standard Material.\r\n * @param configuration\r\n */\r\n protected _attachImageProcessingConfiguration(configuration: Nullable<ImageProcessingConfiguration>): void {\r\n if (configuration === this._imageProcessingConfiguration) {\r\n return;\r\n }\r\n\r\n // Pick the scene configuration if needed.\r\n if (!configuration && this._scene) {\r\n this._imageProcessingConfiguration = this._scene.imageProcessingConfiguration;\r\n } else {\r\n this._imageProcessingConfiguration = configuration;\r\n }\r\n }\r\n\r\n /** @internal */\r\n protected _reset() {}\r\n\r\n /**\r\n * @internal\r\n */\r\n protected _removeGradientAndTexture(gradient: number, gradients: Nullable<IValueGradient[]>, texture: Nullable<RawTexture>): BaseParticleSystem {\r\n if (!gradients) {\r\n return this;\r\n }\r\n\r\n let index = 0;\r\n for (const valueGradient of gradients) {\r\n if (valueGradient.gradient === gradient) {\r\n gradients.splice(index, 1);\r\n break;\r\n }\r\n index++;\r\n }\r\n\r\n if (texture) {\r\n texture.dispose();\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Instantiates a particle system.\r\n * Particles are often small sprites used to simulate hard-to-reproduce phenomena like fire, smoke, water, or abstract visual effects like magic glitter and faery dust.\r\n * @param name The name of the particle system\r\n */\r\n public constructor(name: string) {\r\n this.id = name;\r\n this.name = name;\r\n }\r\n\r\n /**\r\n * Creates a Point Emitter for the particle system (emits directly from the emitter position)\r\n * @param direction1 Particles are emitted between the direction1 and direction2 from within the box\r\n * @param direction2 Particles are emitted between the direction1 and direction2 from within the box\r\n * @returns the emitter\r\n */\r\n public createPointEmitter(direction1: Vector3, direction2: Vector3): PointParticleEmitter {\r\n const particleEmitter = new PointParticleEmitter();\r\n particleEmitter.direction1 = direction1;\r\n particleEmitter.direction2 = direction2;\r\n\r\n this.particleEmitterType = particleEmitter;\r\n return particleEmitter;\r\n }\r\n\r\n /**\r\n * Creates a Hemisphere Emitter for the particle system (emits along the hemisphere radius)\r\n * @param radius The radius of the hemisphere to emit from\r\n * @param radiusRange The range of the hemisphere to emit from [0-1] 0 Surface Only, 1 Entire Radius\r\n * @returns the emitter\r\n */\r\n public createHemisphericEmitter(radius = 1, radiusRange = 1): HemisphericParticleEmitter {\r\n const particleEmitter = new HemisphericParticleEmitter(radius, radiusRange);\r\n this.particleEmitterType = particleEmitter;\r\n return particleEmitter;\r\n }\r\n\r\n /**\r\n * Creates a Sphere Emitter for the particle system (emits along the sphere radius)\r\n * @param radius The radius of the sphere to emit from\r\n * @param radiusRange The range of the sphere to emit from [0-1] 0 Surface Only, 1 Entire Radius\r\n * @returns the emitter\r\n */\r\n public createSphereEmitter(radius = 1, radiusRange = 1): SphereParticleEmitter {\r\n const particleEmitter = new SphereParticleEmitter(radius, radiusRange);\r\n this.particleEmitterType = particleEmitter;\r\n return particleEmitter;\r\n }\r\n\r\n /**\r\n * Creates a Directed Sphere Emitter for the particle system (emits between direction1 and direction2)\r\n * @param radius The radius of the sphere to emit from\r\n * @param direction1 Particles are emitted between the direction1 and direction2 from within the sphere\r\n * @param direction2 Particles are emitted between the direction1 and direction2 from within the sphere\r\n * @returns the emitter\r\n */\r\n public createDirectedSphereEmitter(radius = 1, direction1 = new Vector3(0, 1.0, 0), direction2 = new Vector3(0, 1.0, 0)): SphereDirectedParticleEmitter {\r\n const particleEmitter = new SphereDirectedParticleEmitter(radius, direction1, direction2);\r\n this.particleEmitterType = particleEmitter;\r\n return particleEmitter;\r\n }\r\n\r\n /**\r\n * Creates a Cylinder Emitter for the particle system (emits from the cylinder to the particle position)\r\n * @param radius The radius of the emission cylinder\r\n * @param height The height of the emission cylinder\r\n * @param radiusRange The range of emission [0-1] 0 Surface only, 1 Entire Radius\r\n * @param directionRandomizer How much to randomize the particle direction [0-1]\r\n * @returns the emitter\r\n */\r\n public createCylinderEmitter(radius = 1, height = 1, radiusRange = 1, directionRandomizer = 0): CylinderParticleEmitter {\r\n const particleEmitter = new CylinderParticleEmitter(radius, height, radiusRange, directionRandomizer);\r\n this.particleEmitterType = particleEmitter;\r\n return particleEmitter;\r\n }\r\n\r\n /**\r\n * Creates a Directed Cylinder Emitter for the particle system (emits between direction1 and direction2)\r\n * @param radius The radius of the cylinder to emit from\r\n * @param height The height of the emission cylinder\r\n * @param radiusRange the range of the emission cylinder [0-1] 0 Surface only, 1 Entire Radius (1 by default)\r\n * @param direction1 Particles are emitted between the direction1 and direction2 from within the cylinder\r\n * @param direction2 Particles are emitted between the direction1 and direction2 from within the cylinder\r\n * @returns the emitter\r\n */\r\n public createDirectedCylinderEmitter(\r\n radius = 1,\r\n height = 1,\r\n radiusRange = 1,\r\n direction1 = new Vector3(0, 1.0, 0),\r\n direction2 = new Vector3(0, 1.0, 0)\r\n ): CylinderDirectedParticleEmitter {\r\n const particleEmitter = new CylinderDirectedParticleEmitter(radius, height, radiusRange, direction1, direction2);\r\n this.particleEmitterType = particleEmitter;\r\n return particleEmitter;\r\n }\r\n\r\n /**\r\n * Creates a Cone Emitter for the particle system (emits from the cone to the particle position)\r\n * @param radius The radius of the cone to emit from\r\n * @param angle The base angle of the cone\r\n * @returns the emitter\r\n */\r\n public createConeEmitter(radius = 1, angle = Math.PI / 4): ConeParticleEmitter {\r\n const particleEmitter = new ConeParticleEmitter(radius, angle);\r\n this.particleEmitterType = particleEmitter;\r\n return particleEmitter;\r\n }\r\n\r\n /**\r\n * Creates a Box Emitter for the particle system. (emits between direction1 and direction2 from withing the box defined by minEmitBox and maxEmitBox)\r\n * @param direction1 Particles are emitted between the direction1 and direction2 from within the box\r\n * @param direction2 Particles are emitted between the direction1 and direction2 from within the box\r\n * @param minEmitBox Particles are emitted from the box between minEmitBox and maxEmitBox\r\n * @param maxEmitBox Particles are emitted from the box between minEmitBox and maxEmitBox\r\n * @returns the emitter\r\n */\r\n public createBoxEmitter(direction1: Vector3, direction2: Vector3, minEmitBox: Vector3, maxEmitBox: Vector3): BoxParticleEmitter {\r\n const particleEmitter = new BoxParticleEmitter();\r\n this.particleEmitterType = particleEmitter;\r\n this.direction1 = direction1;\r\n this.direction2 = direction2;\r\n this.minEmitBox = minEmitBox;\r\n this.maxEmitBox = maxEmitBox;\r\n return particleEmitter;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"baseParticleSystem.js","sourceRoot":"","sources":["../../../../dev/core/src/Particles/baseParticleSystem.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAGxD,OAAO,EAAE,mCAAmC,EAAE,MAAM,2CAA2C,CAAC;AAGhG,OAAO,EACH,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,EAC1B,qBAAqB,EACrB,6BAA6B,EAC7B,uBAAuB,EACvB,+BAA+B,EAC/B,mBAAmB,GACtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG7C,OAAO,4CAA4C,CAAC;AAQpD;;;;;GAKG;AACH,MAAM,OAAO,kBAAkB;IAmL3B;;O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CAAC;QAC7B,OAAO,eAAe,CAAC;IAC3B,CAAC;;AArzBD;;GAEG;AACW,mCAAgB,GAAG,CAAC,AAAJ,CAAK;AACnC;;GAEG;AACW,qCAAkB,GAAG,CAAC,AAAJ,CAAK;AACrC;;GAEG;AACW,gCAAa,GAAG,CAAC,AAAJ,CAAK;AAChC;;GAEG;AACW,qCAAkB,GAAG,CAAC,AAAJ,CAAK;AAErC;;GAEG;AACW,wCAAqB,GAAG,CAAC,AAAJ,CAAK","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nimport type { Nullable } from \"../types\";\r\nimport { Vector2, Vector3 } from \"../Maths/math.vector\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport type { ImageProcessingConfiguration } from \"../Materials/imageProcessingConfiguration\";\r\nimport { ImageProcessingConfigurationDefines } from \"../Materials/imageProcessingConfiguration\";\r\nimport type { ColorGradient, FactorGradient, Color3Gradient, IValueGradient } from \"../Misc/gradients\";\r\nimport type { IParticleEmitterType } from \"../Particles/EmitterTypes/index\";\r\nimport {\r\n BoxParticleEmitter,\r\n PointParticleEmitter,\r\n HemisphericParticleEmitter,\r\n SphereParticleEmitter,\r\n SphereDirectedParticleEmitter,\r\n CylinderParticleEmitter,\r\n CylinderDirectedParticleEmitter,\r\n ConeParticleEmitter,\r\n} from \"../Particles/EmitterTypes/index\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport type { BaseTexture } from \"../Materials/Textures/baseTexture\";\r\nimport { Color4 } from \"../Maths/math.color\";\r\nimport type { ThinEngine } from \"../Engines/thinEngine\";\r\n\r\nimport \"../Engines/Extensions/engine.dynamicBuffer\";\r\nimport type { IClipPlanesHolder } from \"../Misc/interfaces/iClipPlanesHolder\";\r\nimport type { Plane } from \"../Maths/math.plane\";\r\nimport type { Animation } from \"../Animations/animation\";\r\nimport type { Scene } from \"../scene\";\r\nimport type { ProceduralTexture } from \"../Materials/Textures/Procedurals/proceduralTexture\";\r\nimport type { RawTexture } from \"../Materials/Textures/rawTexture\";\r\n\r\n/**\r\n * This represents the base class for particle system in Babylon.\r\n * Particles are often small sprites used to simulate hard-to-reproduce phenomena like fire, smoke, water, or abstract visual effects like magic glitter and faery dust.\r\n * Particles can take different shapes while emitted like box, sphere, cone or you can write your custom function.\r\n * @example https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/particle_system_intro\r\n */\r\nexport class BaseParticleSystem implements IClipPlanesHolder {\r\n /**\r\n * Source color is added to the destination color without alpha affecting the result\r\n */\r\n public static BLENDMODE_ONEONE = 0;\r\n /**\r\n * Blend current color and particle color using particle’s alpha\r\n */\r\n public static BLENDMODE_STANDARD = 1;\r\n /**\r\n * Add current color and particle color multiplied by particle’s alpha\r\n */\r\n public static BLENDMODE_ADD = 2;\r\n /**\r\n * Multiply current color with particle color\r\n */\r\n public static BLENDMODE_MULTIPLY = 3;\r\n\r\n /**\r\n * Multiply current color with particle color then add current color and particle color multiplied by particle’s alpha\r\n */\r\n public static BLENDMODE_MULTIPLYADD = 4;\r\n\r\n /**\r\n * List of animations used by the particle system.\r\n */\r\n public animations: Animation[] = [];\r\n\r\n /**\r\n * Gets or sets the unique id of the particle system\r\n */\r\n public uniqueId: number;\r\n\r\n /**\r\n * The id of the Particle system.\r\n */\r\n public id: string;\r\n\r\n /**\r\n * The friendly name of the Particle system.\r\n */\r\n public name: string;\r\n\r\n /**\r\n * Snippet ID if the particle system was created from the snippet server\r\n */\r\n public snippetId: string;\r\n\r\n /**\r\n * The rendering group used by the Particle system to chose when to render.\r\n */\r\n public renderingGroupId = 0;\r\n\r\n /**\r\n * The emitter represents the Mesh or position we are attaching the particle system to.\r\n */\r\n public emitter: Nullable<AbstractMesh | Vector3> = Vector3.Zero();\r\n\r\n /**\r\n * The maximum number of particles to emit per frame\r\n */\r\n public emitRate = 10;\r\n\r\n /**\r\n * If you want to launch only a few particles at once, that can be done, as well.\r\n */\r\n public manualEmitCount = -1;\r\n\r\n /**\r\n * The overall motion speed (0.01 is default update speed, faster updates = faster animation)\r\n */\r\n public updateSpeed = 0.01;\r\n\r\n /**\r\n * The amount of time the particle system is running (depends of the overall update speed).\r\n */\r\n public targetStopDuration = 0;\r\n\r\n /**\r\n * Specifies whether the particle system will be disposed once it reaches the end of the animation.\r\n */\r\n public disposeOnStop = false;\r\n\r\n /**\r\n * Minimum power of emitting particles.\r\n */\r\n public minEmitPower = 1;\r\n /**\r\n * Maximum power of emitting particles.\r\n */\r\n public maxEmitPower = 1;\r\n\r\n /**\r\n * Minimum life time of emitting particles.\r\n */\r\n public minLifeTime = 1;\r\n /**\r\n * Maximum life time of emitting particles.\r\n */\r\n public maxLifeTime = 1;\r\n\r\n /**\r\n * Minimum Size of emitting particles.\r\n */\r\n public minSize = 1;\r\n /**\r\n * Maximum Size of emitting particles.\r\n */\r\n public maxSize = 1;\r\n\r\n /**\r\n * Minimum scale of emitting particles on X axis.\r\n */\r\n public minScaleX = 1;\r\n /**\r\n * Maximum scale of emitting particles on X axis.\r\n */\r\n public maxScaleX = 1;\r\n\r\n /**\r\n * Minimum scale of emitting particles on Y axis.\r\n */\r\n public minScaleY = 1;\r\n /**\r\n * Maximum scale of emitting particles on Y axis.\r\n */\r\n public maxScaleY = 1;\r\n\r\n /**\r\n * Gets or sets the minimal initial rotation in radians.\r\n */\r\n public minInitialRotation = 0;\r\n /**\r\n * Gets or sets the maximal initial rotation in radians.\r\n */\r\n public maxInitialRotation = 0;\r\n\r\n /**\r\n * Minimum angular speed of emitting particles (Z-axis rotation for each particle).\r\n */\r\n public minAngularSpeed = 0;\r\n /**\r\n * Maximum angular speed of emitting particles (Z-axis rotation for each particle).\r\n */\r\n public maxAngularSpeed = 0;\r\n\r\n /**\r\n * The texture used to render each particle. (this can be a spritesheet)\r\n */\r\n public particleTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * The layer mask we are rendering the particles through.\r\n */\r\n public layerMask: number = 0x0fffffff;\r\n\r\n /**\r\n * This can help using your own shader to render the particle system.\r\n * The according effect will be created\r\n */\r\n public customShader: any = null;\r\n\r\n /**\r\n * By default particle system starts as soon as they are created. This prevents the\r\n * automatic start to happen and let you decide when to start emitting particles.\r\n */\r\n public preventAutoStart: boolean = false;\r\n\r\n /**\r\n * Gets or sets a boolean indicating that this particle system will allow fog to be rendered on it (false by default)\r\n */\r\n public applyFog = false;\r\n\r\n /** @internal */\r\n _wasDispatched = false;\r\n\r\n protected _rootUrl = \"\";\r\n private _noiseTexture: Nullable<ProceduralTexture>;\r\n\r\n /**\r\n * Gets or sets a texture used to add random noise to particle positions\r\n */\r\n public get noiseTexture(): Nullable<ProceduralTexture> {\r\n return this._noiseTexture;\r\n }\r\n\r\n public set noiseTexture(value: Nullable<ProceduralTexture>) {\r\n if (this._noiseTexture === value) {\r\n return;\r\n }\r\n\r\n this._noiseTexture = value;\r\n this._reset();\r\n }\r\n\r\n /** Gets or sets the strength to apply to the noise value (default is (10, 10, 10)) */\r\n public noiseStrength = new Vector3(10, 10, 10);\r\n\r\n /**\r\n * Callback triggered when the particle animation is ending.\r\n */\r\n public onAnimationEnd: Nullable<() => void> = null;\r\n\r\n /**\r\n * Blend mode use to render the particle, it can be either ParticleSystem.BLENDMODE_ONEONE or ParticleSystem.BLENDMODE_STANDARD.\r\n */\r\n public blendMode = BaseParticleSystem.BLENDMODE_ONEONE;\r\n\r\n /**\r\n * Forces the particle to write their depth information to the depth buffer. This can help preventing other draw calls\r\n * to override the particles.\r\n */\r\n public forceDepthWrite = false;\r\n\r\n /** Gets or sets a value indicating how many cycles (or frames) must be executed before first rendering (this value has to be set before starting the system). Default is 0 */\r\n public preWarmCycles = 0;\r\n\r\n /** Gets or sets a value indicating the time step multiplier to use in pre-warm mode (default is 1) */\r\n public preWarmStepOffset = 1;\r\n\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled) defines the speed of the sprite loop (default is 1 meaning the animation will play once during the entire particle lifetime)\r\n */\r\n public spriteCellChangeSpeed = 1;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled) defines the first sprite cell to display\r\n */\r\n public startSpriteCellID = 0;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled) defines the last sprite cell to display\r\n */\r\n public endSpriteCellID = 0;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled), defines the sprite cell width to use\r\n */\r\n public spriteCellWidth = 0;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled), defines the sprite cell height to use\r\n */\r\n public spriteCellHeight = 0;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled), defines wether the sprite animation is looping\r\n */\r\n public spriteCellLoop = true;\r\n /**\r\n * This allows the system to random pick the start cell ID between startSpriteCellID and endSpriteCellID\r\n */\r\n public spriteRandomStartCell = false;\r\n\r\n /** Gets or sets a Vector2 used to move the pivot (by default (0,0)) */\r\n public translationPivot = new Vector2(0, 0);\r\n\r\n /** @internal */\r\n public _isAnimationSheetEnabled: boolean;\r\n\r\n /**\r\n * Gets or sets a boolean indicating that hosted animations (in the system.animations array) must be started when system.start() is called\r\n */\r\n public beginAnimationOnStart = false;\r\n\r\n /**\r\n * Gets or sets the frame to start the animation from when beginAnimationOnStart is true\r\n */\r\n public beginAnimationFrom = 0;\r\n\r\n /**\r\n * Gets or sets the frame to end the animation on when beginAnimationOnStart is true\r\n */\r\n public beginAnimationTo = 60;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if animations must loop when beginAnimationOnStart is true\r\n */\r\n public beginAnimationLoop = false;\r\n\r\n /**\r\n * Gets or sets a world offset applied to all particles\r\n */\r\n public worldOffset = new Vector3(0, 0, 0);\r\n\r\n /**\r\n * Gets or sets the active clipplane 1\r\n */\r\n public clipPlane: Nullable<Plane>;\r\n\r\n /**\r\n * Gets or sets the active clipplane 2\r\n */\r\n public clipPlane2: Nullable<Plane>;\r\n\r\n /**\r\n * Gets or sets the active clipplane 3\r\n */\r\n public clipPlane3: Nullable<Plane>;\r\n\r\n /**\r\n * Gets or sets the active clipplane 4\r\n */\r\n public clipPlane4: Nullable<Plane>;\r\n\r\n /**\r\n * Gets or sets the active clipplane 5\r\n */\r\n public clipPlane5: Nullable<Plane>;\r\n\r\n /**\r\n * Gets or sets the active clipplane 6\r\n */\r\n public clipPlane6: Nullable<Plane>;\r\n\r\n /**\r\n * Gets or sets whether an animation sprite sheet is enabled or not on the particle system\r\n */\r\n public get isAnimationSheetEnabled(): boolean {\r\n return this._isAnimationSheetEnabled;\r\n }\r\n\r\n public set isAnimationSheetEnabled(value: boolean) {\r\n if (this._isAnimationSheetEnabled == value) {\r\n return;\r\n }\r\n\r\n this._isAnimationSheetEnabled = value;\r\n\r\n this._reset();\r\n }\r\n\r\n private _useLogarithmicDepth: boolean = false;\r\n\r\n /**\r\n * Gets or sets a boolean enabling the use of logarithmic depth buffers, which is good for wide depth buffers.\r\n */\r\n public get useLogarithmicDepth(): boolean {\r\n return this._useLogarithmicDepth;\r\n }\r\n\r\n public set useLogarithmicDepth(value: boolean) {\r\n this._useLogarithmicDepth = value && this.getScene()!.getEngine().getCaps().fragmentDepthSupported;\r\n }\r\n\r\n /**\r\n * Get hosting scene\r\n * @returns the scene\r\n */\r\n public getScene(): Nullable<Scene> {\r\n return this._scene;\r\n }\r\n\r\n /**\r\n * You can use gravity if you want to give an orientation to your particles.\r\n */\r\n public gravity = Vector3.Zero();\r\n\r\n protected _colorGradients: Nullable<Array<ColorGradient>> = null;\r\n protected _sizeGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _lifeTimeGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _angularSpeedGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _velocityGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _limitVelocityGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _dragGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _emitRateGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _startSizeGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _rampGradients: Nullable<Array<Color3Gradient>> = null;\r\n protected _colorRemapGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _alphaRemapGradients: Nullable<Array<FactorGradient>> = null;\r\n\r\n protected _hasTargetStopDurationDependantGradient() {\r\n return (\r\n (this._startSizeGradients && this._startSizeGradients.length > 0) ||\r\n (this._emitRateGradients && this._emitRateGradients.length > 0) ||\r\n (this._lifeTimeGradients && this._lifeTimeGradients.length > 0)\r\n );\r\n }\r\n\r\n /**\r\n * Defines the delay in milliseconds before starting the system (0 by default)\r\n */\r\n public startDelay = 0;\r\n\r\n /**\r\n * Gets the current list of drag gradients.\r\n * You must use addDragGradient and removeDragGradient to update this list\r\n * @returns the list of drag gradients\r\n */\r\n public getDragGradients(): Nullable<Array<FactorGradient>> {\r\n return this._dragGradients;\r\n }\r\n\r\n /** Gets or sets a value indicating the damping to apply if the limit velocity factor is reached */\r\n public limitVelocityDamping = 0.4;\r\n\r\n /**\r\n * Gets the current list of limit velocity gradients.\r\n * You must use addLimitVelocityGradient and removeLimitVelocityGradient to update this list\r\n * @returns the list of limit velocity gradients\r\n */\r\n public getLimitVelocityGradients(): Nullable<Array<FactorGradient>> {\r\n return this._limitVelocityGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of color gradients.\r\n * You must use addColorGradient and removeColorGradient to update this list\r\n * @returns the list of color gradients\r\n */\r\n public getColorGradients(): Nullable<Array<ColorGradient>> {\r\n return this._colorGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of size gradients.\r\n * You must use addSizeGradient and removeSizeGradient to update this list\r\n * @returns the list of size gradients\r\n */\r\n public getSizeGradients(): Nullable<Array<FactorGradient>> {\r\n return this._sizeGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of color remap gradients.\r\n * You must use addColorRemapGradient and removeColorRemapGradient to update this list\r\n * @returns the list of color remap gradients\r\n */\r\n public getColorRemapGradients(): Nullable<Array<FactorGradient>> {\r\n return this._colorRemapGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of alpha remap gradients.\r\n * You must use addAlphaRemapGradient and removeAlphaRemapGradient to update this list\r\n * @returns the list of alpha remap gradients\r\n */\r\n public getAlphaRemapGradients(): Nullable<Array<FactorGradient>> {\r\n return this._alphaRemapGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of life time gradients.\r\n * You must use addLifeTimeGradient and removeLifeTimeGradient to update this list\r\n * @returns the list of life time gradients\r\n */\r\n public getLifeTimeGradients(): Nullable<Array<FactorGradient>> {\r\n return this._lifeTimeGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of angular speed gradients.\r\n * You must use addAngularSpeedGradient and removeAngularSpeedGradient to update this list\r\n * @returns the list of angular speed gradients\r\n */\r\n public getAngularSpeedGradients(): Nullable<Array<FactorGradient>> {\r\n return this._angularSpeedGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of velocity gradients.\r\n * You must use addVelocityGradient and removeVelocityGradient to update this list\r\n * @returns the list of velocity gradients\r\n */\r\n public getVelocityGradients(): Nullable<Array<FactorGradient>> {\r\n return this._velocityGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of start size gradients.\r\n * You must use addStartSizeGradient and removeStartSizeGradient to update this list\r\n * @returns the list of start size gradients\r\n */\r\n public getStartSizeGradients(): Nullable<Array<FactorGradient>> {\r\n return this._startSizeGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of emit rate gradients.\r\n * You must use addEmitRateGradient and removeEmitRateGradient to update this list\r\n * @returns the list of emit rate gradients\r\n */\r\n public getEmitRateGradients(): Nullable<Array<FactorGradient>> {\r\n return this._emitRateGradients;\r\n }\r\n\r\n /**\r\n * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.\r\n * This only works when particleEmitterTyps is a BoxParticleEmitter\r\n */\r\n public get direction1(): Vector3 {\r\n if ((<BoxParticleEmitter>this.particleEmitterType).direction1) {\r\n return (<BoxParticleEmitter>this.particleEmitterType).direction1;\r\n }\r\n\r\n return Vector3.Zero();\r\n }\r\n\r\n public set direction1(value: Vector3) {\r\n if ((<BoxParticleEmitter>this.particleEmitterType).direction1) {\r\n (<BoxParticleEmitter>this.particleEmitterType).direction1 = value;\r\n }\r\n }\r\n\r\n /**\r\n * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.\r\n * This only works when particleEmitterTyps is a BoxParticleEmitter\r\n */\r\n public get direction2(): Vector3 {\r\n if ((<BoxParticleEmitter>this.particleEmitterType).direction2) {\r\n return (<BoxParticleEmitter>this.particleEmitterType).direction2;\r\n }\r\n\r\n return Vector3.Zero();\r\n }\r\n\r\n public set direction2(value: Vector3) {\r\n if ((<BoxParticleEmitter>this.particleEmitterType).direction2) {\r\n (<BoxParticleEmitter>this.particleEmitterType).direction2 = value;\r\n }\r\n }\r\n\r\n /**\r\n * Minimum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so.\r\n * This only works when particleEmitterTyps is a BoxParticleEmitter\r\n */\r\n public get minEmitBox(): Vector3 {\r\n if ((<BoxParticleEmitter>this.particleEmitterType).minEmitBox) {\r\n return (<BoxParticleEmitter>this.particleEmitterType).minEmitBox;\r\n }\r\n\r\n return Vector3.Zero();\r\n }\r\n\r\n public set minEmitBox(value: Vector3) {\r\n if ((<BoxParticleEmitter>this.particleEmitterType).minEmitBox) {\r\n (<BoxParticleEmitter>this.particleEmitterType).minEmitBox = value;\r\n }\r\n }\r\n\r\n /**\r\n * Maximum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so.\r\n * This only works when particleEmitterTyps is a BoxParticleEmitter\r\n */\r\n public get maxEmitBox(): Vector3 {\r\n if ((<BoxParticleEmitter>this.particleEmitterType).maxEmitBox) {\r\n return (<BoxParticleEmitter>this.particleEmitterType).maxEmitBox;\r\n }\r\n\r\n return Vector3.Zero();\r\n }\r\n\r\n public set maxEmitBox(value: Vector3) {\r\n if ((<BoxParticleEmitter>this.particleEmitterType).maxEmitBox) {\r\n (<BoxParticleEmitter>this.particleEmitterType).maxEmitBox = value;\r\n }\r\n }\r\n\r\n /**\r\n * Random color of each particle after it has been emitted, between color1 and color2 vectors\r\n */\r\n public color1 = new Color4(1.0, 1.0, 1.0, 1.0);\r\n /**\r\n * Random color of each particle after it has been emitted, between color1 and color2 vectors\r\n */\r\n public color2 = new Color4(1.0, 1.0, 1.0, 1.0);\r\n /**\r\n * Color the particle will have at the end of its lifetime\r\n */\r\n public colorDead = new Color4(0, 0, 0, 1.0);\r\n\r\n /**\r\n * An optional mask to filter some colors out of the texture, or filter a part of the alpha channel\r\n */\r\n public textureMask = new Color4(1.0, 1.0, 1.0, 1.0);\r\n\r\n /**\r\n * The particle emitter type defines the emitter used by the particle system.\r\n * It can be for example box, sphere, or cone...\r\n */\r\n public particleEmitterType: IParticleEmitterType;\r\n\r\n /** @internal */\r\n public _isSubEmitter = false;\r\n\r\n /** @internal */\r\n public _billboardMode = Constants.PARTICLES_BILLBOARDMODE_ALL;\r\n /**\r\n * Gets or sets the billboard mode to use when isBillboardBased = true.\r\n * Value can be: ParticleSystem.BILLBOARDMODE_ALL, ParticleSystem.BILLBOARDMODE_Y, ParticleSystem.BILLBOARDMODE_STRETCHED\r\n */\r\n public get billboardMode(): number {\r\n return this._billboardMode;\r\n }\r\n\r\n public set billboardMode(value: number) {\r\n if (this._billboardMode === value) {\r\n return;\r\n }\r\n\r\n this._billboardMode = value;\r\n this._reset();\r\n }\r\n\r\n /** @internal */\r\n public _isBillboardBased = true;\r\n /**\r\n * Gets or sets a boolean indicating if the particles must be rendered as billboard or aligned with the direction\r\n */\r\n public get isBillboardBased(): boolean {\r\n return this._isBillboardBased;\r\n }\r\n\r\n public set isBillboardBased(value: boolean) {\r\n if (this._isBillboardBased === value) {\r\n return;\r\n }\r\n\r\n this._isBillboardBased = value;\r\n this._reset();\r\n }\r\n\r\n /**\r\n * The scene the particle system belongs to.\r\n */\r\n protected _scene: Nullable<Scene>;\r\n\r\n /**\r\n * The engine the particle system belongs to.\r\n */\r\n protected _engine: ThinEngine;\r\n\r\n /**\r\n * Local cache of defines for image processing.\r\n */\r\n protected _imageProcessingConfigurationDefines = new ImageProcessingConfigurationDefines();\r\n\r\n /**\r\n * Default configuration related to image processing available in the standard Material.\r\n */\r\n protected _imageProcessingConfiguration: Nullable<ImageProcessingConfiguration>;\r\n\r\n /**\r\n * Gets the image processing configuration used either in this material.\r\n */\r\n public get imageProcessingConfiguration(): Nullable<ImageProcessingConfiguration> {\r\n return this._imageProcessingConfiguration;\r\n }\r\n\r\n /**\r\n * Sets the Default image processing configuration used either in the this material.\r\n *\r\n * If sets to null, the scene one is in use.\r\n */\r\n public set imageProcessingConfiguration(value: Nullable<ImageProcessingConfiguration>) {\r\n this._attachImageProcessingConfiguration(value);\r\n }\r\n\r\n /**\r\n * Attaches a new image processing configuration to the Standard Material.\r\n * @param configuration\r\n */\r\n protected _attachImageProcessingConfiguration(configuration: Nullable<ImageProcessingConfiguration>): void {\r\n if (configuration === this._imageProcessingConfiguration) {\r\n return;\r\n }\r\n\r\n // Pick the scene configuration if needed.\r\n if (!configuration && this._scene) {\r\n this._imageProcessingConfiguration = this._scene.imageProcessingConfiguration;\r\n } else {\r\n this._imageProcessingConfiguration = configuration;\r\n }\r\n }\r\n\r\n /** @internal */\r\n protected _reset() {}\r\n\r\n /**\r\n * @internal\r\n */\r\n protected _removeGradientAndTexture(gradient: number, gradients: Nullable<IValueGradient[]>, texture: Nullable<RawTexture>): BaseParticleSystem {\r\n if (!gradients) {\r\n return this;\r\n }\r\n\r\n let index = 0;\r\n for (const valueGradient of gradients) {\r\n if (valueGradient.gradient === gradient) {\r\n gradients.splice(index, 1);\r\n break;\r\n }\r\n index++;\r\n }\r\n\r\n if (texture) {\r\n texture.dispose();\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Instantiates a particle system.\r\n * Particles are often small sprites used to simulate hard-to-reproduce phenomena like fire, smoke, water, or abstract visual effects like magic glitter and faery dust.\r\n * @param name The name of the particle system\r\n */\r\n public constructor(name: string) {\r\n this.id = name;\r\n this.name = name;\r\n }\r\n\r\n /**\r\n * Creates a Point Emitter for the particle system (emits directly from the emitter position)\r\n * @param direction1 Particles are emitted between the direction1 and direction2 from within the box\r\n * @param direction2 Particles are emitted between the direction1 and direction2 from within the box\r\n * @returns the emitter\r\n */\r\n public createPointEmitter(direction1: Vector3, direction2: Vector3): PointParticleEmitter {\r\n const particleEmitter = new PointParticleEmitter();\r\n particleEmitter.direction1 = direction1;\r\n particleEmitter.direction2 = direction2;\r\n\r\n this.particleEmitterType = particleEmitter;\r\n return particleEmitter;\r\n }\r\n\r\n /**\r\n * Creates a Hemisphere Emitter for the particle system (emits along the hemisphere radius)\r\n * @param radius The radius of the hemisphere to emit from\r\n * @param radiusRange The range of the hemisphere to emit from [0-1] 0 Surface Only, 1 Entire Radius\r\n * @returns the emitter\r\n */\r\n public createHemisphericEmitter(radius = 1, radiusRange = 1): HemisphericParticleEmitter {\r\n const particleEmitter = new HemisphericParticleEmitter(radius, radiusRange);\r\n this.particleEmitterType = particleEmitter;\r\n return particleEmitter;\r\n }\r\n\r\n /**\r\n * Creates a Sphere Emitter for the particle system (emits along the sphere radius)\r\n * @param radius The radius of the sphere to emit from\r\n * @param radiusRange The range of the sphere to emit from [0-1] 0 Surface Only, 1 Entire Radius\r\n * @returns the emitter\r\n */\r\n public createSphereEmitter(radius = 1, radiusRange = 1): SphereParticleEmitter {\r\n const particleEmitter = new SphereParticleEmitter(radius, radiusRange);\r\n this.particleEmitterType = particleEmitter;\r\n return particleEmitter;\r\n }\r\n\r\n /**\r\n * Creates a Directed Sphere Emitter for the particle system (emits between direction1 and direction2)\r\n * @param radius The radius of the sphere to emit from\r\n * @param direction1 Particles are emitted between the direction1 and direction2 from within the sphere\r\n * @param direction2 Particles are emitted between the direction1 and direction2 from within the sphere\r\n * @returns the emitter\r\n */\r\n public createDirectedSphereEmitter(radius = 1, direction1 = new Vector3(0, 1.0, 0), direction2 = new Vector3(0, 1.0, 0)): SphereDirectedParticleEmitter {\r\n const particleEmitter = new SphereDirectedParticleEmitter(radius, direction1, direction2);\r\n this.particleEmitterType = particleEmitter;\r\n return particleEmitter;\r\n }\r\n\r\n /**\r\n * Creates a Cylinder Emitter for the particle system (emits from the cylinder to the particle position)\r\n * @param radius The radius of the emission cylinder\r\n * @param height The height of the emission cylinder\r\n * @param radiusRange The range of emission [0-1] 0 Surface only, 1 Entire Radius\r\n * @param directionRandomizer How much to randomize the particle direction [0-1]\r\n * @returns the emitter\r\n */\r\n public createCylinderEmitter(radius = 1, height = 1, radiusRange = 1, directionRandomizer = 0): CylinderParticleEmitter {\r\n const particleEmitter = new CylinderParticleEmitter(radius, height, radiusRange, directionRandomizer);\r\n this.particleEmitterType = particleEmitter;\r\n return particleEmitter;\r\n }\r\n\r\n /**\r\n * Creates a Directed Cylinder Emitter for the particle system (emits between direction1 and direction2)\r\n * @param radius The radius of the cylinder to emit from\r\n * @param height The height of the emission cylinder\r\n * @param radiusRange the range of the emission cylinder [0-1] 0 Surface only, 1 Entire Radius (1 by default)\r\n * @param direction1 Particles are emitted between the direction1 and direction2 from within the cylinder\r\n * @param direction2 Particles are emitted between the direction1 and direction2 from within the cylinder\r\n * @returns the emitter\r\n */\r\n public createDirectedCylinderEmitter(\r\n radius = 1,\r\n height = 1,\r\n radiusRange = 1,\r\n direction1 = new Vector3(0, 1.0, 0),\r\n direction2 = new Vector3(0, 1.0, 0)\r\n ): CylinderDirectedParticleEmitter {\r\n const particleEmitter = new CylinderDirectedParticleEmitter(radius, height, radiusRange, direction1, direction2);\r\n this.particleEmitterType = particleEmitter;\r\n return particleEmitter;\r\n }\r\n\r\n /**\r\n * Creates a Cone Emitter for the particle system (emits from the cone to the particle position)\r\n * @param radius The radius of the cone to emit from\r\n * @param angle The base angle of the cone\r\n * @returns the emitter\r\n */\r\n public createConeEmitter(radius = 1, angle = Math.PI / 4): ConeParticleEmitter {\r\n const particleEmitter = new ConeParticleEmitter(radius, angle);\r\n this.particleEmitterType = particleEmitter;\r\n return particleEmitter;\r\n }\r\n\r\n /**\r\n * Creates a Box Emitter for the particle system. (emits between direction1 and direction2 from withing the box defined by minEmitBox and maxEmitBox)\r\n * @param direction1 Particles are emitted between the direction1 and direction2 from within the box\r\n * @param direction2 Particles are emitted between the direction1 and direction2 from within the box\r\n * @param minEmitBox Particles are emitted from the box between minEmitBox and maxEmitBox\r\n * @param maxEmitBox Particles are emitted from the box between minEmitBox and maxEmitBox\r\n * @returns the emitter\r\n */\r\n public createBoxEmitter(direction1: Vector3, direction2: Vector3, minEmitBox: Vector3, maxEmitBox: Vector3): BoxParticleEmitter {\r\n const particleEmitter = new BoxParticleEmitter();\r\n this.particleEmitterType = particleEmitter;\r\n this.direction1 = direction1;\r\n this.direction2 = direction2;\r\n this.minEmitBox = minEmitBox;\r\n this.maxEmitBox = maxEmitBox;\r\n return particleEmitter;\r\n }\r\n}\r\n"]}
|
|
@@ -23,11 +23,9 @@ export class ComputeShaderParticleSystem {
|
|
|
23
23
|
return !!this._updateComputeShader;
|
|
24
24
|
}
|
|
25
25
|
isUpdateBufferReady() {
|
|
26
|
-
|
|
27
|
-
return (_b = (_a = this._updateComputeShader) === null || _a === void 0 ? void 0 : _a.isReady()) !== null && _b !== void 0 ? _b : false;
|
|
26
|
+
return this._updateComputeShader?.isReady() ?? false;
|
|
28
27
|
}
|
|
29
28
|
createUpdateBuffer(defines) {
|
|
30
|
-
var _a;
|
|
31
29
|
const bindingsMapping = {
|
|
32
30
|
params: { group: 0, binding: 0 },
|
|
33
31
|
particlesIn: { group: 0, binding: 1 },
|
|
@@ -54,7 +52,7 @@ export class ComputeShaderParticleSystem {
|
|
|
54
52
|
bindingsMapping["noiseTexture"] = { group: 1, binding: 11 };
|
|
55
53
|
}
|
|
56
54
|
this._updateComputeShader = new ComputeShader("updateParticles", this._engine, "gpuUpdateParticles", { bindingsMapping, defines: defines.split("\n") });
|
|
57
|
-
|
|
55
|
+
this._simParamsComputeShader?.dispose();
|
|
58
56
|
this._simParamsComputeShader = new UniformBuffer(this._engine, undefined, undefined, "ComputeShaderParticleSystemUBO");
|
|
59
57
|
this._simParamsComputeShader.addUniform("currentCount", 1);
|
|
60
58
|
this._simParamsComputeShader.addUniform("timeDelta", 1);
|
|
@@ -128,12 +126,11 @@ export class ComputeShaderParticleSystem {
|
|
|
128
126
|
this._updateComputeShader.dispatch(Math.ceil(currentActiveCount / 64));
|
|
129
127
|
}
|
|
130
128
|
releaseBuffers() {
|
|
131
|
-
var _a;
|
|
132
129
|
for (let i = 0; i < this._bufferComputeShader.length; ++i) {
|
|
133
130
|
this._bufferComputeShader[i].dispose();
|
|
134
131
|
}
|
|
135
132
|
this._bufferComputeShader.length = 0;
|
|
136
|
-
|
|
133
|
+
this._simParamsComputeShader?.dispose();
|
|
137
134
|
this._simParamsComputeShader = null;
|
|
138
135
|
this._updateComputeShader = null;
|
|
139
136
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computeShaderParticleSystem.js","sourceRoot":"","sources":["../../../../dev/core/src/Particles/computeShaderParticleSystem.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAO3D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,iCAAiC,EAAE,MAAM,gDAAgD,CAAC;AAGnG,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,2CAA2C,CAAC;AAEnD,gBAAgB;AAChB,MAAM,OAAO,2BAA2B;IAUpC,YAAY,MAAyB,EAAE,MAAkB;QALjD,yBAAoB,GAAoB,EAAE,CAAC;QAC3C,yBAAoB,GAA2C,EAAE,CAAC;QAE1D,sBAAiB,GAAG,IAAI,CAAC;QAGrC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IAC1B,CAAC;IAEM,WAAW;QACd,IAAI,C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AAkB,GAAG,EAAE,CAAC,CAAC,CAAC;IAC3E,CAAC;IAEM,cAAc;;QACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,oBAAoB,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;YACvD,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;SAC1C;QAED,IAAI,CAAC,oBAAoB,CAAC,MAAM,GAAG,CAAC,CAAC;QAErC,MAAA,IAAI,CAAC,uBAAuB,0CAAE,OAAO,EAAE,CAAC;QAClC,IAAI,CAAC,uBAAwB,GAAG,IAAI,CAAC;QAErC,IAAI,CAAC,oBAAqB,GAAG,IAAI,CAAC;IAC5C,CAAC;IAEM,oBAAoB;QACvB,IAAI,CAAC,oBAAoB,CAAC,MAAM,GAAG,CAAC,CAAC;IACzC,CAAC;CACJ;AAED,aAAa,CAAC,qCAAqC,EAAE,2BAA2B,CAAC,CAAC","sourcesContent":["import type { ThinEngine } from \"../Engines/thinEngine\";\r\nimport type { WebGPUEngine } from \"../Engines/webgpuEngine\";\r\nimport { StorageBuffer } from \"../Buffers/storageBuffer\";\r\nimport { ComputeShader } from \"../Compute/computeShader\";\r\nimport { UniformBuffer } from \"../Materials/uniformBuffer\";\r\nimport type { IGPUParticleSystemPlatform } from \"./IGPUParticleSystemPlatform\";\r\nimport type { Buffer, VertexBuffer } from \"../Buffers/buffer\";\r\nimport type { GPUParticleSystem } from \"./gpuParticleSystem\";\r\n\r\nimport type { DataArray, Nullable } from \"../types\";\r\nimport type { DataBuffer } from \"../Buffers/dataBuffer\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport { UniformBufferEffectCommonAccessor } from \"../Materials/uniformBufferEffectCommonAccessor\";\r\nimport type { ComputeBindingMapping } from \"../Engines/Extensions/engine.computeShader\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\n\r\nimport \"../ShadersWGSL/gpuUpdateParticles.compute\";\r\n\r\n/** @internal */\r\nexport class ComputeShaderParticleSystem implements IGPUParticleSystemPlatform {\r\n private _parent: GPUParticleSystem;\r\n private _engine: ThinEngine;\r\n private _updateComputeShader: ComputeShader;\r\n private _simParamsComputeShader: UniformBuffer;\r\n private _bufferComputeShader: StorageBuffer[] = [];\r\n private _renderVertexBuffers: Array<{ [key: string]: VertexBuffer }> = [];\r\n\r\n public readonly alignDataInBuffer = true;\r\n\r\n constructor(parent: GPUParticleSystem, engine: ThinEngine) {\r\n this._parent = parent;\r\n this._engine = engine;\r\n }\r\n\r\n public contextLost(): void {\r\n this._updateComputeShader = undefined as any;\r\n this._bufferComputeShader.length = 0;\r\n this._renderVertexBuffers.length = 0;\r\n }\r\n\r\n public isUpdateBufferCreated(): boolean {\r\n return !!this._updateComputeShader;\r\n }\r\n\r\n public isUpdateBufferReady(): boolean {\r\n return this._updateComputeShader?.isReady() ?? false;\r\n }\r\n\r\n public createUpdateBuffer(defines: string): UniformBufferEffectCommonAccessor {\r\n const bindingsMapping: ComputeBindingMapping = {\r\n params: { group: 0, binding: 0 },\r\n particlesIn: { group: 0, binding: 1 },\r\n particlesOut: { group: 0, binding: 2 },\r\n randomTexture: { group: 0, binding: 3 },\r\n randomTexture2: { group: 0, binding: 4 },\r\n };\r\n if (this._parent._sizeGradientsTexture) {\r\n bindingsMapping[\"sizeGradientTexture\"] = { group: 1, binding: 1 };\r\n }\r\n if (this._parent._angularSpeedGradientsTexture) {\r\n bindingsMapping[\"angularSpeedGradientTexture\"] = { group: 1, binding: 3 };\r\n }\r\n if (this._parent._velocityGradientsTexture) {\r\n bindingsMapping[\"velocityGradientTexture\"] = { group: 1, binding: 5 };\r\n }\r\n if (this._parent._limitVelocityGradientsTexture) {\r\n bindingsMapping[\"limitVelocityGradientTexture\"] = { group: 1, binding: 7 };\r\n }\r\n if (this._parent._dragGradientsTexture) {\r\n bindingsMapping[\"dragGradientTexture\"] = { group: 1, binding: 9 };\r\n }\r\n if (this._parent.noiseTexture) {\r\n bindingsMapping[\"noiseTexture\"] = { group: 1, binding: 11 };\r\n }\r\n\r\n this._updateComputeShader = new ComputeShader(\"updateParticles\", this._engine as WebGPUEngine, \"gpuUpdateParticles\", { bindingsMapping, defines: defines.split(\"\\n\") });\r\n\r\n this._simParamsComputeShader?.dispose();\r\n this._simParamsComputeShader = new UniformBuffer(this._engine, undefined, undefined, \"ComputeShaderParticleSystemUBO\");\r\n\r\n this._simParamsComputeShader.addUniform(\"currentCount\", 1);\r\n this._simParamsComputeShader.addUniform(\"timeDelta\", 1);\r\n this._simParamsComputeShader.addUniform(\"stopFactor\", 1);\r\n this._simParamsComputeShader.addUniform(\"randomTextureSize\", 1);\r\n this._simParamsComputeShader.addUniform(\"lifeTime\", 2);\r\n this._simParamsComputeShader.addUniform(\"emitPower\", 2);\r\n if (!this._parent._colorGradientsTexture) {\r\n this._simParamsComputeShader.addUniform(\"color1\", 4);\r\n this._simParamsComputeShader.addUniform(\"color2\", 4);\r\n }\r\n this._simParamsComputeShader.addUniform(\"sizeRange\", 2);\r\n this._simParamsComputeShader.addUniform(\"scaleRange\", 4);\r\n this._simParamsComputeShader.addUniform(\"angleRange\", 4);\r\n this._simParamsComputeShader.addUniform(\"gravity\", 3);\r\n if (this._parent._limitVelocityGradientsTexture) {\r\n this._simParamsComputeShader.addUniform(\"limitVelocityDamping\", 1);\r\n }\r\n if (this._parent.isAnimationSheetEnabled) {\r\n this._simParamsComputeShader.addUniform(\"cellInfos\", 4);\r\n }\r\n if (this._parent.noiseTexture) {\r\n this._simParamsComputeShader.addUniform(\"noiseStrength\", 3);\r\n }\r\n if (!this._parent.isLocal) {\r\n this._simParamsComputeShader.addUniform(\"emitterWM\", 16);\r\n }\r\n if (this._parent.particleEmitterType) {\r\n this._parent.particleEmitterType.buildUniformLayout(this._simParamsComputeShader);\r\n }\r\n\r\n this._updateComputeShader.setUniformBuffer(\"params\", this._simParamsComputeShader);\r\n\r\n return new UniformBufferEffectCommonAccessor(this._simParamsComputeShader);\r\n }\r\n\r\n public createVertexBuffers(updateBuffer: Buffer, renderVertexBuffers: { [key: string]: VertexBuffer }): void {\r\n this._renderVertexBuffers.push(renderVertexBuffers);\r\n }\r\n\r\n public createParticleBuffer(data: number[]): DataArray | DataBuffer {\r\n const buffer = new StorageBuffer(\r\n this._engine,\r\n data.length * 4,\r\n Constants.BUFFER_CREATIONFLAG_READWRITE | Constants.BUFFER_CREATIONFLAG_VERTEX,\r\n \"ComputeShaderParticleSystemBuffer\"\r\n );\r\n\r\n buffer.update(data);\r\n this._bufferComputeShader.push(buffer);\r\n\r\n return buffer.getBuffer();\r\n }\r\n\r\n public bindDrawBuffers(index: number, effect: Effect, indexBuffer: Nullable<DataBuffer>): void {\r\n this._engine.bindBuffers(this._renderVertexBuffers[index], indexBuffer, effect);\r\n }\r\n\r\n public preUpdateParticleBuffer(): void {}\r\n\r\n public updateParticleBuffer(index: number, targetBuffer: Buffer, currentActiveCount: number): void {\r\n this._simParamsComputeShader.update();\r\n\r\n this._updateComputeShader.setTexture(\"randomTexture\", this._parent._randomTexture, false);\r\n this._updateComputeShader.setTexture(\"randomTexture2\", this._parent._randomTexture2, false);\r\n if (this._parent._sizeGradientsTexture) {\r\n this._updateComputeShader.setTexture(\"sizeGradientTexture\", this._parent._sizeGradientsTexture);\r\n }\r\n\r\n if (this._parent._angularSpeedGradientsTexture) {\r\n this._updateComputeShader.setTexture(\"angularSpeedGradientTexture\", this._parent._angularSpeedGradientsTexture);\r\n }\r\n\r\n if (this._parent._velocityGradientsTexture) {\r\n this._updateComputeShader.setTexture(\"velocityGradientTexture\", this._parent._velocityGradientsTexture);\r\n }\r\n\r\n if (this._parent._limitVelocityGradientsTexture) {\r\n this._updateComputeShader.setTexture(\"limitVelocityGradientTexture\", this._parent._limitVelocityGradientsTexture);\r\n }\r\n\r\n if (this._parent._dragGradientsTexture) {\r\n this._updateComputeShader.setTexture(\"dragGradientTexture\", this._parent._dragGradientsTexture);\r\n }\r\n\r\n if (this._parent.noiseTexture) {\r\n this._updateComputeShader.setTexture(\"noiseTexture\", this._parent.noiseTexture);\r\n }\r\n\r\n this._updateComputeShader.setStorageBuffer(\"particlesIn\", this._bufferComputeShader[index]);\r\n this._updateComputeShader.setStorageBuffer(\"particlesOut\", this._bufferComputeShader[index ^ 1]);\r\n\r\n this._updateComputeShader.dispatch(Math.ceil(currentActiveCount / 64));\r\n }\r\n\r\n public releaseBuffers(): void {\r\n for (let i = 0; i < this._bufferComputeShader.length; ++i) {\r\n this._bufferComputeShader[i].dispose();\r\n }\r\n\r\n this._bufferComputeShader.length = 0;\r\n\r\n this._simParamsComputeShader?.dispose();\r\n (<any>this._simParamsComputeShader) = null;\r\n\r\n (<any>this._updateComputeShader) = null;\r\n }\r\n\r\n public releaseVertexBuffers(): void {\r\n this._renderVertexBuffers.length = 0;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ComputeShaderParticleSystem\", ComputeShaderParticleSystem);\r\n"]}
|
|
1
|
+
{"version":3,"file":"computeShaderParticleSystem.js","sourceRoot":"","sources":["../../../../dev/core/src/Particles/computeShaderParticleSystem.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAO3D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,iCAAiC,EAAE,MAAM,gDAAgD,CAAC;AAGnG,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,2CAA2C,CAAC;AAEnD,gBAAgB;AAChB,MAAM,OAAO,2BAA2B;IAUpC,YAAY,MAAyB,EAAE,MAAkB;QALjD,yBAAoB,GAAoB,EAAE,CAAC;QAC3C,yBAAoB,GAA2C,EAAE,CAAC;QAE1D,sBAAiB,GAAG,IAAI,CAAC;QAGrC,I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AAC,CAAC,CAAC;QAEjG,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,GAAG,EAAE,CAAC,CAAC,CAAC;IAC3E,CAAC;IAEM,cAAc;QACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,oBAAoB,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;YACvD,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;SAC1C;QAED,IAAI,CAAC,oBAAoB,CAAC,MAAM,GAAG,CAAC,CAAC;QAErC,IAAI,CAAC,uBAAuB,EAAE,OAAO,EAAE,CAAC;QAClC,IAAI,CAAC,uBAAwB,GAAG,IAAI,CAAC;QAErC,IAAI,CAAC,oBAAqB,GAAG,IAAI,CAAC;IAC5C,CAAC;IAEM,oBAAoB;QACvB,IAAI,CAAC,oBAAoB,CAAC,MAAM,GAAG,CAAC,CAAC;IACzC,CAAC;CACJ;AAED,aAAa,CAAC,qCAAqC,EAAE,2BAA2B,CAAC,CAAC","sourcesContent":["import type { ThinEngine } from \"../Engines/thinEngine\";\r\nimport type { WebGPUEngine } from \"../Engines/webgpuEngine\";\r\nimport { StorageBuffer } from \"../Buffers/storageBuffer\";\r\nimport { ComputeShader } from \"../Compute/computeShader\";\r\nimport { UniformBuffer } from \"../Materials/uniformBuffer\";\r\nimport type { IGPUParticleSystemPlatform } from \"./IGPUParticleSystemPlatform\";\r\nimport type { Buffer, VertexBuffer } from \"../Buffers/buffer\";\r\nimport type { GPUParticleSystem } from \"./gpuParticleSystem\";\r\n\r\nimport type { DataArray, Nullable } from \"../types\";\r\nimport type { DataBuffer } from \"../Buffers/dataBuffer\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport { UniformBufferEffectCommonAccessor } from \"../Materials/uniformBufferEffectCommonAccessor\";\r\nimport type { ComputeBindingMapping } from \"../Engines/Extensions/engine.computeShader\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\n\r\nimport \"../ShadersWGSL/gpuUpdateParticles.compute\";\r\n\r\n/** @internal */\r\nexport class ComputeShaderParticleSystem implements IGPUParticleSystemPlatform {\r\n private _parent: GPUParticleSystem;\r\n private _engine: ThinEngine;\r\n private _updateComputeShader: ComputeShader;\r\n private _simParamsComputeShader: UniformBuffer;\r\n private _bufferComputeShader: StorageBuffer[] = [];\r\n private _renderVertexBuffers: Array<{ [key: string]: VertexBuffer }> = [];\r\n\r\n public readonly alignDataInBuffer = true;\r\n\r\n constructor(parent: GPUParticleSystem, engine: ThinEngine) {\r\n this._parent = parent;\r\n this._engine = engine;\r\n }\r\n\r\n public contextLost(): void {\r\n this._updateComputeShader = undefined as any;\r\n this._bufferComputeShader.length = 0;\r\n this._renderVertexBuffers.length = 0;\r\n }\r\n\r\n public isUpdateBufferCreated(): boolean {\r\n return !!this._updateComputeShader;\r\n }\r\n\r\n public isUpdateBufferReady(): boolean {\r\n return this._updateComputeShader?.isReady() ?? false;\r\n }\r\n\r\n public createUpdateBuffer(defines: string): UniformBufferEffectCommonAccessor {\r\n const bindingsMapping: ComputeBindingMapping = {\r\n params: { group: 0, binding: 0 },\r\n particlesIn: { group: 0, binding: 1 },\r\n particlesOut: { group: 0, binding: 2 },\r\n randomTexture: { group: 0, binding: 3 },\r\n randomTexture2: { group: 0, binding: 4 },\r\n };\r\n if (this._parent._sizeGradientsTexture) {\r\n bindingsMapping[\"sizeGradientTexture\"] = { group: 1, binding: 1 };\r\n }\r\n if (this._parent._angularSpeedGradientsTexture) {\r\n bindingsMapping[\"angularSpeedGradientTexture\"] = { group: 1, binding: 3 };\r\n }\r\n if (this._parent._velocityGradientsTexture) {\r\n bindingsMapping[\"velocityGradientTexture\"] = { group: 1, binding: 5 };\r\n }\r\n if (this._parent._limitVelocityGradientsTexture) {\r\n bindingsMapping[\"limitVelocityGradientTexture\"] = { group: 1, binding: 7 };\r\n }\r\n if (this._parent._dragGradientsTexture) {\r\n bindingsMapping[\"dragGradientTexture\"] = { group: 1, binding: 9 };\r\n }\r\n if (this._parent.noiseTexture) {\r\n bindingsMapping[\"noiseTexture\"] = { group: 1, binding: 11 };\r\n }\r\n\r\n this._updateComputeShader = new ComputeShader(\"updateParticles\", this._engine as WebGPUEngine, \"gpuUpdateParticles\", { bindingsMapping, defines: defines.split(\"\\n\") });\r\n\r\n this._simParamsComputeShader?.dispose();\r\n this._simParamsComputeShader = new UniformBuffer(this._engine, undefined, undefined, \"ComputeShaderParticleSystemUBO\");\r\n\r\n this._simParamsComputeShader.addUniform(\"currentCount\", 1);\r\n this._simParamsComputeShader.addUniform(\"timeDelta\", 1);\r\n this._simParamsComputeShader.addUniform(\"stopFactor\", 1);\r\n this._simParamsComputeShader.addUniform(\"randomTextureSize\", 1);\r\n this._simParamsComputeShader.addUniform(\"lifeTime\", 2);\r\n this._simParamsComputeShader.addUniform(\"emitPower\", 2);\r\n if (!this._parent._colorGradientsTexture) {\r\n this._simParamsComputeShader.addUniform(\"color1\", 4);\r\n this._simParamsComputeShader.addUniform(\"color2\", 4);\r\n }\r\n this._simParamsComputeShader.addUniform(\"sizeRange\", 2);\r\n this._simParamsComputeShader.addUniform(\"scaleRange\", 4);\r\n this._simParamsComputeShader.addUniform(\"angleRange\", 4);\r\n this._simParamsComputeShader.addUniform(\"gravity\", 3);\r\n if (this._parent._limitVelocityGradientsTexture) {\r\n this._simParamsComputeShader.addUniform(\"limitVelocityDamping\", 1);\r\n }\r\n if (this._parent.isAnimationSheetEnabled) {\r\n this._simParamsComputeShader.addUniform(\"cellInfos\", 4);\r\n }\r\n if (this._parent.noiseTexture) {\r\n this._simParamsComputeShader.addUniform(\"noiseStrength\", 3);\r\n }\r\n if (!this._parent.isLocal) {\r\n this._simParamsComputeShader.addUniform(\"emitterWM\", 16);\r\n }\r\n if (this._parent.particleEmitterType) {\r\n this._parent.particleEmitterType.buildUniformLayout(this._simParamsComputeShader);\r\n }\r\n\r\n this._updateComputeShader.setUniformBuffer(\"params\", this._simParamsComputeShader);\r\n\r\n return new UniformBufferEffectCommonAccessor(this._simParamsComputeShader);\r\n }\r\n\r\n public createVertexBuffers(updateBuffer: Buffer, renderVertexBuffers: { [key: string]: VertexBuffer }): void {\r\n this._renderVertexBuffers.push(renderVertexBuffers);\r\n }\r\n\r\n public createParticleBuffer(data: number[]): DataArray | DataBuffer {\r\n const buffer = new StorageBuffer(\r\n this._engine,\r\n data.length * 4,\r\n Constants.BUFFER_CREATIONFLAG_READWRITE | Constants.BUFFER_CREATIONFLAG_VERTEX,\r\n \"ComputeShaderParticleSystemBuffer\"\r\n );\r\n\r\n buffer.update(data);\r\n this._bufferComputeShader.push(buffer);\r\n\r\n return buffer.getBuffer();\r\n }\r\n\r\n public bindDrawBuffers(index: number, effect: Effect, indexBuffer: Nullable<DataBuffer>): void {\r\n this._engine.bindBuffers(this._renderVertexBuffers[index], indexBuffer, effect);\r\n }\r\n\r\n public preUpdateParticleBuffer(): void {}\r\n\r\n public updateParticleBuffer(index: number, targetBuffer: Buffer, currentActiveCount: number): void {\r\n this._simParamsComputeShader.update();\r\n\r\n this._updateComputeShader.setTexture(\"randomTexture\", this._parent._randomTexture, false);\r\n this._updateComputeShader.setTexture(\"randomTexture2\", this._parent._randomTexture2, false);\r\n if (this._parent._sizeGradientsTexture) {\r\n this._updateComputeShader.setTexture(\"sizeGradientTexture\", this._parent._sizeGradientsTexture);\r\n }\r\n\r\n if (this._parent._angularSpeedGradientsTexture) {\r\n this._updateComputeShader.setTexture(\"angularSpeedGradientTexture\", this._parent._angularSpeedGradientsTexture);\r\n }\r\n\r\n if (this._parent._velocityGradientsTexture) {\r\n this._updateComputeShader.setTexture(\"velocityGradientTexture\", this._parent._velocityGradientsTexture);\r\n }\r\n\r\n if (this._parent._limitVelocityGradientsTexture) {\r\n this._updateComputeShader.setTexture(\"limitVelocityGradientTexture\", this._parent._limitVelocityGradientsTexture);\r\n }\r\n\r\n if (this._parent._dragGradientsTexture) {\r\n this._updateComputeShader.setTexture(\"dragGradientTexture\", this._parent._dragGradientsTexture);\r\n }\r\n\r\n if (this._parent.noiseTexture) {\r\n this._updateComputeShader.setTexture(\"noiseTexture\", this._parent.noiseTexture);\r\n }\r\n\r\n this._updateComputeShader.setStorageBuffer(\"particlesIn\", this._bufferComputeShader[index]);\r\n this._updateComputeShader.setStorageBuffer(\"particlesOut\", this._bufferComputeShader[index ^ 1]);\r\n\r\n this._updateComputeShader.dispatch(Math.ceil(currentActiveCount / 64));\r\n }\r\n\r\n public releaseBuffers(): void {\r\n for (let i = 0; i < this._bufferComputeShader.length; ++i) {\r\n this._bufferComputeShader[i].dispose();\r\n }\r\n\r\n this._bufferComputeShader.length = 0;\r\n\r\n this._simParamsComputeShader?.dispose();\r\n (<any>this._simParamsComputeShader) = null;\r\n\r\n (<any>this._updateComputeShader) = null;\r\n }\r\n\r\n public releaseVertexBuffers(): void {\r\n this._renderVertexBuffers.length = 0;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ComputeShaderParticleSystem\", ComputeShaderParticleSystem);\r\n"]}
|
|
@@ -13,7 +13,7 @@ import type { IAnimatable } from "../Animations/animatable.interface";
|
|
|
13
13
|
import { ThinEngine } from "../Engines/thinEngine";
|
|
14
14
|
import type { DataBuffer } from "../Buffers/dataBuffer";
|
|
15
15
|
import { DrawWrapper } from "../Materials/drawWrapper";
|
|
16
|
-
import
|
|
16
|
+
import { Scene } from "../scene";
|
|
17
17
|
import "../Engines/Extensions/engine.transformFeedback";
|
|
18
18
|
import "../Shaders/gpuRenderParticles.fragment";
|
|
19
19
|
import "../Shaders/gpuRenderParticles.vertex";
|
|
@@ -383,7 +383,7 @@ export declare class GPUParticleSystem extends BaseParticleSystem implements IDi
|
|
|
383
383
|
/**
|
|
384
384
|
* @internal
|
|
385
385
|
*/
|
|
386
|
-
static _GetEffectCreationOptions(isAnimationSheetEnabled?: boolean, useLogarithmicDepth?: boolean): string[];
|
|
386
|
+
static _GetEffectCreationOptions(isAnimationSheetEnabled?: boolean, useLogarithmicDepth?: boolean, applyFog?: boolean): string[];
|
|
387
387
|
/**
|
|
388
388
|
* Fill the defines array according to the current settings of the particle system
|
|
389
389
|
* @param defines Array to be updated
|
|
@@ -17,6 +17,7 @@ import { ThinEngine } from "../Engines/thinEngine.js";
|
|
|
17
17
|
import { DrawWrapper } from "../Materials/drawWrapper.js";
|
|
18
18
|
import { GetClass } from "../Misc/typeStore.js";
|
|
19
19
|
import { addClipPlaneUniforms, bindClipPlane, prepareStringDefinesForClipPlanes } from "../Materials/clipPlaneMaterialHelper.js";
|
|
20
|
+
import { Scene } from "../scene.js";
|
|
20
21
|
import "../Engines/Extensions/engine.transformFeedback.js";
|
|
21
22
|
import "../Shaders/gpuRenderParticles.fragment.js";
|
|
22
23
|
import "../Shaders/gpuRenderParticles.vertex.js";
|
|
@@ -179,12 +180,10 @@ export class GPUParticleSystem extends BaseParticleSystem {
|
|
|
179
180
|
* @returns The effect
|
|
180
181
|
*/
|
|
181
182
|
getCustomEffect(blendMode = 0) {
|
|
182
|
-
|
|
183
|
-
return (_b = (_a = this._customWrappers[blendMode]) === null || _a === void 0 ? void 0 : _a.effect) !== null && _b !== void 0 ? _b : this._customWrappers[0].effect;
|
|
183
|
+
return this._customWrappers[blendMode]?.effect ?? this._customWrappers[0].effect;
|
|
184
184
|
}
|
|
185
185
|
_getCustomDrawWrapper(blendMode = 0) {
|
|
186
|
-
|
|
187
|
-
return (_a = this._customWrappers[blendMode]) !== null && _a !== void 0 ? _a : this._customWrappers[0];
|
|
186
|
+
return this._customWrappers[blendMode] ?? this._customWrappers[0];
|
|
188
187
|
}
|
|
189
188
|
/**
|
|
190
189
|
* Sets the custom effect used to render the particles
|
|
@@ -292,10 +291,9 @@ export class GPUParticleSystem extends BaseParticleSystem {
|
|
|
292
291
|
* Resets the draw wrappers cache
|
|
293
292
|
*/
|
|
294
293
|
resetDrawCache() {
|
|
295
|
-
var _a;
|
|
296
294
|
for (const blendMode in this._drawWrappers) {
|
|
297
295
|
const drawWrapper = this._drawWrappers[blendMode];
|
|
298
|
-
|
|
296
|
+
drawWrapper.drawContext?.reset();
|
|
299
297
|
}
|
|
300
298
|
}
|
|
301
299
|
_addFactorGradient(factorGradients, gradient, factor) {
|
|
@@ -645,11 +643,15 @@ export class GPUParticleSystem extends BaseParticleSystem {
|
|
|
645
643
|
this._createIndexBuffer();
|
|
646
644
|
// Setup the default processing configuration to the scene.
|
|
647
645
|
this._attachImageProcessingConfiguration(null);
|
|
648
|
-
options = options
|
|
646
|
+
options = options ?? {};
|
|
649
647
|
if (!options.randomTextureSize) {
|
|
650
648
|
delete options.randomTextureSize;
|
|
651
649
|
}
|
|
652
|
-
const fullOptions =
|
|
650
|
+
const fullOptions = {
|
|
651
|
+
capacity: 50000,
|
|
652
|
+
randomTextureSize: this._engine.getCaps().maxTextureSize,
|
|
653
|
+
...options,
|
|
654
|
+
};
|
|
653
655
|
const optionsAsNumber = options;
|
|
654
656
|
if (isFinite(optionsAsNumber)) {
|
|
655
657
|
fullOptions.capacity = optionsAsNumber;
|
|
@@ -974,7 +976,7 @@ export class GPUParticleSystem extends BaseParticleSystem {
|
|
|
974
976
|
*/
|
|
975
977
|
_getWrapper(blendMode) {
|
|
976
978
|
const customWrapper = this._getCustomDrawWrapper(blendMode);
|
|
977
|
-
if (customWrapper
|
|
979
|
+
if (customWrapper?.effect) {
|
|
978
980
|
return customWrapper;
|
|
979
981
|
}
|
|
980
982
|
const defines = [];
|
|
@@ -1021,7 +1023,7 @@ export class GPUParticleSystem extends BaseParticleSystem {
|
|
|
1021
1023
|
/**
|
|
1022
1024
|
* @internal
|
|
1023
1025
|
*/
|
|
1024
|
-
static _GetEffectCreationOptions(isAnimationSheetEnabled = false, useLogarithmicDepth = false) {
|
|
1026
|
+
static _GetEffectCreationOptions(isAnimationSheetEnabled = false, useLogarithmicDepth = false, applyFog = false) {
|
|
1025
1027
|
const effectCreationOption = ["emitterWM", "worldOffset", "view", "projection", "colorDead", "invView", "translationPivot", "eyePosition"];
|
|
1026
1028
|
addClipPlaneUniforms(effectCreationOption);
|
|
1027
1029
|
if (isAnimationSheetEnabled) {
|
|
@@ -1030,6 +1032,10 @@ export class GPUParticleSystem extends BaseParticleSystem {
|
|
|
1030
1032
|
if (useLogarithmicDepth) {
|
|
1031
1033
|
effectCreationOption.push("logarithmicDepthConstant");
|
|
1032
1034
|
}
|
|
1035
|
+
if (applyFog) {
|
|
1036
|
+
effectCreationOption.push("vFogInfos");
|
|
1037
|
+
effectCreationOption.push("vFogColor");
|
|
1038
|
+
}
|
|
1033
1039
|
return effectCreationOption;
|
|
1034
1040
|
}
|
|
1035
1041
|
/**
|
|
@@ -1040,6 +1046,9 @@ export class GPUParticleSystem extends BaseParticleSystem {
|
|
|
1040
1046
|
fillDefines(defines, blendMode = 0) {
|
|
1041
1047
|
if (this._scene) {
|
|
1042
1048
|
prepareStringDefinesForClipPlanes(this, this._scene, defines);
|
|
1049
|
+
if (this.applyFog && this._scene.fogEnabled && this._scene.fogMode !== Scene.FOGMODE_NONE) {
|
|
1050
|
+
defines.push("#define FOG");
|
|
1051
|
+
}
|
|
1043
1052
|
}
|
|
1044
1053
|
if (blendMode === ParticleSystem.BLENDMODE_MULTIPLY) {
|
|
1045
1054
|
defines.push("#define BLENDMULTIPLYMODE");
|
|
@@ -1085,7 +1094,7 @@ export class GPUParticleSystem extends BaseParticleSystem {
|
|
|
1085
1094
|
*/
|
|
1086
1095
|
fillUniformsAttributesAndSamplerNames(uniforms, attributes, samplers) {
|
|
1087
1096
|
attributes.push(...GPUParticleSystem._GetAttributeNamesOrOptions(!!this._colorGradientsTexture, this._isAnimationSheetEnabled, this._isBillboardBased, this._isBillboardBased && this.billboardMode === ParticleSystem.BILLBOARDMODE_STRETCHED));
|
|
1088
|
-
uniforms.push(...GPUParticleSystem._GetEffectCreationOptions(this._isAnimationSheetEnabled, this.useLogarithmicDepth));
|
|
1097
|
+
uniforms.push(...GPUParticleSystem._GetEffectCreationOptions(this._isAnimationSheetEnabled, this.useLogarithmicDepth, this.applyFog));
|
|
1089
1098
|
samplers.push("diffuseSampler", "colorGradientSampler");
|
|
1090
1099
|
if (this._imageProcessingConfiguration) {
|
|
1091
1100
|
ImageProcessingConfiguration.PrepareUniforms(uniforms, this._imageProcessingConfigurationDefines);
|
|
@@ -1097,8 +1106,7 @@ export class GPUParticleSystem extends BaseParticleSystem {
|
|
|
1097
1106
|
* @param preWarm defines if we are in the pre-warmimg phase
|
|
1098
1107
|
*/
|
|
1099
1108
|
animate(preWarm = false) {
|
|
1100
|
-
|
|
1101
|
-
this._timeDelta = this.updateSpeed * (preWarm ? this.preWarmStepOffset : ((_a = this._scene) === null || _a === void 0 ? void 0 : _a.getAnimationRatio()) || 1);
|
|
1109
|
+
this._timeDelta = this.updateSpeed * (preWarm ? this.preWarmStepOffset : this._scene?.getAnimationRatio() || 1);
|
|
1102
1110
|
this._actualFrame += this._timeDelta;
|
|
1103
1111
|
if (!this._stopped) {
|
|
1104
1112
|
if (this.targetStopDuration && this._actualFrame >= this.targetStopDuration) {
|
|
@@ -1159,14 +1167,13 @@ export class GPUParticleSystem extends BaseParticleSystem {
|
|
|
1159
1167
|
this._colorGradientsTexture.name = "colorGradients";
|
|
1160
1168
|
}
|
|
1161
1169
|
_render(blendMode, emitterWM) {
|
|
1162
|
-
var _a, _b, _c, _d, _e;
|
|
1163
1170
|
// Enable render effect
|
|
1164
1171
|
const drawWrapper = this._getWrapper(blendMode);
|
|
1165
1172
|
const effect = drawWrapper.effect;
|
|
1166
1173
|
this._engine.enableEffect(drawWrapper);
|
|
1167
|
-
const viewMatrix =
|
|
1174
|
+
const viewMatrix = this._scene?.getViewMatrix() || Matrix.IdentityReadOnly;
|
|
1168
1175
|
effect.setMatrix("view", viewMatrix);
|
|
1169
|
-
effect.setMatrix("projection",
|
|
1176
|
+
effect.setMatrix("projection", this.defaultProjectionMatrix ?? this._scene.getProjectionMatrix());
|
|
1170
1177
|
effect.setTexture("diffuseSampler", this.particleTexture);
|
|
1171
1178
|
effect.setVector2("translationPivot", this.translationPivot);
|
|
1172
1179
|
effect.setVector3("worldOffset", this.worldOffset);
|
|
@@ -1190,6 +1197,9 @@ export class GPUParticleSystem extends BaseParticleSystem {
|
|
|
1190
1197
|
const defines = effect.defines;
|
|
1191
1198
|
if (this._scene) {
|
|
1192
1199
|
bindClipPlane(effect, this, this._scene);
|
|
1200
|
+
if (this.applyFog) {
|
|
1201
|
+
MaterialHelper.BindFogParameters(this._scene, undefined, effect);
|
|
1202
|
+
}
|
|
1193
1203
|
}
|
|
1194
1204
|
if (defines.indexOf("#define BILLBOARDMODE_ALL") >= 0) {
|
|
1195
1205
|
const invView = viewMatrix.clone();
|
|
@@ -1220,19 +1230,19 @@ export class GPUParticleSystem extends BaseParticleSystem {
|
|
|
1220
1230
|
break;
|
|
1221
1231
|
}
|
|
1222
1232
|
// Bind source VAO
|
|
1223
|
-
this._platform.bindDrawBuffers(this._targetIndex, effect,
|
|
1233
|
+
this._platform.bindDrawBuffers(this._targetIndex, effect, this._scene?.forceWireframe ? this._linesIndexBufferUseInstancing : null);
|
|
1224
1234
|
if (this._onBeforeDrawParticlesObservable) {
|
|
1225
1235
|
this._onBeforeDrawParticlesObservable.notifyObservers(effect);
|
|
1226
1236
|
}
|
|
1227
1237
|
// Render
|
|
1228
|
-
if (
|
|
1238
|
+
if (this._scene?.forceWireframe) {
|
|
1229
1239
|
this._engine.drawElementsType(6, 0, 10, this._currentActiveCount);
|
|
1230
1240
|
}
|
|
1231
1241
|
else {
|
|
1232
1242
|
this._engine.drawArraysType(7, 0, 4, this._currentActiveCount);
|
|
1233
1243
|
}
|
|
1234
1244
|
this._engine.setAlphaMode(0);
|
|
1235
|
-
if (
|
|
1245
|
+
if (this._scene?.forceWireframe) {
|
|
1236
1246
|
this._engine.unbindInstanceAttributes();
|
|
1237
1247
|
}
|
|
1238
1248
|
return this._currentActiveCount;
|
|
@@ -1482,7 +1492,7 @@ export class GPUParticleSystem extends BaseParticleSystem {
|
|
|
1482
1492
|
* @returns the cloned particle system
|
|
1483
1493
|
*/
|
|
1484
1494
|
clone(name, newEmitter, cloneTexture = false) {
|
|
1485
|
-
const custom =
|
|
1495
|
+
const custom = { ...this._customWrappers };
|
|
1486
1496
|
let program = null;
|
|
1487
1497
|
const engine = this._engine;
|
|
1488
1498
|
if (engine.createEffectForParticles) {
|