com.unity.demoteam.hair icon indicating copy to clipboard operation
com.unity.demoteam.hair copied to clipboard

Changes in UV data

Open qlee01 opened this issue 1 year ago • 2 comments

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 avatar Dec 12 '23 08:12 qlee01

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.

qlee01 avatar Dec 12 '23 10:12 qlee01

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

fuglsang avatar Apr 16 '24 09:04 fuglsang