Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Towel simulation in Quest
#1
Hi,

I am working on a VR project where I need to grab a towel using a controller and then fold and unfold it, as well as rub the cloth on other objects with collision.

Could you please suggest possible ways to achieve the above simulation?


Thanks.
Reply
#2
(12-06-2024, 07:31 AM)balaji.v Wrote: Hi,

I am working on a VR project where I need to grab a towel using a controller and then fold and unfold it, as well as rub the cloth on other objects with collision.

Could you please suggest possible ways to achieve the above simulation?


Thanks.

Hi Balaji,

There's not much involved in doing this. You just need a basic cloth setup with collision detection.

Then you need to decide on a what for the user to interact with the cloth. This can get more complicated depending on which kind of interaction you want, for instance if you want the user to be able to grab it by specific particles you'd use contact callbacks to detect when the hand is close to specific particles, then use the particles API to move these particles around.

kind regards,
Reply
#3
(12-06-2024, 07:37 AM)josemendez Wrote: Hi Balaji,

There's not much involved in doing this. You just need a basic cloth setup with collision detection.

Then you need to decide on a what for the user to interact with the cloth. This can get more complicated depending on which kind of interaction you want, for instance if you want the user to be able to grab it by specific particles you'd use contact callbacks to detect when the hand is close to specific particles, then use the particles API to move these particles around.

kind regards,
Thank you for your reply. 
Instead of directly attaching the particle to the hand, shall I attach the particle to another invisible object (such as a cube or cylinder) and then grab the invisible object with the Quest controller?
Reply
#4
(14-06-2024, 12:38 PM)balaji.v Wrote: Thank you for your reply. 
Instead of directly attaching the particle to the hand, shall I attach the particle to another invisible object (such as a cube or cylinder) and then grab the invisible object with the Quest controller?

Yes, you wouldn't be able to scale it otherwise. The idea is that you attach the cloth to a transform, then drive the transform's scale using the Quest controller.
Reply
#5
(14-06-2024, 02:27 PM)josemendez Wrote: Yes, you wouldn't be able to scale it otherwise. The idea is that you attach the cloth to a transform, then drive the transform's scale using the Quest controller.
I have folded wash cloth model. I created blue print for the model and created obi cloth for the model. when playing the scene in unity editor the fps is too low(fps: 3) and not smooth.  How can I fix this. 
[Image: view?usp=sharing]
[Image: view?usp=sharing]
https://drive.google.com/file/d/18ZLFF3w...sp=sharing
https://drive.google.com/file/d/1cXCblT9...sp=sharing
Reply
#6
(25-06-2024, 01:36 PM)balaji.v Wrote: I have folded wash cloth model. I created blue print for the model and created obi cloth for the model. when playing the scene in unity editor the fps is too low(fps: 3) and not smooth.  How can I fix this. 

Hi,

Please don't drag/drop images directly into the forum, host your image somewhere and post a [img] link.

If you're having performance problems, make sure you've properly installed the required package dependencies for Burst as per the manual.
http://obi.virtualmethodstudio.com/manua...setup.html
http://obi.virtualmethodstudio.com/manua...kends.html

If you have installed them and performance is still an issue, please share a profiling session with us (in the profiler, top right button allows you to export the session). Otherwise it's pretty much impossible to tell what the issue might be.

kind regards,
Reply
#7
(25-06-2024, 01:49 PM)josemendez Wrote: Hi,

Please don't drag/drop images directly into the forum, host your image somewhere and post a [img] link.

If you're having performance problems, make sure you've properly installed the required package dependencies for Burst as per the manual.
http://obi.virtualmethodstudio.com/manua...setup.html
http://obi.virtualmethodstudio.com/manua...kends.html

If you have installed them and performance is still an issue, please share a profiling session with us (in the profiler, top right button allows you to export the session). Otherwise it's pretty much impossible to tell what the issue might be.

kind regards,
Hi, I have installed the packages but still its slow only. please find the profiler data link.

https://drive.google.com/file/d/1n1VJB7s...sp=sharing
Reply
#8
(25-06-2024, 03:38 PM)balaji.v Wrote: Hi, I have installed the packages but still its slow only. please find the profiler data link.

https://drive.google.com/file/d/1n1VJB7s...sp=sharing

Keep in mind you must disable the jobs debugger and safety checks when running Burst code in-editor, otherwise it will be much slower due to the debugging/checks overhead. See "Performance" in the manual:
http://obi.virtualmethodstudio.com/manua...kends.html

Regarding your profiler session: you're updating all physics in the scene 17 times per frame.
[Image: QE3jLlk.png]


This likely means your max allowed timestep is too high, and the workload for each individual update too great.
To reduce the max allowed timestep, go to Unity's Time settings and set max allowed timestep to a small multiple of your timestep (eg. if you're using 0.02 as the timestep, set the max to 0.02 - 0.06)

Zooming into an individual update shows most of the time is spent calculating collisions between particles. If you have a folded towel, it's a lot more efficient to simulate it as a softbody instead of simulating it as cloth and relying on self-collisions to do all the work keeping the folds from penetrating each other.

kind regards,
Reply
#9
(26-06-2024, 08:58 AM)josemendez Wrote: Keep in mind you must disable the jobs debugger and safety checks when running Burst code in-editor, otherwise it will be much slower due to the debugging/checks overhead. See "Performance" in the manual:
http://obi.virtualmethodstudio.com/manua...kends.html

Regarding your profiler session: you're updating all physics in the scene 17 times per frame.
[Image: QE3jLlk.png]


This likely means your max allowed timestep is too high, and the workload for each individual update too great.
To reduce the max allowed timestep, go to Unity's Time settings and set max allowed timestep to a small multiple of your  timestep (eg. if you're using 0.02 as the timestep, set the max to 0.02 - 0.06)

Zooming into an individual update shows most of the time is spent calculating collisions between particles. If you have a folded towel, it's a lot more efficient to simulate it as a softbody instead of simulating it as cloth and relying on self-collisions to do all the work keeping the folds from penetrating each other.

kind regards,
Hi,
I followed your steps but still its too slow in editor.
  • I just duplicated the 'ClothSoftbody' scene and the softbody game object under the solver. 
  • I duplicated the balloon blueprint, added our washcloth mesh, and then assigned it to the duplicated softbody gameobject.
please check the screenshots attached.
[Image: view?usp=sharing]
[Image: view?usp=sharing]
[Image: view?usp=sharing]
[Image: view?usp=sharing]
[Image: view?usp=sharing]
[img] https://drive.google.com/file/d/1TeAcuSD...sp=sharing[/img]

https://drive.google.com/file/d/14a44sPC...sp=sharing
https://drive.google.com/file/d/1AS7Xqzf...sp=sharing
https://drive.google.com/file/d/1xijcgBW...sp=sharing
https://drive.google.com/file/d/1bDMhnd5...sp=sharing
https://drive.google.com/file/d/18MLq2Lz...sp=sharing
https://drive.google.com/file/d/1TeAcuSD...sp=sharing
Reply
#10
(28-06-2024, 09:27 AM)balaji.v Wrote: Hi,
I followed your steps but still its too slow in editor.
  • I just duplicated the 'ClothSoftbody' scene and the softbody game object under the solver. 
  • I duplicated the balloon blueprint, added our washcloth mesh, and then assigned it to the duplicated softbody gameobject.
please check the screenshots attached.
[Image: view?usp=sharing]
[Image: view?usp=sharing]
[Image: view?usp=sharing]
[Image: view?usp=sharing]
[Image: view?usp=sharing]
[img] https://drive.google.com/file/d/1TeAcuSD...sp=sharing[/img]

https://drive.google.com/file/d/14a44sPC...sp=sharing
https://drive.google.com/file/d/1AS7Xqzf...sp=sharing
https://drive.google.com/file/d/1xijcgBW...sp=sharing
https://drive.google.com/file/d/1bDMhnd5...sp=sharing
https://drive.google.com/file/d/18MLq2Lz...sp=sharing
https://drive.google.com/file/d/1TeAcuSD...sp=sharing

Hi,

I meant simulating it as an actual softbody, not a cloth softbody. Cloth softbodies use http://obi.virtualmethodstudio.com/manua...aints.html pressure to inflate closed meshes, like a balloon. This doesn’t make any sense for your use case: a folded towel is very expensive to simulate as cloth due to the sheer amount of contacts, and doesn’t make sense to inflate it like a balloon either.

The best way to simulate it is as a softbody. Note this would *not allow you to unfold the towel*. If you want to be able to fold/unfold it, you need to simulate it as cloth, but obviously in the unfolded state (not using a mesh that represents is as a folded object like you’re currently doing).

In few words:
- if you want to simulate a folded towel using a mesh that represents it in a folded state, use ObiSoftbody.
- if you want to be able to fold/unfold it, you must use a mesh that represents it in an unfolded state, and use ObiCloth.

Write to support(at)virtualmethodstudio.com and we’ll swap your ObiCloth license for a ObiSoftbody license in case you need.


Kind regards,
Reply