Open CrazyFlasher opened 4 years ago
Frame drops, such as when moving the window, create gaps in created particle elements although the existing particles move appropriately based on time. Is there a simple workaround to force creation of particles during the elapsed time to prevent unwanted gaps in effects in this scenario?
@Dimensionscape you can try to jump in time by some step (say, 1 second) in a loop. This will be inefficient, especially when desired time to pass is much larger than step, but it should "fix" gaps.
But what exactly you are trying to achieve?
I just want to preserve the fidelity of particle effects through frame drops. I have a game using a snow particle but if the user drags the window around, the main thread gets block. When frame rate comes back theres a giant gap in particles depending on how long its been and breaks the illusion. It's not a big issue, but does effect quality of production.
I prevented the issue in my case by adding
if (dt > .5) return false;
after prevTime is set in the update..... its not really ideal but it prevents any gaps in the event the main thread gets blocked for any amount of time. What do you think might be a long term solution for this?
@Dimensionscape I think it is the optimal for your case, because it will prevent visual lags, and at the same time it is super fast solution (comparing to "fair" solution in my prev comment).
I think you can even use 1.0
instead of .5
, but not sure about it 😄
Thanks for the feedback. I appreciate your work.
Oh yeah, 1 is feasible, but still creates a small gap. >.5 is less noticeable, but still "technically" 1fps.
Currently it is possible only using following hack (because timer usage is hard-coded into
ParticleSystem
):prevTime
inParticleSystem
public.ps.pervTime = Timer.stamp() - desired_time_to_pass
.