# Textures created by particle system

**URL:** <https://forum.babylonjs.com/t/textures-created-by-particle-system/9260>\
**Category:** Questions\
**Tags:** particles\
**Created:** [March 16, 2020, 6:57pm UTC](https://forum.babylonjs.com/t/textures-created-by-particle-system/9260 "2020-03-16T18:57:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeroen](https://avatars.discourse-cdn.com/v4/letter/j/bbe5ce/32.png) [@Jeroen](https://forum.babylonjs.com/u/Jeroen)\
**Post date:** [March 16, 2020, 6:57pm UTC](https://forum.babylonjs.com/t/textures-created-by-particle-system/9260/1 "2020-03-16T18:57:56Z")

</div>

Hi there,

I’m using the particle system to create some fancy explosions in my RTS game.

I noticed that each time I create a particle system, Babylon creates two textures.

![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/f/fc53002c0e2f98fc2f7a89fee5f0d2430d4e6f93.png)

It’s the “no name” and the flare textures.

I create the particle system using:

> ParticleHelper.CreateDefault(position, 50, this.scene, false);

As there will be a LOT of explosions during the game, I’d like to get rid of those extra textures. 🙂

What’s the best way to accomplish that?

Cheers,  
Jeroen

---

<div class="post-metadata">

**Author:** ![PirateJC](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/piratejc/32/1003_2.png) [@PirateJC](https://forum.babylonjs.com/u/PirateJC)\
**Post date:** [March 16, 2020, 7:16pm UTC](https://forum.babylonjs.com/t/textures-created-by-particle-system/9260/2 "2020-03-16T19:16:33Z")

</div>

Best way to obliterate something out of your scene is to use the “.dispose()” method.

Perhaps in your example, after the particles die, you could do a quick search for those texture names and then dispose of the textures?

---

<div class="post-metadata">

**Author:** ![Wingnut](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/wingnut/32/53_2.png) [@Wingnut](https://forum.babylonjs.com/u/Wingnut)\
**Post date:** [March 17, 2020, 12:23am UTC](https://forum.babylonjs.com/t/textures-created-by-particle-system/9260/3 "2020-03-17T00:23:19Z")

</div>

Hi guys. Jeroen… just in case useful, we have _manualEmitCount_ (used instead-of _emitRate_) that is helpful to make multiple explosions… using only one particleSystem.

Here’s an example: [https://playground.babylonjs.com/#36UHXZ#48](https://playground.babylonjs.com/#36UHXZ#48)

See line 91 emitRate? Disabled. 🙂

See line 113? Set particleSystem _emitter_ to be a vector3 (cool, huh? It can also be a mesh.)

Now let’s look at the renderLoop… lines 121 and 122… I put the vector3 _emitter_ into an “X-Z orbit animation”… right? In your game… you would have a function… makeExplosion(where). I’m just using an orbiting _where_ for an example.

Now onto lines 123-126… every 50th renderLoop… I set the _.manualEmitCount_ = 1000; POOM! Explosion of 1000 particles… and then particleSystem goes (back-) to sleep… awaiting the NEXT setting of _.manualEmitCount_ to ANY value greater than 0.

AND, you can change ANY particleSystem parameters… just-before setting .manualEmitCount explosions (within your explosion-maker function, for example). Soooooo… a fancy SINGLE PS explosion-maker function… might be like this…

var makeExplosion = function(whichPS, whereEmit, size, color, direction, power, etc, etc) { massive code }

Your custom make-explosion function… can make all sorts of adjustments to ALL the properties on whichPS… and then LAST THING in the function… set the .manualEmitCount and return. POOM.

Jeroen’s Variable Particle Explosion Generator v1.0. “Getting the most… from a single particleSystem” 🙂

Just an idea. Might help your issue, might not. 🙂 Here’s [a search for more playgrounds that use .manualEmitCount](https://doc.babylonjs.com/playground/?code=manualEmitCount).

Ignore the customUpdater in the #48 playground - used to make `sparticles` (sparkly particles). Demented Wingnut experiments of old. 🙂

---

<div class="post-metadata">

**Author:** ![Jeroen](https://avatars.discourse-cdn.com/v4/letter/j/bbe5ce/32.png) [@Jeroen](https://forum.babylonjs.com/u/Jeroen)\
**Post date:** [March 17, 2020, 6:14pm UTC](https://forum.babylonjs.com/t/textures-created-by-particle-system/9260/4 "2020-03-17T18:14:59Z")

</div>

Thanks guys, that’s very helpful!

Wingnut: that is, indeed, what I am aiming for: the ability to generate multiple sorts of explosions using a single particle emiter. I’ll be sure to check out your examples - thanks a bunch!

In case anyone is interested, here’s a little video on Linkedin showing the first little test with explosions:

> **[Jeroen C Commandeur posted on LinkedIn](https://www.linkedin.com/feed/update/urn:li:activity:6644981973410553857/)**
>
> Well, here's another update on my #rts gamedevelopment adventure.
> 
> So last week I showed some units riding along near a building. My brother (Michiel Commandeur...
