12-11-2024, 03:01 PM
(12-11-2024, 08:44 AM)josemendez Wrote: Adding the SDF to the ObiCollider component is the correct thing to do.
Updating an SDF is an extremely expensive operation. This is not what you'd typically do unless you're baking it in the GPU and the SDF is quite low-resolution. For instance, Unity's MeshToSDF is fast enough for realtime use with resolutions of 32^3 to 128^3, which are not nearly enough for accurate cloth collision detection against a human body (you'd need at least 512^3). VFX Graph's SDF baker also warns you about this:
Instead, use multiple convex (or nearly convex) SDFs and parent them to the character's bones, similarly to what you'd usually do for regular character hitboxes in most games. This requires no updates whatsoever so it's completely free in terms of performance and for most use cases results will be indistinguishable from updating a whole-body SDF. I wrote a quite detailed description of this approach's strengths and weaknesses in this thread.
kind regards,
Thanks for the help and suggestions!