Search Unity

Assets [RELEASED] Hair Composer (nVidia HairWorks)

Discussion in 'Works In Progress' started by Simod, Jan 26, 2017.

  1. Simod

    Simod

    Joined:
    Jan 29, 2014
    Posts:
    161
    @hippocoder, good question, to date we expect it to run any card by any manufacturer which supports DX11. For example: it was tested (and partially developed) on Intel® HD Graphics 4000 - was slow but running.

    DirectX12 is in a list and has a low priority as we did not get too much interest from everyone.

    @sybere, yes we got pricing already: €35 on launch, supplied with RC version, and a short documentation.
    The price will be increased up until €50, with promised features list (see above), clean API, extended docs and tutorials.

    All subsequent features in TODO list (also see above) will be charged at extra as it needs more effort and work. Hence expect price to get higher.

    "XBOX One" is in a list too (support of other platforms in a TODO list), but development not started yet, nor the platform study. PS4 on the other hand has nothing but rumors if Dx API available for developers :)
     
    Crossway likes this.
  2. sybere

    sybere

    Joined:
    Mar 26, 2015
    Posts:
    176
    Thank you for the answer.

    Its a good starting price, if im buying for 35, will i need to compensate later?

    I'm currently working on xbox one project so in my case this is the main target, but i will make a try, any way to get notified if its available on the asset store? :)
     
  3. Simod

    Simod

    Joined:
    Jan 29, 2014
    Posts:
    161
    Thank you sybere,

    No, compensation is not necessary, once purchased you may use it in your application and all subsequent updates are free of charge.

    For updates please watch this thread and you will get notification for sure.
     
    Crossway likes this.
  4. johnartune

    johnartune

    Joined:
    Oct 18, 2016
    Posts:
    61
    Thanks for your help, Now I only need is waiting.
     
  5. johnartune

    johnartune

    Joined:
    Oct 18, 2016
    Posts:
    61
    I still worry about the time, We are waiting for the plugin, but if it's not suited for our projects, or have not enough tutorials. If or may release a beta version, let us trying. maybe we will send some other demands.
     
  6. Simod

    Simod

    Joined:
    Jan 29, 2014
    Posts:
    161
    Hello johnartune,
    I could send you a closed beta, if you willing give a feedback. There is no documentation yet (also in preparation).
     
    johnartune likes this.
  7. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    394
    I'm really willing to test it too. I know it will be the best hair system for unity.
     
  8. johnartune

    johnartune

    Joined:
    Oct 18, 2016
    Posts:
    61
    Hello Simod,
    Thanks for your believable. We are trying use unity make an animation film. But still been disturbed with character's hair and cloth simulation. And we created hair with polygons as the shader of Uncharted. But you know it just limited in short hair style. Then actually we should create hair like real human like. Like collision with head\neck\body and any other place could be. All so I bought a plugin from asset store, HairTool a good author give us so much help with a clown character's hair. But from then on still have so many problems. For example, simulation efficiency is the first trouble, and if the hair has curled style then curve just keep in one XYZ vector position, not along with hair line. But first of all the experiments, I have taken some experimentation with Nvidia hairworks the author is Unity Technologies Japan. And if you have tested the project, you know that just let the hair appears in scenes have no shadow and no self-shadow and can't receive texture hair color sky color and the plugin just in the previous version, not enough for our character use.
     
  9. johnartune

    johnartune

    Joined:
    Oct 18, 2016
    Posts:
    61
    This is our trying things. Not better but we wish a better plugin make us a leap. And I am so glad to test the version of Beta. I wish and will give a feedback, I promise I will.
     

    Attached Files:

  10. johnartune

    johnartune

    Joined:
    Oct 18, 2016
    Posts:
    61
  11. Simod

    Simod

    Joined:
    Jan 29, 2014
    Posts:
    161
    Hello guys,

    Sorry for late reply. I will send you links by PM today. Thank you
     
  12. Simod

    Simod

    Joined:
    Jan 29, 2014
    Posts:
    161
    Hi johnartune,

    To confirm: yes HairWorks can do curled hairs, with a few settings. To say clown with hair tools looks good too.
    Speaking of clown hairs, it depends how it will be shown to the viewer. Several questions:

    Q. Will you use camera close to the hair object. To rephrase: will your hair object cover lots of screen space?
    Q. How often viewer will notice a hair simulation? Does it use wind? Does character moves a lot? Does hair style is supposed to be static most of the time?

    These questions will help to decide what is best for your project.

    Hair simulation shines at closups
    , or to say: big enough hair objects which cover lots of screen space.
    The opposite case, when objects are too small (short hairs, no wind, no movement etc), is better used with old school meshes.
    Anything in a middle: depends on the case, and you could use both variants and switch them in runtime.

    Hopefully that will help.
     
    johnartune likes this.
  13. johnartune

    johnartune

    Joined:
    Oct 18, 2016
    Posts:
    61
    Hi Simod,
    Thank you so much, it's so much helpful to us.
     
  14. sybere

    sybere

    Joined:
    Mar 26, 2015
    Posts:
    176
    Hi, maybe can i get the beta version too?
     
  15. sccdhyt

    sccdhyt

    Joined:
    Apr 24, 2017
    Posts:
    9
    Hi Simod,
    It's a really awesome work of the hair system for unity, I can't wait any longer to try it before it appears in asset store.
    May I get a beta version too? I believe it will be really useful for my work.
     
  16. Simod

    Simod

    Joined:
    Jan 29, 2014
    Posts:
    161
    Hi Sybere,
    Yes, if could you send us feedback on XBox? There is no guarantee it will run on it though, but it's good to know.
    I will send you a link.

    Thank you sccdhyt,
    We are trying to test this on a wide range of hardware and in a different environments. If you could describe just a little of your work, t.e. how it will run hairs simulation. That would be very helpful to understand if closed beta test will work for you. Please contact me by PM. A very short detail is sufficient.
     
  17. umauj

    umauj

    Joined:
    Nov 20, 2011
    Posts:
    80
    Very impressive! Thanks for creating such an easy to use plugin!
    Are there any plans for other nvidia gameworks features to be transformed into plugins for Unity?
     
  18. Simod

    Simod

    Joined:
    Jan 29, 2014
    Posts:
    161
    Thank you umauj,

    There is no plans to implement extra from nVidia GameWorks yet. After completely finishing the current project, and if there is high demand, we will look into this for sure.
     
  19. johnartune

    johnartune

    Joined:
    Oct 18, 2016
    Posts:
    61
    Hi Simod,
    Sorry for so late to send the feedback. I have to improve the last polygon hair shader for some camera scripts, We use Post-Processing Utilities from https://github.com/keijiro/PostProcessingUtilities to create Ambient Occlusion but the hair shader with transparent render queue. Because of that, the scripts can't get model mesh then have any Ambient Occlusion & Depth of Field or other used of mesh depth FX.
    Maybe, hair shader's render queue set as geometry then make sure camera scripts can receive depth on the screen. OF1S088YRT70YIL`XM_(I}H.png PGAVXC7(THT~BV30TA67$RK.png
     
  20. johnartune

    johnartune

    Joined:
    Oct 18, 2016
    Posts:
    61
    Hi Simod,
    Sorry for the Bones & Pin Constraints, should be they are two different things in the hair system. For example, the male beard tied with two steel rings, how do I could make sure the two rings moving and rotating with Pin Constraints
    Pin Constraints.png
     
  21. Simod

    Simod

    Joined:
    Jan 29, 2014
    Posts:
    161
    Hello johnartune,

    You actually described two cases which are not supported yet.

    Currently image effects are not guaranteed to be working with HC... It's actualy related to depth map which should be rendered at extra pass. Let me try make it work today, it should not be hard to implement. Will let you know later

    Yes, pins and bones are absolutely separate. Pins API is not used by HC yet. But will be implemented after release.
    HC will get an extra function which should be called at every frame. It will return a list of positions. Using these details you may position your objects (steel rings) in the scene.
     
    Last edited: May 10, 2017
  22. Simod

    Simod

    Joined:
    Jan 29, 2014
    Posts:
    161
    @johnartune,

    Much better now. It probably will take two more days to complete, as it still needs testing "here and there".

    Unity 2017-05-09 18-46-43-68.png
     
  23. johnartune

    johnartune

    Joined:
    Oct 18, 2016
    Posts:
    61
    Hello Simod,
    Thanks for everything you did. Now I'll test our character for some more test. If there any other problem I'll send the feedback in the forum posts. For example, how to import hair with Shave And A Haircut & Nvidia hairworks to Unity.
     
  24. Simod

    Simod

    Joined:
    Jan 29, 2014
    Posts:
    161
    No problem and thank you too for the tests
    I assume you are using http://www.joealter.com/shave-and-a-haircut in Maya. In this case try this manual. I did not use this, but it should work just fine.
    There are also bunch of video tutorials, which are also very helpful.
     
  25. johnartune

    johnartune

    Joined:
    Oct 18, 2016
    Posts:
    61
    Hello Simod,
    I analysis the unity projects, find some different about how to use APX files. In your way, I need to create a hair asset file, then load the hair asset file to Hc Instance General Options. Why not load APX or APB file. Or just maybe we need do it once in HairWorksViewer, Cause of the HairWorks Pipeline process.
    HairWorks_Art_Pipeline.jpg
    But I find could create hair from Assets menu.
    CreateHair.jpg
    So should I import the APX to HairWorks first need to Edit in HairWorks Viewer?
    Because of I find some hair assets have some information about other FBX file.
    Eve_asset.jpg
    Or I could import the hair APX and edit it just in Unity.
     
  26. Simod

    Simod

    Joined:
    Jan 29, 2014
    Posts:
    161
    Hi johnartune,

    Yes the HairWorks Pipeline diagram is correct, and yes - you CAN cut the corners and start twicking hairs straight in Unity.
    There are some caveats though.

    HairWorksViewer has:
    • Hairs preview
    • Hairs tweaking
    • Simple scene setup for preview
    • Load and save to APX
    Hair Composer (HcInstance component) got:
    • Hairs preview
    • Hairs tweaking, except Pins
    • Scene of any complexity
    • Does NOT support saving to APX yet...!
    I would suggest start tweaking with HairWorks Viewer, save to APX and then load in Unity. This approach has several advantages:
    1. All settings are located in APX, hence you will get your backup
    2. You may preview your models with anyone of your team. No need to run a whole project
    3. Much faster setup in Unity:
      - create a new asset with Assets / Create / Hair Composer / Asset
      - load APX from a file
      - put all textures and FBX model into your Unity project
      - setup HcInstance component with a brand new Asset attached
      - hit "Reset Settings" button to load textures and settings
    4. Even faster with APX updates:
      - load updated APX from a file
      - hit "Reset Settings" button to update/reset all settings
    Once Hair Composer will get "Save To APX" feature, this workflow will be much easier.
     
  27. Simod

    Simod

    Joined:
    Jan 29, 2014
    Posts:
    161
    Upcoming update for Image Effects support. Two types which should cover most of the needs:
    1. depth (+1 pass); and
    2. depth and normals (+1 pass)
    Although it won't support motion vectors as we did not find a way to alter a texture.

     
    jdraper3 likes this.
  28. jdraper3

    jdraper3

    Joined:
    May 28, 2015
    Posts:
    117
    Looks great - hopefully you can find a solution for motion vectors. Really interested in the asset, but we use temporal aa.
     
  29. Simod

    Simod

    Joined:
    Jan 29, 2014
    Posts:
    161
    Thank you jdraper3,

    Yes, Speaking of AA, this definitely needs alike post processing technique. Think of lots and lots of lines on the screen - everything is aliased, a pure nightmare. We got something in mind, which is likely efficient for lines and much faster than MSAA, and also works for Deferred rendering path.
    Until then all our videos and examples are working with MSAA.
     
  30. johnartune

    johnartune

    Joined:
    Oct 18, 2016
    Posts:
    61
    Hello Simod,
    I already tested the pipeline of hairworks import to Unity. I found what ever you did in hairworks viewer, could not been recognized in unity. So next time I'll use unity import APX along. HairinNvidia.jpg
    And there some trouble in Camera Defferd setting, have no hair view in normal screen untill I start to play the game. HairinUnityDeffered.jpg HairinUnity.jpg
    Directional light have no hair shadow right now. Or maybe will have.
    This is the next hairstyle test.
    Hair02.jpg Hair01.jpg
     
  31. johnartune

    johnartune

    Joined:
    Oct 18, 2016
    Posts:
    61
    Hello Simod,
    Sorry for the inconvenience, If any possible let us select Animator or Animation system in hair asset setting.
     
  32. evilangel89

    evilangel89

    Joined:
    Feb 8, 2017
    Posts:
    268
    Hi, really interested in getting this, I am not extremely familiar with Unity apis and am definitely no shader wizard. Having said that will I be able to use this easily to add hair to my characters and fur to my creatures ?

    Is there a paid beta or something we can get aboard on now ? I see that you've got pricing set up for 35$ on launch.
     
  33. Simod

    Simod

    Joined:
    Jan 29, 2014
    Posts:
    161
    Hi johnartune,

    Thank you for report. Let's try troubleshoot it. Before importing into Unity from HairWorks Viewer (HWV), please make sure you save changes into APX file. You may do so in the "Hair Tab / Asset Selection", or in the "File menu" by selecting "Save hair file".

    Yes,
    Deferred path and Directional light shadows are not supported yet. You may find a full list of supported features on the first page. Deferred rendering and Directional shadows will be implemented later.

    Nice hairs style :) Keep going.
     
  34. Simod

    Simod

    Joined:
    Jan 29, 2014
    Posts:
    161
    @johnartune, In order to optimize the hairs you can animate what is really necessary. Please refer to the image attached. What will help to win some performance.
    Hair02.jpg
    /SPOILER]
     
  35. Simod

    Simod

    Joined:
    Jan 29, 2014
    Posts:
    161
    Hi evilangel,

    Thank you for your interest.
    To my experience most of work should be done then designing the hair style. For this you can use 3DsMax or Maya. Then after that you can tweak the hair settings (APX file) in the HairWorks Viewer, or import APX straight into Unity.
    No coding or shader knowledge is required.

    Try 3dsMax tutorial, this will give you a clue of the "hardest" part


    There is no paid beta (currently this product awaits nVidia's license). Until then we are running closed beta for tests, which will give this product some feedback, and let us know which parts should be polished.
     
    evilangel89 likes this.
  36. johnartune

    johnartune

    Joined:
    Oct 18, 2016
    Posts:
    61
    Hi Evilangel,
    Thanks for your reply.
    I'm just an artist in game development, I have no any of code technology. And the project are Simod gave it to me, let us do it in our projects and send feedback in our works if any problem.
     
  37. johnartune

    johnartune

    Joined:
    Oct 18, 2016
    Posts:
    61
    Hello Simod,
    I have done the new hairstyle this moment. I think it's almost a perfect plugin for creating hair in unity, better than I ever used before. And I found there are some functions are still developing, for example, Pin Constraints hope for support quickly, because when animation moving fast then hair guide curves stiffness top points couldn't keep in right place.
    HairMaya01.jpg HairNvidiaViewer01.jpg HairUnity02.jpg
    And then there some not better images.
    HairUnity04.jpg HairUnity03.jpg
     
  38. johnartune

    johnartune

    Joined:
    Oct 18, 2016
    Posts:
    61
    Some about motion blur and I think you already know this before.
    HairUnity06.jpg
     
  39. johnartune

    johnartune

    Joined:
    Oct 18, 2016
    Posts:
    61
    Thanks for your suggestion, I have created whole hair with hairworks to keep the art style and it looks greater right now when I push it into unity.
     
  40. johnartune

    johnartune

    Joined:
    Oct 18, 2016
    Posts:
    61
    Hello Simod,
    This is where I said about Animation or Animator setting in Hc Instance General Settings. Because of almost of time we use animation to control a character's movement. Or maybe could you please support let us chose.
    AnimationAnimator.jpg
     
  41. Simod

    Simod

    Joined:
    Jan 29, 2014
    Posts:
    161
    Thank you johnartune,

    To my knowledge Pin will always move and supposed for a different purpose. Although there is an example very close to your hair style. This can be helpful a lot - please take a look at the attached images. This example does NOT use Pins, hence hairs are very stable.
    PS. Also look at the FPS, if HairWorks simulates what is really necessary you will get a lot of performance. In the first image you can see three active instances. In the second image you can see removed "Top Crown", and "Hair Mess" instances - and only "Hair Tail" is active.
    Hair Composer (Tech Demo) 2017-05-17 11-46-53-79.png
    Hair Composer (Tech Demo) 2017-05-17 11-43-25-07.png


    Yes, motions vectors are not supported yet. Hence some Image effects, which rely on motion vectors, will not work

    "Animator" field is the type of Animator. This is for enabling Frame rate Independent Rendering (FIR). And gives an accurate simulation at expense of CPU time (or GPU if such setting was selected in Unity).

    Should be used rarely (for performance reasons), and only if necessary. For example:
    • This may improve the calculation accuracy for Pins
    • This may remove visible penetration into skinned model
    In order to use this option, just drag and drop Animator component of your character in the scene into this field
     
    Last edited: May 17, 2017
  42. johnartune

    johnartune

    Joined:
    Oct 18, 2016
    Posts:
    61
    Hello Simod,
    Thank you for your reply, I have used the "Hair Tail" method created my character. But it's so bad communication with images so I think to send you the project file is the best way then let you know what the problems in our projects.
    And how do I send the file to you, May I send a Email to you?
     
  43. Simod

    Simod

    Joined:
    Jan 29, 2014
    Posts:
    161
    Hello johnartune,

    Before you send the files please could you clarify how it looks right now? Please could you show a screenshot of the problem? Just need to check this again.
     
  44. ywj7931

    ywj7931

    Joined:
    Jun 24, 2015
    Posts:
    41
    I would also be loved to join the closed beta. Can I also ask how is the performance? Is it good for mid-end PC?
     
  45. johnartune

    johnartune

    Joined:
    Oct 18, 2016
    Posts:
    61
    Hello Simod,
    This is how I created tail and hair. Use the way of Nvidia Hairworks example file. The tail is a single APX file, and it looks no bad.
    I'm so sorry, it's my mistake, I just set the hair to have no physical simulate it's looking better now.
     
  46. johnartune

    johnartune

    Joined:
    Oct 18, 2016
    Posts:
    61
    Hi ywj7931,
    For the performances, I have tested better below 3 lights keep perfect frame per second. PS: I use the shadow library of PCSS filtering for spot/point shadows. Unity basic shadow library is too simple not enough for our art style. Or maybe can keep better FPS in basic above 3 lights.
    But I haven't test how many characters in scenes will keep FPS above 30.
    HairUnity09.jpg
     
  47. Simod

    Simod

    Joined:
    Jan 29, 2014
    Posts:
    161
    Hi johnartune,

    Absolutely no problem, and I'm glad you found a way. I guess you are running two instances now: one for the tail and another for the "crown", which covers rest of the head.

    Just to clarify: You can try up to eight (8) simultaneous lights and render hairs in one pass, but be careful with shadows, especially point light shadows. :)
    On screenshot I see 13.4ms per frame, that's a lot, yet depends on the graphical card and settings. Try to manipulate:
    1. "Style / Density", it improves visual quality but affects on performance, try to keep that value low. In some cases you may want to increase "Style / Strand Width"
    2. "Graphics / Shadow Density Scale", it improves shadow quality, but also affects performance. Keep this low too.
    3. "Level Of Details" or LOD, you may tweak Instance depending on your camera position. In order to see LOD levels try "Visualization / Debug / Colorize Options / LOD" and move your camera.

    Please could you share a few details with us?:
    1. What kind of PCSS library do you use? Just curious because your shadows are looking very good!
    2. What graphical card do you test on?
     
  48. Simod

    Simod

    Joined:
    Jan 29, 2014
    Posts:
    161
    Hi ywj7931,

    Speaking of performance: this will depend on several factors
    • PC hardware, t.e. VGA, CPU, memory and screen resolution. Not sure what is mid-end PC these days, but we got a few stats on GTX 780, i7-3970X and 3440x1440 screen:
      • Performance Demo is usually running at lowest 30 FPS (creatures)
      • Tech Demo... not sure, I believe test/plain cases were slow at ~40 FPS

      In comparison: if running GTX 1080 Ti on 3440x1440 screen with same hardware gets times better performance, but this is a Hi-end already.
      Worst (test/plain) case example. Showing 86 FPS. With GTX 780 it was ~40 FPS. The scene includes hairs object, Spot light and shadows. This image was rendered with two passes (camera and light shadows).
      Hair Composer (Tech Demo) 2017-05-18 15-56-34-62.jpg

      Normal case. 268 FPS. Two passes (camera and light shadows)
      Hair Composer (Tech Demo) 2017-05-18 15-56-57-94.png
    • Scene complexity and Hairs complexity.
      Depending on the settings HairWorks require lots of GPU power. But if you got a simple scene (for example a room), you will likely get lot's GPU resources free to use.
      You may run hairs in a open world of course, but it will get less space for manipulation (ex. The Witcher 3 and others)
    Please contact me by PM for closed beta request.
     
    Last edited: May 18, 2017
  49. johnartune

    johnartune

    Joined:
    Oct 18, 2016
    Posts:
    61
    Hello Simod,
    1.About PCSS shadow library is from asset store Next-Gen Soft-Shadows Next-Gen Soft-Shadows.jpg
    2.My graphical card is one NVIDIA GeForce GTX 1080.
    CPU: Intel(R) Cord(TM)i7-6850 CPU @ 3.6GHz 12 Logical processor.
    RAM:64G
     
  50. johnartune

    johnartune

    Joined:
    Oct 18, 2016
    Posts:
    61
    Hello Simod,
    The reason is not about hairworks. If I set not render hair, it's still kept in 75FPS. Maybe some other settings make me trouble.
    HairUnity10.jpg
     
unityunity