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

Alembic scene scale ruins the UV mesh resolving #80

Open Donatoz opened 4 months ago

Donatoz commented 4 months ago

Hi, i've encountered an issue while using a texture to sample a strand color.

I'm using .abc file as a source (exported from Blender, with the scale of 100.0) and Root UV option is set to Resolve From Mesh, with the basic mesh provided. The file has the Scale Factor set to 1 (default is 0.01), i.e. it has x100 scale during the import stage.

image image

Expected result (blender view): image

Actual result: image

Seems like alembic scene scale is not considered during the UV resolve process.

Hair shader (all values are set to default expect the base color, which is sampled from the texture using rootUV): image

Sampling works fine with the file scale set to 0.01, but the hair object appears to be incredibly small in the scene + simulation is unstable. image

I've found a workaround for the texture to be sampled properly - setting the .abc file scale back to 0.01 and increasing the hair object scale with Strand Scale set to Uniform World Max, but that makes the simulation absolutely unstable, so that won't suffice either.

image

Tested on Unity 2023.2.11f1, package version 0.11.0-exp.1, Alembic package version 2.3.4.

Resources: ReproFiles.zip

Note that the texture was created using the sphere UV.

I'll try to find the solution, but if you know any other way to import a strand color data, please let me know. Any help would be greatly appreciated!

fuglsang commented 3 months ago

Thank you for attaching repro resources. Will look into this when time permits.