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

BuiltIn Line Strand Renderer sometimes produces invalid normals #5

Closed qlee01 closed 1 year ago

qlee01 commented 2 years ago

On complex hair, I get black screen flickering using the BuiltIn Line Strand Renderer, probably due to invalid normals being produced. This behavior goes away as soon as I switch to BuiltIn Strips Strand Renderer, so I guess it is not fault of my shader.

qlee01 commented 2 years ago

On further observation, the issue only happens if Subdivision is being used; without Subdivision, the black flickering is not happening. So it seems the combination of Subdivision and Line Strand Renderer seems to produce invalid results. I tried to catch the NaNs in shader (not sure if it's even NaNs), but did not succeed. This happens mostly on very curly or afro style hair.

Edit: It seems that the "staging" needs to be turned off to avoid the flickering, having staging on and subdivision to 0 does not help.

Edit2: I was able to narrow down the issue on normals and tangents, both seem to produce NaNs. If I catch both, issue goes away. Hope this helps. BTW this is some awesome library.

nukadelic commented 2 years ago

this is so weird , looks like a bot or something

qlee01 commented 2 years ago

this is so weird , looks like a bot or something

seems the bot got deleted ;)