|
@@ -11,6 +11,7 @@ import { MaterialHelper } from "../Materials/materialHelper";
|
|
|
import { Effect } from "../Materials/effect";
|
|
|
import { ImageProcessingConfiguration } from "../Materials/imageProcessingConfiguration";
|
|
|
import { Texture } from "../Materials/Textures/texture";
|
|
|
+import { InternalTexture } from "../Materials/Textures/internalTexture"
|
|
|
import { RawTexture } from "../Materials/Textures/rawTexture";
|
|
|
import { ProceduralTexture } from "../Materials/Textures/Procedurals/proceduralTexture";
|
|
|
import { EngineStore } from "../Engines/engineStore";
|
|
@@ -1927,7 +1928,16 @@ export class ParticleSystem extends BaseParticleSystem implements IDisposable, I
|
|
|
result.noiseTexture = this.noiseTexture;
|
|
|
result.emitter = newEmitter;
|
|
|
if (this.particleTexture) {
|
|
|
- result.particleTexture = new Texture(this.particleTexture.url, this._scene);
|
|
|
+ if (this.particleTexture.getInternalTexture().dataSource === InternalTexture.DATASOURCE_DYNAMIC) {
|
|
|
+ // clone
|
|
|
+ result.particleTexture = this.particleTexture.clone();
|
|
|
+ // copy underlying image data
|
|
|
+ const ctx = result.particleTexture.getContext();
|
|
|
+ ctx.drawImage(this.particleTexture.getContext().canvas, 0, 0);
|
|
|
+ result.particleTexture.update();
|
|
|
+ } else {
|
|
|
+ result.particleTexture = new Texture(this.particleTexture.url, this._scene);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// Clone gradients
|