GPU particle systems and targetStopDuration

Hey Bjs team!

I noticed 2 issues recently using GPU particle systems when setting “targetStopDuration”:

  • The PS always returns “true” when calling ps.isStarted() even when the stop duration is reached and no particle drawn anymore. Maybe this is expected but this behavior is different from classic ParticleSystem implementation
  • Once stop duration is reached, impossible to start the system again. The only ways is to set _actualFrame = 0. This behaviour is also from the one implemented in ParticleSystem class.

Here is a playground: https://playground.babylonjs.com/#1ASENS#417

  • The first log attests the partcile system is started.
  • The second one says it’s started but “_stopped” is equal to “true”. Also, I try to start again the PS and nothing happens.

As it’s different from the ParticleSystem class implementation I report it as a bug. Don’t hesitate if I’m wrong :slight_smile:

Again thanks a lot for you help :heart:

I think it’s because of:

Particles are not removed from a GPU particle system, they are just skipped when they are not alive anymore, so isStarted for a GPU PS always stays true after it has been started.

This one is probably a bug, as this._actualFrame = 0; is done in the start function of ThinParticleSystem but not in GPUParticleSystem:

Thanks for reporting!

(note that you can do particleSystem.isStopped() instead of particleSystem["_stopped"])

1 Like

I understand, thanks a lot!!
And in the editor I’ll test “isStopped()” instead of “isStarted()” for both as it looks like it works the same.

Thanks for your fix! :heart: