Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Softbodies intersecting easily
#1
Hi Jose,

I'm finding that softbodies intersect and get stuck inside each other incredibly easily. In the video example, I have pretty much a standard ball from the ball pool scene and a larger hemisphere softbody. When I jump the ball onto the hemisphere, with very little forces involved other than gravity, the ball gets stuck in the larger object and sucked in.

I've tried enabling surface collisions but that makes it get stuck much quicker (and disables collisions with the static ground for some reason). I'm on Obi 6 still, I've not been able to get Obi 7 working yet.

Should softbody-softbody collisions be this unstable, or is there something I can do to improve them?

Video link: https://drive.google.com/file/d/1AHhu00a...sp=sharing

Thanks,

Matthew
Reply
#2
(01-09-2024, 09:09 PM)MattS Wrote: Hi Jose,

I'm finding that softbodies intersect and get stuck inside each other incredibly easily. In the video example, I have pretty much a standard ball from the ball pool scene and a larger hemisphere softbody. When I jump the ball onto the hemisphere, with very little forces involved other than gravity, the ball gets stuck in the larger object and sucked in.

Hi Matt,

No, this behavior should not usually take place. What's the mass of these particles? Looks as if the ball is much heavier than the platform. In that case, it will be very easy for the ball to push the platform's particles apart and go into it. Making the platform heavier than the ball should help.

Note the same will happen with rigidbodies, eg if you place a heavy rigidbody on top of a light one, at a certain mass ratio they'll just go trough each other.

kind regards,
Reply
#3
(02-09-2024, 07:53 AM)josemendez Wrote: Hi Matt,

No, this behavior should not usually take place. What's the mass of these particles? Looks as if the ball is much heavier than the platform. In that case, it will be very easy for the ball to push the platform's particles apart and go into it. Making the platform heavier than the ball should help.

Note the same will happen with rigidbodies, eg if you place a heavy rigidbody on top of a light one, at a certain mass ratio they'll just go trough each other.

kind regards,

The mass of the particles for the ball are 0.5 (203 particles total), for the bottom object 1 (556 particles total), so the bottom object is actually much heavier. The only option I've found to stop them penetrating eventually is to increase the Collision margin in the solver from 0.02 to 0.2 (which is probably not a good idea!). The radius of the ball is around 0.5 for reference.

I thought surface collisions would solve this, but the ball simply falls through the floor (a static obi collider) when I do this. Is there anything I can do to debug this, there aren't any errors or warnings fired.

For easy repro, set surface collision on the ball in the pool bool scene to true and they'll fall through the floor too, so I'm assuming there's some regen step?
Reply
#4
Hi Matt,

(02-09-2024, 03:05 PM)MattS Wrote: The mass of the particles for the ball are 0.5 (203 particles total), for the bottom object 1 (556 particles total), so the bottom object is actually much heavier. The only option I've found to stop them penetrating eventually is to increase the Collision margin in the solver from 0.02 to 0.2 (which is probably not a good idea!). The radius of the ball is around 0.5 for reference.

You could try to set particle CCD to 1 in the solver, this should work similarly and it is a better option as it does not force to expand the collision margin in all directions: only in the direction that the particles are moving.

(02-09-2024, 03:05 PM)MattS Wrote: I thought surface collisions would solve this, but the ball simply falls through the floor (a static obi collider) when I do this. Is there anything I can do to debug this, there aren't any errors or warnings fired.

If the problem is solved by increasing the collision margin, then the issue is tunneling (particles moving fast enough that they just "jump" past each other a single timestep).

Using surface collisions won't help at all in this case, as they are designed to improve spatial resolution, not temporal resolution which seems to be the issue here. If yours was a problem of spatial resolution (eg. gaps in the particle-based representation of the softbody) then surface collisions would help.

Out of curiosity, what's your solver's gravity setting? particles seem to fall quite fast in your video. Maybe your gravity is accelerating particles fast enough for them to tunnel trough each other?

(02-09-2024, 03:05 PM)MattS Wrote: For easy repro, set surface collision on the ball in the pool bool scene to true and they'll fall through the floor too, so I'm assuming there's some regen step?

The balls in the pool scene don't have any simplices in their blueprint, so enabling surface collisions will essentially leave them with no collision geometry. Re-generating their blueprint to include surface simplices will allow you to use surface collisions on them.

kind regards,
Reply
#5
Ah interesting about temporal resolution, I'll ignore going down the surface collision route then. Thank you for clearing that up, I obviously was completely misunderstanding the issue.

You're right that gravity is quite high, about -30 in total (-9.81 for the solver and another -20 externally). CCD is already 1 though. I've attached my solver settings, it's possible they've diverged with sensible values over time.

I'm unclear why tunnelling can happen so easily at such low speeds (force is quite high but not overly so). Is there anything else I can do to prevent it? Larger particles, more iterations etc...?


Attached Files Thumbnail(s)
       
Reply
#6
(02-09-2024, 04:28 PM)MattS Wrote: You're right that gravity is quite high, about -30 in total (-9.81 for the solver and another -20 externally). CCD is already 1 though. I've attached my solver settings, it's possible they've diverged with sensible values over time.

That's a huge acceleration, more than 3 times Earth's gravity. CCD will help for high velocities as it expands the collision bounds in the direction of the velocity, but for large changes in velocity between frames (that is, large accelerations) you'll likely need to increase the collision margin for the collision detection system to get ahead and consider contact pairs that would otherwise be missed as gravity increases velocity mid-simulation (during substeps).

(02-09-2024, 04:28 PM)MattS Wrote: I'm unclear why tunnelling can happen so easily at such low speeds (force is quite high but not overly so). Is there anything else I can do to prevent it? Larger particles, more iterations etc...?

Tunneling doesn't necessarily happen at high speeds: the smaller the objects involved, the lower the velocity threshold that triggers tunneling. We have an older video on tunneling here that explains it in detail:



Since particles are very small objects, using traditional static collision detection would cause tunneling even at very low speeds. That's why Obi uses speculative contacts, which is a very aggressive form of CCD - not failproof but more robust than sweep-based systems.

Things I'd try in your case, from cheaper to more expensive:

- Increase platform mass (even if it's already heavier than the ball, the larger the mass ratio in favor of the platform the more resilient it will be to clipping).
- Increase particle radius.
- Increase the solver's collision margin.
- Use a smaller fixed timestep (you can find this setting in Unity's Time settings).

let me know if you need further help,

kind regards
Reply
#7
Thank you so much Jose for taking the time to provide me such a detailed response! I definitely feel I understand the issue much better now so I'll play around with your suggestions and see what works best. 

Much appreciated!

Matthew
Reply