Unity-Technologies / com.unity.demoteam.hair

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

Changes in UV data #78

Open qlee01 opened 7 months ago

qlee01 commented 7 months ago

Hi, one of the updates after 0.9 there seems to have been a change how UV data is utilized; the former version of Enemies Demo used a vertex ID stored in UV0 and some custom HLSL to determine the position on individual hair strands (0-1 from root to tip). With the latest changes, which are also replicated to Enemies demo, the strand UV from the HairVertex are used directly for this. However, this UV does not reliably have same data on all kind of strands, some strands don't seem to go until 1. Is there any way to replicate the old behavior now, having full range of 0-1 on all strands? This is critical for good looking simulation.

qlee01 commented 7 months ago

I was able to "repair" the function "CalculateHairStrandUV" by unpacking IDs the same way it is done in HairVertex.hlsl. This is suboptimal, as now we are doing some things twice, and I don't want to change anything in Hair package. it would be much better if the StrandUV provided by HairVertex node would deliver correct UV across the full length of strands.

fuglsang commented 3 months ago

Hi. This will be added soon, pending some additional refactoring work on inputs/outputs of the HairVertex node.