Search Unity

Hair Designer - Dynamic hair & fur tool

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

  1. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    That looked (obviously) very good, but I'm a bit confused at what you understood.

    I have been researching how to represent black people hair type, and one of the thing I have realized was missing in many render to make that hair more believable was the "baby hair". I thought you were a black woman, that's why I name drop that term (baby hair) because in my research I found out it was a big deal and immediately make a visual difference (and also people who don't have that type of hair don't really conceptualized it, and therefore don't see it), it's one of the key of the cute fluffy look of black hair.

    Baby hair is basically the small very thin hair at the fringe of the hairline. Even when hair is straigthen it's there, because it's too thin and small for hair styling tool to caught them. They are further style with gel and toothbrush like tool, to make the wavy styling fringe pattern iconic to certain type of black woman. Like many thing about black people features, it's really really hard to google good reference stuff about it, so I cant provide visual example just now. Also I feel uncomfortable having to explain this since it's like it feels like I'm explaining to you something that belong to you lol

    But basically, it help visually fill the gap between hair strand layering on top of each other. I'm further surprised because I have seen another haircut you made where you at least the sensation of that type of hair.

    But to be frank there is little to no research made on that type of hair at all, and most document are made by peiple who have straight hair or with big loose curl, and they don't behave teh same at all. I always say that I will bring solutions for that type of hair, it's been a while, but I kept discovering things while trying stuff that didn'y look quite right. I think I have got a few fondamental right now, but there is still complexity to explore lol (mostly composed hairstyle from that type of hair). I had the idea to expose a few thing to @kalagaan but I want to be sure I have clear solutions, as I have seen him sweat a bit at some proposition, despite him being very open to suggestion (like the early curly trick with folded card, though even that need more extension to be fully believable).

    BTW I had made the promise to have the infinite hair volume shader done, it would have been complete if it was only about straight hair, turns out that you can't trace a ray and simply return an intersection with a sin, which I need to draw an helix (or so I think, I'm bad at math), so now I have to recompose a sin function with two x² function while keeping the wrapping effect, I'm still not sure how to do that (and it's pause because i'm doing an internship right now).

    AZlso I have some more research to do to approximate the fluffy shading look of that type of hair, because typical hair shader give them that hard look that don't match visual experience. In fact my whole quest is to get back that fluffy quality of that type of hair, because I found most rendering absolutely disastrous. Best example so far is still Sazh and Dajh in ff, and that's dated with pre PBR look. Amizingly in this case, the in engine render look way better that the sorry CG look they rendered into :confused:

    I'm commited to fully document good practice for that forgotten hair type! For all type of rendering and hardware power!
     
    kalagaan and wetcircuit like this.
  2. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    If we can figure out a workflow to pass to kalagaan, it will be the ultimate hair shader lol, the only one who cover all hair type.
     
    kalagaan, hopeful and wetcircuit like this.
  3. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,502
    I've rewritten the shader for PBR support :)

     
  4. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,502
    With longer fur :p
     
    hopeful, neoshaman and wetcircuit like this.
  5. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    interesting :)
     
  6. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,502
    You'll be able to touch the fur with colliders :D

     
    neoshaman, hopeful and wetcircuit like this.
  7. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,502
    Better fur flexibility

     
    led_bet likes this.
  8. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    What if he wears something, like a helmet or armband? Does that automatically suppress fur generation in that area, or do we need to alter the fur texture for when such are added?
     
  9. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,502
    I've fixed a bug on the animation system, its more fluid now :D
     
    imDanOush and led_bet like this.
  10. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,502
    You'll have to create different textures with the tool and swap them at runtime ;)
     
    led_bet likes this.
  11. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    Good to know. Was thinking mainly in terms of UMA implications.
     
  12. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,502
    The advanced fur will have the same issue that the regular fur for UMA integration.
    The UV of the generated character must be the same than the original character on which the fur was created. :confused:
     
  13. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    I don't think that's a problem. Texture generation for UMA is mainly done in Blender or similar tools.
     
  14. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,502
    maybe I'm wrong, but it looks like the different textures are compacted into an atlas at runtime, so the mesh UV are modified according to the texture position in the atlas.
     
  15. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    I'm 100% certain you have a better idea of what's going on and how it affects your plugin better than I do. :)

    I wasn't thinking of UV modification in that way, but yes, UMA will atlas all meshes for a character that are using the same material.

    A workaround is to have each furred item have its own material. Then it won't get atlased.

    Probably there is a better solution.

    What I was expecting was to have a fur mask that operates like a metallic, emission, or roughness mask, but I guess that's not possible for some reason.
     
  16. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,502
    I could pack metallic, emission and roughness into into the mask texture :)
    The shader is now PBR ready, so it would work. :p

    I'm not a UMA user, so I still don't know how to use it properly :confused:
    I'll add that in my todo list... ;)
     
    Last edited: Jul 1, 2019
  17. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    Well, UMA is not really all that complicated ... more or less. ;)

    The main thing is that I think UMA users would want to apply fur as an overlay (texture) on a slot (mesh). That way it can be over-written by other overlays, and that should allow for precise application of fur, different colors of fur, that sort of thing, within an atlas.

    If there is a fur shader that uses textures for fur color, length, and direction, then it could be the basis for an UMA material that is used in addition to the standard clothing shader.

    For example, I believe many people are using a skin shader for all skin areas, and the standard shader for clothing. This would be one more specialty shader, for fur areas.

    And / or there could be a way to add the fur code into ASE, which would help people doing custom character shaders.
     
    Last edited: Jul 1, 2019
  18. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,502
    The Advanced fur shader can't be done with Amplify shader :(
    And the fur is not a simple material, it requires the HairDesigner script and a compute shader.
     
  19. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    Hmm! Well, if you haven't already spoken to @Jaimi with the UMA steering group, he's probably the guy to consult.
     
  20. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,502
    Yes, he'll probably find a trick for the fur layer :p
     
  21. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Unity - Main Camera 2019-07-02 at 18.57.36.png

    Probably almost the last time I'll post this hairstyle, since I think(?) it's about done.
     
    Ruberta, neoshaman, kalagaan and 2 others like this.
  22. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,502
    Improved interactions :D

     
    Last edited: Jul 3, 2019
  23. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,502
    Better lighting

     
  24. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    Just an intuition, but what would that gorilla render looks like with ssao on the fur?
     
  25. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,502
    It looks like this....
    Does it confirm your intuition? :D

     
    Last edited: Jul 4, 2019
    wetcircuit likes this.
  26. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,502
    without Amplify occlusion ;)

     
    Last edited: Jul 4, 2019
  27. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,502
  28. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    Wait the ssao create teh zebra looks? :confused:
    i'm not sure if you are showcasing teh artefact, it's hard to compare if it's a new texture!
     
  29. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,502
    1st zebra with SSAO
    2nd without ;)
     
  30. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,502
    Without SSAO


    with SSAO



    without gorilla

     
    Last edited: Jul 4, 2019
    neoshaman likes this.
  31. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    Oh great!
    My intuition was it would make the volume less featureless, although the result is kinda low frequency, because ssao is done in half rez, maybe soft contact shadow.

    Maybe using a fake ao by masking light based on "depth (length) of strand" to simulate self occlusion of the fur volume. My intuition also say we could probably discriminate light direction using the tangent too.
     
  32. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    I want to hug them. Especially the prison stripes.
     
    neoshaman likes this.
  33. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,502
    I have already added a lot of ways to control a fake AO. ;)
    - the colors (root/tips) can be changed
    - it uses the texture generator, so you can control the color of the texture (and many more parameters)
    - there's a 'normal switch' function, so you can control the orientation of the normals of the strands.

    Here a version with other settings (without SSAO)
     
    Last edited: Jul 5, 2019
    OfficialHermie and neoshaman like this.
  34. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,502
    I should do a VR version for that :p
     
    wetcircuit likes this.
  35. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,502
    Here another version with less density, more softness...
    You can really change a lot of things with a few sliders :D

     
    neoshaman likes this.
  36. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,502
    Oops, I forgot to brush it :D


    Better with colors? I don't know... :p
     
    Last edited: Jul 5, 2019
  37. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    SHTAAAHP! :p:D
    Give us teh furries!
    Fluffy is wuvable..., but brushed he is an actual character. :cool:
     
  38. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,502
    I wanted to make that gorilla great again :p
    I'll try to release the first version of the shader next week ;)
     
    neoshaman and wetcircuit like this.
  39. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,502
    Quick test : haircut & beard using the advanced fur shader
    design made in 2 min :p

     
    neoshaman and wetcircuit like this.
  40. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,502
  41. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,502
    Better lighting / AO, translucency & Rim

     
    Ruberta and neoshaman like this.
  42. Ruberta

    Ruberta

    Joined:
    Mar 5, 2019
    Posts:
    114
    How much polygon of this gorilla? :confused: Does the fur work with 20k tris model?
     
  43. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,502
    This gorilla is a free model on the assetStore (5500 tris)
    https://assetstore.unity.com/packages/3d/characters/animals/gorilla-character-5108

    The shader is based on tessellation, so if your model has already enougth polygons, you won't have to use a high tessellation density for the fur. A density of 1 unit will draw only one quad per face.
    You can also set the subdivision of each 'quad' at runtime.

    All is done by GPU, so the minimum graphic card to use it is a GTX 970.
    I tried on my old computer ( GTX 460M ), it was really slow.
     
    Ruberta likes this.
  44. Ruberta

    Ruberta

    Joined:
    Mar 5, 2019
    Posts:
    114
    Thanks for reply. So, this fur cannot be export as geometry... How much frame rate you got from GTX460M? Is it lower than 30fps?
    I hope to use this with HDRP but the performance seems to be... low?
     
  45. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,502
    No
    It can't be exported as geometry, all the mesh is generated procedurally.
    About 10 fps or less on GTX460M (released in 2010), so it's really unusable on old graphic cards, you'll have to switch to the standard fur layer.
    This is not yet compatible with HDRP, I'll try to convert it later.

    The animation of the fur is also made procedurally by a compute shader,
    so the performances will be great on powerful graphic cards, and really low on old graphic cards.
     
  46. Ruberta

    Ruberta

    Joined:
    Mar 5, 2019
    Posts:
    114
    I'm asking this because I saw you said about geometry shader. Don't know what it is. :p Sorry.

    Few more questions:
    1. Is standard fur layer compatible with HDRP or I have to use HDRP hair instead for now?
    2. Can I use texture on fur? I means texture per fur (aka bird feather). It seems like I can use texture with hair in Hair Designer.

    I'm not gonna asking about ETA for advanced fur on HDRP but I hope it'll be released soon. :) Keep up a good work!
     
    Last edited: Jul 12, 2019
  47. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,502
    The geometry shader generates the mesh in the GPU, so it's really faster because the mesh is made directly in the GPU memory, no need to transfert data. ;)
    1. The standard fur is not yet compatible, I want to release the advanced fur shader before.
    2. There's different textures : main texture, fur density, strand textures (for each generated quad)...
    so yes, you'll be able to use a feather texture (diffuse + normal)...
    The tool also includes a custom color texture that you can paint on the mesh, so you can tint different part of the fur.
    You'll also be able to paint the mask texture to define where the fur should be applied.

    Here a quick test


    The orientation of the quad for feathers (or dragon scale :p ) is different than the fur, I'll add a parameter for changing the type of orientation.


    I'll try to release the Advanced fur shader (standard PBR) before my vacations (next week), but if I can't, it will be available next month.;)

    Thank you,
    I'm working hard on this stuff!!! :p
     
  48. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,502
    I've worked hard these last days on the Advanced Fur, but it won't be released until next month :(
    It requires more optimizations and I want to add more features for the customization.
    And I won't be able to do support for GPU stuff with my old laptop during my vacations :p
     
    hopeful, Ruberta and wetcircuit like this.
  49. Ruberta

    Ruberta

    Joined:
    Mar 5, 2019
    Posts:
    114
    Take your time. :) Enjoy your vacation.
     
    kalagaan and hopeful like this.
  50. coolguyconan

    coolguyconan

    Joined:
    Aug 24, 2018
    Posts:
    4
    We want to use hair desinger in our game,but the performance is poor. This picture is a screenshot of profile when run the long hair demo in your package.Will you improve performance in the future. upload_2019-7-19_10-20-11.png