Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Question about garment onto a 3d avatar using Obi
#2
Hi!

What you want to do is not possible to do in realtime in a game, only under extremely controlled circumstances. Obi -like any other general purpose cloth simulator for games- isn't designed to approach clothing this way either.

The reason is that performing collision detection/reponse between two deformable meshes at the level of detail /accuracy required for cloth to stay on a moving character's body is extremely costly. MeshColliders in Unity (and their equivalent in other engines) do not support dynamic/deformable meshes for this reason: meshes must be static to be able to precompute a spatial acceleration structure that makes collision queries against a mesh tractable in realtime.

Software that does this (OptiTex, Marvelous Designer just to name a couple) are only barely realtime when using extremely simple cloth on a single character. They use specialized cloth simulation algorithms and collision detection pipelines specifically tailored for this use case, as their goal is accuracy over speed.

In games, character cloth is done by using what Obi calls skin constraints: basically constrain each cloth vertex to an animation-driven position. This does away entirely with collision detection. In cases where cloth is not very close to the body (a like a scarf, or a long cape) collisions are approximated using primitive colliders like capsules or spheres, parented to the character's joints. This is what's done in the CharacterCloth sample scene, and is the usual approach for clothing used in all existing games.

If you want to try doing this with Obi anyway, there's lots of fine parameter tweaking to do and you must become very familiar with how physics engines work internally. I'd recommend reading the documentation thoroughly, specially this one page that explains engine internals:
http://obi.virtualmethodstudio.com/manua...gence.html

Off the top of my head, some of the settings you'll have to tweak:
- In Unity's Time manager, set your maximum allowed timestep to a small multiple of the timestep (eg, for the default tiemestep of 0.02, use a maximum allowed timestep of 0.04)
- Increase the amount of substeps in your ObiFixedUpdater.
- In your ObiSolver, make sure all your constraint evaluation modes are set to Sequential.
- In your Obi Solver, fine-tune your collision settings (reduce collision margin and ccd)


kind regards
Reply


Messages In This Thread
RE: Question about garment onto a 3d avatar using Obi - by josemendez - 23-04-2024, 08:24 AM