Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug / Crash  Bug of particle sleep
#2
(12-07-2024, 06:02 AM)GuoliZheng Wrote: Dear Developers,
I have encountered a bug related to particle sleeping, which has caused significant issues in my application scenario. As demonstrated in the video, I initially set the sleep threshold value to 0.5.

That's a extremely high sleep threshold, which will send particles to sleep almost immediately. Remember the sleep threshold is a mass-weighted kinetic energy threshold: 1/2 * velocity^2. A threshold of 0.5 will cause particles moving any slower than 1 m/s to stop.

(12-07-2024, 06:02 AM)GuoliZheng Wrote: When particles are emitted at a low height, they correctly enter a sleep state. However, when the emission height is increased, the particles fall to the ground and exhibit slow creeping movements.

Correct. Because when emitted from a higher point, they have more time to accelerate downwards due to gravity and they will have larger kinetic energy, which allows them to keep moving. As their energy is near the sleep threshold, they will go in and out of sleep which creates this "creeping" movement.

(12-07-2024, 06:02 AM)GuoliZheng Wrote: At this point, I have to increase the sleep threshold to 10 to get them to sleep.

Yes, this is what should happen. The larger the kinetic energy of the particles (that is, the faster they move) the larger the sleep threshold needed for them to go to sleep.

(12-07-2024, 06:02 AM)GuoliZheng Wrote: The higher the velocity the particles experience during activity, the harder it is for them to sleep, which seems unreasonable.

This is the expected outcome, why would it be otherwise? It is natural for an object to go to sleep when its velocity is low (below the sleep threshold) since that's when its energy can be considered negligible. Conversely, it should be harder for them to sleep the higher their velocity is. Sleeping works like this in all physics engines. Pseudocode for sleeping:

Code:
if (velocityMagnitude * velocityMagnitude * 0.5 < sleepThreshold)
   particle.Freeze();
else
   particle.Move();

It seems to me like you're expecting to use sleep to kind of fake or approximate high viscosity, which of course won't work. Sleeping is intended to reduce or eliminate positional drift, making particles stay in place instead of moving at very small speeds. Using a very large sleep threshold like you're doing will result in jerky/creepy movement, as particles go in and out of sleep continuously. In the worst case scenario, it will completely freeze the simulation as all particles go to sleep.

kind regards,
Reply


Messages In This Thread
Bug of particle sleep - by GuoliZheng - 12-07-2024, 06:02 AM
RE: Bug of particle sleep - by josemendez - 12-07-2024, 07:55 AM
RE: Bug of particle sleep - by GuoliZheng - 13-07-2024, 12:43 PM