Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/dev/core/src/Particles/gpuParticleSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1808,9 +1808,10 @@ export class GPUParticleSystem extends BaseParticleSystem implements IDisposable
* Clones the particle system.
* @param name The name of the cloned object
* @param newEmitter The new emitter to use
* @param cloneTexture Also clone the textures if true
* @returns the cloned particle system
*/
public clone(name: string, newEmitter: any): GPUParticleSystem {
public clone(name: string, newEmitter: any, cloneTexture = false): GPUParticleSystem {
const custom = { ...this._customWrappers };
let program: any = null;
const engine = this._engine as any;
Expand All @@ -1831,7 +1832,7 @@ export class GPUParticleSystem extends BaseParticleSystem implements IDisposable
}
}

const serialization = this.serialize();
const serialization = this.serialize(cloneTexture);
const result = GPUParticleSystem.Parse(serialization, this._scene || this._engine, this._rootUrl);
result.name = name;
result.customShader = program;
Expand Down
5 changes: 3 additions & 2 deletions packages/dev/core/src/Particles/particleSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2232,9 +2232,10 @@ export class ParticleSystem extends BaseParticleSystem implements IDisposable, I
* Clones the particle system.
* @param name The name of the cloned object
* @param newEmitter The new emitter to use
* @param cloneTexture Also clone the textures if true
* @returns the cloned particle system
*/
public clone(name: string, newEmitter: any): ParticleSystem {
public clone(name: string, newEmitter: any, cloneTexture = false): ParticleSystem {
const custom = { ...this._customWrappers };
let program: any = null;
const engine = this._engine as Engine;
Expand All @@ -2251,7 +2252,7 @@ export class ParticleSystem extends BaseParticleSystem implements IDisposable, I
}
}

const serialization = this.serialize();
const serialization = this.serialize(cloneTexture);
const result = ParticleSystem.Parse(serialization, this._scene || this._engine, this._rootUrl);
result.name = name;
result.customShader = program;
Expand Down