@babylonjs/core 8.44.1 → 8.45.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/Cameras/Inputs/geospatialCameraKeyboardInput.js +6 -10
  2. package/Cameras/Inputs/geospatialCameraKeyboardInput.js.map +1 -1
  3. package/Cameras/Inputs/geospatialCameraMouseWheelInput.js +1 -1
  4. package/Cameras/Inputs/geospatialCameraMouseWheelInput.js.map +1 -1
  5. package/Cameras/Limits/geospatialLimits.d.ts +4 -22
  6. package/Cameras/Limits/geospatialLimits.js +4 -36
  7. package/Cameras/Limits/geospatialLimits.js.map +1 -1
  8. package/Cameras/geospatialCamera.d.ts +15 -4
  9. package/Cameras/geospatialCamera.js +90 -37
  10. package/Cameras/geospatialCamera.js.map +1 -1
  11. package/Cameras/geospatialCameraMovement.d.ts +1 -3
  12. package/Cameras/geospatialCameraMovement.js +15 -51
  13. package/Cameras/geospatialCameraMovement.js.map +1 -1
  14. package/Collisions/collisionCoordinator.d.ts +2 -2
  15. package/Collisions/collisionCoordinator.js +1 -0
  16. package/Collisions/collisionCoordinator.js.map +1 -1
  17. package/Engines/Extensions/engine.debugging.d.ts +3 -5
  18. package/Engines/Extensions/engine.debugging.js +3 -4
  19. package/Engines/Extensions/engine.debugging.js.map +1 -1
  20. package/Engines/WebGPU/Extensions/engine.debugging.js +15 -65
  21. package/Engines/WebGPU/Extensions/engine.debugging.js.map +1 -1
  22. package/Engines/WebGPU/webgpuTextureManager.js +9 -9
  23. package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
  24. package/Engines/abstractEngine.d.ts +2 -0
  25. package/Engines/abstractEngine.js +4 -2
  26. package/Engines/abstractEngine.js.map +1 -1
  27. package/Engines/thinWebGPUEngine.d.ts +0 -2
  28. package/Engines/thinWebGPUEngine.js +0 -8
  29. package/Engines/thinWebGPUEngine.js.map +1 -1
  30. package/Engines/webgpuEngine.d.ts +1 -3
  31. package/Engines/webgpuEngine.js +4 -10
  32. package/Engines/webgpuEngine.js.map +1 -1
  33. package/FrameGraph/Passes/renderPass.js +4 -9
  34. package/FrameGraph/Passes/renderPass.js.map +1 -1
  35. package/FrameGraph/Tasks/PostProcesses/postProcessTask.js +3 -0
  36. package/FrameGraph/Tasks/PostProcesses/postProcessTask.js.map +1 -1
  37. package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +1 -1
  38. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +4 -1
  39. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
  40. package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +2 -1
  41. package/FrameGraph/Tasks/Rendering/objectRendererTask.js +31 -7
  42. package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
  43. package/FrameGraph/frameGraph.js +2 -2
  44. package/FrameGraph/frameGraph.js.map +1 -1
  45. package/FrameGraph/frameGraphContext.d.ts +9 -0
  46. package/FrameGraph/frameGraphContext.js +13 -2
  47. package/FrameGraph/frameGraphContext.js.map +1 -1
  48. package/FrameGraph/frameGraphObjectList.js.map +1 -1
  49. package/FrameGraph/frameGraphRenderContext.d.ts +9 -8
  50. package/FrameGraph/frameGraphRenderContext.js +23 -20
  51. package/FrameGraph/frameGraphRenderContext.js.map +1 -1
  52. package/FrameGraph/frameGraphTask.d.ts +2 -0
  53. package/FrameGraph/frameGraphTask.js +14 -4
  54. package/FrameGraph/frameGraphTask.js.map +1 -1
  55. package/Lights/Shadows/cascadedShadowGenerator.js +4 -1
  56. package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
  57. package/Lights/Shadows/shadowGenerator.js +8 -3
  58. package/Lights/Shadows/shadowGenerator.js.map +1 -1
  59. package/Lights/areaLight.d.ts +2 -1
  60. package/Lights/areaLight.js +3 -2
  61. package/Lights/areaLight.js.map +1 -1
  62. package/Lights/directionalLight.d.ts +2 -1
  63. package/Lights/directionalLight.js +3 -2
  64. package/Lights/directionalLight.js.map +1 -1
  65. package/Lights/hemisphericLight.d.ts +2 -1
  66. package/Lights/hemisphericLight.js +3 -2
  67. package/Lights/hemisphericLight.js.map +1 -1
  68. package/Lights/light.d.ts +2 -1
  69. package/Lights/light.js +8 -3
  70. package/Lights/light.js.map +1 -1
  71. package/Lights/lightingVolume.js +11 -6
  72. package/Lights/lightingVolume.js.map +1 -1
  73. package/Lights/pointLight.d.ts +2 -1
  74. package/Lights/pointLight.js +3 -2
  75. package/Lights/pointLight.js.map +1 -1
  76. package/Lights/rectAreaLight.d.ts +2 -1
  77. package/Lights/rectAreaLight.js +3 -2
  78. package/Lights/rectAreaLight.js.map +1 -1
  79. package/Lights/spotLight.d.ts +2 -1
  80. package/Lights/spotLight.js +3 -2
  81. package/Lights/spotLight.js.map +1 -1
  82. package/Loading/Plugins/babylonFileLoader.js +17 -0
  83. package/Loading/Plugins/babylonFileLoader.js.map +1 -1
  84. package/Materials/Node/Blocks/Input/inputBlock.js +3 -0
  85. package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
  86. package/Materials/Node/nodeMaterial.d.ts +1 -0
  87. package/Materials/Node/nodeMaterial.js +4 -0
  88. package/Materials/Node/nodeMaterial.js.map +1 -1
  89. package/Materials/Node/nodeMaterialBuildStateSharedData.d.ts +6 -0
  90. package/Materials/Node/nodeMaterialBuildStateSharedData.js +4 -0
  91. package/Materials/Node/nodeMaterialBuildStateSharedData.js.map +1 -1
  92. package/Materials/Textures/Loaders/iesTextureLoader.js +1 -1
  93. package/Materials/Textures/Loaders/iesTextureLoader.js.map +1 -1
  94. package/Materials/Textures/Procedurals/proceduralTexture.js +7 -2
  95. package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
  96. package/Materials/Textures/internalTexture.d.ts +6 -4
  97. package/Materials/Textures/internalTexture.js +6 -4
  98. package/Materials/Textures/internalTexture.js.map +1 -1
  99. package/Materials/Textures/renderTargetTexture.js +2 -2
  100. package/Materials/Textures/renderTargetTexture.js.map +1 -1
  101. package/Materials/Textures/textureSampler.d.ts +3 -3
  102. package/Materials/Textures/textureSampler.js.map +1 -1
  103. package/Misc/minMaxReducer.js +2 -2
  104. package/Misc/minMaxReducer.js.map +1 -1
  105. package/Misc/screenshotTools.d.ts +3 -1
  106. package/Misc/screenshotTools.js +5 -2
  107. package/Misc/screenshotTools.js.map +1 -1
  108. package/Particles/Node/Blocks/Emitters/setupSpriteSheetBlock.d.ts +4 -0
  109. package/Particles/Node/Blocks/Emitters/setupSpriteSheetBlock.js +10 -0
  110. package/Particles/Node/Blocks/Emitters/setupSpriteSheetBlock.js.map +1 -1
  111. package/Particles/Node/Blocks/systemBlock.d.ts +4 -0
  112. package/Particles/Node/Blocks/systemBlock.js +32 -1
  113. package/Particles/Node/Blocks/systemBlock.js.map +1 -1
  114. package/Particles/Node/nodeParticleSystemSet.helper.js +65 -46
  115. package/Particles/Node/nodeParticleSystemSet.helper.js.map +1 -1
  116. package/Particles/thinParticleSystem.js +10 -6
  117. package/Particles/thinParticleSystem.js.map +1 -1
  118. package/PostProcesses/RenderPipeline/Pipelines/taaMaterialManager.js +4 -1
  119. package/PostProcesses/RenderPipeline/Pipelines/taaMaterialManager.js.map +1 -1
  120. package/Probes/reflectionProbe.js +9 -2
  121. package/Probes/reflectionProbe.js.map +1 -1
  122. package/Rendering/depthRenderer.js +7 -2
  123. package/Rendering/depthRenderer.js.map +1 -1
  124. package/Shaders/particles.vertex.js +8 -1
  125. package/Shaders/particles.vertex.js.map +1 -1
  126. package/ShadersWGSL/particles.vertex.js +6 -0
  127. package/ShadersWGSL/particles.vertex.js.map +1 -1
  128. package/package.json +1 -1
  129. package/scene.d.ts +10 -0
  130. package/scene.js +30 -5
  131. package/scene.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"systemBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Particles/Node/Blocks/systemBlock.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,sBAAsB,EAA0B,6CAAsC;AAC/F,OAAO,EAAE,aAAa,E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EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;8CAC3G;AAkO7B,aAAa,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC","sourcesContent":["import type { ParticleSystem } from \"core/Particles/particleSystem\";\r\nimport type { NodeParticleConnectionPoint } from \"core/Particles/Node/nodeParticleBlockConnectionPoint\";\r\nimport type { NodeParticleBuildState } from \"core/Particles/Node/nodeParticleBuildState\";\r\n\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"core/Decorators/nodeDecorator\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { Vector2 } from \"core/Maths/math.vector\";\r\nimport { Color4 } from \"core/Maths/math.color\";\r\nimport { BaseParticleSystem } from \"core/Particles/baseParticleSystem\";\r\nimport { NodeParticleBlock } from \"core/Particles/Node/nodeParticleBlock\";\r\nimport { _TriggerSubEmitter } from \"core/Particles/Node/Blocks/Triggers/triggerTools\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"core/Particles/Node/Enums/nodeParticleBlockConnectionPointTypes\";\r\n\r\n/**\r\n * Block used to get a system of particles\r\n */\r\nexport class SystemBlock extends NodeParticleBlock {\r\n private static _IdCounter = 0;\r\n\r\n /**\r\n * Gets or sets the blend mode for the particle system\r\n */\r\n @editableInPropertyPage(\"Blend mode\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { rebuild: true },\r\n embedded: true,\r\n options: [\r\n { label: \"OneOne\", value: BaseParticleSystem.BLENDMODE_ONEONE },\r\n { label: \"Standard\", value: BaseParticleSystem.BLENDMODE_STANDARD },\r\n { label: \"Add\", value: BaseParticleSystem.BLENDMODE_ADD },\r\n { label: \"Multiply\", value: BaseParticleSystem.BLENDMODE_MULTIPLY },\r\n { label: \"MultiplyAdd\", value: BaseParticleSystem.BLENDMODE_MULTIPLYADD },\r\n ],\r\n })\r\n public blendMode = BaseParticleSystem.BLENDMODE_ONEONE;\r\n\r\n /**\r\n * Gets or sets the epsilon value used for comparison\r\n */\r\n @editableInPropertyPage(\"Capacity\", PropertyTypeForEdition.Int, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true }, min: 0, max: 10000 })\r\n public capacity = 1000;\r\n\r\n /**\r\n * Gets or sets the manual emit count\r\n */\r\n @editableInPropertyPage(\"Manual emit count\", PropertyTypeForEdition.Int, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true }, min: -1 })\r\n public manualEmitCount = -1;\r\n\r\n /**\r\n * Gets or sets the target stop duration for the particle system\r\n */\r\n @editableInPropertyPage(\"Delay start(ms)\", PropertyTypeForEdition.Float, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true }, min: 0 })\r\n public startDelay = 0;\r\n\r\n /**\r\n * Gets or sets the target stop duration for the particle system\r\n */\r\n @editableInPropertyPage(\"updateSpeed\", PropertyTypeForEdition.Float, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true }, min: 0, max: 0.1 })\r\n public updateSpeed = 0.0167;\r\n\r\n /**\r\n * Gets or sets the number of pre-warm cycles before rendering the particle system\r\n */\r\n @editableInPropertyPage(\"Pre-warm cycles\", PropertyTypeForEdition.Float, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true }, min: 0 })\r\n public preWarmCycles = 0;\r\n\r\n /**\r\n * Gets or sets the time step multiplier used for pre-warm\r\n */\r\n @editableInPropertyPage(\"Pre-warm step multiplier\", PropertyTypeForEdition.Float, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true }, min: 0 })\r\n public preWarmStepOffset = 0;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the system is billboard based\r\n */\r\n @editableInPropertyPage(\"Is billboard based\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true } })\r\n public isBillboardBased = true;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the system coordinate space is local or global\r\n */\r\n @editableInPropertyPage(\"Is local\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true } })\r\n public isLocal = false;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the system should be disposed when stopped\r\n */\r\n @editableInPropertyPage(\"Dispose on stop\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true } })\r\n public disposeOnStop = false;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the system should not start automatically\r\n */\r\n @editableInPropertyPage(\"Do no start\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true } })\r\n public doNoStart = false;\r\n\r\n /** @internal */\r\n public _internalId = SystemBlock._IdCounter++;\r\n\r\n /**\r\n * Create a new SystemBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this._isSystem = true;\r\n\r\n this.registerInput(\"particle\", NodeParticleBlockConnectionPointTypes.Particle);\r\n this.registerInput(\"emitRate\", NodeParticleBlockConnectionPointTypes.Int, true, 10, 0);\r\n this.registerInput(\"texture\", NodeParticleBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"translationPivot\", NodeParticleBlockConnectionPointTypes.Vector2, true);\r\n this.registerInput(\"textureMask\", NodeParticleBlockConnectionPointTypes.Color4, true);\r\n this.registerInput(\"targetStopDuration\", NodeParticleBlockConnectionPointTypes.Float, true, 0, 0);\r\n this.registerInput(\"onStart\", NodeParticleBlockConnectionPointTypes.System, true);\r\n this.registerInput(\"onEnd\", NodeParticleBlockConnectionPointTypes.System, true);\r\n this.registerOutput(\"system\", NodeParticleBlockConnectionPointTypes.System);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"SystemBlock\";\r\n }\r\n\r\n /**\r\n * Gets the particle input component\r\n */\r\n public get particle(): NodeParticleConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the emitRate input component\r\n */\r\n public get emitRate(): NodeParticleConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the texture input component\r\n */\r\n public get texture(): NodeParticleConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the translationPivot input component\r\n */\r\n public get translationPivot(): NodeParticleConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the textureMask input component\r\n */\r\n public get textureMask(): NodeParticleConnectionPoint {\r\n return this._inputs[4];\r\n }\r\n\r\n /**\r\n * Gets the targetStopDuration input component\r\n */\r\n public get targetStopDuration(): NodeParticleConnectionPoint {\r\n return this._inputs[5];\r\n }\r\n\r\n /**\r\n * Gets the onStart input component\r\n */\r\n public get onStart(): NodeParticleConnectionPoint {\r\n return this._inputs[6];\r\n }\r\n\r\n /**\r\n * Gets the onEnd input component\r\n */\r\n public get onEnd(): NodeParticleConnectionPoint {\r\n return this._inputs[7];\r\n }\r\n\r\n /**\r\n * Gets the system output component\r\n */\r\n public get system(): NodeParticleConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n /**\r\n * Builds the block and return a functional particle system\r\n * @param state defines the building state\r\n * @returns the built particle system\r\n */\r\n public createSystem(state: NodeParticleBuildState): ParticleSystem {\r\n state.capacity = this.capacity;\r\n state.buildId = this._buildId++;\r\n\r\n this.build(state);\r\n\r\n const particleSystem = this.particle.getConnectedValue(state) as ParticleSystem;\r\n particleSystem.particleTexture = this.texture.getConnectedValue(state);\r\n particleSystem.emitRate = this.emitRate.getConnectedValue(state) as number;\r\n particleSystem.manualEmitCount = this.manualEmitCount;\r\n particleSystem.updateSpeed = this.updateSpeed;\r\n particleSystem.preWarmCycles = this.preWarmCycles;\r\n particleSystem.preWarmStepOffset = this.preWarmStepOffset;\r\n particleSystem.blendMode = this.blendMode;\r\n particleSystem.name = this.name;\r\n particleSystem._targetStopDuration = (this.targetStopDuration.getConnectedValue(state) as number) ?? 0;\r\n particleSystem.startDelay = this.startDelay;\r\n particleSystem.isBillboardBased = this.isBillboardBased;\r\n particleSystem.translationPivot = (this.translationPivot.getConnectedValue(state) as Vector2) || Vector2.Zero();\r\n particleSystem.textureMask = this.textureMask.getConnectedValue(state) ?? new Color4(1, 1, 1, 1);\r\n particleSystem.isLocal = this.isLocal;\r\n particleSystem.disposeOnStop = this.disposeOnStop;\r\n\r\n // The emit rate can vary if it is connected to another block like a gradient\r\n particleSystem._calculateEmitRate = () => {\r\n state.systemContext = particleSystem;\r\n return this.emitRate.getConnectedValue(state) as number;\r\n };\r\n\r\n this.system._storedValue = this;\r\n\r\n particleSystem.canStart = () => {\r\n return !this.doNoStart;\r\n };\r\n\r\n particleSystem.onStartedObservable.add((system) => {\r\n // Triggers\r\n const onStartSystem = this.onStart.getConnectedValue(state);\r\n if (onStartSystem) {\r\n system.onStartedObservable.addOnce(() => {\r\n state.systemContext = particleSystem;\r\n const clone = _TriggerSubEmitter(onStartSystem, state.scene, state.emitterPosition!);\r\n\r\n this.onDisposeObservable.addOnce(() => {\r\n // Clean up the cloned system when the original system is disposed\r\n clone.dispose();\r\n });\r\n });\r\n }\r\n\r\n const onEndSystem = this.onEnd.getConnectedValue(state);\r\n if (onEndSystem) {\r\n system.onStoppedObservable.addOnce(() => {\r\n state.systemContext = particleSystem;\r\n const clone = _TriggerSubEmitter(onEndSystem, state.scene, state.emitterPosition!);\r\n\r\n this.onDisposeObservable.addOnce(() => {\r\n // Clean up the cloned system when the original system is disposed\r\n clone.dispose();\r\n });\r\n });\r\n }\r\n });\r\n\r\n this.onDisposeObservable.addOnce(() => {\r\n particleSystem.dispose();\r\n });\r\n\r\n // Return\r\n return particleSystem;\r\n }\r\n\r\n /**\r\n * Serializes the system block\r\n * @returns The serialized object\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.capacity = this.capacity;\r\n serializationObject.manualEmitCount = this.manualEmitCount;\r\n serializationObject.blendMode = this.blendMode;\r\n serializationObject.updateSpeed = this.updateSpeed;\r\n serializationObject.preWarmCycles = this.preWarmCycles;\r\n serializationObject.preWarmStepOffset = this.preWarmStepOffset;\r\n serializationObject.isBillboardBased = this.isBillboardBased;\r\n serializationObject.isLocal = this.isLocal;\r\n serializationObject.disposeOnStop = this.disposeOnStop;\r\n serializationObject.doNoStart = this.doNoStart;\r\n serializationObject.startDelay = this.startDelay;\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Deserializes the system block\r\n * @param serializationObject The serialized system\r\n */\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.capacity = serializationObject.capacity;\r\n this.manualEmitCount = serializationObject.manualEmitCount ?? -1;\r\n this.updateSpeed = serializationObject.updateSpeed ?? 0.0167;\r\n this.preWarmCycles = serializationObject.preWarmCycles ?? 0;\r\n this.preWarmStepOffset = serializationObject.preWarmStepOffset ?? 0;\r\n this.isBillboardBased = serializationObject.isBillboardBased ?? true;\r\n this.isLocal = serializationObject.isLocal ?? false;\r\n this.disposeOnStop = serializationObject.disposeOnStop ?? false;\r\n this.doNoStart = !!serializationObject.doNoStart;\r\n\r\n if (serializationObject.emitRate !== undefined) {\r\n this.emitRate.value = serializationObject.emitRate;\r\n }\r\n\r\n if (serializationObject.blendMode !== undefined) {\r\n this.blendMode = serializationObject.blendMode;\r\n }\r\n\r\n if (serializationObject.startDelay !== undefined) {\r\n this.startDelay = serializationObject.startDelay;\r\n }\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.SystemBlock\", SystemBlock);\r\n"]}
1
+ {"version":3,"file":"systemBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Particles/Node/Blocks/systemBlock.ts"],"names":[],"mappings":";AAKA,OAAO,EAAE,sBAAsB,EAA0B,6CAAsC;AAC/F,OAAO,EAAE,aAAa,EAAE,mCAA4B;AACpD,OAAO,EAAE,OAAO,EAAE,sCAA+B;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,qCAA8B;AACvD,OAAO,EAAE,kBAAkB,EAAE,oCAA0C;AACvE,OAAO,EAAE,iBAAiB,EAAE,gCAA8C;AAC1E,OAAO,EA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AkC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;8CAC3G;AAkQ7B,aAAa,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC","sourcesContent":["import type { ParticleSystem } from \"core/Particles/particleSystem\";\r\nimport type { NodeParticleConnectionPoint } from \"core/Particles/Node/nodeParticleBlockConnectionPoint\";\r\nimport type { NodeParticleBuildState } from \"core/Particles/Node/nodeParticleBuildState\";\r\nimport type { ParticleGradientValueBlock } from \"./particleGradientValueBlock\";\r\n\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"core/Decorators/nodeDecorator\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { Vector2 } from \"core/Maths/math.vector\";\r\nimport { Color3, Color4 } from \"core/Maths/math.color\";\r\nimport { BaseParticleSystem } from \"core/Particles/baseParticleSystem\";\r\nimport { NodeParticleBlock } from \"core/Particles/Node/nodeParticleBlock\";\r\nimport { _TriggerSubEmitter } from \"core/Particles/Node/Blocks/Triggers/triggerTools\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"core/Particles/Node/Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport { ParticleGradientBlock } from \"./particleGradientBlock\";\r\n\r\n/**\r\n * Block used to get a system of particles\r\n */\r\nexport class SystemBlock extends NodeParticleBlock {\r\n private static _IdCounter = 0;\r\n\r\n /**\r\n * Gets or sets the blend mode for the particle system\r\n */\r\n @editableInPropertyPage(\"Blend mode\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { rebuild: true },\r\n embedded: true,\r\n options: [\r\n { label: \"OneOne\", value: BaseParticleSystem.BLENDMODE_ONEONE },\r\n { label: \"Standard\", value: BaseParticleSystem.BLENDMODE_STANDARD },\r\n { label: \"Add\", value: BaseParticleSystem.BLENDMODE_ADD },\r\n { label: \"Multiply\", value: BaseParticleSystem.BLENDMODE_MULTIPLY },\r\n { label: \"MultiplyAdd\", value: BaseParticleSystem.BLENDMODE_MULTIPLYADD },\r\n ],\r\n })\r\n public blendMode = BaseParticleSystem.BLENDMODE_ONEONE;\r\n\r\n /**\r\n * Gets or sets the epsilon value used for comparison\r\n */\r\n @editableInPropertyPage(\"Capacity\", PropertyTypeForEdition.Int, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true }, min: 0, max: 10000 })\r\n public capacity = 1000;\r\n\r\n /**\r\n * Gets or sets the manual emit count\r\n */\r\n @editableInPropertyPage(\"Manual emit count\", PropertyTypeForEdition.Int, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true }, min: -1 })\r\n public manualEmitCount = -1;\r\n\r\n /**\r\n * Gets or sets the target stop duration for the particle system\r\n */\r\n @editableInPropertyPage(\"Delay start(ms)\", PropertyTypeForEdition.Float, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true }, min: 0 })\r\n public startDelay = 0;\r\n\r\n /**\r\n * Gets or sets the target stop duration for the particle system\r\n */\r\n @editableInPropertyPage(\"updateSpeed\", PropertyTypeForEdition.Float, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true }, min: 0, max: 0.1 })\r\n public updateSpeed = 0.0167;\r\n\r\n /**\r\n * Gets or sets the number of pre-warm cycles before rendering the particle system\r\n */\r\n @editableInPropertyPage(\"Pre-warm cycles\", PropertyTypeForEdition.Float, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true }, min: 0 })\r\n public preWarmCycles = 0;\r\n\r\n /**\r\n * Gets or sets the time step multiplier used for pre-warm\r\n */\r\n @editableInPropertyPage(\"Pre-warm step multiplier\", PropertyTypeForEdition.Float, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true }, min: 0 })\r\n public preWarmStepOffset = 0;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the system is billboard based\r\n */\r\n @editableInPropertyPage(\"Is billboard based\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true } })\r\n public isBillboardBased = true;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the system coordinate space is local or global\r\n */\r\n @editableInPropertyPage(\"Is local\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true } })\r\n public isLocal = false;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the system should be disposed when stopped\r\n */\r\n @editableInPropertyPage(\"Dispose on stop\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true } })\r\n public disposeOnStop = false;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the system should not start automatically\r\n */\r\n @editableInPropertyPage(\"Do no start\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true } })\r\n public doNoStart = false;\r\n\r\n /** @internal */\r\n public _internalId = SystemBlock._IdCounter++;\r\n\r\n /**\r\n * Create a new SystemBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this._isSystem = true;\r\n\r\n this.registerInput(\"particle\", NodeParticleBlockConnectionPointTypes.Particle);\r\n this.registerInput(\"emitRate\", NodeParticleBlockConnectionPointTypes.Int, true, 10, 0);\r\n this.registerInput(\"texture\", NodeParticleBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"translationPivot\", NodeParticleBlockConnectionPointTypes.Vector2, true);\r\n this.registerInput(\"textureMask\", NodeParticleBlockConnectionPointTypes.Color4, true);\r\n this.registerInput(\"targetStopDuration\", NodeParticleBlockConnectionPointTypes.Float, true, 0, 0);\r\n this.registerInput(\"onStart\", NodeParticleBlockConnectionPointTypes.System, true);\r\n this.registerInput(\"onEnd\", NodeParticleBlockConnectionPointTypes.System, true);\r\n this.registerInput(\"rampGradient\", NodeParticleBlockConnectionPointTypes.Color4, true);\r\n this.registerOutput(\"system\", NodeParticleBlockConnectionPointTypes.System);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"SystemBlock\";\r\n }\r\n\r\n /**\r\n * Gets the particle input component\r\n */\r\n public get particle(): NodeParticleConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the emitRate input component\r\n */\r\n public get emitRate(): NodeParticleConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the texture input component\r\n */\r\n public get texture(): NodeParticleConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the translationPivot input component\r\n */\r\n public get translationPivot(): NodeParticleConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the textureMask input component\r\n */\r\n public get textureMask(): NodeParticleConnectionPoint {\r\n return this._inputs[4];\r\n }\r\n\r\n /**\r\n * Gets the targetStopDuration input component\r\n */\r\n public get targetStopDuration(): NodeParticleConnectionPoint {\r\n return this._inputs[5];\r\n }\r\n\r\n /**\r\n * Gets the onStart input component\r\n */\r\n public get onStart(): NodeParticleConnectionPoint {\r\n return this._inputs[6];\r\n }\r\n\r\n /**\r\n * Gets the onEnd input component\r\n */\r\n public get onEnd(): NodeParticleConnectionPoint {\r\n return this._inputs[7];\r\n }\r\n\r\n /**\r\n * Gets the rampGradient input component\r\n */\r\n public get rampGradient(): NodeParticleConnectionPoint {\r\n return this._inputs[8];\r\n }\r\n\r\n /**\r\n * Gets the system output component\r\n */\r\n public get system(): NodeParticleConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n /**\r\n * Builds the block and return a functional particle system\r\n * @param state defines the building state\r\n * @returns the built particle system\r\n */\r\n public createSystem(state: NodeParticleBuildState): ParticleSystem {\r\n state.capacity = this.capacity;\r\n state.buildId = this._buildId++;\r\n\r\n this.build(state);\r\n\r\n const particleSystem = this.particle.getConnectedValue(state) as ParticleSystem;\r\n particleSystem.particleTexture = this.texture.getConnectedValue(state);\r\n particleSystem.emitRate = this.emitRate.getConnectedValue(state) as number;\r\n particleSystem.manualEmitCount = this.manualEmitCount;\r\n particleSystem.updateSpeed = this.updateSpeed;\r\n particleSystem.preWarmCycles = this.preWarmCycles;\r\n particleSystem.preWarmStepOffset = this.preWarmStepOffset;\r\n particleSystem.blendMode = this.blendMode;\r\n particleSystem.name = this.name;\r\n particleSystem._targetStopDuration = (this.targetStopDuration.getConnectedValue(state) as number) ?? 0;\r\n particleSystem.startDelay = this.startDelay;\r\n particleSystem.isBillboardBased = this.isBillboardBased;\r\n particleSystem.translationPivot = (this.translationPivot.getConnectedValue(state) as Vector2) || Vector2.Zero();\r\n particleSystem.textureMask = this.textureMask.getConnectedValue(state) ?? new Color4(1, 1, 1, 1);\r\n particleSystem.isLocal = this.isLocal;\r\n particleSystem.disposeOnStop = this.disposeOnStop;\r\n\r\n // The emit rate can vary if it is connected to another block like a gradient\r\n particleSystem._calculateEmitRate = () => {\r\n state.systemContext = particleSystem;\r\n return this.emitRate.getConnectedValue(state) as number;\r\n };\r\n\r\n // Get the ramp gradients\r\n particleSystem.useRampGradients = false;\r\n if (this.rampGradient.isConnected) {\r\n if (this.rampGradient.connectedPoint?.ownerBlock instanceof ParticleGradientBlock) {\r\n // We have a possible gradient, loop through its entries\r\n const gradientInputs = this.rampGradient.connectedPoint?.ownerBlock.inputs;\r\n\r\n // Skip the first input which is the gradient selector, and we only care about the gradient values\r\n for (let i = 1; i < gradientInputs.length; i++) {\r\n if (gradientInputs[i].isConnected) {\r\n const rampEntry = gradientInputs[i].connectedPoint?.ownerBlock as ParticleGradientValueBlock;\r\n const color = rampEntry._inputs[0].getConnectedValue(state) as Color4;\r\n particleSystem.addRampGradient(rampEntry.reference, new Color3(color.r, color.g, color.b));\r\n particleSystem.useRampGradients = true;\r\n }\r\n }\r\n } else {\r\n // We have a single value, add it as ramp gradient\r\n const color = this.rampGradient.getConnectedValue(state) as Color4;\r\n particleSystem.addRampGradient(0, new Color3(color.r, color.g, color.b));\r\n particleSystem.useRampGradients = true;\r\n }\r\n }\r\n\r\n this.system._storedValue = this;\r\n\r\n particleSystem.canStart = () => {\r\n return !this.doNoStart;\r\n };\r\n\r\n particleSystem.onStartedObservable.add((system) => {\r\n // Triggers\r\n const onStartSystem = this.onStart.getConnectedValue(state);\r\n if (onStartSystem) {\r\n system.onStartedObservable.addOnce(() => {\r\n state.systemContext = particleSystem;\r\n const clone = _TriggerSubEmitter(onStartSystem, state.scene, state.emitterPosition!);\r\n\r\n this.onDisposeObservable.addOnce(() => {\r\n // Clean up the cloned system when the original system is disposed\r\n clone.dispose();\r\n });\r\n });\r\n }\r\n\r\n const onEndSystem = this.onEnd.getConnectedValue(state);\r\n if (onEndSystem) {\r\n system.onStoppedObservable.addOnce(() => {\r\n state.systemContext = particleSystem;\r\n const clone = _TriggerSubEmitter(onEndSystem, state.scene, state.emitterPosition!);\r\n\r\n this.onDisposeObservable.addOnce(() => {\r\n // Clean up the cloned system when the original system is disposed\r\n clone.dispose();\r\n });\r\n });\r\n }\r\n });\r\n\r\n this.onDisposeObservable.addOnce(() => {\r\n particleSystem.dispose();\r\n });\r\n\r\n // Return\r\n return particleSystem;\r\n }\r\n\r\n /**\r\n * Serializes the system block\r\n * @returns The serialized object\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.capacity = this.capacity;\r\n serializationObject.manualEmitCount = this.manualEmitCount;\r\n serializationObject.blendMode = this.blendMode;\r\n serializationObject.updateSpeed = this.updateSpeed;\r\n serializationObject.preWarmCycles = this.preWarmCycles;\r\n serializationObject.preWarmStepOffset = this.preWarmStepOffset;\r\n serializationObject.isBillboardBased = this.isBillboardBased;\r\n serializationObject.isLocal = this.isLocal;\r\n serializationObject.disposeOnStop = this.disposeOnStop;\r\n serializationObject.doNoStart = this.doNoStart;\r\n serializationObject.startDelay = this.startDelay;\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Deserializes the system block\r\n * @param serializationObject The serialized system\r\n */\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.capacity = serializationObject.capacity;\r\n this.manualEmitCount = serializationObject.manualEmitCount ?? -1;\r\n this.updateSpeed = serializationObject.updateSpeed ?? 0.0167;\r\n this.preWarmCycles = serializationObject.preWarmCycles ?? 0;\r\n this.preWarmStepOffset = serializationObject.preWarmStepOffset ?? 0;\r\n this.isBillboardBased = serializationObject.isBillboardBased ?? true;\r\n this.isLocal = serializationObject.isLocal ?? false;\r\n this.disposeOnStop = serializationObject.disposeOnStop ?? false;\r\n this.doNoStart = !!serializationObject.doNoStart;\r\n\r\n if (serializationObject.emitRate !== undefined) {\r\n this.emitRate.value = serializationObject.emitRate;\r\n }\r\n\r\n if (serializationObject.blendMode !== undefined) {\r\n this.blendMode = serializationObject.blendMode;\r\n }\r\n\r\n if (serializationObject.startDelay !== undefined) {\r\n this.startDelay = serializationObject.startDelay;\r\n }\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.SystemBlock\", SystemBlock);\r\n"]}
@@ -1,4 +1,6 @@
1
+ import { Color4 } from "../../Maths/math.color.js";
1
2
  import { Vector2, Vector3 } from "../../Maths/math.vector.js";
3
+ import { NodeParticleBlockConnectionPointTypes } from "./Enums/nodeParticleBlockConnectionPointTypes.js";
2
4
  import { NodeParticleSystemSet } from "./nodeParticleSystemSet.js";
3
5
  import { NodeParticleContextualSources } from "./Enums/nodeParticleContextualSources.js";
4
6
  import { NodeParticleSystemSources } from "./Enums/nodeParticleSystemSources.js";
@@ -71,7 +73,7 @@ function _CreateParticleBlockGroup(oldSystem, context) {
71
73
  _CreateParticleAngleBlockGroup(oldSystem).connectTo(createParticleBlock.angle);
72
74
  _CreateParticleColorBlockGroup(oldSystem, context).connectTo(createParticleBlock.color);
73
75
  // Dead color
74
- _CreateAndConnectInput("Dead Color", oldSystem.colorDead, createParticleBlock.colorDead);
76
+ _CreateAndConnectInput("Dead Color", oldSystem.colorDead.clone(), createParticleBlock.colorDead);
75
77
  // Emitter shape
76
78
  createdParticle = _EmitterShapeBlock(createdParticle, oldSystem);
77
79
  // Sprite sheet setup
@@ -88,7 +90,7 @@ function _CreateParticleBlockGroup(oldSystem, context) {
88
90
  */
89
91
  function _CreateParticleLifetimeBlockGroup(oldSystem, context) {
90
92
  if (oldSystem.targetStopDuration && oldSystem._lifeTimeGradients && oldSystem._lifeTimeGradients.length > 0) {
91
- context.timeToStopTimeRatioBlockGroupOutput = _CreateTimeToStopTimeRatioBlockGroup(oldSystem, context);
93
+ context.timeToStopTimeRatioBlockGroupOutput = _CreateTimeToStopTimeRatioBlockGroup(oldSystem.targetStopDuration, context);
92
94
  const gradientBlockGroupOutput = _CreateGradientBlockGroup(context.timeToStopTimeRatioBlockGroupOutput, oldSystem._lifeTimeGradients, ParticleRandomBlockLocks.PerParticle, "Lifetime");
93
95
  return gradientBlockGroupOutput;
94
96
  }
@@ -141,7 +143,7 @@ function _CreateParticleScaleBlockGroup(oldSystem, context) {
141
143
  _CreateAndConnectInput("Max Scale", new Vector2(oldSystem.maxScaleX, oldSystem.maxScaleY), randomScaleBlock.max);
142
144
  if (oldSystem.targetStopDuration && oldSystem._startSizeGradients && oldSystem._startSizeGradients.length > 0) {
143
145
  // Create the start size gradient
144
- context.timeToStopTimeRatioBlockGroupOutput = _CreateTimeToStopTimeRatioBlockGroup(oldSystem, context);
146
+ context.timeToStopTimeRatioBlockGroupOutput = _CreateTimeToStopTimeRatioBlockGroup(oldSystem.targetStopDuration, context);
145
147
  const gradientBlockGroupOutput = _CreateGradientBlockGroup(context.timeToStopTimeRatioBlockGroupOutput, oldSystem._startSizeGradients, ParticleRandomBlockLocks.PerParticle, "Start Size");
146
148
  // Multiply the initial random scale by the start size gradient
147
149
  const multiplyScaleBlock = new ParticleMathBlock("Multiply Scale by Start Size Gradient");
@@ -178,8 +180,8 @@ function _CreateParticleColorBlockGroup(oldSystem, context) {
178
180
  }
179
181
  else {
180
182
  const randomColorBlock = new ParticleRandomBlock("Random color");
181
- _CreateAndConnectInput("Color 1", oldSystem.color1, randomColorBlock.min);
182
- _CreateAndConnectInput("Color 2", oldSystem.color2, randomColorBlock.max);
183
+ _CreateAndConnectInput("Color 1", oldSystem.color1.clone(), randomColorBlock.min);
184
+ _CreateAndConnectInput("Color 2", oldSystem.color2.clone(), randomColorBlock.max);
183
185
  return randomColorBlock.output;
184
186
  }
185
187
  }
@@ -216,10 +218,10 @@ function _EmitterShapeBlock(particle, oldSystem) {
216
218
  const source = emitter;
217
219
  shapeBlock = new BoxShapeBlock("Box Shape");
218
220
  const target = shapeBlock;
219
- _CreateAndConnectInput("Direction 1", source.direction1, target.direction1);
220
- _CreateAndConnectInput("Direction 2", source.direction2, target.direction2);
221
- _CreateAndConnectInput("Min Emit Box", source.minEmitBox, target.minEmitBox);
222
- _CreateAndConnectInput("Max Emit Box", source.maxEmitBox, target.maxEmitBox);
221
+ _CreateAndConnectInput("Direction 1", source.direction1.clone(), target.direction1);
222
+ _CreateAndConnectInput("Direction 2", source.direction2.clone(), target.direction2);
223
+ _CreateAndConnectInput("Min Emit Box", source.minEmitBox.clone(), target.minEmitBox);
224
+ _CreateAndConnectInput("Max Emit Box", source.maxEmitBox.clone(), target.maxEmitBox);
223
225
  break;
224
226
  }
225
227
  case "ConeParticleEmitter": {
@@ -243,8 +245,8 @@ function _EmitterShapeBlock(particle, oldSystem) {
243
245
  _CreateAndConnectInput("Angle", source.angle, target.angle);
244
246
  _CreateAndConnectInput("Radius Range", source.radiusRange, target.radiusRange);
245
247
  _CreateAndConnectInput("Height Range", source.heightRange, target.heightRange);
246
- _CreateAndConnectInput("Direction 1", source.direction1, target.direction1);
247
- _CreateAndConnectInput("Direction 2", source.direction2, target.direction2);
248
+ _CreateAndConnectInput("Direction 1", source.direction1.clone(), target.direction1);
249
+ _CreateAndConnectInput("Direction 2", source.direction2.clone(), target.direction2);
248
250
  break;
249
251
  }
250
252
  case "CustomParticleEmitter": {
@@ -273,8 +275,8 @@ function _EmitterShapeBlock(particle, oldSystem) {
273
275
  _CreateAndConnectInput("Height", source.height, target.height);
274
276
  _CreateAndConnectInput("Radius", source.radius, target.radius);
275
277
  _CreateAndConnectInput("Radius Range", source.radiusRange, target.radiusRange);
276
- _CreateAndConnectInput("Direction 1", source.direction1, target.direction1);
277
- _CreateAndConnectInput("Direction 2", source.direction2, target.direction2);
278
+ _CreateAndConnectInput("Direction 1", source.direction1.clone(), target.direction1);
279
+ _CreateAndConnectInput("Direction 2", source.direction2.clone(), target.direction2);
278
280
  break;
279
281
  }
280
282
  case "HemisphericParticleEmitter": {
@@ -292,8 +294,8 @@ function _EmitterShapeBlock(particle, oldSystem) {
292
294
  shapeBlock = new MeshShapeBlock("Mesh Shape");
293
295
  const target = shapeBlock;
294
296
  target.useMeshNormalsForDirection = source.useMeshNormalsForDirection;
295
- _CreateAndConnectInput("Direction 1", source.direction1, target.direction1);
296
- _CreateAndConnectInput("Direction 2", source.direction2, target.direction2);
297
+ _CreateAndConnectInput("Direction 1", source.direction1.clone(), target.direction1);
298
+ _CreateAndConnectInput("Direction 2", source.direction2.clone(), target.direction2);
297
299
  target.mesh = source.mesh;
298
300
  break;
299
301
  }
@@ -301,8 +303,8 @@ function _EmitterShapeBlock(particle, oldSystem) {
301
303
  const source = emitter;
302
304
  shapeBlock = new PointShapeBlock("Point Shape");
303
305
  const target = shapeBlock;
304
- _CreateAndConnectInput("Direction 1", source.direction1, target.direction1);
305
- _CreateAndConnectInput("Direction 2", source.direction2, target.direction2);
306
+ _CreateAndConnectInput("Direction 1", source.direction1.clone(), target.direction1);
307
+ _CreateAndConnectInput("Direction 2", source.direction2.clone(), target.direction2);
306
308
  break;
307
309
  }
308
310
  case "SphereParticleEmitter": {
@@ -320,8 +322,8 @@ function _EmitterShapeBlock(particle, oldSystem) {
320
322
  const target = shapeBlock;
321
323
  _CreateAndConnectInput("Radius", source.radius, target.radius);
322
324
  _CreateAndConnectInput("Radius Range", source.radiusRange, target.radiusRange);
323
- _CreateAndConnectInput("Direction1", source.direction1, target.direction1);
324
- _CreateAndConnectInput("Direction2", source.direction2, target.direction2);
325
+ _CreateAndConnectInput("Direction1", source.direction1.clone(), target.direction1);
326
+ _CreateAndConnectInput("Direction2", source.direction2.clone(), target.direction2);
325
327
  break;
326
328
  }
327
329
  }
@@ -338,6 +340,7 @@ function _SpriteSheetBlock(particle, oldSystem) {
338
340
  spriteSheetBlock.end = oldSystem.endSpriteCellID;
339
341
  spriteSheetBlock.width = oldSystem.spriteCellWidth;
340
342
  spriteSheetBlock.height = oldSystem.spriteCellHeight;
343
+ spriteSheetBlock.spriteCellChangeSpeed = oldSystem.spriteCellChangeSpeed;
341
344
  spriteSheetBlock.loop = oldSystem.spriteCellLoop;
342
345
  spriteSheetBlock.randomStartCell = oldSystem.spriteRandomStartCell;
343
346
  return spriteSheetBlock.output;
@@ -355,7 +358,7 @@ function _SpriteSheetBlock(particle, oldSystem) {
355
358
  function _UpdateParticleBlockGroup(inputParticle, oldSystem, context) {
356
359
  let updatedParticle = inputParticle;
357
360
  updatedParticle = _UpdateParticleColorBlockGroup(updatedParticle, oldSystem._colorGradients, context);
358
- updatedParticle = _UpdateParticleAngleBlockGroup(updatedParticle, oldSystem, context);
361
+ updatedParticle = _UpdateParticleAngleBlockGroup(updatedParticle, oldSystem._angularSpeedGradients, oldSystem.minAngularSpeed, oldSystem.maxAngularSpeed, context);
359
362
  if (oldSystem._velocityGradients && oldSystem._velocityGradients.length > 0) {
360
363
  context.scaledDirection = _UpdateParticleVelocityGradientBlockGroup(oldSystem._velocityGradients, context);
361
364
  }
@@ -367,7 +370,7 @@ function _UpdateParticleBlockGroup(inputParticle, oldSystem, context) {
367
370
  updatedParticle = _UpdateParticleVelocityLimitGradientBlockGroup(updatedParticle, oldSystem._limitVelocityGradients, oldSystem.limitVelocityDamping, context);
368
371
  }
369
372
  if (oldSystem.noiseTexture && oldSystem.noiseStrength) {
370
- updatedParticle = _UpdateParticleNoiseBlockGroup(updatedParticle, oldSystem.noiseTexture, oldSystem.noiseStrength);
373
+ updatedParticle = _UpdateParticleNoiseBlockGroup(updatedParticle, oldSystem.noiseTexture.clone(), oldSystem.noiseStrength.clone());
371
374
  }
372
375
  if (oldSystem._sizeGradients && oldSystem._sizeGradients.length > 0) {
373
376
  updatedParticle = _UpdateParticleSizeGradientBlockGroup(updatedParticle, oldSystem._sizeGradients, context);
@@ -410,19 +413,21 @@ function _UpdateParticleColorBlockGroup(inputParticle, colorGradients, context)
410
413
  /**
411
414
  * Creates the group of blocks that represent the particle angle update
412
415
  * @param inputParticle The input particle to update
413
- * @param oldSystem The old particle system to convert
416
+ * @param angularSpeedGradients The angular speed gradients (if any)
417
+ * @param minAngularSpeed The minimum angular speed
418
+ * @param maxAngularSpeed The maximum angular speed
414
419
  * @param context The context of the current conversion
415
420
  * @returns The output of the group of blocks that represent the particle color update
416
421
  */
417
- function _UpdateParticleAngleBlockGroup(inputParticle, oldSystem, context) {
422
+ function _UpdateParticleAngleBlockGroup(inputParticle, angularSpeedGradients, minAngularSpeed, maxAngularSpeed, context) {
418
423
  // We will try to use gradients if they exist
419
424
  // If not, we will try to use min/max angular speed
420
425
  let angularSpeedCalculation = null;
421
- if (oldSystem._angularSpeedGradients && oldSystem._angularSpeedGradients.length > 0) {
422
- angularSpeedCalculation = _UpdateParticleAngularSpeedGradientBlockGroup(oldSystem._angularSpeedGradients, context);
426
+ if (angularSpeedGradients && angularSpeedGradients.length > 0) {
427
+ angularSpeedCalculation = _UpdateParticleAngularSpeedGradientBlockGroup(angularSpeedGradients, context);
423
428
  }
424
- else if (oldSystem.minAngularSpeed !== 0 || oldSystem.maxAngularSpeed !== 0) {
425
- angularSpeedCalculation = _UpdateParticleAngularSpeedBlockGroup(oldSystem.minAngularSpeed, oldSystem.maxAngularSpeed);
429
+ else if (minAngularSpeed !== 0 || maxAngularSpeed !== 0) {
430
+ angularSpeedCalculation = _UpdateParticleAngularSpeedBlockGroup(minAngularSpeed, maxAngularSpeed);
426
431
  }
427
432
  // If we have an angular speed calculation, then update the angle
428
433
  if (angularSpeedCalculation) {
@@ -663,8 +668,8 @@ function _ClampUpdateColorAlpha(colorCalculationOutput) {
663
668
  // ------------- SYSTEM FUNCTIONS -------------
664
669
  function _SystemBlockGroup(updateParticleOutput, oldSystem, context) {
665
670
  const newSystem = new SystemBlock(oldSystem.name);
666
- newSystem.translationPivot.value = oldSystem.translationPivot;
667
- newSystem.textureMask.value = oldSystem.textureMask;
671
+ newSystem.translationPivot.value = oldSystem.translationPivot.clone();
672
+ newSystem.textureMask.value = oldSystem.textureMask.clone();
668
673
  newSystem.manualEmitCount = oldSystem.manualEmitCount;
669
674
  newSystem.blendMode = oldSystem.blendMode;
670
675
  newSystem.capacity = oldSystem.getCapacity();
@@ -675,20 +680,23 @@ function _SystemBlockGroup(updateParticleOutput, oldSystem, context) {
675
680
  newSystem.isBillboardBased = oldSystem.isBillboardBased;
676
681
  newSystem.isLocal = oldSystem.isLocal;
677
682
  newSystem.disposeOnStop = oldSystem.disposeOnStop;
678
- _SystemEmitRateValue(oldSystem, newSystem, context);
683
+ _SystemEmitRateValue(oldSystem.getEmitRateGradients(), oldSystem.targetStopDuration, oldSystem.emitRate, newSystem, context);
679
684
  const texture = oldSystem.particleTexture;
680
685
  if (texture) {
681
686
  _CreateTextureBlock(texture).connectTo(newSystem.texture);
682
687
  }
683
- _SystemTargetStopDuration(oldSystem, newSystem, context);
688
+ _SystemTargetStopDuration(oldSystem.targetStopDuration, newSystem, context);
689
+ const rampGradients = oldSystem.getRampGradients();
690
+ if (rampGradients && rampGradients.length > 0) {
691
+ _SystemRampGradientsBlockGroup(rampGradients, newSystem);
692
+ }
684
693
  updateParticleOutput.connectTo(newSystem.particle);
685
694
  return newSystem;
686
695
  }
687
- function _SystemEmitRateValue(oldSystem, newSystem, context) {
688
- const emitGradients = oldSystem.getEmitRateGradients();
689
- if (emitGradients && emitGradients.length > 0 && oldSystem.targetStopDuration > 0) {
696
+ function _SystemEmitRateValue(emitGradients, targetStopDuration, emitRate, newSystem, context) {
697
+ if (emitGradients && emitGradients.length > 0 && targetStopDuration > 0) {
690
698
  // Create the emit gradients
691
- context.timeToStopTimeRatioBlockGroupOutput = _CreateTimeToStopTimeRatioBlockGroup(oldSystem, context);
699
+ context.timeToStopTimeRatioBlockGroupOutput = _CreateTimeToStopTimeRatioBlockGroup(targetStopDuration, context);
692
700
  const gradientValue = _CreateGradientBlockGroup(context.timeToStopTimeRatioBlockGroupOutput, emitGradients, ParticleRandomBlockLocks.PerSystem, "Emit Rate");
693
701
  // Round the value to an int
694
702
  const roundBlock = new ParticleFloatToIntBlock("Round to Int");
@@ -697,10 +705,10 @@ function _SystemEmitRateValue(oldSystem, newSystem, context) {
697
705
  roundBlock.output.connectTo(newSystem.emitRate);
698
706
  }
699
707
  else {
700
- newSystem.emitRate.value = oldSystem.emitRate;
708
+ newSystem.emitRate.value = emitRate;
701
709
  }
702
710
  }
703
- function _SystemTargetStopDuration(oldSystem, newSystem, context) {
711
+ function _SystemTargetStopDuration(targetStopDuration, newSystem, context) {
704
712
  // If something else uses the target stop duration (like a gradient),
705
713
  // then the block is already created and stored in the context
706
714
  if (context.targetStopDurationBlockOutput) {
@@ -708,8 +716,19 @@ function _SystemTargetStopDuration(oldSystem, newSystem, context) {
708
716
  }
709
717
  else {
710
718
  // If no one used it, do not create a block just set the value
711
- newSystem.targetStopDuration.value = oldSystem.targetStopDuration;
719
+ newSystem.targetStopDuration.value = targetStopDuration;
720
+ }
721
+ }
722
+ function _SystemRampGradientsBlockGroup(rampGradients, newSystem) {
723
+ const gradientBlock = new ParticleGradientBlock("Ramp Gradient Block");
724
+ for (let i = 0; i < rampGradients.length; i++) {
725
+ const rampGradient = rampGradients[i];
726
+ const gradientValueBlock = new ParticleGradientValueBlock(`Ramp Gradient ${i}`);
727
+ gradientValueBlock.reference = rampGradient.gradient;
728
+ _CreateAndConnectInput(`Color ${i}`, new Color4(rampGradient.color.r, rampGradient.color.g, rampGradient.color.b), gradientValueBlock.value, NodeParticleBlockConnectionPointTypes.Color4);
729
+ gradientValueBlock.output.connectTo(gradientBlock.inputs[i + 1]);
712
730
  }
731
+ gradientBlock.output.connectTo(newSystem.rampGradient);
713
732
  }
714
733
  // ------------- UTILITY FUNCTIONS -------------
715
734
  function _CreateDeltaModifiedInput(name, value) {
@@ -742,18 +761,18 @@ function _CreateAndConnectSystemSource(systemBlockName, systemSource, targetToCo
742
761
  /**
743
762
  * Creates the target stop duration input block, as it can be shared in multiple places
744
763
  * This block is stored in the context so the same block is shared in the graph
745
- * @param oldSystem The old particle system to convert
764
+ * @param targetStopDuration The target stop duration value
746
765
  * @param context The context of the current conversion
747
766
  * @returns
748
767
  */
749
- function _CreateTargetStopDurationInputBlock(oldSystem, context) {
768
+ function _CreateTargetStopDurationInputBlock(targetStopDuration, context) {
750
769
  // If we have already created the target stop duration input block, return it
751
770
  if (context.targetStopDurationBlockOutput) {
752
771
  return context.targetStopDurationBlockOutput;
753
772
  }
754
773
  // Create the target stop duration input block if not already created
755
774
  const targetStopDurationInputBlock = new ParticleInputBlock("Target Stop Duration");
756
- targetStopDurationInputBlock.value = oldSystem.targetStopDuration;
775
+ targetStopDurationInputBlock.value = targetStopDuration;
757
776
  // Save the output in our context to avoid regenerating it again
758
777
  context.targetStopDurationBlockOutput = targetStopDurationInputBlock.output;
759
778
  return context.targetStopDurationBlockOutput;
@@ -762,16 +781,16 @@ function _CreateTargetStopDurationInputBlock(oldSystem, context) {
762
781
  * Create a group of blocks that calculates the ratio between the actual frame and the target stop duration, clamped between 0 and 1.
763
782
  * This is used to simulate the behavior of the old particle system where several particle gradient values are affected by the target stop duration.
764
783
  * This block group is stored in the context so the same group is shared in the graph
765
- * @param oldSystem The old particle system to convert
784
+ * @param targetStopDuration The target stop duration value
766
785
  * @param context The context of the current conversion
767
786
  * @returns The ratio block output connection point
768
787
  */
769
- function _CreateTimeToStopTimeRatioBlockGroup(oldSystem, context) {
788
+ function _CreateTimeToStopTimeRatioBlockGroup(targetStopDuration, context) {
770
789
  // If we have already generated this group, return it
771
790
  if (context.timeToStopTimeRatioBlockGroupOutput) {
772
791
  return context.timeToStopTimeRatioBlockGroupOutput;
773
792
  }
774
- context.targetStopDurationBlockOutput = _CreateTargetStopDurationInputBlock(oldSystem, context);
793
+ context.targetStopDurationBlockOutput = _CreateTargetStopDurationInputBlock(targetStopDuration, context);
775
794
  // Find the ratio between the actual frame and the target stop duration
776
795
  const ratio = new ParticleMathBlock("Frame/Stop Ratio");
777
796
  ratio.operation = ParticleMathBlockOperations.Divide;
@@ -846,8 +865,8 @@ function _CreateGradientBlockGroup(gradientSelector, gradientValues, randomLockM
846
865
  function _CreateGradientValueBlockGroup(gradientStep, randomLockMode, prefix, index) {
847
866
  const gradientValueBlock = new ParticleGradientValueBlock(prefix + " Gradient Value " + index);
848
867
  gradientValueBlock.reference = gradientStep.gradient;
849
- const value1 = gradientStep.factor1 ?? gradientStep.color1;
850
- const value2 = gradientStep.factor2 ?? gradientStep.color2;
868
+ const value1 = gradientStep.factor1 ?? gradientStep.color1.clone();
869
+ const value2 = gradientStep.factor2 ?? gradientStep.color2?.clone();
851
870
  if (value2 !== undefined) {
852
871
  // Create a random between value1 and value2
853
872
  const randomBlock = new ParticleRandomBlock("Random Value " + index);