Unity-Technologies / com.unity.demoteam.hair

An integrated solution for authoring / importing / simulating / rendering strand-based hair in Unity.
Other
719 stars 97 forks source link

Hair depenetration is too fast and brutal on SDF #29

Open methusalah opened 1 year ago

methusalah commented 1 year ago

When the hair is penetrating a SDF mesh, the depenetration causes a high velocity and a big bounce of the strands. It does not happen with sphere boundaries in my tests, with which depenetration is rather slow and linear.

This can happen when the hair is spawn or reset on a character that is not in their original pose (long hair spawned inside the back or shoulders for example).

Is there a way to lower the depenetration speed for SDF collisions?

fuglsang commented 1 year ago

Hi, thanks for reporting this. Currently there is no special handling for de-penetration on initialization, and we are aware of the issue. It'll be solved in a future release.

methusalah commented 1 year ago

Understood.

For what it's worth, in the meantime, I've added a tiny script that maximize the damping for a few frames after a reset, with decent results (it prevents most of the bounce).