# Multiple ParticleSystems and createEffectForParticles

**URL:** <https://forum.babylonjs.com/t/multiple-particlesystems-and-createeffectforparticles/35187>\
**Category:** Questions\
**Created:** [October 27, 2022, 5:43pm UTC](https://forum.babylonjs.com/t/multiple-particlesystems-and-createeffectforparticles/35187 "2022-10-27T17:43:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BrianK](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/briank/32/18020_2.png) [@BrianK](https://forum.babylonjs.com/u/BrianK)\
**Post date:** [October 27, 2022, 5:43pm UTC](https://forum.babylonjs.com/t/multiple-particlesystems-and-createeffectforparticles/35187/1 "2022-10-27T17:43:21Z")

</div>

I’m using `createEffectForParticles` to provide a custom fragment shader to render particles.

I’m also creating multiple ParticleSystems.

Should I only call createEffectForParticles one time, and reuse the Effect across all ParticleSystems that need it? Or is it more efficient to create an effect for each ParticleSystem.

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [October 27, 2022, 8:48pm UTC](https://forum.babylonjs.com/t/multiple-particlesystems-and-createeffectforparticles/35187/2 "2022-10-27T20:48:39Z")

</div>

To be fully shareadble they would need almost the same conditions resulting in the same #define

I would suggest to try it and see if that works ?

---

<div class="post-metadata">

**Author:** ![BrianK](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/briank/32/18020_2.png) [@BrianK](https://forum.babylonjs.com/u/BrianK)\
**Post date:** [October 27, 2022, 10:45pm UTC](https://forum.babylonjs.com/t/multiple-particlesystems-and-createeffectforparticles/35187/4 "2022-10-27T22:45:09Z")

</div>

Yeah, it works to share the same effect for my case. Creating new instances of the effect for each ParticleSystem also works. Perf wise it sounds like a bit of a wash? More dependent on the actual use-case.

In terms of using the same effect for multiple systems, take care where uniforms are set. I was originally using the Effect’s onBind to set uniforms, but the bind only happens for the first ParticleSystem using the effect and not the other two. So I ended up using ParticleSystem onBeforeDrawParticleObservable to set the effect uniforms instead.
