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:
    1,503
    I'll convert the fur shader when the HDRP will be more stable... ;)
    I've started working on it, but there's some weird modifications each time unity update the package...
    I'll convert the fur shader when the HDRP will be more stable... :p
    I've started working on it, but there's some weird bugs each time unity update the HDRP package...
    The conversion is made with ShaderGraph, so it will be easier to convert it for LWRP/URP.
     
  2. XthemeCore

    XthemeCore

    Joined:
    Jul 23, 2013
    Posts:
    23
    I try to reproduce it. Still not really sure but... maybe these parameters have been modified.
    upload_2019-9-9_22-21-57.png
     
    kalagaan likes this.
  3. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    Thank you so much!
    I missed that checkbox :confused:
    It also fixes the issue for 2019.2 :D
     
  4. XthemeCore

    XthemeCore

    Joined:
    Jul 23, 2013
    Posts:
    23
    @kalagaan
    Finally, I get my conclusion for 2019.3 (HDRP 7.0.1). Postpass not effect the result. You're welcome.
    upload_2019-9-9_23-11-13.png
     
    Last edited: Sep 9, 2019
    kalagaan likes this.
  5. Ruberta

    Ruberta

    Joined:
    Mar 5, 2019
    Posts:
    114
    Do you think you can work on fur in HDRP yet? Since the bug is fixed.
     
  6. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    Yes, I'll continue my work on the HDRP fur shader ;)
    I'll post some screenshots when I'll have nice results :)
     
    XthemeCore and Ruberta like this.
  7. TDHALL

    TDHALL

    Joined:
    Feb 19, 2017
    Posts:
    7
    Day 2 now of trying to use the Long Hair option and I cannot make any progress. I add hair strands and they extend straight outward, they are green, and have small red balls attached to them. How do you actually make hair looking strands which are realistic? I have fiddled with all the parameters in the materials settings and the "Add hair" menu, and nothing is happening that looks like hair. When I leave the editor mode and press Play, there is no hair anywhere. I am a 22 plus year computer scientist -- this system doesn't appear to work for the long hair case (given my efforts). Any help would be appreciated; I'm at a loss for how to make long hair. At one point I had some very long strands in Design mode, but they are always straight and extend for meters away from my mesh, and no variable setting changes this state. Explainer video or document for long hair? Totally baffling. Once again, what are the steps to go from straight green lines to being able to see and manipulable hair strands? When does long hair happen?
    Cheers,
    Tom H.
    upload_2019-9-16_21-54-8.png
    upload_2019-9-16_21-57-29.png
     
  8. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    Hello Tom,
    It looks like there's a scale issue wtih your character, you can change the initial length of the strand in the layer parameters (Design tab), you should set it to a small value (0.01). If you still have issues, please send me the fbx file of your character (contact@kalagaan.com), I'll have a look ;)
     
  9. TDHALL

    TDHALL

    Joined:
    Feb 19, 2017
    Posts:
    7
    At last! I see some anchor points to work with. I re-imported from Blender with a scaling factor of 100 and I see things to work with now. Thanks very much. Moving forward....
    Cheers
    Tom H.
     
    kalagaan likes this.
  10. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    HDRP fur shell WIP

     
    XthemeCore and Ruberta like this.
  11. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    HDRP WIP
    root color + specular

     
  12. TDHALL

    TDHALL

    Joined:
    Feb 19, 2017
    Posts:
    7
    Hello,
    Does anyone know how to move a layer of strands around all at once for the Long Hair option? For example, I have created 50 strands in Layer 1 and duplicated it and renamed to Layer 2. I then want to shift all of Layer 2 to the right or left a smidgen so that I can cover more of my head mesh. How do you move the whole mass at one time? I sense that the Alt key was designed with move in my mind. but pressing the Alt key does not result in an ability to move anything on my Windows 10 build. As it stands, I have to copy the layer, then switch to Design mode and move each strands one at a time, across the empty area of the mesh.
    Cheers,
    Tom H.
     
  13. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    You can use the design layers, you 'll be able to show/hide the part of the haircut you're working on.
    You can also use the mirror tool on a layer to speed up the design.

    the alt key is the way to move a strand on the mesh surface, you can easily duplicate and move the strands :
    - hold alt + shift
    - click on the duplicate button at the tip of the strand
    - hold alt + drag the duplicated curve


    Here a sample, the layer 1 is mirrored.
     
    TDHALL likes this.
  14. TDHALL

    TDHALL

    Joined:
    Feb 19, 2017
    Posts:
    7
    Thank you for responding. Your description is for moving individual strands. I want to move the entire layer around the mesh, with all of the strands included within the layer, with their relative positions in tact. Move all within the layer.
    Example is if you choose the duplicate layer option. It duplicates the new layer in exactly the same position as the original, so they are superimposed. It is at that moment that I will to drag the entire new layer out away from the original, to a new part of the mesh. And I don't see a way to do that. I can send a picture of two layers of 50 items each, one the duplicate of the other. But I can't make a picture of the new copy moved en masse to a different location.
    Cheers,
    Tom H.

    You can use the design layers, you 'll be able to show/hide the part of the haircut you're working on.
    You can also use the mirror tool on a layer to speed up the design.

    the alt key is the way to move a strand on the mesh surface, you can easily duplicate and move the strands :
    - hold alt + shift
    - click on the duplicate button at the tip of the strand
    - hold alt + drag the duplicated curve


    Here a sample, the layer 1 is mirrored.
    [/QUOTE]
     

    Attached Files:

  15. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    There's no option for moving all the strands at the same time, you have hold alt and drag each strand.
    I'll think about it for a next update. ;)
     
  16. TDHALL

    TDHALL

    Joined:
    Feb 19, 2017
    Posts:
    7
    Oh! Okay that explains that. Thanks regardless. It's late here in Seattle and I'm burning the midnight oil.
    Cheers,
    Tom H.
     
  17. Artaani

    Artaani

    Joined:
    Aug 5, 2012
    Posts:
    423
    Hello.
    Is there a way to create long hair using a code?

    I am asking because I found an editor for long hair is very complex to use, it has very small control gizmos which is hard to select and manipulate, so maybe will be better to create splines in Blender and after that spawn hair lines using data from Blender.
     
  18. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    imho, the Hair Designer gizmos are fine, but Unity's Scene View tools are just terrible. :confused:
    Not just the view controls, but the lighting, and that hideous outline…. Cryptic gizmos, and scaling that makes no sense :rolleyes:
    I considered buying a 3D mouse just to use Hair Designer… That or I need trackballs for my feet.
     
    kalagaan likes this.
  19. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    Sorry, there's no API for generating the splines by code.
    You can change the size of the gizmos in the inspector ("Handles size").
     
  20. Artaani

    Artaani

    Joined:
    Aug 5, 2012
    Posts:
    423
    Great, thanks you. Now is much better, also I noticed that in orto mode editing is much more convenient : )
    With new mirror tool it is much easier to work now, first tests:

    hair designer test 2.gif

    Is there a way to quickly reduce detail of long hair to implement LOD system?
    In the manual I found info about LOD only for Fur type of hair.
     
    wetcircuit likes this.
  21. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    There's not yet a built in LOD system for long hair.
    You could do your own LOD like this :
    - Duplicate the layer
    - Change the subdivisions of the strands
    - Switch the hair layer with a custom script
     
    Artaani likes this.
  22. Artaani

    Artaani

    Joined:
    Aug 5, 2012
    Posts:
    423
    That nice, thanks.

    Theoretically VR could be very good for hair editing since it provides a good orientation and control in 3D space, but we need API to make it possible.

    By the way, if I will buy a Pro version (with source code, I suppose), t will be possible to spawn long hair with code, right? Because it should be possible to invoke functions which invoked with mouse clicks while editing.
     
    wetcircuit likes this.
  23. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    The pro version includes the source code, so you'll have to replace the editor scripts by your own edition script.
    The mesh & bones generation is done by a runtime script, so if you generate the strand input data it could work.
     
    Last edited: Sep 23, 2019
    Artaani likes this.
  24. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    HDRP WIP
    dual specular color + AO

     
    XthemeCore, Ruberta and Artaani like this.
  25. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    HDRP WIP
    RIM + Transmittance
    Better control of density & thickness

     
  26. Artaani

    Artaani

    Joined:
    Aug 5, 2012
    Posts:
    423
    kalagaan
    Could you please collect your collection of pictures of long hair and put it as screenshots on asset store page, or somewhere else?

    Because I am not satisfied with result of long hair which I am trying to design, and I can't understand, am I doing something wrong or it is maximum quality which is possible in Hair Designer.
    Would be good to have some examples of what to expect and what can be achieved with this tool.

    Hair designer have "Long hair" feature, but there is no screenshots of such hair on the Asset Store, overall, asset store page should contain more screenshots of various hair on various characters.
     
    Last edited: Sep 25, 2019
  27. TDHALL

    TDHALL

    Joined:
    Feb 19, 2017
    Posts:
    7
    [Subj: Loading Layer Prefabs]
    Hello!,
    Could you explain how to load prefabs after they have been saved. I see a "....RuntimeLoader" script I think it is called, but not sure if I should attach the script to my player and add code to load the prefabs by name. (When I tried this it has a slot or two, but could not drag the prefabs into that slot).
    Suppose I have finished modeling hair for my character, have saved all the layers as prefabs. But now I want to go back to 3d modeling and improve my character mesh. When I re-import my character, or delete the character prefab and import anew, I would then like re-use the hair (prefabs). How do you do it? The documentation simply says that it can be done, but now how. I'm not interested in dynamically loading hair prefabs at runtime -- instead, I want to load the layer prefabs and continue tweaking things on the new character mesh.
    Cheers,
    Tom H.
     
  28. kevhayes

    kevhayes

    Joined:
    Nov 8, 2015
    Posts:
    10
    Do you have an ETA on HDRP (and Unity 2019) support release?
     
  29. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    I didn't show long hair pictures on the Assetstore because I want to improve the tool before.
    I'll work on a better demo but I need to finish the braid generator first.

    here some samples with the built-in RP (it should be better with HDRP)






    The final result depends of the textures generated by the tool.
    Theses samples where made with a few splines (~10 - 20) and the mirror tool.

    most of time I use a few hair count ( ~30-50) for generating the texture.
    Here a sample of the settings :


     
    Ruberta and Artaani like this.
  30. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    The runtime layers are only used for Runtime, so you can't load it in the editor. :(
    The haircuts generated by the tool depend of the original mesh, if you change the mesh it will break the compatibility, because the vertices and the faces index will change.
    The HairDesigner strands positions are defined per face, for the morphing compatibility and the skinning, so it's not yet possible to retarget a haircut to another character.
    I'll work on a way to save a haircut as a template, but it's not yet available.
     
  31. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    The current version contains a addon with a HDRP version of the atlas shader, for short hair and long hair.
    I'm working on the fur shader for HDRP, it should be available soon, I still need to work on the fur motion (motion zone, wind...)
     
  32. Artaani

    Artaani

    Joined:
    Aug 5, 2012
    Posts:
    423
    Great, thanks you. Good point.
    I think shader of long hair should be improved so it should looks similar like in this asset
    More contrast reflections would be nice.
     
  33. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    868
    Hi; I have two questions or suggestions:
    1) Hair designer generates a game object Layer1 with a SkinnedMeshRenderer, which is re-generated each time I do an edit. However I need different default settings for the rendering to work properly in my VR setup; this includes increase of render "priority" and "update when offscreen". would it be possible (or is it already possible) to influence these settings? right now I need to change them back each time I edit something.
    2) The mirror functionality on long hair is great. I guess it would help even more if one could mirror on the same side, and use the offset to make more dense hair (with only small offsets). Is this already possible, or is there another work around? Right now I need to do lots of copies and do the same adjustment over and over. to create a somehow dense hair effect.
    And one small issue I see: Sometimes it is hard to position a strand for long hair, especially on the top of the head, the tool sometimes does not allow to pull a strand up there.

    Thanks for all the efforts, great tool with high flexibility!
     
  34. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    1) I'll add a "Mesh generation" section in the design tool, so you'll be able to define these settings only once ;)
    2) you can add more density on each strand with 'strand count' parameter, you have to set the max angle to a small value (0-10) so the hair quads will overlap with small offest. You can also apply a random length on each of these quads. The parameters 'start offset' and 'End offset' are also important for generating more volume.

    The idea is to use less curves with higher density for covering the head.

    Here a sample :


    In the current version the raycast for the is based on the spline direction (green line), so moving the spline could be inaccurate according to the face normal direction, I'll improve that ;)
    If you have issues with this behavior, you could disable the 'snap surface' parameter.
     
  35. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    868
    wow, thanks for the fast answer, much appreciated! One other thing I noticed, and it seem also apparent on the image you posted, the shorter strands are not looking as good as the longer ones on the tips; probably it would need another layer with different settings in alpha & co ?
     
  36. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    The shorter strands share the same texture and shader settings thant the longer ones, so the only difference is that it's streched on the Y axis. I don't noticed such a difference, but if you want different settings, you could use another layer with other shader settings. ;)
     
  37. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    868
    Thanks for all the tips, I am getting close to good results for long hair (using HDRP in VR btw).

    I noticed one potential bug and have two more question:
    1) the mirror functionality seems to yield at a certain amount of strands (or vertices?), not mirroring any more new strands (edit: created a new layer with less subdivision, where problem does not occur. So best guess it is connected with number of vertices)
    2) is it possible to scale the root of strands with a blendshape? I am using blendshapes to adjust head scale and shape during runtime, but both in editor and during runtime the hair strands don't seem to move with the vertices, so I guess they have fixed positions?
    3) why are only capsule colliders allowed for collision ? sphere would be good to have also, at least I use sphere a lot in context of building complex collliders for characters.

    EDIT: One more issue I see: If I change depth offset, or leave it at default value, sometimes there are weird rendering artifacts, e.g. hair shining through other body parts. The more this value goes against 0, this effect seems to go away, but then the hair is partly hidden under the mesh already.
     
    Last edited: Sep 29, 2019
  38. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    1) Yes, the maximum vertex count of the mesh is limited, so you have to reduce the number of subdivisions for some strands. :)
    2) The strands are locked to the mesh faces for edition, but I have to update the position at runtime for the blend shape compatibility (like the short hair layer). It will be done soon ;)
    3) I'm working on a better motion/collision system, I'll add sphere, capsule and dual spheres capsule ( capsule with 2 different radius )

    4) The depth offset default value should be 0, I'll fix this in the next version.
     
  39. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    868
    Thanks for all the tips, making good progress, getting good results.
    I have one more question:
    It seems that the tool does not work on all kind of SkinnedMeshRenderers; so far I only got it to work on "characters".To make it transferable, I'd rather like to use it on a hair cap. However, I cannot create strands on this mesh. I don't get any error message. just no strands are appearing. (I am using https://www.sharecg.com/v/89347/, which requires Daz3d). Are there any restrictions on the mesh?

    Update: I found out that it only does not work if the skinnedmesh is a child of another gameobject, in this case the head bone of an character. if I move it to Root level, I can draw strands! If I move it back, strands remain, but I cannot paint again! Seems like a bug ?

    Update2: On the very same mesh, I encountered another bug. sometimes, newly created strands seem to randomly move their "endpoints" whenever I switch between design tab and something else.
     
    Last edited: Oct 8, 2019
  40. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    using hair cap is the best way to use the haircut on different characters. ;)
    Could you send me a sample scene? (contact@kalagaan.com)
    I'll have a look ;)
     
  41. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    868
    will try to reproduce with free assets, so I can send you a project. for now, I can work around the issue with parenting (this is better setup anyway), the only bad thing is moving strands of long hair.
     
  42. Ruberta

    Ruberta

    Joined:
    Mar 5, 2019
    Posts:
    114
    @kalagaan I wonder if advanced fur is possible to port to HDRP now. I know that you're working on fur now but how about advanced one? :)
     
  43. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    No, advanced fur is not ready for HDRP :(
    I can't convert it to ShaderGraph or ASE, because it requires a custom geometry pass and tessellation...
    I have to write the HDRP code, and it's not easy.... :confused:

    Unfortunatly I can't work full time on HairDesigner this month, I hope that I'll be able to finish the current work asap.;)
     
    wetcircuit and Ruberta like this.
  44. athosrojas

    athosrojas

    Joined:
    Jun 26, 2017
    Posts:
    76
    heeeelp! i am not a programer i am a 3d artist using your tool to create hairs for my characters. i was using ok on unity 2018.3 since last version now i installed the last release and i got this error and its not working. i make some tests with NGG softshadows and this change some files on unity , i just unistalll unity and re install and keeping geting this error ... unity 2018 legacy pipeline
     

    Attached Files:

  45. athosrojas

    athosrojas

    Joined:
    Jun 26, 2017
    Posts:
    76
    MY BAD! is all working ok sorrry guys. forget my last post
     
  46. Daniel_FuzzyLogic

    Daniel_FuzzyLogic

    Joined:
    May 8, 2018
    Posts:
    2
    @kalagaan Hi! Thanks for creating such an awesome tool!

    I've encountered an issue with the long hair system that is driving me crazy. Whenever I reselect the Design tab of a long hair layer, certain strands suddenly move to weird rotations and positions. Even if I lock the layer after editing, the same will happen when I unlock it.

    I also tested on the demo scene's long hair. I see the same happens if I convert to 1.6, move off the Design tab then move back. Am I doing something wrong or is this a bug?

    I am using Unity 2019.2.5 with the legacy renderer. There are no errors or logs in the console when this happens.

    I have attached 2 gifs showing the issue
    http://www.giphy.com/gifs/SvFIXc08pCwPefP65W
    http://www.giphy.com/gifs/ggEqOW0g9jUAoLZgG4
     
  47. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    Thank you for the feedback,
    I'll check what's going on ;)
     
  48. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    I've found the bug :)
    I'm working on a fix, it will be available soon ;)
     
    wetcircuit likes this.
  49. Daniel_FuzzyLogic

    Daniel_FuzzyLogic

    Joined:
    May 8, 2018
    Posts:
    2
    @kalagaan Thanks so much for the awesome support!
     
    kalagaan likes this.
  50. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    I've submitted the version 1.7.1 to the assetstore. :)
    It fixes the weird rotation bug, and it improves the snap to surface function for the long hair layer.
    It should be available soon.
     
    Last edited: Oct 19, 2019