Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  cloth passthrough
#1
Hi, I need help with 2 issues.




In the first half of the video, the forceps stretches the skin as desired. However at some point it then passes through suddenly and unexpectedly. The second half of the video shows how it reacts to a different mesh (green large capsule)




Q1: This pass through issue improves with larger colliders on the forceps, but there is an upper limit to how big the collider can be. Is there a way to set when the particles will "tear"? I have tried using surface collisions but that does not help at all.




Q2: There does not seem to be a connection between mobile and attached particles. This causes a gap to form (more obvious in second half). Is there a way for the mobile particles remain connected to the attached particles?
Like this:    









Cloth and Solver settings

       



Thanks
Reply
#2
(08-11-2022, 03:23 PM)danazoid Wrote: In the first half of the video, the forceps stretches the skin as desired. However at some point it then passes through suddenly and unexpectedly. The second half of the video shows how it reacts to a different mesh (green large capsule)
Q1: This pass through issue improves with larger colliders on the forceps, but there is an upper limit to how big the collider can be. Is there a way to set when the particles will "tear"? I have tried using surface collisions but that does not help at all.


What's the mass of the forceps rigidbody, relative to the cloth particles? Reducing the mass of the forceps or increasing the mass of the cloth will make it harder to pull it around once it's tense.

Here I'm assuming that the forceps are a rigidbody, and you're moving it using forces or impulses. Otherwise collisions against the cloth will of course fail at some point because the cloth is unable to prevent the forceps from moving once it's too tense: you can pull as much as you want until collision detection simply fails because cloth is unnaturally tense.

In order to have two-way interaction between the forceps and the cloth -or for any two dynamic objects to interact in a physically meaningful way, really- both must be part of the simulation. Note you can't explicitly control the point at which collision detection fails, as it's a function of particle size vs collider size: when the pulling force is too large, larger colliders and/or larger particles will make it harder for colliders to slip between particles.


(08-11-2022, 03:23 PM)danazoid Wrote: Q2: There does not seem to be a connection between mobile and attached particles. This causes a gap to form (more obvious in second half). Is there a way for the mobile particles remain connected to the attached particles?
Like this:

Particle connectivity is directly extracted from the mesh, since particles are visually "connected" trough mesh triangles. If there's a gap in the mesh, that's probably because your mesh has this gap too.

Also keep in mind there's no explicit differentiation between "mobile" and "attached" particles in Obi: they're the exact same kind of particles, it's just that the attached ones have their position/velocity modified by the attachment.

let me know if I can be of further help,
Reply
#3
(08-11-2022, 03:50 PM)josemende Wrote: Particle connectivity is directly extracted from the mesh, since particles are visually "connected" trough mesh triangles. If there's a gap in the mesh, that's probably because your mesh has this gap too.

Also keep in mind there's no explicit differentiation between "mobile" and "attached" particles in Obi: they're the exact same kind of particles, it's just that the attached ones have their position/velocity modified by the attachment.
Thanks for the clarification. On another look it happens because of "pass through".




Quote:Here I'm assuming that the forceps are a rigidbody, and you're moving it using forces or impulses. Otherwise collisions against the cloth will of course fail at some point because the cloth is unable to prevent the forceps from moving once it's too tense: you can pull as much as you want until collision detection simply fails because cloth is unnaturally tense.

In order to have two-way interaction between the forceps and the cloth -or for any two dynamic objects to interact in a physically meaningful way, really- both must be part of the simulation.
Yes, I understand. I think not having 2-way is acceptable for me. I can restrict the movement of the forceps.




=====

Ok, the simulation works very well except for this pass through issue. I am very keen to get it to work.




Quote:Note you can't explicitly control the point at which collision detection fails, as it's a function of particle size vs collider size: when the pulling force is too large, larger colliders and/or larger particles will make it harder for colliders to slip between particles.
Checking my understanding here: pass through happens when the distance between cloth particles exceeds collider size?


That is why larger colliders don't pass through. Also curved colliders seem to work better, I think for the same reason.




If so, then if I am trying to model a very compliant elastic sheet, and I use a small collider to deform it, then there is a high risk that pass through once the particles separate enough? (which is in essence what my issue is)




Quote:What's the mass of the forceps rigidbody, relative to the cloth particles? Reducing the mass of the forceps or increasing the mass of the cloth will make it harder to pull it around once it's tense.
Changing the mass helps. There is less pass through, instead the cloth jitters when it is tense.


Would you mind explaining how the relative mass works on this pass through issue?
Reply
#4
(09-11-2022, 08:53 AM)danazoid Wrote: Thanks for the clarification. On another look it happens because of "pass through".

Yes, I understand. I think not having 2-way is acceptable for me. I can restrict the movement of the forceps.

2-way means the forceps can apply forces on the cloth, and the cloth can apply forces back to restrict forceps movement. This is what happens in the real world when you pick an object: you apply a force to it, and it applies a force back on you. For instance if you push a door, your hand moves forward and the door opens, but once it's fully opened you can't continue pushing it and your hand will not move past/trough the door, no matter how much you push.

Drawing a parallel to your current situation, the hand in this example would simply pass trough the door since it's ignoring the force the door is applying on it.

Most VR games use a two-way coupling approach so that you can't (for instance) lift very heavy objects or simply force your hands past walls or other obstacles:
You could restrict forceps movement any other way without relying on physics, but manually determining when and how to restrict movement can be *very* tricky.

(09-11-2022, 08:53 AM)danazoid Wrote: Checking my understanding here: pass through happens when the distance between cloth particles exceeds collider size?
That is why larger colliders don't pass through. Also curved colliders seem to work better, I think for the same reason.

Correct. When you pull the cloth, at first particles move normally and there's not much tension in the links between them. If you continue pulling, at some point tension starts to become too much and particles start separating from each other, opening gaps in between them trough which colliders can pass. The size of the gap vs the size of the collider determines whether the collider can pass or not.

In a two-way coupled setup, as tension increases, cloth starts to apply a force on the forceps that's equal to the force you're applying to the cloth while pulling. Once both forces cancel out each other, neither the cloth or the forceps are able to move.

(09-11-2022, 08:53 AM)danazoid Wrote: If so, then if I am trying to model a very compliant elastic sheet, and I use a small collider to deform it, then there is a high risk that pass through once the particles separate enough?

In this case, surface collisions will help. Surface collisions improve spatial sampling, as long as the tension forces involved aren't large (and they won't be because cloth is compliant) collisions will work fine.

(09-11-2022, 08:53 AM)danazoid Wrote: Changing the mass helps. There is less pass through, instead the cloth jitters when it is tense.
Would you mind explaining how the relative mass works on this pass through issue?

Changing the mass will not really help much. In this case, it just changes tension distribution: will affect how particles are distributed when under a lot of tension, but not in any meaningful/controllable way.

If the forceps were a rigidbody mass would work just like it does in the real world: the relative mass of two objects determines how energy is distributed when they interact. The larger the mass of the cloth is compared to the mass of the forceps, the harder it would be to pull from it. Imho, this would be the ideal setup in your case.

kind regards,
Reply
#5
(09-11-2022, 09:08 AM)josemendez Wrote: In a two-way coupled setup, as tension increases, cloth starts to apply a force on the forceps that's equal to the force you're applying to the cloth while pulling. Once both forces cancel out each other, neither the cloth or the forceps are able to move.


Do I need to enable 2-way coupling in Obi?

My VR setup is just XR interaction toolkit, and the forceps are held using "velocity tracking" mode. The forceps doesn't go through walls and gets pushed back.



Quote:Correct. When you pull the cloth, at first particles move normally and there's not much tension in the links between them. If you continue pulling, at some point tension starts to become too much and particles start separating from each other, opening gaps in between them trough which colliders can pass. The size of the gap vs the size of the collider determines whether the collider can pass or not.


Naively asking: are there any sims that avoid the elastic pass through problem?


Quote:In this case, surface collisions will help. Surface collisions improve spatial sampling, as long as the tension forces involved aren't large (and they won't be because cloth is compliant) collisions will work fine.
The last time I tried surface collisions it didn't work and the skin started to er... spike.
But for some reason I can't reproduce the problem and it works great now! Huh.

Thanks for help!
Reply
#6
(10-11-2022, 05:57 AM)danazoid Wrote: Do I need to enable 2-way coupling in Obi?

No, two way coupling emerges automatically between physical objects. This also happens between Obi actors and rigidbodies. All you need to make sure is that your VR hands are using rigidbodies.

(10-11-2022, 05:57 AM)danazoid Wrote: My VR setup is just XR interaction toolkit, and the forceps are held using "velocity tracking" mode. The forceps doesn't go through walls and gets pushed back.


In that case they're already using rigidbodies, and all you need to do is adjust cloth mass.


(10-11-2022, 05:57 AM)danazoid Wrote: Naively asking: are there any sims that avoid the elastic pass through problem?

All of them when properly set up Sonrisa. This is only an issue when non-dynamic objects (colliders with no rigidbody, or kinematic rigidbodies) interact with dynamic ones. In this situation you get one-way interaction: dynamic objects are forced to respond to non-dynamic objects, but cannot "fight back" in any way so they are forced to stretch (in the case of a softbody, like cloth) or sink/penetrate other objects (in case of rigidbodies).

let me know if you need further help,

kind regards
Reply
#7
(10-11-2022, 08:22 AM)josemendez Wrote: No, two way coupling emerges automatically between physical objects. This also happens between Obi actors and rigidbodies. All you need to make sure is that your VR hands are using rigidbodies.

In that case they're already using rigidbodies, and all you need to do is adjust cloth mass.

All of them when properly set up Sonrisa. This is only an issue when non-dynamic objects (colliders with no rigidbody, or kinematic rigidbodies) interact with dynamic ones. In this situation you get one-way interaction: dynamic objects are forced to respond to non-dynamic objects, but cannot "fight back" in any way so they are forced to stretch (in the case of a softbody, like cloth) or sink/penetrate other objects (in case of rigidbodies).

let me know if you need further help,

kind regards


Thanks for the explanation! Reducing forceps mass helps show 2-way interaction better
I think my skin is more or less setup well.



Unfortunately I am facing another problem.



1st half of the video shows skin working more or less as intended. (Except when opening the forceps too quickly, causing what I suspect is tunneling - was thinking of solving it by slowing down the forceps opening)



2nd half of the video shows the main issue. There is a cube game object with a box collider behind the skin.

When my forceps collides the cube while touching the skin, the skin starts behaving strangely. It's like the collider on the forceps has enlarged. (In unity physics debug mode it hasn't changed)



The forceps has 2 colliders. One for the straight part, one for the curved part.
   
The curved part is a separate game object that is child of the straight part.

.png   clamp setup.png (Size: 13.82 KB / Downloads: 21)
The straight collider has its own Obi collider, the curved collider also has its own Obi collider
Reply
#8
(10-11-2022, 10:48 AM)danazoid Wrote: Unfortunately I am facing another problem.
2nd half of the video shows the main issue. There is a cube game object with a box collider behind the skin.

When my forceps collides the cube while touching the skin, the skin starts behaving strangely. It's like the collider on the forceps has enlarged. (In unity physics debug mode it hasn't changed)

What's the mass of the forceps, vs the mass of one cloth particle?

Looks like the forceps have a specific velocity, that the box collider is limiting after the cloth has been simulated. So the cloth reacts to the velocity the force colliders had before being pushed back by the box. Which Obi updater component are you using? You could try using ObiLateFixedUpdater instead of the standard ObiFixedUpdater, in case the velocity limiting is taking place at the end of FixedUpdate that should help.

kind regards,
Reply
#9
(10-11-2022, 11:53 AM)josemendez Wrote: What's the mass of the forceps, vs the mass of one cloth particle?

Looks like the forceps have a specific velocity, that the box collider is limiting after the cloth has been simulated. So the cloth reacts to the velocity the force colliders had before being pushed back by the box. Which Obi updater component are you using? You could try using ObiLateFixedUpdater instead of the standard ObiFixedUpdater, in case the velocity limiting is taking place at the end of FixedUpdate that should help.

kind regards,

Forceps is 0.2, each particle is 0.01

On using the LateFixedUpdater, the unusual behaviour has ceased. The cloth deforms without the weird wave effect.
BUT, the forceps now passes through the cloth very easily, the cloth barely even stretches before the forceps slips through.

I've tried increasing the distance and bend compliances (by 100x), helps a bit.
I've also reduced the forceps mass to 0.1 and 0.01, which doesn't help.
Reply
#10
(10-11-2022, 01:13 PM)danazoid Wrote: Forceps is 0.2, each particle is 0.01

That's quite a large mass ratio. Most physics engines will work ok up until ratios of 1:10, this is also recommended in Unity's docs. Try increasing the cloth mass to 0.05-ish.

(10-11-2022, 01:13 PM)danazoid Wrote: On using the LateFixedUpdater, the unusual behaviour has ceased. The cloth deforms without the weird wave effect.
BUT, the forceps now passes through the cloth very easily, the cloth barely even stretches before the forceps slips through.

I've tried increasing the distance and bend compliances (by 100x), helps a bit.

Compliance is expressed in m/N, a value of 100 will make the cloth extremely stretchy which I believe is the exact opposite of what you want in this case.Compliances should be left to zero unless you're aiming for very elastic materials.

Using ObiLateFixedUpdater will cause the simulation to execute once after every other script has called its FixedUpdate(). Another option is using ObiFixedUpdater, but forcing XRInteractable to update before the cloth simulation manually. You can do this in Unity's script execution order window, by setting ObiFixedUpdater to update after XRInteractable.
Reply