|
@@ -11,6 +11,7 @@ import { MaterialHelper } from "../Materials/materialHelper";
|
|
import { Effect } from "../Materials/effect";
|
|
import { Effect } from "../Materials/effect";
|
|
import { ImageProcessingConfiguration } from "../Materials/imageProcessingConfiguration";
|
|
import { ImageProcessingConfiguration } from "../Materials/imageProcessingConfiguration";
|
|
import { Texture } from "../Materials/Textures/texture";
|
|
import { Texture } from "../Materials/Textures/texture";
|
|
|
|
+import { DynamicTexture } from "../Materials/Textures/dynamicTexture";
|
|
import { RawTexture } from "../Materials/Textures/rawTexture";
|
|
import { RawTexture } from "../Materials/Textures/rawTexture";
|
|
import { ProceduralTexture } from "../Materials/Textures/Procedurals/proceduralTexture";
|
|
import { ProceduralTexture } from "../Materials/Textures/Procedurals/proceduralTexture";
|
|
import { EngineStore } from "../Engines/engineStore";
|
|
import { EngineStore } from "../Engines/engineStore";
|
|
@@ -1927,7 +1928,14 @@ export class ParticleSystem extends BaseParticleSystem implements IDisposable, I
|
|
result.noiseTexture = this.noiseTexture;
|
|
result.noiseTexture = this.noiseTexture;
|
|
result.emitter = newEmitter;
|
|
result.emitter = newEmitter;
|
|
if (this.particleTexture) {
|
|
if (this.particleTexture) {
|
|
- result.particleTexture = new Texture(this.particleTexture.url, this._scene);
|
|
|
|
|
|
+ if (this.particleTexture instanceof DynamicTexture) {
|
|
|
|
+ result.particleTexture = this.particleTexture.clone();
|
|
|
|
+ const ctx = (<unknown>result.particleTexture as DynamicTexture).getContext();
|
|
|
|
+ ctx.drawImage((<unknown>this.particleTexture as DynamicTexture).getContext().canvas, 0, 0);
|
|
|
|
+ (<unknown>result.particleTexture as DynamicTexture).update();
|
|
|
|
+ } else {
|
|
|
|
+ result.particleTexture = new Texture(this.particleTexture.url, this._scene);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
// Clone gradients
|
|
// Clone gradients
|