Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Cloth does not follow animation
#8
(14-10-2022, 07:38 AM)Ocean Wrote: https://gpuopen.com/tressfx/

Animated mesh colliders can be done in the link above.Convert the skinmesh to a signed distance field (SDF) collider each frame .


You can search the following keywords in the web page.

"Signed distance field (SDF) collision, including compute shaders to generate the SDF from a dynamic mesh."

Not really, for multiple reasons:

1) Performance-wise: this only works if you can use the GPU to generate the SDF, and use the SDF in the GPU as well. Obi is (at least right now) 100% CPU based, collision detection happens on the CPU and so the SDF must be used there. Bringing SDF data from the GPU to the CPU is extremely expensive, which makes using compute shaders for this unfeasible.

2) Robustness-wise: a SDF flip book does not contain any velocity information: you just have static "snapshots" of the mesh at each animation frame. So for fast moving meshes, this would break the same way a dynamically updated MeshCollider does because it's not possible to use CCD on it.

3) Detail-wise: the SDF generated by Obi is adaptive, so the amount of detail it can capture is far greater than you'd be capable of in a fixed-resolution SDF (which is what you'd usually do on the GPU since regular grids map very well to graphics hardware).

For skeletally-animated characters, the way I've done this in the past is to decompose the into convex pieces (one per bone, you can use bone influences to automate this), approximate each one with a SDF, and parent the SDFs to the corresponding bone along with a kinematic rigidbody.

This is extremely fast even in the CPU -since the only work done at runtime is updating the bone transforms-, robust -since velocity data is automatically derived by Obi for kinematic rigidbodies- and provides a fair amount of detail -except on areas that deform wildly, which is uncommon in humanoid characters-

cheers,
Reply


Messages In This Thread
Cloth does not follow animation - by adev eloper - 01-08-2018, 04:29 PM
RE: Cloth does not follow animation - by shilltk - 30-09-2022, 03:52 PM
RE: Cloth does not follow animation - by Ocean - 14-10-2022, 07:38 AM
RE: Cloth does not follow animation - by josemendez - 14-10-2022, 08:20 AM
RE: Cloth does not follow animation - by Ocean - 17-10-2022, 02:36 AM