Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Skinned cloth simulation clipping
#1
Hi, I'm working on an Obi Skinned Cloth shirt on an animated character, with an ambient force zone around them that changes direction. Depending on the arm position and the direction of the wind, sometimes there is some clipping between the sleeves and the side of the shirt, where the wind blows the cloth under the armpit outwards, leading it to clip with the sleeves of the shirt when the character's arms are lowered. These screenshots are from my initial cloth blueprints:
https://gyazo.com/58704254eb5c6f29a9e61df98ef49c97

To be fair, some of this is because of the original mesh design, here is a screenshot of the mesh with no cloth simulation:
https://gyazo.com/2d6b14283956874ca3b4c80a751c55f7

I've had some success with increasing the mass, skin radius and backstop of the particles directly underneath the arm, which looks good when the wind is blowing towards that side of the shirt, but when the wind is in the opposite direction, the increased skin radius results in even more clipping
(wind blowing left) https://gyazo.com/24ca161db1378b6acdbd465465729193
(wind blowing right) https://gyazo.com/b70b20e0b74cc11a1f0c7dae6c1f3ee9

Any advice for what kind of parameters would allow the particles to sink into the mesh (when the wind is blowing towards that side), but restricts the particles from moving away from the mesh surface?
Reply
#2
(25-02-2020, 06:12 PM)jp715 Wrote: Hi, I'm working on an Obi Skinned Cloth shirt on an animated character, with an ambient force zone around them that changes direction. Depending on the arm position and the direction of the wind, sometimes there is some clipping between the sleeves and the side of the shirt, where the wind blows the cloth under the armpit outwards, leading it to clip with the sleeves of the shirt when the character's arms are lowered. These screenshots are from my initial cloth blueprints:
https://gyazo.com/58704254eb5c6f29a9e61df98ef49c97

To be fair, some of this is because of the original mesh design, here is a screenshot of the mesh with no cloth simulation:
https://gyazo.com/2d6b14283956874ca3b4c80a751c55f7

I've had some success with increasing the mass, skin radius and backstop of the particles directly underneath the arm, which looks good when the wind is blowing towards that side of the shirt, but when the wind is in the opposite direction, the increased skin radius results in even more clipping
(wind blowing left) https://gyazo.com/24ca161db1378b6acdbd465465729193
(wind blowing right) https://gyazo.com/b70b20e0b74cc11a1f0c7dae6c1f3ee9

Any advice for what kind of parameters would allow the particles to sink into the mesh (when the wind is blowing towards that side), but restricts the particles from moving away from the mesh surface?

Hi there!

Skin constraints impose two "off-limits" zones for a particle:
  • outside the sphere defined by the vertex skinned position and the skin radius value
  • inside the sphere defined by the vertex skinned position/normal and the skin backstop radius/skin backstop values.

The first one is pretty intuitive (i'd like to think) as it's basically a "don't move too far away from the skinned position" constraint.

The second one creates a "virtual" spherical collider behind the particle at each vertex (lets call it the "backstop" sphere), so that the vertex can't get too far back inside the character's body. The catch here is that the center of the backstop sphere is placed along the surface normal, at a distance of backstop radius (the sphere's radius) + backstop (the distance from the surface). So if your mesh has pre-modeled wrinkles/folds in it, the backstop spheres will be in weird positions (to the left or the right of the surface, because that's where the cloth normal is pointing), instead of right underneath the cloth surface which is where you want them. Am I making sense?

The solution would be to model your cloth with as few wrinkles as possible (the simulation will add result in wrinkles anyway), making sure that all normals point away from the body as much as you can.
Reply
#3
(27-02-2020, 10:27 AM)josemendez Wrote: Hi there!

Skin constraints impose two "off-limits" zones for a particle:
  • outside the sphere defined by the vertex skinned position and the skin radius value
  • inside the sphere defined by the vertex skinned position/normal and the skin backstop radius/skin backstop values.

The first one is pretty intuitive (i'd like to think) as it's basically a "don't move too far away from the skinned position" constraint.

The second one creates a "virtual" spherical collider behind the particle at each vertex (lets call it the "backstop" sphere), so that the vertex can't get too far back inside the character's body. The catch here is that the center of the backstop sphere is placed along the surface normal, at a distance of backstop radius (the sphere's radius) + backstop (the distance from the surface). So if your mesh has pre-modeled wrinkles/folds in it, the backstop spheres will be in weird positions (to the left or the right of the surface, because that's where the cloth normal is pointing), instead of right underneath the cloth surface which is where you want them. Am I making sense?

The solution would be to model your cloth with as few wrinkles as possible (the simulation will add result in wrinkles anyway), making sure that all normals point away from the body as much as you can.

Thanks! This did help a lot with understanding how the backstop and backstop radius parameters work.

Just to clarify, does this mean that the "backstop" sphere is always behind the particle? Is there any way to make a backstop sphere with a center that is some units away from the surface of the mesh, so that the particle can only move inwards, and not outwards? 

As far as I can tell, all the normals do point away from the body of the mesh, or at least the blue skin radius visualization lines point away from the mesh in particle editing mode. Unfortunately, because the model is created by a different studio hired by the company we are doing contract work for, I don't think re-modelling the cloth is an option.
Reply
#4
(27-02-2020, 08:28 PM)jp715 Wrote: Thanks! This did help a lot with understanding how the backstop and backstop radius parameters work.

Just to clarify, does this mean that the "backstop" sphere is always behind the particle? Is there any way to make a backstop sphere with a center that is some units away from the surface of the mesh, so that the particle can only move inwards, and not outwards? 

As far as I can tell, all the normals do point away from the body of the mesh, or at least the blue skin radius visualization lines point away from the mesh in particle editing mode. Unfortunately, because the model is created by a different studio hired by the company we are doing contract work for, I don't think re-modelling the cloth is an option.


Backstop can have positive and negative values.

-A value of 0 will make it so that the surface of the sphere just touches the cloth surface from "inside". That is, the center of the sphere will be along the normal, at "-skin backstop radius".

-Positive values will "sink" the backstop sphere further inside the mesh, negative values will bring it forward, causing the mesh to "bulge" (see image in the middle of this manual page: http://obi.virtualmethodstudio.com/tutor...aints.html). If -backstop = backstop radius, the sphere will barely touch the surface from "outside", and the particle will only be able to move backwards.

Mesh normals should not only point away from the body mesh as in not pointing inwards, but as close to being as perpendicular to the surface as possible. This will ensure the backstop spheres approximate the character's body shape as closely as possible. Pretty much all character cloth simulators I've ever had the opportunity to use (Havok, PhysX) work like this, or in a very similar way(*), to ensure maximum performance: each particle implicitly "knows" what zones it should keep out of, without the need of expensive collision detection. Unfortunately this requires the mesh to be authored with cloth simulation in mind, you can't just throw any mesh to it and get perfect results.

If necessary, you could modify the code that feeds the vertex normals to the skin constraints every frame, and modify the normals procedurally. Let me know if you want to go this route and need help with it.

(*)PhysX had the ability to "warp" the skin spheres into skin ellipses, but everything else behaved the same.
Reply
#5
(28-02-2020, 08:04 AM)josemendez Wrote: Backstop can have positive and negative values.

-A value of 0 will make it so that the surface of the sphere just touches the cloth surface from "inside". That is, the center of the sphere will be along the normal, at "-skin backstop radius".

-Positive values will "sink" the backstop sphere further inside the mesh, negative values will bring it forward, causing the mesh to "bulge" (see image in the middle of this manual page: http://obi.virtualmethodstudio.com/tutor...aints.html). If -backstop = backstop radius, the sphere will barely touch the surface from "outside", and the particle will only be able to move backwards.

Mesh normals should not only point away from the body mesh as in not pointing inwards, but as close to being as perpendicular to the surface as possible. This will ensure the backstop spheres approximate the character's body shape as closely as possible. Pretty much all character cloth simulators I've ever had the opportunity to use (Havok, PhysX) work like this, or in a very similar way(*), to ensure maximum performance: each particle implicitly "knows" what zones it should keep out of, without the need of expensive collision detection. Unfortunately this requires the mesh to be authored with cloth simulation in mind, you can't just throw any mesh to it and get perfect results.

If necessary, you could modify the code that feeds the vertex normals to the skin constraints every frame, and modify the normals procedurally. Let me know if you want to go this route and need help with it.

(*)PhysX had the ability to "warp" the skin spheres into skin ellipses, but everything else behaved the same.

So I've tried what you suggested with the negative backstop and backstop radius, and I think it's kind of working, but probably the mesh itself just isn't well designed for the simulation, like you said. Thanks for all your help anyway!
Reply