Search Unity

Hair Designer - Dynamic hair & fur tool

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

  1. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    929
    Hi, the demo is not really optimized, it uses a lot of subdivisions for the long hair layer.
    You can reduce the performance cost by selecting all the strand in design mode, and set the subdivision Y to 8 instead of 30. You could also disable the dynamic setting on the shortest strand, and rely on the motion zone (GPU based), but it won't react to collisions.
    I'll improve the long hair motion system with multithreading or compute shader. ;)
     
    Last edited: Jul 20, 2019
    neoshaman likes this.
  2. r3ndesigner

    r3ndesigner

    Joined:
    Mar 21, 2013
    Posts:
    92
    Hey kalagaan when you ll sell some hair templates for your tool? ll be nice asset i ll love to buy.
     
  3. coolguyconan

    coolguyconan

    Joined:
    Aug 24, 2018
    Posts:
    4
    Thank you for your reply. We will follow your advice and try to make the best of it.;)
     
  4. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    929
    I'm doing some tests, I'll probably use the Jobs system & Burst compiler to boost the performances ;)
     
  5. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    929
    I have to finish some tools and features before selling extra content.
    I want to create a way to share strand models between users by using a graph system for the generation.
    It's a lot of work and I don't know when it will be released.
     
  6. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    293
    hi, I have a problem when I add Hair Designer to my character and select Fur there is a massive ball of fur surrounding it, then I click on Design - Create Texture and it disappears but when I start painting its just too big like 5 times bigger than my character and even if I decrease the intensity its still big (0.04) and 0.03 intensity doesnt do anything at all.

    I should mention that my model is very low scale and I resized it to 25x25x25 (the skinned mesh renderer is 1-1-1 though)

    I want to make lion mane and I need more info on the gorilla example you posted.
     
    Last edited: Jul 22, 2019
  7. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    929
    It looks like the fur length is too high,(because of the model scaling)
    when you add the fur layer, you can change the length of the fur in the material tab, try something like 0.01.
    The mask value will decrease the max length defined in the material tab.

    The gorilla example was made with the 'Advanced fur' layer, it's not yet available in the current version.
    I'll release it next month. ;)
     
  8. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    293
    okay, whats the performance of it? how many polygons? I noticed lag while editing the fur but it might be because if the big length im setting (or because my model is 40k polys).
     
  9. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    929
    The fur layer works better on low poly mesh, because the shell technic duplicates the model.
    If you have LOD versions of your character, you have to use the lower version.
    You have to reduce the shell count to optimize the performances in the design panel.
    There's also a LOD system for optimizing the shell count according to the camera distance.
     
    Last edited: Jul 22, 2019
    skinwalker likes this.
  10. coolguyconan

    coolguyconan

    Joined:
    Aug 24, 2018
    Posts:
    4
    Thank you very much. We are looking forward to the next version.;)
     
  11. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,016
    With the long hair, do I need to recalculate the cloth physics after each edit to the mesh?
     
  12. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    929
    Yes, the cloth data are defined on a specific mesh, so if the main mesh is modified, it won't work properly.
    When the mesh is edited, the gameObject of the haircut is removed and generated again.
     
    wetcircuit likes this.
  13. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,016
    Unity - Main Camera 2019-07-27 at 22.21.46.png

    Learning the v2 Long hair motion, … and the specular.
     
    hopeful, kalagaan and kilik128 like this.
  14. Fluffy-Tails

    Fluffy-Tails

    Joined:
    Jun 28, 2009
    Posts:
    114
    Hey Kalagaan, I have some suggestions and ideas to improve this asset :D

    My game is entirely Furry based and Fur and Hair is an important feature.
    One thing that won't work for my game, based on some experiments I have tried, is manually painting Groom and Direction Maps.
    Masking and Density maps are easy but Grooming and it's Direction Maps prove problematic when you have a larger scale project than just a few characters.

    Seeing as how I plan to have many different species and not all of them have Fur, this includes things like height, weight and build.

    Currently, I am using Substance to generate maps and I tried to find a way to generate a sort of normal direction map that hasn't helped any and doesn't seem to get normal directions for grooming.

    Would it be possible to have a sort of procedural Fur Groom / Direction Map?
    How about Flow Maps that take a Normal Vector Direction and could possibly be painted?

    Having many different species and fur types would be a nightmare for static Maps I could have to change for every character if not species.

    Do you have any ideas how this could be accomplished?
    Manually painting and editing Maps is going to be a major pain in the neck with countless characters.
     
  15. Ruberta

    Ruberta

    Joined:
    Mar 5, 2019
    Posts:
    34
    Can you support hair shader for LWRP please?
     
  16. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,016
    Screen Shot 2019-07-29 at 10.28.46 AM.png

    Curls and physics and backlighting….

    Why make games in Unity when you could be making ~ HAIR DRAMA ~
     
    Last edited: Jul 29, 2019
    hopeful, neoshaman and kalagaan like this.
  17. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    929
    The brush map of the fur shader is a per vertex direction in tangent space, so it's really difficult to generate this map automaticaly because it depends of the mesh topology. So you have to manually define the direction of the fur for each mesh :confused:
    If you find a way to generate the direction in UV space, you could convert it to a per vertex map compatible with the fur shader.
     
    Last edited: Jul 29, 2019
  18. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    929
    I'll have a look to the LWRP when the all the shaders will be compatible with HDRP. ;)
     
    Ruberta likes this.
  19. r3ndesigner

    r3ndesigner

    Joined:
    Mar 21, 2013
    Posts:
    92
    One more gift to you kalagaan
     
    kalagaan likes this.
  20. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    929
    Nice tool :)
    The workflow is incredible! Thank you for the reference ;)
     
  21. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,016
    I was sold until the mustache and eyebrow magically appeared completely filled in. I am skeptical.
    I think this is a tool for avatar customization based on presets, not a creator interface on an un-prepped model.

    But an interpolation-fill would be a cool tool to have.
     
  22. r3ndesigner

    r3ndesigner

    Joined:
    Mar 21, 2013
    Posts:
    92
    http://www.hao-li.com/publications/papers/uist2019HBIDDHM.pdf
     
    kalagaan and wetcircuit like this.
  23. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,016
    kalagaan likes this.
  24. r3ndesigner

    r3ndesigner

    Joined:
    Mar 21, 2013
    Posts:
    92
    ^^ you are welcome
     
    wetcircuit likes this.
  25. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    929
    Thank you for sharing :)
    It's really inspiring, even if I won't use a haircut database now...
    The idea would be to create the tools to feed the database :p

    I think that I have to create more tools (better mirror, area duplication...) for helping to create the strand curves with a few informations.
    If I combine it with a strand generator, it would be really easy to generate haircuts on any models.
    And the best would be a template exporter for adapting a haircut (or a part of it) on another 3D model.
    Still a lot of work on HairDesigner, but it will be better and better ;)
     
    Last edited: Aug 6, 2019
    r3ndesigner and wetcircuit like this.
  26. r3ndesigner

    r3ndesigner

    Joined:
    Mar 21, 2013
    Posts:
    92
    no problem, you are welcome, i love your job ^^.
     
    kalagaan likes this.
  27. Ruberta

    Ruberta

    Joined:
    Mar 5, 2019
    Posts:
    34
    When will fur and advanced fur be ready fro HDRP? o_O It seems like there is only atlas shader in HDRP now.
     
  28. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    929
    I'll try to convert the fur shader with ShaderGraph this month,
    but the advanced fur shader can't be converted with ShaderGraph, so the conversion for HDRP requires more work and I don't know yet when it will be available.
     
    Last edited: Aug 7, 2019
    Ruberta likes this.
  29. Lewnatic

    Lewnatic

    Joined:
    Sep 29, 2012
    Posts:
    193
    Hello @kalagaan

    Im currently running into a very strange bug when using the new hairdesignerRuntimeLoader on my character. My Creatures have multiple different fur types that can be selected from an ingame UI. I always had a bit of a problem to create HairDesigner prefabs especially with Unitys new prefab system because sometime the changes in hairdesigner did not last after hitting the play button. so I was happy to try out the new HairDesigner runtime loader script.

    Sadly I run into a very strange bug while using it.
    When using the runtime loader only the default fur that is used in the prefab seems to be loaded and its not possible for me to change the fur again with my script.

    This is an example, how I interact with my fur textures.
    Code (CSharp):
    1.  
    2.  
    3. HairDesigner HDFur = this.GetComponent<HairDesigner>();
    4.  
    5. HairDesignerGenerator HDLayer = HDFur.GetLayer (0);
    6. HairDesignerShaderFurShell shader = HDLayer.GetShaderParams () as HairDesignerShaderFurShell;
    7.  
    8. if(creature1) {
    9.         shader.SetTexture (2,(Texture2D)T2DDefault1Fur);
    10.         shader.SetTexture (0,(Texture2D)MCreature1Fur.mainTexture);
    11. }
    12. else if(creature2) {
    13.         shader.SetTexture (2,(Texture2D)T2DDefault2Fur);
    14.         shader.SetTexture (0,(Texture2D)MCreature2Fur.mainTexture);
    15. }
    16.  
    17.  
    I could however try to create a prefab for every creature, but it seems a bit odd and redudant to do so, when the only thing I really need to change is the texture.

    But the actual kicker is coming now....

    I found out, that the creature fur selection is suddenly working when I select the gameobject in editor which has the HairDesigner component attached to it, and strangely then only when doing so! Is there something in idle or standby that is called when something with a HairDesigner component is selected in the editor?

    Then I tried the following:
    My creature selection worked fine before without using the run time loaded so I thought maybe it is something related to the "activateOnLoad" flag enabling/disabling it did not work, so I tried to disable the runtime loader and only .Load() it when it really is needed. Sadly it did not work as well. Its always the texture of the prefab that is loaded.

    My suspicion is that the runtime loader is forcing the prefab textures and does not allow changes to them. Is this true?

    But its still a very strange thing, since selecting the gameobject with the runtime and the Hairdesigner component is suddenly fixing it. o_O

    Edit: Problem might be in the HairDesignerRuntimeLayerBase but sadly cannot open it because its an dll.
     
    Last edited: Aug 10, 2019
  30. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    929
    You have to add this line in your script after the shader modifiations :
    HDLayer.m_shaderNeedUpdate = true;

    When the gameobject with the HairDesigner component is selected, the editor script update the shader. ;)
     
  31. Lewnatic

    Lewnatic

    Joined:
    Sep 29, 2012
    Posts:
    193
    Hello kalagaan

    thanks for your response. Found that property yesterday and tried it already. Sadly it did not help to resolve that problem.:(

    I can also confirm that my script seems to work fine. Because my creatures have normal materials under the fur shell, which swap their textures just fine. Its only the fur shader that for some reason only updates when the gameobject with the component is selected once.

    Another interesting thing is that the fur selection works fine just after i clicked the gameobject with the component. So after that it works just fine and I can click on other UI to change the fur without problems. So it seems like there is some initializing going on that might not be intended.
     
  32. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    929
    Thank you for the feedback,
    I'm not at home, I'll do some tests tomorrow
    Could you send me a sample scene?
    (contact@kalagaan.com)
     
  33. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    929
    I've found the bug, it will be fixed in the next version ;)
     
  34. Lewnatic

    Lewnatic

    Joined:
    Sep 29, 2012
    Posts:
    193
    Wow cool thanks a lot! Glad I could help.
     
  35. SoloChristian

    SoloChristian

    Joined:
    Oct 9, 2012
    Posts:
    645
    I am looking for a hair system to do film rendering. I noticed on the demo we are not seeing shadows. Is this system capable of this? I would be using an offline renderer like Deckard Render or Offline Render. I am looking for Quality over speed for the Film rendering. So I am not concerned with real-time speeds at all.

    I was wondering if this has been used before for this and if it was an option?
     
  36. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    929
    Yes, hair and fur shaders cast and receive shadows. ;)
    But I didn't tried offline renderer, so I don't know if it requires specific shaders or not.
     
    SoloChristian likes this.
  37. zmiksic

    zmiksic

    Joined:
    Jan 15, 2014
    Posts:
    4
    When I try to edit a prefab with Hair Designer a following error appears in the console when I unlock a layer:

    IndexOutOfRangeException: Index was outside the bounds of the array.
    Kalagaan.HairDesignerExtension.TriangleLock.InitFaceData (UnityEngine.Vector3[] vertices, System.Int32[] triangles, UnityEngine.Transform transMesh, UnityEngine.Transform transTarget) (at <7f27ad60fec2455e8b0fe11806cad871>:0)
    Kalagaan.HairDesignerExtension.TriangleLock.Apply (UnityEngine.Transform transTarget, UnityEngine.Transform transMesh, UnityEngine.Vector3[] vertices, System.Int32[] triangles, System.Boolean force) (at <7f27ad60fec2455e8b0fe11806cad871>:0)
    Kalagaan.HairDesignerExtension.HairGeneratorLongHairBaseEditor.OnInspectorGUI () (at <84c2caa72d134ba1b2b4eeac596e8c35>:0)
    Kalagaan.HairDesignerExtension.HairDesignerEditor.OnInspectorGUI () (at <84c2caa72d134ba1b2b4eeac596e8c35>:0)
    UnityEditor.InspectorWindow.DoOnInspectorGUI (System.Boolean rebuildOptimizedGUIBlock, UnityEditor.Editor editor, System.Boolean wasVisible, UnityEngine.Rect& contentRect) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1625)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    My long hair layer is saved but there is no more edit tools when I click on Design button and unlock a layer this error appears. I'm using Unity 2018.4.6f1 LTS. Any clues what's wrong or what am I doing wrong? Thanks.
     
  38. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    929
    What is your version of HairDesigner? Did you create the layer with an older version?
    Does it works if you create a new layer?

    Could you send me the prefab ? (contact@kalagaan.com)
    It would be easier to check what's going on.
     
  39. zmiksic

    zmiksic

    Joined:
    Jan 15, 2014
    Posts:
    4
    Hair designer 1.7.0. I just purchased it a couple of days ago for the first time so I have no older versions. It doesn't work if I create a new layer. Sure, I can mail you a prefab. Thanks.
     
  40. cspid

    cspid

    Joined:
    Apr 25, 2014
    Posts:
    21
    Hello, I'm having an issue where my fur shell is unable to follow IK movement on my character. Is there a workaround for this? In my case I'm using RootMotion Final IK.

    Thanks!
     

    Attached Files:

  41. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    929
    Hello,
    you could try to change the script execution order in the project settings, the hairDesigner components (HairDesigner and HairDesignerBase) should be executed after Final IK.
     
    cspid and wetcircuit like this.
  42. Ruberta

    Ruberta

    Joined:
    Mar 5, 2019
    Posts:
    34
    Any update on fur in HDRP?
     
  43. siumanchun

    siumanchun

    Joined:
    Apr 7, 2013
    Posts:
    26
    Hi !
    Hair Designer 1.7.0 Support unity 2017.4.11 ?
    Thank you !
     
  44. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    929
    Sorry not yet,
    Unity change the transparency of the ShaderGraph HairMaster node in 2019.2, so I have to find a way to get the same quality than in 2019.1
    HDRP is a pain to support... :confused:
     
  45. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    929
    Yes it works with 2017.4 ;)
     
  46. Xskey

    Xskey

    Joined:
    Jul 23, 2013
    Posts:
    16
    That also explained why HDRP Demo look likes this in 2019.3 :( Hope you find the way to fix it soon.
    upload_2019-9-8_22-13-32.png
    Here is an error message in HDRP 7.0.1 (Unity 2019.3.0b2)
    I know that 2019.3 is still in beta but HDRP will be ready for production with this Unity version.
    It would be good to test on the version that's close to the production.
    upload_2019-9-8_22-10-24.png
     
  47. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    929
    Yes, same bug in 2019.3 than 2019.2.
    in this version the transparency must be enable in the material... this is weird...:confused:
    So you have to select the material "HairDesigner/Materials/HD_HDRP_Atlas"
    then set the surface type to 'Opaque', and revert it to 'Transparent'... and the transparency will be back. o_O
    But the transparency is complely different than the previous version... (the Hair master node is the same)

    Version 2019.1



    2019.2 (after the modification of the material)
     
    Last edited: Sep 8, 2019
  48. Xskey

    Xskey

    Joined:
    Jul 23, 2013
    Posts:
    16
    Thank you for the solution. This is what it looks like in Unity 2019.3 (HDRP 7.0.1)
    It looks more like 2019.1 version than 2019.2. :) However, there still is an error as I mentioned in previous post.

    upload_2019-9-9_10-16-45.png

    P.S. Not sure this will effect hair designer editor or not.
    upload_2019-9-9_10-55-58.png
     
    Last edited: Sep 9, 2019
  49. Fluffy-Tails

    Fluffy-Tails

    Joined:
    Jun 28, 2009
    Posts:
    114
    Any idea when Universal Render Pipeline (formerly Lightweight Render Pipeline) and HDRP will be supported for Fur?
     
  50. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    929
    How did you get this result???
    Did you change some parameters in the shader?
    I've tested with 2019.3b2 and the transparency is really weird :confused: