Search Unity

HairStudio - beautiful hair, now in Unity !

Discussion in 'Assets and Asset Store' started by methusalah999, Apr 2, 2020.

  1. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    HairStudio is not dependant on the skinned mesh. The scalp is simply parented to a bone. So you can create prefabs for your hair styles, and attach these prefab to the head bone of your rig, whetever it is.

    Note that the hair root implentation is made by painting on a mesh collider. So, if you try and place a hair style on a mesh with a different skull shape, you may have annoying offsets between the hair roots and the skin.
     
  2. DankP3

    DankP3

    Joined:
    Jul 17, 2017
    Posts:
    93
    Thanks, so if I have a rigged 'scull cap' including blendshapes, it sounds like it will be OK, in that it will follow bendshapes and bone deformations. Thanks again.
     
  3. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    A I said, HairStudio is not dependant on the skinned mesh. Hair roots won't follow the mesh faces as they move due to blendshapes or joint transformation.

    The hair is in a gameobject, and you can attach it to any bone, or anything. Making roots follow the skinned mesh is a planned feature, to allow the creation and animation of fur and beard, but I can't give any ETA for this one.

    I hope it's clear !
     
    DankP3 likes this.
  4. local306

    local306

    Joined:
    Feb 28, 2016
    Posts:
    155
    Maybe I missed this in some of the demo videos, but is there a way to add wind affects to hair @methusalah999?
     
  5. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    The component WindForHair is what your looking for. It uses the WindZones that are in range.

    You can find more info on this feature and an example in the showcase scene, pedestal 21

    upload_2020-5-23_2-6-58.png
     
    local306 and r3ndesigner like this.
  6. martinNista

    martinNista

    Joined:
    Jan 3, 2019
    Posts:
    3
    You already mentioned it as a planned feature. The possibility to convert hair assets from DAZ etc. Not everyone will achieve good results manually, some simply lack the talent. This feature would be a game changer and increase the possibilities enormously. Btw. when will an update appear, for example with the tesselation stuff?
     
  7. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    Update is coming soon. I'm currently optimising the colliding code so that you can add as many colliders as you want with no performance drawback, as long as the current number of colliders in range is not too high.

    I also wanted to wait for HDRP support to progress but it's harder than I thought, so it will be for another update.

    About creating hair using an imported asset made in a modeling software, I'm talking about hair style with individual strands. The goal is to allow artists to produce the hair style in advanced tools like Maya nGen and export it to HairStudio.

    I understand your idea. I think that most of the hair models in DAZ are made with hair cards or plain old meshes. Converting such a model to HairStudio seems impossible. The hair volume is given by the mesh but the style itself is mainly described in the texture and the UV mapping. I can't think of any solution to extract that information and generate a procedural hair in HairStudio.

    But I admit, it would be great!
     
  8. chrisabranch

    chrisabranch

    Joined:
    Aug 15, 2014
    Posts:
    146
    when I tested it on invector character controller, the hair moved like elastic with fast movement.
     
  9. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    To prevent the hair from being stretched, you can increase the number of iterations of the length solver.

    If you have a lot of strong accelerations, you can decrease the drag force and increase the gravity, or increase the friction. If some motions are particularily violent, like the shockwave of an explosion, it is also possible to apply an inverse force as external force.

    All of these parameters are located in the HairSimulation component and can be changed during play time in code to adapt to special situations. For example, it is quite easy to write a script that computes the velocity of the head at each frame, and increases the global stiffness of the hair when velocity become too high, to always preserve the hair shape.
     
    wetcircuit likes this.
  10. Makio64

    Makio64

    Joined:
    Nov 9, 2014
    Posts:
    27
    Amazing job!
    Any plan to support mobile iOS / Android ? ( even by eliminating the number of hair )
     
  11. ottinkmike

    ottinkmike

    Joined:
    Jun 8, 2020
    Posts:
    5
    Is it posssible to give thickness to the hair strands? I'm thinking about using this for a upcoming project but all the hair I've seen so far looks really thin, I would like to add thickness.

    Also, is it possible to add contraints. So with that I mean like putting a knot in the hair?
     
  12. ottinkmike

    ottinkmike

    Joined:
    Jun 8, 2020
    Posts:
    5
    I would be interested in that aswell! What platforms are currently supported?
     
  13. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    I'm already working on that. iOS uses Metal API and Android uses OpenGL ES3 API for shader compatibility. The issue is that HairStudio relies on StructuredBuffers, which are a DirectX11 specification.

    It seems that Unity is able to make it work at least with Metal, but only for MacOS. iOS and OGL ES3 are still not working.

    Also, if anybody have usefull information on the subject I'm interested, as the documentation is sparse.
     
  14. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    You can choose any thickness in the hair material.

    upload_2020-6-8_14-36-15.png
     
  15. ottinkmike

    ottinkmike

    Joined:
    Jun 8, 2020
    Posts:
    5
    Great! And how about addding contrainst to make a pony tail?
     
  16. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    Sorry I missed that part. It's not currently possible to constraint strands at a single point. But for the ponytail, you can have two hairstyles, one for the fixed part of the hair, that won't move at all, and another for the tail itself.

    This is how Lara's style is made in tomb raider.
     
  17. ottinkmike

    ottinkmike

    Joined:
    Jun 8, 2020
    Posts:
    5
    Will you add constraints in the future?
     
  18. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    Definitely. I want to make long thick braids possible!
     
  19. ottinkmike

    ottinkmike

    Joined:
    Jun 8, 2020
    Posts:
    5
    Great, then I will buy the early access to start experimenting. I'll let you know when I find bugs ;) Look amazing btw great work.
     
  20. r3ndesigner

    r3ndesigner

    Joined:
    Mar 21, 2013
    Posts:
    143
    hey bro, the answer about hdrp in the other post fix the issue you are getting? You ll back to try any support for hdrp or btm its still impossible?
     
  21. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    Unfortunatly no, the latest HDRP 7.4.1 is causing the same issue and I still have no clue how to resolve it.
     
    r3ndesigner likes this.
  22. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    For those who want to test HairStudio on their computer and have a look at the showcase, here is a demo build (windows only)!
     
    local306 and r3ndesigner like this.
  23. chrisabranch

    chrisabranch

    Joined:
    Aug 15, 2014
    Posts:
    146
    Is URP having the same problems?
     
  24. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    No, URP should be alright as all the light data is accessible. HairStudio doesn't support it now, but it's at a high position in the todo list.
     
  25. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    HairStudio has been update to version early access 1.1!

    Features:
    • Added support for MacOS, iOS and Android
    • Tesselation: the renderer can now add vertices to smooth hair curves.
    • Colliders optimisation: You can now add as many colliders as you want in the simulation, only those in range will be checked.

    Bug fixes:
    • roots were placed too densely if the tool radius was too high.
    • tool was buggy if a collider was present behind the camera

    Please beware that in the next version, colliders will most likely be found automatically, using Unity layers. You won't need to add colliders manually in the simulation (boxes and capsules may also become available, if I can acheive a fast sphere/box collision solver in HLSL ^^)

    Have fun with HairStudio !
     
  26. vonWolfehaus

    vonWolfehaus

    Joined:
    Oct 14, 2011
    Posts:
    11
    The tool looks fantastic! I'm using anime/toon style for my games so hair strands won't fit well with the aesthetic, but hair cards or mesh strands will. Do you plan on adding support for those? Not from an external tool, but generating them in your tool like you currently do with the individual strands. It would be perfect to design hair and use your physics in one go.
    The sparseness of the hair at the base makes the characters all look like their balding, but cards or meshes would fix that.
     
  27. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    In HairStudio design, the physic simulation and the rendering are completly separated:
    - physic simulation consider hair strands as nodes and segments, producing an array of segments with position and tangents,
    - rendering is building billbaords (quads facing the camera) out of this array and painting them according to hair color and light scattering.

    It would be possible to replace this billboard rendering by another, using geometries like cards, extrusions or even meshes. There would be some issues , though :
    - the shading of the hair is a complex subject as it does not use face normal. A dedicated shading method would be necessary to shade geometries correctly,
    - as HairStudio is based on realistic hair strand, the twist of the hair strand is random to create scattered glints. With geometries, the artist would need to control the twist of the strand manually.

    I'm afraid that such a feature is not planned but I will have it in the todo list and it will go up if more people are asking. In the meantime, HairStudio is able to produce some kind of anime style by increasing the thickness of the billboard (picture below).

    Finaly, for the sparesness of the hair, it's all up to the artists to paint the scalp to hide the skin color and obtain more convincing results. In HairStudio promotionnal content, I'm trying to only show what HairStudio is capable of, without adding any sugar to it. But I understand the concern.

     
    vonWolfehaus likes this.
  28. nenghuo

    nenghuo

    Joined:
    Feb 7, 2019
    Posts:
    12
    HI, first nice work there, but Im run in to some issues.
    im using it on a Mac it was working fine at first ( I can do anything comb, cut cet. ), but at one point I lost the ability to "cut" the hair, all I can do is to comb the hair even I select the Scissors icon. I don't know why, even I open a new project I still can't cut. why is that???
     
  29. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    This is indeed very strange, sorry for the inconvenience. Let's try things:
    - check if you have any error or warning in the console,
    - try and cut some hair into the showcase scene, where parameters are already set to correct values,
    - check your tool strength and radius, by holding the control key and moving mouse horizontally and vertically. you should be able to see both blue and red circle. Test with strength at maximum (big red circle),
    - check that the guides to cut are selected (selected guides are blue, unselected ones are grey),
    - test the cutting tool by having the whole hair style affected (all guides into the tool's blue circle),
    - HairStudio stored some preferences in EditorPrefs. If it's ok for you, use this method to clear them all : https://docs.unity3d.com/ScriptReference/EditorPrefs.DeleteAll.html. If it's not ok to loose the editor prefs, tell me and we will find a workaround.
    - send me a screenshot showing the guides, the HairDressing inspector with hair styling tab open and guide generator panel expanded.

    That's all I think about for now !

    Ben
     
  30. nenghuo

    nenghuo

    Joined:
    Feb 7, 2019
    Posts:
    12
    haha! I get it, its only because I open a new inspector window. ones you open a separate inspector window the control gos to only the latest one , and the UI of this two window will not sync, maybe need to fix this.

    looking for the HDRP support, and better performance on Mac
     
    methusalah999 likes this.
  31. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    This needs to be fixed indeed. Thanks for the report!

    About Mac, as I don't own a Mac myself, I would appreciate some feedback:
    - can you confirm that the whole showcase scene is running without issue or crash?
    - can you give your Mac specifications?
    - can you provide a screen shot of the game window with stats panel open, running the showcase scene?

    Thank you very much in advance!
     
  32. nenghuo

    nenghuo

    Joined:
    Feb 7, 2019
    Posts:
    12
    no, the demo scene can not run properly, it almost freezes my computer, so I have open one bey one ,and it still make some glitch.

    my Mac is

    MacBook Pro (15-inch, 2018)
    2.6 GHz Intel Core i7
    16 GB 2400 MHz DDR4
    Radeon Pro 560X 4 GB
    Intel UHD Graphics 630 1536 MB
     
  33. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    Thanks for the specification. GPU is not the strongest but it should be ok. I've heard of other people having some issues with HairStudio using AMD GPU.

    To help me diagnose the issue, can you please send me a screenshot of the game window with HairStudio running and the stats panel open? Also, you talked about glitches. Is this only a performance issue with low framerates? or is there any other visual artifact? If so, again, please send me a screenshot.

    As I do not own a Mac myself, the more info you can share, the easier it will be to find a fix.
     
  34. nenghuo

    nenghuo

    Joined:
    Feb 7, 2019
    Posts:
    12
    OK,but I can't run it all at ones, so I take some of the bad one.
    The 21 - Colliders is the worst, I can't even take a screenshot, my Mac just freezes have to reboot it.

    yes there is visual artifact, like mesh triangles, it can go really crazy , some time time even Unity UI gos funny.
     

    Attached Files:

  35. nenghuo

    nenghuo

    Joined:
    Feb 7, 2019
    Posts:
    12
    but still, love what you made, its really what I'm looking for.

    here is a screenshot of what I'm making using it, I can go 4000 roots with 10 segments, its about the limit to running
    smooth, sometimes drop frame . luckily I'm not really making Game, I use Unity to make films
     

    Attached Files:

  36. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    First, sorry for the late answer. I've not seen any notification :(

    This is very nice, I would be very happen to have more visuals of what you are making with HairStudio !

    About the performance issue, thank you very much for the screenshots. As I thought, the issue is not situated in the GPU side, but somewhere in the CPU update loop. I don't have enough Mac knowledge to understand what is going on, and as I don't have a Mac myself, debugging will certainly not be easy... The most frustrating is that it's most likely a single line of incompatible code! Please if you get to more conclusions or find anything strange, tell me, it may help a lot.

    In the meantime, would you please make a last test for me? Change the hair density in the 21st pedestal (dancing head with colliders) to a very low value like 0.1 or less, so that the hair is very sparse. And tell me if the performance is good with that (the idea is to check if there is a issue with the colliders specificaly).

    Thank you very much !
     
  37. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    URP compatibility is on the way ! Everything is working fine so far and I'm almost done with URP.

    HDRP is still on the very top of the to-do list but still stuck.

    Also, the next patch will include an important fix for fast moving hair: the hair simulation was on frame late and could collide with the scalp at high velocity.

    upload_2020-7-9_23-25-48.png
     
    Weendie-Games, corjn and r3ndesigner like this.
  38. corjn

    corjn

    Joined:
    Feb 6, 2014
    Posts:
    168
    Hey @methusalah999
    Unity provided a full answer to the #SRPLife here, you may already know but making "exotic" shaders in HDRP should be simplier in a (I hope) near future :) Maybe it will help for future iterations of Hair Studio for HDRP.

    "What we have designed, though, is the ability to extend HDRP to implement custom lighting models by creating new forward materials, effectively allowing you to author entirely new BRDFs. This method ensures that these BRDFs will support all lighting types in a coherent manner. This functionality will be provided in the 2021 product cycle."
     
  39. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    I've seen it and it seems like we will have to wait a long time before URP/HDRP acquire the same feature set than the built-in rendering. For example, URP custom lighting can't get spot light shadows...

    I will continue to hack things anyway, but it would make me sad to release URP and HDRP verions of HairStudio that are worse than the built-in one..
     
    Weendie-Games likes this.
  40. OnikiKay

    OnikiKay

    Joined:
    Dec 20, 2017
    Posts:
    10
    Hello,

    The asset looks really good... in the video. Unfortunately, despite having a correct configuration (Core i7-8700 16 GB RAM, GeForce GTX 1060 6GB VRAM), it's unusable because of the low fps. I get a poor 1 fps at 2560x1440. And it's not much better at 1920x1080. There is no error or warning in the log file other than:

    HairDressing does not contain any guide. Hair generation aborted. You must generate guides using the guide generator in styling tab.
    (Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

    The simulation does not contain any strand to render.
    (Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)


    I hope this is just a bug that will be fixed, because I'd like to use it in my game.

    Regards,
    Oniki
     
  41. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    It is absolutly not a normal situation. Can you please give me more details? A simple screenshot of the game window with the stats panel open, with what you have in your scene would do.

    Thanks !
     
  42. westryder907

    westryder907

    Joined:
    Dec 28, 2016
    Posts:
    61
    This is weird as your specs are way above mine (FX4300 AMD + 1050Ti 8GB)
    I don't notice a slow down and average a normal fps (for 1 character in a large forest environment.
     
  43. OnikiKay

    OnikiKay

    Joined:
    Dec 20, 2017
    Posts:
    10
    I'm sorry, but it's just the demo I've tested. I don't own the asset (yet). So, there is no stats window.
     
    methusalah999 likes this.
  44. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    Ok this is valuable information. The demo is indeed containing a lot, and I will have to run some tests with computers with less performances than mine to be sure it runs smoothless in a more realistic situation.

    I will contact you when it's done if you are willing to test again.
     
  45. corjn

    corjn

    Joined:
    Feb 6, 2014
    Posts:
    168
    Same here, I just tested the demo and I get 3 FPS with a GTX 1060 MaxQ (6 go), Intel core i7 2.20 GHz, 3,9 GHZ in turbo boost and 60 go of ram. I'm also getting 3 FPS in editor with version 1.1, but, I had 60 FPS with version 1.0 of Hair Studio. Hope it can help debug.
     
    methusalah999 likes this.
  46. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    I've just updated the standalone demo. Could you please download and test iton your computer, and give me a feedback of the performances?

    It's here.

    Thanks !
     
  47. OnikiKay

    OnikiKay

    Joined:
    Dec 20, 2017
    Posts:
    10
    Thanks for the updated demo.
    The result is better (from 8 to 15 fps) but it's still not what I'm looking for. My game is currently running at a steady 60 fps and I want to keep that. There are usually not more than five characters rendered at the same time with full hair details so it's quite difficult to compare with your demo.
    It may be a bit early for an evaluation of the asset, so I'll wait for optimizations/fixes and will keep an eye on this thread.
     
  48. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    Thank you for the feedback. This is worse than I expected from a GTX 1060, because I get 800fps on a RTX2070. There may be a threshold of some kind at which things are going bad.

    It is indeed hard to compare but HairStudio is completly scalable. Performance depends mainly on these parameters:
    - the density of strands,
    - the length of the strands,
    - is the hair fixed or can it move?
    And the number of hair styles activated in the scene, obviously. So when you have created your styles and decided whether to make the hair move or not, you only have to set the density corresponding to the targeted hardware. With a lower density, a bigger thickness can compasate the sparseness.
     
  49. zhangshunze

    zhangshunze

    Joined:
    Jul 16, 2020
    Posts:
    1
    can you support realtime cutting?
     
  50. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643