Search Unity

Hair Designer - Dynamic hair & fur tool

Discussion in 'Assets and Asset Store' started by kalagaan, Sep 16, 2016.

  1. XthemeCore

    XthemeCore

    Joined:
    Jul 23, 2013
    Posts:
    23
    Does it support HDRP and URP?
     
  2. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    yes, the package includes addon for HDRP and URP
     
    XthemeCore likes this.
  3. XthemeCore

    XthemeCore

    Joined:
    Jul 23, 2013
    Posts:
    23
    Can't wait for the update. :p I just not sure that new animation system work on URP and HDRP.
    It looks cool! I wonder if I can use it with fur, or use that hair as a fur.
     
  4. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    Yes, the new animation system works with all the render pipelines, but it's only available for the long hair system.
    You have to use the motion zones for the short hair and the fur.

    I'll create a new kind of layer based on the new motion system.
    You could also animate any bone system using the API.
     
    XthemeCore likes this.
  5. JumpingGuy

    JumpingGuy

    Joined:
    Jan 2, 2016
    Posts:
    69
    @kalagaan
    Once again. I'm happy to say that this is an awesome tool. I've had great success so far with the fur and short hair.

    For the long hair. I'm trying to create a full set of long hair. Aside from adding hair one layer at a time, or duplicating and moving around duplicated layers, is there an easier way? Eg: a prefab that I can use or script to create a full set up of long hair as a starting base that can then be tweaked and customized?

    * Edit
    I'm able to use the long hair from the demo scene but only on the sample mesh. I can't seem to copy the sample long hair onto my character mesh. thanks in advance.
     
    Last edited: Mar 9, 2021
  6. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    Each layer is based on the character geometry, so you can't copy/past a layer from a character to another.
    I'll try to create a way to export a layer as a template, but it's no yet possible.
     
  7. Ruberta

    Ruberta

    Joined:
    Mar 5, 2019
    Posts:
    114
    I wonder if hair designer can do something like this? The developer said on his twitter that he use hair cards with DrawProcedural and a compute buffer. I'm not sure about short hair method in hair designer right now. Does it is capable to draw massive amount of cards?
     
    OfficialHermie likes this.
  8. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    You can create a lot of hair cards using the short hair layer.
    It will generate a new mesh based on the character skinning and blendshapes.

    You can use the advanced fur for creating DX11 fur with tesselation, it generates the hair cards at runtime.
    This tech is limited to windows computers and works only with thie built-in RP.




    I'm working on a new generator type based on drawprocedural, compute buffers and compute shaders for the animation. So it looks like the same kind of tech than in the video.
    I've still some work to do on the tool, so I don't know when it will be available.

    Here a sample,
    each strand is generated in the shader itself, based on animated nodes.

     
    Last edited: Apr 7, 2021
    Rotary-Heart, Ruberta and XthemeCore like this.
  9. Chris-St

    Chris-St

    Joined:
    Apr 8, 2021
    Posts:
    1
    While it was finicky and quite a bit of effort, I did exactly that and I am pretty happy with the result overall.
    I used short hair to have it support blendshapes.

    Anyway, visually they look pretty great and with the texture generator you can get a lot out of variation (length, density, clumpiness, straightness) out of it with just one set of painted short hair

    lashes1.png lashes2.png


    The generated blendshapes could be a bit better though as the movement is sometimes a bit off. For example I would expect the hair to move as a whole with the root, but sometimes the tip of the hair tries to stay in place while the root moves away.

    lashes.gif
     
  10. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    Wow, really nice work! :)

    I'll check the blendshapes generation, the hair card should follow the face orientation.
     
  11. Doomchecker

    Doomchecker

    Joined:
    Apr 5, 2021
    Posts:
    109
    Hi,
    the main reason for me using this tool is to create "simple" long hair added to a character Mesh.

    But I can't figure out how to do that. Is there a tutorial for that somewhere or do you mind giving me just a quick guideline how to practically accomplish that?

    I can use the small hair section, make the hair longer, but can't figure out how to make them just fall down with gravity. When changing the gravity parameter in the design or material tab nothing happens.

    Thank you very much!!
     
    Last edited: Apr 16, 2021
  12. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    Hello,

    You have to use the long hair layer.
    You'll be able to create geometry from curves, and the system will generates the bones and the animation system.

    I've just updated the package to the version 1.10.0, it should be available soon on the assetstore.

    This new version includes a specific demo for the long hair generator.
    The curve generator has been improved with new functions and options for optimizing the rendering while editing the curves.
    The new animation system (V3) is based on compute shader and it looks much better.
     
    hopeful likes this.
  13. Doomchecker

    Doomchecker

    Joined:
    Apr 5, 2021
    Posts:
    109
    Wow I'm perfectly on time for the new version :)
    Also thank you for your quick and comprehensive reply!

    Have to bother one more time though:
    All of a sudden I can't use the long & short hair Designer anymore with the mesh I'm using. Flur still works but when I try adding long/short hair, nothing happens. A few hours ago it worked with the exact same mesh.
    Maybe you've encountered something like that before and have a quick idea?
    Thanks again!
     
  14. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    That's weird :confused:
    Could you send me the mesh ? (contact@kalagaan.com)
    I could try by my side.
     
  15. Doomchecker

    Doomchecker

    Joined:
    Apr 5, 2021
    Posts:
    109
    I just made a new project, reimportet everything and it works fine. (restart before wasn't enough)

    Wonderful tool btw, so much fun :) Can't wait for the new version.

    Cheers!
     
    kalagaan likes this.
  16. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    Here some tests of the strand based tech.

     
    Rotary-Heart, hopeful and wetcircuit like this.
  17. Weendie-Games

    Weendie-Games

    Joined:
    Feb 17, 2015
    Posts:
    75
    This new update is available on the assetstore.. does it work with HDRP ? Because right now the long hair demo is using standard materials so in my HDRP project is all pink.

    How i can fix that? Wich material shoud i use to replace the standard one?

    Thanks
     
    Last edited: Apr 19, 2021
  18. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    Yes, the new animation system works with all the render pipelines. :)
    The demo is only available for the built-in render pipeline now, but I'll add a package for HDRP and URP.

    You have to change the material to 'HD_HDRP_Atlas', 'unlock' and 'Lock' the layer in the design tab.
    You can add the same hair textures than the built-in shader.

    If you need a version before the assetstore update, please send me an email with your invoice number
    ( contact@kalagaan.com ).
     
    Last edited: Apr 19, 2021
    Weendie-Games likes this.
  19. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    Hi,

    The documentation and example videos are way out of date.

    upload_2021-4-19_21-16-30.png

    I have attached the Hair Designer component to the head gameobject. I do not see any UI for placing long hair polygons. Is there an up-to-date walkthrough video?

    For reference, I am using URP11, Unity 2021.1.3f1
     
  20. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    Hello,
    I'll create a new video for the long hair layer.
    In the latest versions of unity, you have to enable the 'Gizmos' button in the scene view to enable the scene UI.
     
  21. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    I finally found a way to render really thin strands without too much aliasing :D

     
  22. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    I've added a braid mode :)
     
    XthemeCore, hopeful and wetcircuit like this.
  23. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    Alien thing ^^

     
    XthemeCore likes this.
  24. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    Sounds good, I will wait for a video demonstrating best practices for long hair. Very curious about your recommendations of where to place the curves and where not to place for more believable hair.
     
  25. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    WIP Better realtime subdivisions


     
    hopeful and XthemeCore like this.
  26. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    Any update on this, or are you working on the next asset update and I should wait for that first?
     
  27. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    I'll record the tutorial tomorrow ;)
     
    Exeneva and wetcircuit like this.
  28. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    I found a bug on Unity 2020.3 while recording the video, I need to fix it :confused:
    It prevent the long hair layer tools to work properly on 2020.3 and 2021.
    I'm focus on this and I'll finish the tutorial asap!
     
    Exeneva and XthemeCore like this.
  29. ChickenHero

    ChickenHero

    Joined:
    Jul 18, 2016
    Posts:
    79
    I'm trying UMA addon.
    1) When I set HairDesignerUMALoader to multiple long hairstyles, I get an error because the Head bone has already been added in the GenerateLayers function at runtime.
    Am I making a mistake when I want to use multiple hairstyles with HairDesignerUMALoader?

    2) I'm sorry if I missed the document.
    Is there an API to change the hairstyle in a script at runtime?
     
  30. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    Here a modification of the loader :


    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using Kalagaan.HairDesignerExtension;
    5.  
    6. public class HairDesignerUMALoader : MonoBehaviour {
    7.  
    8.     public List<HairDesignerRuntimeLayer> m_runtimeLayers = new List<HairDesignerRuntimeLayer>();
    9.     [HideInInspector]
    10.     public HairDesigner m_hairDesigner = null;
    11.  
    12.     public int m_haircutID = 0;
    13.  
    14.     public void Awake()
    15.     {
    16.                
    17.         UMA.UMAAvatarBase avatar = GetComponent<UMA.UMAAvatarBase>();
    18.         if (avatar != null)
    19.             avatar.CharacterCreated.AddListener(GenerateLayers);
    20.        
    21.     }
    22.  
    23.  
    24.  
    25.     void GenerateLayers(UMA.UMAData data)
    26.     {
    27.         m_hairDesigner = data.GetRenderer(0).gameObject.AddComponent<HairDesigner>();
    28.         HairDesignerRuntimeLayer.m_boneNameTotransform.Clear();
    29.  
    30.         for (int l = 0; l < m_runtimeLayers.Count; ++l)
    31.         {
    32.             HairDesignerRuntimeLayer rtl = m_runtimeLayers[l];
    33. HairDesignerRuntimeLayer.m_boneNameTotransform.Clear();
    34.  
    35.             if (rtl == null)
    36.                 continue;
    37.  
    38.             for (int i = 0; i < rtl.m_requiredBones.Count; ++i)
    39.             {
    40.                 GameObject bone = data.GetBoneGameObject(rtl.m_requiredBones[i]);
    41.                 if (bone != null && !HairDesignerRuntimeLayer.m_boneNameTotransform.ContainsKey(rtl.m_requiredBones[i]) )
    42.                     HairDesignerRuntimeLayer.m_boneNameTotransform.Add(rtl.m_requiredBones[i], bone.transform);
    43.             }
    44.  
    45.            
    46.             rtl.GenerateLayers(m_hairDesigner);          
    47.         }
    48.  
    49.         HairDesignerRuntimeLayer.m_boneNameTotransform.Clear();
    50.  
    51.     }
    52.  
    53.  
    54.     void Update()
    55.     {
    56.         if (m_hairDesigner == null)
    57.             return;
    58.         Debug.Log("test");
    59.         for(int i=0; i<m_hairDesigner.m_generators.Count; ++i )
    60.         {
    61.             m_hairDesigner.m_generators[i].SetActive(m_haircutID == i);
    62.         }
    63.     }
    64.  
    65. }
    66.  
    It fixes the bones to be registered twice, and provide a way to change the Haircut id at runtime.
     
    hopeful and ChickenHero like this.
  31. ChickenHero

    ChickenHero

    Joined:
    Jul 18, 2016
    Posts:
    79
    I was able to change my hairstyle. Thank you.
     
    hopeful likes this.
  32. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    Any update on this?
     
  33. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    The error has been fixed and the latest version has been uploaded on the assetstore :)
    It was a weird bug mixing editor code and runtime code. :confused:

    Now I'm working on the tutorial ;)
     
    XthemeCore likes this.
  34. Asarge

    Asarge

    Joined:
    Jun 2, 2018
    Posts:
    26
    Where do you post the tutorial videos I don't see any recent ones on youtube or the site? Also will URP be getting the advanced fur eventually?
     
  35. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    I'll post the new one on youtube.
    The advanced fur requires DX11 for generating each strand on the mesh, so it's not compatible with URP.
    I'm woking on a new procedural fur that will be compatible with all the render pipeline.
    It will be easier to generate LOD and it will use the same motion system than the long hair layer (motion system V3).
     
  36. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Which systems are compatible with blend shapes? (and which aren't?)
     
  37. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    Only the long hair layer is not compatible with blendshapes because it rely on its own bone system, not on the character mesh.
     
  38. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    can the long hair be instantiated on similar geometry? Like, if I made a wigcap with consistent vertex order?
     
  39. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    yes, you can load a runtimelayer made with the same reference mesh.
     
    wetcircuit likes this.
  40. OfficialHermie

    OfficialHermie

    Joined:
    Oct 12, 2012
    Posts:
    585
    Hello!

    I'm using Hair Designer since over a year now.
    It's great fun, but I have real problems producing good hair.

    Could you perhaps have a look here?


    Would it be possible to make Hair Desinger more like this?

    Well, I just read that the blender hair tool already does almost the same: https://gumroad.com/l/hairtool

    But I had already asked you about it like 1 year ago, if I remember correctly.

    Edit2:
    Hmmmm, I always get stuck at some point with Hair Designer.
    I will give it yet another try and see if I can get it this time.

    What would be so great would be a good preview. I will check it anything has changed, but in the previous versions, the Unity hair always looked unnatural, so it didn't motivate me to dig deeper into it. And the Blender video looks sooooo realistic. Totally motivating.
    Can we get the same with Hair Designer in Unity perhaps?

    Thank you for your reply!
     
    Last edited: May 26, 2021
  41. OfficialHermie

    OfficialHermie

    Joined:
    Oct 12, 2012
    Posts:
    585
    I am using Unity 2020.3.3f1 with URP 10.4.0.

    I have imported HairDesigner_URP_2019.3 from the Addon folder.

    Then I click HairCutDemo_proceduralV1(legacy), or HairCutDemo_AtlasShader.

    This is what I see:
    console1.jpg

    What am doing wrong?
    Is it not possible to perhaps write a script and add it to the gameobject which will tell your users what goes wrong in such a case and how to resolve it? Or it might even help you to figure out which fixes have to be automatically applied / suggested to make it work?

    Or is all this so complex that we have no other way than to ask for help here?
     
  42. OfficialHermie

    OfficialHermie

    Joined:
    Oct 12, 2012
    Posts:
    585
    After playing with it in a 3D template, I can tell again why I dislike Hair Designer and don't use it for production:

    The hair creation is just crappy, sorry.
    You can just spray hair cards on the mesh, nothing else.
    This is not enough to create realistic hair.

    And unfortunately it's still the same after 3 years where you said you would change it.

    I was so fascinated when I bought it 5 years ago, but even after 5 years, it can't be used for real hair unfortunately.
    Fur however seems to work fine.
    Perhaps rename it to Fur Designer only and not Hair to be more honest. :-(
    Sorry, I wanted to write more encouraging, but after 5 years of wainting and seeing no change for hair designing, I'm simply disappointed.
     
  43. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    The short hair layer sprays hair cards, this is usefull for fur, but with the long hair system you can generate more accurate haircuts using curves, and the new GPU motion system is much better than the previous version.

    The final result depends on geometry, material settings and texture generation, HairDesigner provides the tools for each step. The base of the tech is almost the same than in the video, but I can't recreate Blender inside Unity...
    If you can create hair in a 3D software you'll have much more tools than any unity addon will ever provide. But you'll have to create the skinning and use an addon in Unity for the animation.
    HairDesigner generates all the bones, the animation system automatically, and you can add hair colliders.

    The shading system is also really different in Blender, so I don't think that you'll have the same result if you import the model in Unity, and you'll have to use HDRP if you want the best result.

    I'm currently working on a strand based system that will look better, it will be another layer type that will generate the hair strands at runtime.
    Maybe it will be more suitable with your needs, I hope so.
     
  44. OfficialHermie

    OfficialHermie

    Joined:
    Oct 12, 2012
    Posts:
    585
    Well, maybe we can establish where it goes wrong.
    I use Unity 3D template.
    I use Long Hair with your standard material settings.
    This is what I get:

    1.jpg

    How do I get something realistic as shown in the Blender video, please?

    2.jpg

    Because that is what I would need to keep me motivated, and I guess most other people, too.

    Thank you.
     
  45. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    First you should use HDRP if you want to get the better results.
    You have to create the hair textures using the Texture generator (use the button in the material tab)

    In the strand edition, you should set the 'strand count' parameter to 10, and set some values in 'start offset' and 'end offset' for creating a volume.

    I'll post the tutorial about this asap ;)
    I had so many work these days that I'm super late for finishing the video :oops:

    Here a sample :


    A curve setting


    The texture generator looks like this
     
  46. OfficialHermie

    OfficialHermie

    Joined:
    Oct 12, 2012
    Posts:
    585
    Thank you, but it doesn't look like hair.
    With HDRP, I expect photorealistic results.
    What is missing for that in your workflow, please?
     
  47. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    The shader is based on the HDRP Hair master node provided by unity.
    I won't try to create a custom rendering system, because the HDRP is a big black box...

    Maybe you should use the Unreal engine, meta human is the most realistic avatar system.
     
  48. OfficialHermie

    OfficialHermie

    Joined:
    Oct 12, 2012
    Posts:
    585
    No, there are good hair shaders available, like Lux URP Essentials.
    Its hair shader is based on the HDRP hair shader, but is for URP.

    Is requires the following maps:

    albedo + alpha
    normal
    shift
    occlusion
    smoothness

    So I can simply switch the shader while I create the hair, right?
    Or would that require you to integrate a connection to Lux URP Essentials?
     
  49. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    HairDesigner shaders use the same maps, you can generate them in the texture generator.
    here the same character with different parameters


    You can use any material, you have to drag & drop it in the material tab.
     
    Last edited: May 29, 2021
  50. Doomchecker

    Doomchecker

    Joined:
    Apr 5, 2021
    Posts:
    109
    Hi there,

    When I add hair, it starts out about 50m from the head
    upload_2021-6-2_15-18-27.png

    After some time I manage to bring the hair back to the head by dragging&dropping the points on the line.
    That's fine I guess, just want to make sure if this is normal or am I missing something?


    And another quick question please:

    Is there a way to not let the hair getting through meshes (like the head and cloth) or do I have to be very precise here editing?
    EDIT: I found the colliders. Works great, great stuff :)

    Thanks a lot for helping out!
     
    Last edited: Jun 2, 2021