12-03-2021, 10:44 AM
(This post was last modified: 12-03-2021, 10:46 AM by josemendez.)
Quote:Found out 2 more things, at the beginning I put the cloth on top of a table which is mesh convex. So it collide since start the scene and that made hugh fps drop. Then I changed it to a box.
Another thing is I copy an Obisolver from some scene and its constraints are high value in the iteration. So I create a new one. That all fixed the issue.
MeshColliders are very expensive in general, but more so when using cloth as each individual cloth particle has to be tested for collisions against it. From Unity's manual (https://docs.unity3d.com/Manual/class-MeshCollider.html):
Quote:[..] they have higher processing overhead than collisions involving primitive colliders (such as Sphere, Box, and Capsule), so it is best to use Mesh Colliders sparingly.
Use MeshColliders only when absolutely necessary, and make them as simple as possible. Most of the time it's best to use Obi's distance fields: http://obi.virtualmethodstudio.com/tutor...ields.html. They're much cheaper and considerably more robust.