Posts: 10
Threads: 2
Joined: May 2025
Reputation:
0
23-07-2025, 02:39 PM
Hello,
I'm trying to make a garment simulator in real time using ObiCloth. The clothes are behaving a bit oddly, i went through all the settings within the Obi Cloth component as a test hoping to make my garments stiff, and yet they stretch a lot during runtime, especially falling off the shoulders. I have also tried increasing iterations on each obi solver component, but the behaviour persisted.
Here is a swimsuit example:
Before hitting play
During play mode
Note: My colliders aren't yet perfect which is why the cloth comes a bit inside the avatar in some parts, please ignore this. In case this context matters, the avatar is divided into many colliders using distance fields, which are then assigned to each bone in order to "allow" for avatar animation. In addition, the colliders have a material collider assigned to them, with 1 dynamic friction and 0.95 static friction (this should make it so it barely slides).
ObiCloth settings:
The Obisolver is essentially at default settings, i only changed the distance constraint to be Parallel and have 6 iterations to remove some jittering i was having, and I'm using CPU (Burst) to develop for a Web environment (The compute GPU mode uses too many buffers, there's a buffer limit in browsers).
My Cloth blueprint:
Unless i understood the wiki incorrectly, the obicloth settings i have for that cloth should make it very stiff, and not allow for much stretching or deformation. Why is it then, that this swimsuit falls so much off the avatar's chest?
Thank you for your time!
Posts: 6,559
Threads: 27
Joined: Jun 2017
Reputation:
427
Obi Owner:
23-07-2025, 03:02 PM
(This post was last modified: 23-07-2025, 03:11 PM by josemendez.)
(23-07-2025, 02:39 PM)Andreia Mendes Wrote: Unless i understood the wiki incorrectly, the obicloth settings i have for that cloth should make it very stiff, and not allow for much stretching or deformation.
Hi!
Quite the opposite: your settings will yield rather stretchy cloth. Specifically, your compliance is set to 0.01 N/m2 which is extremely high (for comparison, the compliance of rubber is 1x10^-6)
Keep in mind that compliance is the inverse of stiffness: a compliant material is stretchy, a non-compliant material (that is, a material with zero compliance) is as stiff as possible given the current solver settings.
(23-07-2025, 02:39 PM)Andreia Mendes Wrote: The Obisolver is essentially at default settings, i only changed the distance constraint to be Parallel and have 6 iterations to remove some jittering i was having
Don't tweak iterations unless you need to balance out cost with other constraint types. As mentioned in the manual, the ideal setup is to set all iteration counts to 1 and increase the amount of substeps instead. Substeps are far more efficient at improving simulation quality than iterations.
As a side note, I see you're using surface collisions with a considerably dense mesh. Such use case is specifically discouraged in the manual as it will lead to very costly collision detection and no noticeable benefit.
kind regards,
Posts: 10
Threads: 2
Joined: May 2025
Reputation:
0
(23-07-2025, 03:02 PM)josemendez Wrote: Hi!
Quite the opposite: your settings will yield rather stretchy cloth. Specifically, your compliance is set to 0.01 N/m2 which is extremely high (for comparison, the compliance of rubber is 1x10^-6)
Keep in mind that compliance is the inverse of stiffness: a compliant material is stretchy, a non-compliant material (that is, a material with zero compliance) is as stiff as possible given the current solver settings.
Don't tweak iterations unless you need to balance out cost with other constraint types. As mentioned in the manual, the ideal setup is to set all iteration counts to 1 and increase the amount of substeps instead. Substeps are far more efficient at improving simulation quality than iterations.
As a side note, I see you're using surface collisions with a considerably dense mesh. Such use case is specifically discouraged in the manual as it will lead to very costly collision detection and no noticeable benefit.
kind regards,
Hello, thank you for the quick response!
I have attempted your suggestions:
I changed the stretch compliance to 0, however it seemed to make no difference in the simulation. The swimsuit was just as stretchy.
I remade the cloth blueprint to have less particles, but the swimsuit now compressed so much it became a waist sash! Changing back the stretch compliance to 0.01 doesn't change this.
Posts: 6,559
Threads: 27
Joined: Jun 2017
Reputation:
427
Obi Owner:
(23-07-2025, 04:18 PM)Andreia Mendes Wrote: Hello, thank you for the quick response!
I have attempted your suggestions:
I changed the stretch compliance to 0, however it seemed to make no difference in the simulation. The swimsuit was just as stretchy.
That means your solver budget isn't enough to reach 0 compliance. Use more substeps as suggested.
(23-07-2025, 04:18 PM)Andreia Mendes Wrote: I remade the cloth blueprint to have less particles, but the swimsuit now compressed so much it became a waist sash! Changing back the stretch compliance to 0.01 doesn't change this.
Make sure the scale of your cloth transform is not smaller than 1, otherwise the cloth will shrink at runtime.
However, the proper solution in your case is probably not to have less particles but simply to disable surface collisions: they're not needed if the mesh is dense enough.
kind regards
Posts: 10
Threads: 2
Joined: May 2025
Reputation:
0
23-07-2025, 05:03 PM
(This post was last modified: 23-07-2025, 05:11 PM by Andreia Mendes.)
Hello,
I have disabled surface collisions, and increased the amount of substeps gradually, as well as max steps per frame isolated and together. I have also changed the distance constraint to default, sequential and 1 iteration. The crumpling effect still happens, and on higher substeps the cloth appears to crumple as before around the waist, then escape to a side and "fly off" upwards, even after no longer colliding with the avatar.
If I disable self collisions, the cloth falls down instead of up, everything else described still happens.
Thank you.
Posts: 6,559
Threads: 27
Joined: Jun 2017
Reputation:
427
Obi Owner:
23-07-2025, 05:11 PM
(This post was last modified: 23-07-2025, 05:12 PM by josemendez.)
(23-07-2025, 05:03 PM)Andreia Mendes Wrote: Hello,
I have disabled surface collisions, and increased the amount of substeps gradually, as well as max steps per frame isolated and together. I have also changed the distance constraint to default, sequential and 1 iteration. The crumpling effect still happens, and on higher substeps the cloth appears to crumple as before around the waist, then escape to a side and "fly off" upwards, even after no longer colliding with the avatar.
If I disable self collisions, the cloth falls down instead of up, everything else described still happens.
What's your cloth object's transform scale value?
Posts: 10
Threads: 2
Joined: May 2025
Reputation:
0
23-07-2025, 05:19 PM
(This post was last modified: 23-07-2025, 05:20 PM by Andreia Mendes.)
(23-07-2025, 05:11 PM)josemendez Wrote: What's your cloth object's transform scale value? It is 4.60817 on all axis. Should have said that, you did mention crumpling can be caused by values lesser than 1.
Posts: 6,559
Threads: 27
Joined: Jun 2017
Reputation:
427
Obi Owner:
23-07-2025, 05:22 PM
(This post was last modified: 23-07-2025, 05:24 PM by josemendez.)
(23-07-2025, 05:19 PM)Andreia Mendes Wrote: It is 4.60817 on all axis.
That's the problem. The cloth blueprint is x4.6 times smaller than the transform it's spawning it into the scene, so immediately upon starting the simulation it crumples down. Conversely, values smaller than 1 will cause the cloth to expand at runtime. Keep in mind that blueprints are assets, as such, they're not tied to any scene in particular and have no scene hierarchy information available.
The simplest solution is to make sure the transform scale is 1 on all axis. This is easy to achieve on most modeling software, by "freezing" or "applying" (terminology varies depending on the software you use) the scale before exporting.
See our video on this subject:
https://www.youtube.com/watch?v=5j7k_tJUSJc
Posts: 10
Threads: 2
Joined: May 2025
Reputation:
0
I see! I thought the scale was the one inside Unity, I got no more time to test today, but I'll come back tomorrow and share my results, thanks for your time!
Posts: 6,559
Threads: 27
Joined: Jun 2017
Reputation:
427
Obi Owner:
23-07-2025, 05:26 PM
(This post was last modified: 23-07-2025, 05:30 PM by josemendez.)
(23-07-2025, 05:24 PM)Andreia Mendes Wrote: I see! I thought the scale was the one inside Unity, I got no more time to test today, but I'll come back tomorrow and share my results, thanks for your time!
The scale inside Unity reflects the scale you exported the asset with. It's the same value. However, blueprints take a mesh as input, without any scene transform information. So the actual cloth in the scene is smaller than your mesh, and that's what's causing it to shrink.
Export and import settings may affect scale however. Most FBX exporters have options to deal with transform scale, and Unity mesh import settings also allow you to apply an extra scale after import.
|