Unity-Technologies / com.unity.demoteam.hair

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

SDF collisions are broken #92

Closed qlee01 closed 3 months ago

qlee01 commented 4 months ago

Hi, tested the last version a bit; SDF collisions seem to be broken in 0.14.1. All other collision types seem to work fine, but SDF collisions seem to have some weird offset / unpredictable behavior. SDF textures look correct in SDF debugger and it worked fine with former versions (used 0.11 before).

fuglsang commented 4 months ago

Hi, could you please attach a zip with a minimal scene + SDF for me to reproduce the behavior that you're seeing? Thank you.

qlee01 commented 4 months ago

Hi, could you please attach a zip with a minimal scene + SDF for me to reproduce the behavior that you're seeing? Thank you.

Unfortunately not so easily possible, as it's part of a 400GB+ project using copyrighted material. I have no issues with any version up to 0.13.0, though, only in 0.14.1 it started to go mad. Downgrading to 0.13.0 solved the issue. I am happy to retry once the crash bug is fixed, though.

qlee01 commented 4 months ago

Retested, same result: SDF collisions are completely off. Only changing the package to different version resolves the issue. I use the SDF also for other stuff, like cloth collision, and would recognize instantly if something is wrong about the SDF Texture. Does it work for you? I could build a repro project, but that would require much work (especially if it works on static SDF, as SDF in our project is synched with an animated character.

qlee01 commented 4 months ago

PS: As issue already is visible in editor, I guess it fails already on a static SDF. If you are not able to reproduce I could build a project, but would need to send by PM.

fuglsang commented 4 months ago

Retested, same result: SDF collisions are completely off. Only changing the package to different version resolves the issue. I use the SDF also for other stuff, like cloth collision, and would recognize instantly if something is wrong about the SDF Texture. Does it work for you? I could build a repro project, but that would require much work (especially if it works on static SDF, as SDF in our project is synched with an animated character.

Hmm, ok, so that is strange. Yes, it does work for me -- I am testing all new developments in an actual project, and specifically also against a static SDF. Are you using the "Standalone" mode in HairBoundary, or "Bind To Component"? One of the recent additions in HairBoundary is the ability to specify the assumed world size of the SDF if referencing a Texture3D directly. Perhaps this is what causes issues. Another addition is hidden: The transform of a HairBoundary is now used to derive motion of the static SDF for improved subframe/substep collisions.

In any case, I think I'll have to take a closer look. If you could email me the static SDF that you are using, as well as the settings from associated HairBoundary, that would be great. :)

lassejon@unity3d.com

fuglsang commented 3 months ago

Fixed in 3b6e5e950f4a4226e89f9efe716d82a548879233. Thanks for reporting this!