Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug / Crash  Fluid emitter stuttering with more fixed steps and lower FPS
#4
(23-09-2024, 11:39 AM)josemendez Wrote: That's not entirely accurate: the amount of particles emitted per frame depends on the ratio between the velocity of the emitted particles and their size: at the start of each step the distance the previously emitted particles have moved forward is calculated and divided by the size of a particle, this yields the amount of particle "bursts" that need to be emitted and the distance from the emitter that they should be spawned at.

So the distance between particles should be constant regardless of the amount of time steps performed during the frame.

That was my understanding as well, but I've observed that it's not the case. It seems to be that if you have irregular numbers of fixed timesteps happening per rendered frame, the particle emission becomes unstable and the stream breaks up. It shouldn't logically happen, but it's happening consistently and makes me think there's potentially a bug in the emitter code.

(23-09-2024, 11:50 AM)josemendez Wrote: Just set up a quick test: set Unity's fixed delta time to 0.005 in order to force multiple timesteps per frame, set the solver's max steps per frame to 4. However no gaps appear in between emitted particles, flow seems continuous.
Would it be possible for you to set up a scene that reproduces the issues you mentioned? I'll be glad to take a look at it.

Sure, I'll get some time to put together minimum viable reproduction scenes of these issues at some point and send them over.

To be clear though, these issues are not caused by there being multiple fixed timesteps per frame so just changing unity's timestep and the solver's max steps won't show this bug. These bugs seem to be explicitly happening when there's a non-integer ratio of rendered frames to fixed frames so that some rendered frames get more fixed frames than others. For example, if you had say 28 FPS and a fixed timestep of 1/50 you'd see the bug, but at 25 FPS it would disappear because that's an integer factor of 50.

The bug will only show up in a scene with sufficient rendering load to reduce the rendered FPS below the fixed timestep, so it may not easily show up in your minimalist test scenes but will happen in a real game fairly easily. Put a few hundred complex skinned meshes in camera view to artificially bring your FPS down and you may see the issue. I'll try to get the time to put together a test scene/project showing it.
Reply


Messages In This Thread
RE: Fluid emitter stuttering with more fixed steps and lower FPS - by Nyphur - 24-09-2024, 11:43 PM