Alchemist0823 / three.quarks

Three.quarks is a general purpose particle system / VFX engine for three.js
https://quarks.art
480 stars 22 forks source link

Add a way to stop and start an emitter, hiding all current visibility and removing any emitting particles #85

Closed johnnyrainbow closed 1 month ago

johnnyrainbow commented 2 months ago

Pause does not quite do what I want as it suspends the current particles in air and doesn't hide the emitter. Setting the visibility of the emitter didn't seem to quite work either, as the particles remained

Alchemist0823 commented 2 months ago

Have you tried restart() function on particleSystem

johnnyrainbow commented 2 months ago

Correct me if I'm wrong but restarting will reset the time, and if the particle system is set as looping:true it will begin emitting again.

At the moment it seems that restarting, and then pausing may work but I seem to have a performance degradation even though its now not emitting (the degradation seems to not be draw call or triangle related but cpu related - will try and debug more though). At this time, completely deleting the emitter and creating a new one seems like the way to go

Alchemist0823 commented 2 months ago

stop() function hides all current visibility and removes any emitting particles, I don't know if that works for you.

Do you know the performance degradation happens at which stage?

Alchemist0823 commented 1 month ago

Just realized the stop function doesn't exist. I added stop function in this commit 509019b34eacb880bd8b8a8f2f2cd7eb9854a993