Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. We are looking for your feedback about Templates! Tell us about your experiences by taking our survey.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Hair Tool

Discussion in 'Assets and Asset Store' started by andrii-shpak, Dec 15, 2016.

Thread Status:
Not open for further replies.
  1. peardez

    peardez

    Joined:
    Jun 27, 2017
    Posts:
    10
    Ok. I finally got it working after several tries. I'm not sure what made it work, but copy/deleting/copying the HairSetting script defintely had to do with it. I then tweaked waviness and other parameters and finally looks like it is keeping the pace and the physics look realistic. Still need to try more tweakings but Iwouldsay it looks a bittoo synthetic. A meshstripes/cloth simulation alternative seems to blend better with the rest of the elements of my character and scene. This is a very promising tool anyway and I'm eager to see it with my oculus. Upgrading to 2017.3 broke cloth simulation for this character for some unknown reason and I must deactivate either the hairmeshh cloth component or the dress one, I can't play them both or everything gets messed, so using this hair instead might be a solution. I still need to decide because of the difference of appearance but this tool definitey is very interesting andgives very good results.
    I'd suggest maybe to add the possibility to change tones of groups of hairs, not just root and tips. Also using textures instead of flat colours. Someone suggestedthat too I believe.

    Thanks for the fast support and keep the effort!
     
    Last edited: Dec 31, 2017
  2. incendy

    incendy

    Joined:
    Aug 23, 2013
    Posts:
    5
    Edit: Nevermind, figured out the issue. Camera had a raycast making sure my character was visible and the hair was getting in the way, changed the script to ignore the hair. Sorry if you wasted any time looking at this. Awesome product.
     
    Last edited: Dec 31, 2017
  3. hkung

    hkung

    Joined:
    Dec 1, 2015
    Posts:
    8
    Hello, thank you very much for the great tool!

    Can I add the Hair Tool components (GeometryCreator, HairSettings, and CollidersProvider) through scripting? For example, if I have a GameObject in the scene, instead of manually dragging the GeometryCreator component to the GameObject, how can I add the component through a script? This is my code but I couldn't get it working. Maybe I did not do this the right way?

    // Add the HairGeometryCreator component to the existing GameObject
    HairGeometryCreator creator = gameObject.AddComponent<HairGeometryCreator>() as HairGeometryCreator;
    MeshFilter meshFilter = gameObject.GetComponent<MeshFilter>();
    creator.ScalpProvider.StaticProvider.MeshFilter = meshFilter;
    creator.Geomery.List.Add(new GeometryGroupData());
    creator.Geomery.SelectedIndex = creator.Geomery.List.Count - 1;
    creator.Geomery.List[0].Generate(creator.ScalpProvider.Mesh, creator.Segments);

    // Create a GameObject that contains the HairSettings component
    GameObject hair = new GameObject();
    HairSettings settings = hair.AddComponent<HairSettings>() as HairSettings;
    settings.StandsSettings.Provider = gameObject.GetComponent<HairGeometryCreator>();
    settings.RenderSettings.HairMaterial = Resources.Load("Hair") as Material;
     
  4. cwmanley

    cwmanley

    Joined:
    Aug 8, 2013
    Posts:
    201
    Hi,

    I was able to sort out a workflow for Zbrush by creating a custom mesh for the Geometry Importer.

    Zbrush Fiber Mesh Intergration.PNG

    Should each strand have a unique index in the scalp mesh?

    The fibers in Zbrush do not match the topology so I have to handle mapping them to a scalp mesh.

    Thanks
     
  5. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    Each stands root vertex shoud be in same position with some scalp vertex
     
  6. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    It was not developed to use this way.
    Creator script do some things OnAwake. In your case data is initialized after Awake. So you can try to move code form Awake to Generate
     
  7. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    [Upgrading to 2017.3 broke cloth simulation] Reimporting pack will fix it.
    [using textures instead of flat colours] I plan to support both
     
  8. hkung

    hkung

    Joined:
    Dec 1, 2015
    Posts:
    8
    I exported hair geometry from Maya to Unity and applied Hair Tool to it. The hair geometry quickly fell off when the simulation started. I compared my settings (see attached screenshots) to the tutorial and document and did not find any major difference. Do you know any reason that might cause this problem?
     

    Attached Files:

  9. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    Increase Iterations.
    Play with root - tip elasticy curve
    Add colliders providers for head collisions
    Also try to decrease gravity
     
  10. blackant

    blackant

    Joined:
    Jun 18, 2009
    Posts:
    484
    Hello,

    i made a little setup to test Hair tool for my project, but it's actually not perfect because of a visual bug :
    Screenshot at 2018-01-12 12 09 05.png
    To make this setup it has been complicated, i tested multiple ways to do so,
    and the first problem i encountered was the main pose wich was not the same as the animation:
    Screenshot at 2018-01-12 12 08 00.png
    So i tested by using a separated mesh first, then each separated parts to meshes, but finally came to do it directly do it on the skinned mesh because it's simple to remove unused parts and create group for each part.

    it works but not perfectly and i would like to know if the bug is caused by my workflow or by the shader himself.
     
  11. blackant

    blackant

    Joined:
    Jun 18, 2009
    Posts:
    484
    I had another question,

    Would you plan to make the possibility to define grows, density, colors and others possibilities from texture map ?

    also would you like to add th possibility to rename groups so we can identify them easily ?
    And also the possibility to Show/Hide the groups to keep the process Clean or at least set the color to the new group directly
     
    Last edited: Jan 12, 2018
  12. blackant

    blackant

    Joined:
    Jun 18, 2009
    Posts:
    484
    i made more est and practices to setup my character, and it returns always that the max result i can get is using 1 group or 2, but at the third and fourth, the shader bugs a bit.
    Screenshot at 2018-01-12 16 56 44.png
    This time i made the head on the first group, wich was perfect alone,
    then i added the second group withe the arms, wich was also working correctly.
    then i added the third with legs and tail and bugs started to appear,
    so i removed the tail and made a final group for this part.

    and as you can see the fur is behaving strangly, especially at this step of the animation, when the arm, and the tail are near of each other.
    GIF.gif
     
    Last edited: Jan 12, 2018
  13. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    Thanks for reporting, It is a bug. You can only create 3 groups. I'll try to fix it tomorrow.
     
  14. Iguanodon

    Iguanodon

    Joined:
    Sep 9, 2016
    Posts:
    2
    Hi! I'm really enjoying the tool so far but have an issue with ambient occlusion - when AO is enabled in the post processing stack, the hair appears transparent and I can see the outline of the character's head underneath - this happens with both 2017.2.0 and 2017.3.0. Is there any solution for this at the moment?
     
  15. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,943
    Did anyone test this on OSX with Metal?

    Does it work, or needs still to be updated
     
  16. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    I've fixed it and uploaded to store as 1.3.2. Is you need it faster just write to my support mail
     
  17. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    It because normal depth testure is not supported by default. Here is quisk tutorial how to set it up
     
    blackant and hopeful like this.
  18. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    It will be soon but only in Unity 2018beta as it support tesselation on Metal. I'm working on it right now .
     
    Lars-Steenhoff likes this.
  19. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,943
    Great to hear!
    Have installed 2018 beta on Mac :)
     
  20. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    429
    It doesn't work with SEGI! please help.
     
  21. Iguanodon

    Iguanodon

    Joined:
    Sep 9, 2016
    Posts:
    2
    Thank you!
     
  22. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    The same solution you should add Depth texture support
     
    Malbers and ksam2 like this.
  23. AlenH

    AlenH

    Joined:
    Jun 30, 2015
    Posts:
    42
    Updating to 1.3.2 breaks tool. Hair does not show in play mode. Reverting back to 1.3.1 all works....
     
  24. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,943
    Can you also check for iOS when porting to metal?
    thanks
     
  25. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    393
    great tool ...
    but is it possible to using this tool on an animated alembic object?
     
  26. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    Yes if you import animaation as blend shapes
     
  27. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    Yes. obvious
     
    Lars-Steenhoff likes this.
  28. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    Maybe it is not compatible with older verssions but it works.
     
  29. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    393
  30. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    393
    any helps? :\
     
    Last edited: Jan 24, 2018
  31. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    Ok I'll play with it and let you know
     
  32. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    393
    thanks alot ...
     
  33. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    jdraper3, k_a_p_p_o and hopeful like this.
  34. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,268
    Just curious if the issue only appears when the hair is moved relative to the camera or if it occurs relative to the world. From the video I would guess the issue was only relative to camera.
     
  35. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    object position was animated. like just regular char movement
     
  36. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    hopeful likes this.
  37. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    Alembic objects is not supported yet. I've added it to my feature list.
     
  38. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    393
    does a chance to supporting alembic on 1.3.3?
     
  39. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    Not, 1.3.3 is already uploaded to store. I'll try to add it in 1.3.4 but I can't promise as I didn't worked with alembic import to unity and don't know how it works under hood.
     
  40. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    393
    its very simple ... just go to https://github.com/unity3d-jp/AlembicImporter/releases
    and download package and install it ...

    then just drag and drop alembic file to unity :]

    for playing animation select it from hierarchy and on timeline window click create and then right click and click on "add from animation clip"
     
  41. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    thanks, I it will help
     
  42. cheesepant

    cheesepant

    Joined:
    Jun 28, 2017
    Posts:
    3
    Sorry for dumb question but I was wondering if this would work with mobile, or if there is an option for caching the hair and using a still version for mobile.
     
  43. blackant

    blackant

    Joined:
    Jun 18, 2009
    Posts:
    484
    could you tell me about this question ?
     
  44. blackant

    blackant

    Joined:
    Jun 18, 2009
    Posts:
    484
    i did the update to 1.3.3, but the render is not showing any hairs now

    NullReferenceException: Object reference not set to an instance of an object
    GPUTools.Hair.Scripts.Runtime.Render.HairRender.Awake () (at Assets/GPUTools/Hair/Scripts/Runtime/Render/HairRender.cs:19)

    i miss something because i tested in a simple scene, dropping hair creator and hair settings on a mesh, but hair renderrer is created on the fly and is missing the material.
     
    Last edited: Feb 3, 2018
  45. blackant

    blackant

    Joined:
    Jun 18, 2009
    Posts:
    484
    well, i reimported the whole plugin and restarted my setup to make it work,
    but i'm still having an issue with it, same as the last, this time with only one group on a static mesh:
    Screenshot at 2018-02-03 11 08 16.png

    and this bug can be removed while adjusting volume so the best is to avoid volume at 1,1,1 and for exemple 0.99,1,1 will correct it
     
  46. blackant

    blackant

    Joined:
    Jun 18, 2009
    Posts:
    484
    While brushing hairs, it can sometimes happens that using middle mouse in remove mode to move camera, also delete splines.

    it also happens while rotating camera, maintening Alt

    and it can also soudenly does nothing while you try to continue editing it
     
    Last edited: Feb 3, 2018
  47. blackant

    blackant

    Joined:
    Jun 18, 2009
    Posts:
    484
    i tryed to make my strands from max 2018, but ...
    sorry to say that it doesn't work very well:
    Screenshot at 2018-02-03 13 29 00.png
     
  48. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    It doesn't works on mobile. I plan to add Metal support in unity 2018
     
  49. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
     
  50. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    Will fix it in fast update
     
Thread Status:
Not open for further replies.
unityunity