Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Hair tool

Discussion in 'Assets and Asset Store' started by andrii-shpak, Aug 2, 2016.

  1. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315

    Hair tool
    is a plugin for creating animated human hair. To set it up you need a hair geometry mesh, and a few minutes to configure. Hair consist of nearly 20000 individual stands. Up to 500 of them are simulated with a physics engine, others are tesselated and interpolated.

    Physics are implemented with a custom engine based on Verlet integration, and executed on GPU (Compute Shader). You can configure elasticity, gravity, and curveness in editor. Colliders can be added to bones. Unity WindZone component is supported.

    Lighting is based on Kajiya-Kay reflection model. You can configure color and specular facor in editor.

    Shadows are implemented as a Unity shadow caster pass. Shadow receiving will be added with the next update.

    Editor is Blender. 3dmax support will be added in next build.

    Plans for the next update:
    - Shadows receiving.
    - Self shadowing by deep shadow map.

    Asset Store: http://u3d.as/wbp

    Tutorial:


    Performance Test:
     
    Last edited: Aug 6, 2016
    HelckOne, Thanathos, Artaani and 4 others like this.
  2. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Very cool.
    Looking forward to Max integration.
     
  3. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,202
    Looks great. Are you planning on releasing any tools for Maya? Are you also able to style hair within Unity as well? I would also love to see a video of performance of long hair, using multiple colliders for the shoulders, arms, chest, etc.

    Thanks.
     
    Last edited: Aug 8, 2016
  4. ElectroMantis

    ElectroMantis

    Joined:
    Sep 15, 2013
    Posts:
    78
    Wow this looks promising, and I appreciate the blender integration.
    What sort of hardware is this running on? Are you going to release a demo application?

    I'll definitely be following this.
     
  5. mysticfall

    mysticfall

    Joined:
    Aug 9, 2016
    Posts:
    649
    Is there any chance it could work on Linux? I know it requires DX11 for now, but I had to purchase it and try it anyway, as I was quite eager to see any option to make Blender hair to work with Unity.

    I really wish future versions could run on Linux version of Unity. Anyway, Thanks for the nice work!
     
  6. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    I plan to add long hair style with the next build. I'm not sure about Maya, I'll think about this. At now I'm working on plugin for 3d max.
     
    Artaani and theANMATOR2b like this.
  7. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    I run it on nvidia gtx 960. Yes I'll upload the demo with a new buld next week.
     
  8. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    Unfortunately dx 11 applications can't run on linux. But I'm working on hair for slower devices even mobile.
     
    Artaani likes this.
  9. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,202
    Can you style the hair in Unity, or do i need to use Blend or Max when it's available?
     
  10. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    You need Blender. 3ds max will be added soon.
    I was trying to add ability to style hair inside unity. But it was fail.
     
  11. Nostre

    Nostre

    Joined:
    Mar 3, 2012
    Posts:
    44
    This is a really nice work, I like where you go with that.

    Got 2 questions.

    First one, how much draw call or polygon this can take on a character? (Approximation)

    Number two, can we use this for mustache or beard?
     
  12. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    1) it use 2 draw calls. 1 draw call for hair and 1 for shadow. and it can have from 50000 to 5000000 and more polygons. depends from your settings.
    2) Yes hair can grow on any part of face and body
     
    Artaani likes this.
  13. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
  14. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,202
  15. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
  16. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,202
  17. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    At now I plan only Maya support.
     
  18. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    This video has bad quality, actually it looks much better. I will publish demo build soon.
    And yes it is without anti-aliasing. Anti-aliasing can be added as post process.
     
  19. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,202
    Love to see a demo!
     
  20. Aabel

    Aabel

    Joined:
    Nov 4, 2012
    Posts:
    193
    This looks fantastic! I would encourage you to make the file format information available so users can add support for their 3d app of choice. I would buy this but you do not support the 3d app I use (Houdini).
     
  21. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    Thank you for a great idea. I'll make this doc asap.
     
  22. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,202
    Just picked this up... it looks great! Just waiting in the Maya plugin and I'll share some of my work with it.
     
  23. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    Maya plugin will be added soon in the next update. As a lot of people asked.
     
  24. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,202
    Glad to hear it. Any idea of when that might be ready?
     
  25. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,202
    Any chance for capsule collider integration too?
     
  26. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Looks fantastic!
    Couldn´t this be used for grass, too?
     
  27. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    I plan to upload it at the end of this month.
     
    DigitalAdam likes this.
  28. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    Yes, I plan to add capsule collider. It has hight priority as well.
     
    DigitalAdam likes this.
  29. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    It is possible.
    But grass need different shading model.
    And other LOD system
    And it have sense only if you need realistic collision with grass.
    I will think about and maybe will release other asset for grass.
     
  30. anomas

    anomas

    Joined:
    Jul 3, 2016
    Posts:
    47
    Hi im having three problems i cant seem to find solutions for:


    1. Ive tried different scalps and hair styles but i always get this weird result, half of of the hair back is always missing.

    2. whenever i zoom the camera too much or alt tab unity while in runtime the hair tool stops working.

    3. im also having these errors no matter what.
     
  31. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,202
    Hi, any update on how the Maya export is coming along? Thanks.
     
    andrii-shpak likes this.
  32. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    1. Render settings => Length1 Length2 Length3 Try to set all values 1.
    2. Stands settings=> Bounds Size. try to increase this value
    3. It's unity bug. It always appear when you instantiating compute shader. Bug is registered. But it works good whis this messages.
    If you will not be able fix something send me Hair Script screenshot
     
  33. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    Yesterday I uploaded a new version with editor inside of unity.
    I can make plugin for maya it is 2 -3 days. But please send my any working video. Which instruments people ususaly use to create hair. Because instruments which I saw in maya was owfull.
     
  34. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,202
    I never used Maya hair before, but I was going to quickly learn it to work with your tool. Did you say you now have a hair editor inside of Unity?
     
  35. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    Yes, It is ready to download now
     
    Last edited: Oct 21, 2016
  36. k_a_p_p_o

    k_a_p_p_o

    Joined:
    Oct 24, 2016
    Posts:
    4
    It is a great tool!

    So I have a question.
    Shadow is not rendered.
    How do I render shadows?
    Error appears in the HairShadowShader.
    --------------------------------------------------------
    Shader error in 'Unlit / HairShadow': unrecognized identifier 'V2F_SHADOW_COLLECTOR' at line 238 (on d3d11)
     
    Last edited: Oct 27, 2016
  37. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    It because of changes in unity 5.4.1 I've fixed it and uploaded to asset store. So it is waiting for approve
     
  38. Goldrake

    Goldrake

    Joined:
    Feb 6, 2010
    Posts:
    148
    Any news about receiving shadows ?
     
    nxrighthere and RoyArtorius like this.
  39. Knightmore

    Knightmore

    Joined:
    May 11, 2012
    Posts:
    227
    This is somehow not really working with 3DS Max.

    Everytime I use the HairExporter Script I get this scalp model with one or two added triangles (depends if I seperate my scalpt to left and right)
    2016-11-13 02_24_27-Unity Personal .png
    This is what HairTool produces

    2016-11-13 02_25_01-Unity Personal.png


    And here the HairTool Settings

    2016-11-13 02_29_58-Unity Personal (64bit) - hairtest.unity.png
     
  40. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    Update with fuly supported shadows and depth texture is already uploaded to asset store and waiting for approve.
     
    nxrighthere likes this.
  41. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Will it work on PS4, and is there a 'high performance' mode? Like maybe thicker-fewer strands? I want almost no gpu impact if possible, even if it must be much simpler..
     
  42. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    One of my client have errors on PS4. We are trying to fix that. But I don't have ps4 development kit. So, it is long process.
    HairSettings script has LOD Setings. You can configure density, detail and thickness depends of distance to camera.
     
    Last edited: Nov 17, 2016
    Artaani likes this.
  43. npyasith

    npyasith

    Joined:
    Nov 23, 2016
    Posts:
    1
    This is awesome!!! is this mobile friendly?
     
  44. Knightmore

    Knightmore

    Joined:
    May 11, 2012
    Posts:
    227
    Okay I finally give up with this.
    The 3DS Max Script is giving me some strange triangle mesh on every object, so it still doesn't work for me like in my Nov 13 post.

    Then with the 1.0.6 update, the scripts show me random errors for e.g. the GeometryProvider when I want to add a "Hair Mesh Filter" to try if it works with blender.

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. Assets.Hair.Editor.Geometry.Import.GeometryProviderEditor.HairMeshFiltersList () (at Assets/Hair/Editor/Geometry/Import/GeometryProviderEditor.cs:78)
    3. Assets.Hair.Editor.Geometry.Import.GeometryProviderEditor.OnInspectorGUI () (at Assets/Hair/Editor/Geometry/Import/GeometryProviderEditor.cs:24)
    4. UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1235)
    5. UnityEditor.DockArea:OnGUI()
    6.  
     
  45. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    No it resquires dx11. I'm working on mobile hair.
     
  46. andrii-shpak

    andrii-shpak

    Joined:
    Nov 27, 2014
    Posts:
    315
    Fixed and uploaded to assetstore
     
    Knightmore likes this.
  47. Knightmore

    Knightmore

    Joined:
    May 11, 2012
    Posts:
    227
    After some bugs that occured to me, Andrii could get rid of them after two patches and I was able to get my first model with longer hairs done. I still need to test some things but for now it seems, that everything is working so far.

    2016-12-05 23_26_09-Unity Personal (64bit) - Demo.png

    I am very happy with the results. I just found another problem with added AO, but I have to figure out if it is on hair tools end or the AO solution itself.
     
    cwmanley likes this.
  48. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    I was looking for a new hair solution but sadly, I don't have 3ds Max and I refuse to use blender... does look good though
     
  49. tasadar

    tasadar

    Joined:
    Nov 23, 2010
    Posts:
    290
    hi, is it possible to add procedural hair, i mean add/remove hair at runtime?
    thank you.
     
  50. MrG

    MrG

    Joined:
    Oct 6, 2012
    Posts:
    363
    Please clarify if we still need external tools like Blender to use this, or can we just work in Unity to add hair to any model we already have?

    Where can we read the documentation without buying the asset?