Search Unity

HairStudio - beautiful hair, now in Unity !

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

  1. hecali_aj

    hecali_aj

    Joined:
    Sep 1, 2015
    Posts:
    24
    Yes, everything is working fine on my game logic. I also did another test where the hair object is set to inactive on the editor, then I set the object to active in runtime after a 2 second delay. Here's what happened:

    As you can see, it gets worse the more I restart the scene.
     
  2. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    Have you tried to unload/reload your scene outside of the coroutine?
     
  3. hecali_aj

    hecali_aj

    Joined:
    Sep 1, 2015
    Posts:
    24
    Yes, I unload/reloaded the scene using just the code SceneManager.LoadScene. Still the same error. Could you maybe test it on an android device on your end? Just reload the scene using the demo scene of HairStudio.
     
    methusalah999 likes this.
  4. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    Hi everyone,

    HDRP is here ! (about time..)

    It works great with 2020.1 but feedbacks are welcome! I've been able to make it work on 2019 too but I've also experienced a random bug so... 2019 is at your own risk but may worth the try.

    Also, if you haven't write a review for HairStudio on the asset store, today is a perfect day for that! It really important to me.

    Have fun with HairStudio

    upload_2020-8-15_22-54-36.png
     
    nirvanajie and chrisabranch like this.
  5. chrisabranch

    chrisabranch

    Joined:
    Aug 15, 2014
    Posts:
    146
    I have been waiting for a good hair solution sense 'HairTool' was depreciated from the asset store. This is the best asset in the store in my opinion. I'll not only give a good review I'll write an article in my gaming site blog recommending Hair studio.
     
    methusalah999 likes this.
  6. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    I've just submitted the version 1.3.1 to the store:
    - HDRP and built-in showcase scene were in different packages, which was confusing.
    - HairDressing tool was slow since the 1.3. Thanks to @flamingogs !
     
  7. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    Please connect with me on twitter or contact me via PM if you want me to communicate on your article ^^
     
    chrisabranch likes this.
  8. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    With such accelerations, raising length iterations to 2 or 3 should be ok, have you tried adding some friction too? Some of the extension effect could also be sure to the second problem, because the whole hair is late.

    About that second problem, in you first video, the shaking is indeed a problem. It is due to the FPS too high, the fact that the camera is attached to the scalp without a spring, and a issue in HairStudio that has already been reported, that leads to the hair being one frame late somehow. I will work on it.

    The issue in the second video is unknown to me. I'll try and reproduce it with opsive.

    In the meantime,I suggest you add a spring between your character and your camera, it is a good practice whenever the character is using the physic engine, because the physics is not synchronized with the FPS. A camera attached to a rigidbody will most likely have jitter, for example, unless you add an interpolation or extrapolation. Unfortunately, HairStudio does not do any interpolation or extrapolation at the moment.

    Edit: also, you have to much drag force
     
    Last edited: Aug 17, 2020
  9. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    I've implemented a simple extrapolation for the physic to be anticipated during the intermediate frames that are rendered between two physic passes. It may help to avoid the scalp going through the hair during accelerations.

    Extrapolation off
    extrapolationOff.gif
    Extrapolation on
    extrapolationOn.gif

    It won't be perfect, though, and it may require a depenetration step to avoid collisions. But depenetration is not a trivial computation and would affect performances if done during the render step.

    I will continue to work on that point. In the meantime, @chrisabranch (and anyone experiencing the issue) would you please contact me via PM, twitter or mail? I would like to see if it resolves some of your shaking effect before I release.
     
    Last edited: Aug 17, 2020
  10. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    Thanks for the feedback. I'll test some of the available character controllers out there to check if everything is ok. I will also think about including templates.

    In your demo, I would add a lot of local stiffness. This force is the one reponsible for the preservation of the hairstyle. No stiffness means that the hair is completly flexible and leads to the strands being floating behind at any motion.

    But the new option Inextensible (not yet released, alpha tested) is preventing the stiffness to be stable at rest. A solution could be to enable this method only when the scalp is moving at a certain speed.

    Also, to gain stability at rest, you can add some drag to slow the hair down and avoid jitter.

    Finaly, it seems that you use a lot of very short segments for your hair guides (but I can't tell for sure, it can be tesselation). More segments means less perf and simulation stability. It is ok to have longer segments and make the strands smooth by using the tesselation instead. The default 2cm segment length is good in most situation in my experience, but 3 or 4cm can be even better. On an existing hairstyle, you can also limit the maximum number of segment per strands (16 by default, 6 or 8 can be ok).
     
  11. JibberJabber

    JibberJabber

    Joined:
    Apr 4, 2013
    Posts:
    7
    Hi!
    I've recently purchased hairstudio and I'm really impressed. It is an excellent asset.

    We are interested in cutting the hair in real time, like in this video:
    https://twitter.com/pushmatrix/status/1277953972599508992

    Do you have any advice about how this might be achieved?

    Many thanks,
    Andrew
     
  12. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    First, thank you for your purchase and trust. Here is a message I already send to someone else about the hair cutting.

    Hope it helps!

     
    JibberJabber likes this.
  13. JibberJabber

    JibberJabber

    Joined:
    Apr 4, 2013
    Posts:
    7
    Many thanks! I'll get on to this tomorrow. :)
     
  14. ILonion

    ILonion

    Joined:
    Oct 26, 2015
    Posts:
    73
    Hi,
    is there news about fur for skinned mesh feature?
    UPD: for hdrp
    ?
     
  15. asherdavidson

    asherdavidson

    Joined:
    Aug 17, 2020
    Posts:
    17
    Looks real good for an early access product! Tho yeah, have to agree with some of the others, a bit expensive for sure.
     
  16. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    Sorry no, fur support is not in the todo list right now. It is a big deal to make it correctly I'm afraid.

    HDRP is supported since the last major update ^^
     
  17. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    Thanks for your interest! HairStudio will leave the early access stage on the next major update.

    The price won't go down but it won't raise either. Also, I will try to have the asset available in sales often so keep it in your wishlist ^^
     
  18. Duende

    Duende

    Joined:
    Oct 11, 2014
    Posts:
    200
  19. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    Hey thanks for your interest!

    1 - HairStudio is not compatible with blendshapes. If you use it for a beard, the beard roots won't move when the character smiles. But you can still use several hair objects and have some beard on the chin, moving with the jaw for example.
    2 - HairStudio is not tested with UMA specifically but it should work without any issue. It's only a matter of creating a hair object under the head bone of your UMA character, then paint hair roots onto the character mesh collider (you can get rid of this collider once the roots are painted).
    3 - HairStudio don't allow any modification of the hair once it is generated at stratup. That said, many users have already changed the source code to allow effects like hair cutting or growing. We can discuss on the subject in more details if you wish, as there is a lot to say about it (growing the hair will change the hair style)
    4 - hair styles can be saved in prefabs and used at will.

    Please ask if you need anything else.
     
    Duende likes this.
  20. Duende

    Duende

    Joined:
    Oct 11, 2014
    Posts:
    200
    Hmm, alright, thank you very much for your attention. :)

    If I have any more questions I'll let you know. :p
     
    methusalah999 likes this.
  21. JibberJabber

    JibberJabber

    Joined:
    Apr 4, 2013
    Posts:
    7
    Hi,
    Thank you for your earlier advice on cutting hair in real time. It is working well for me now.
    I am now interested in having the hair blow in the wind. I have tried this today, and it seems to work, but the hair passes through the colliders in the head. Is this normal? Is there any way to avoid it? I can appreciate that this is a difficult problem.

    Thank you,
    Andrew
     
  22. JibberJabber

    JibberJabber

    Joined:
    Apr 4, 2013
    Posts:
    7
    Ah - no problem. I've found the problem. It wasn't picking up the head colliders because they were children of the HairSimulator. I moved them to be siblings, and it is detecting them correctly.
     
  23. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    Glad to hear that your fixed your issue. Indeed a collider attached to the hair object won't be detected because it will be part of the hair rigidbody that is created to detect collisions. I will have to mention this limitation in the doc.

    Thanks !
     
  24. JibberJabber

    JibberJabber

    Joined:
    Apr 4, 2013
    Posts:
    7
    There seems to be a limit of 5 colliders (i.e. any more don't have any effect). Is this correct?
     
  25. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    Nope there is no limit and I've ever tried playing with hundreds of colliders without issue: https://twitter.com/dumas181/status/1271464943028768768

    Only sphere colliders are supported. Colliders are only taken into account when they get in the range of the hair. You can check the range that is calculated by looking at the sphere collider generated under the hair simulation object at startup.

    What make you think there is a limit?
     
  26. SympaK

    SympaK

    Joined:
    Apr 14, 2010
    Posts:
    134
    Hi Benoit. What if I would put the hair under a cap or tie a ponytail with a hairstring?
     
  27. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    Collisions in HairStudio are made to be fast and are not precise enough to allow such behaviour. Also, a cap or hair string would go against the original hair style and that would cause undesired effect and a bad new hairstyle, driven only by physics and not by artistic skill.

    But you can definitely have many hairstyle ready to enable or disable, depending on the situation. When you place your cap on, you just switch to a different hairstyle, idem for the hair string.

    It would require some animation trick to hide the transition, though.

    To go further and obtain smooth transitions, you could also change the code and add a feature that allows multiple hair style for a single generated hair, and lerp hair initial position. It would not be a trivial feature to implement, but totally doable (I could provide some help)
     
    Last edited: Sep 13, 2020
  28. SympaK

    SympaK

    Joined:
    Apr 14, 2010
    Posts:
    134
    I see. For example, one could leave rigid the part of the upper skull which has to to be covered by the cap: or remove it at all, leaving only the sides (which might be somewhat rigid themselves, except from the back perhaps: this in case of a male hair, of course). The string still baffles me anyway: unless I should set two kinds of hairs (one for the head and one for the tail, the latter bind to a null which is attached to the former?).
     
  29. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    This is indeed how it's done.

    For a cap, hat or helmet, you can create a style with hair strating at the bottom of it, with a high density. If your hat is transparent (that would be strange but eh!) you can add a second hairstyle, locked in place (no physics) beneath it. If you want to have a large helmet (like Vader's one) and make your hair starts upper, to get better motion or in case the user can go and see beneath it from below, you will want to add some colliders to the helmet to prevent the hair from going through it (Vader's helmet with hair would also be strange but eh!).

    For a ponytail, you will have two hair style. One for the locked hair, and another for the tail. The first one will most likely be locked in place. The transition will be hidden into the hair string mesh. If you wish to have some hair moving in the upper head or the side, like the famous Lara Croft hair style in Tomb Raider, you can add a third hair style and place some hair roots here and there in addition to the locked first hair style. This is how it's done in Tomb Raider.

    Hope it helps !
     
    SympaK likes this.
  30. nenghuo

    nenghuo

    Joined:
    Feb 7, 2019
    Posts:
    12
    HI, I am using the 1.3V HDRP on Mac with Unity 2019.4.8
    I think the is a bug , it can only show one script of hair at a time(some time more but still buggy visualy)
     
  31. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    Do you mean that you can display the gizmos of only one HairDressing component at a time? If so, it is indeed a limitation of the current interface, and I plan to add the option of drawing many gizmos in a future version.

    By default only the gizmos of the selected HairDressing are drawn because there are a lot of things to draw and performances are not great in the editor.
     
  32. nenghuo

    nenghuo

    Joined:
    Feb 7, 2019
    Posts:
    12
    I mean if I have 2 game obj with heir it can only show one if the obj heir
     
  33. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    In the meantime, if you really need that and don't mind going into HairStudio code, please copy and paste this snippet at the bottom of the file HairDressingEditor.cs

    This may help, but it will also impact your editor performance, especially if you have a lot of HairDressing components in your scene. I will try and find a better implementation later.

    Code (CSharp):
    1. [DrawGizmo(GizmoType.InSelectionHierarchy | GizmoType.NotInSelectionHierarchy)]
    2. static void DrawHandles(HairDressing dressing, GizmoType gizmoType) {
    3.     if(gizmoType == (GizmoType.Active | GizmoType.InSelectionHierarchy | GizmoType.Selected)) return;
    4.  
    5.     Handles.zTest = UnityEngine.Rendering.CompareFunction.Less;
    6.     Handles.color = Color.grey;
    7.     foreach(var guide in dressing.guides) {
    8.         Handles.DrawPolyLine(guide.segments.Select(seg => dressing.transform.TransformPoint(seg.localPosition)).ToArray());
    9.     }
    10.  
    11.     var points = new List<Vector3>();
    12.     foreach (var root in dressing.roots.Get()) {
    13.         var wRoot = dressing.transform.TransformPoint(root.LocalPos);
    14.         points.Add(wRoot);
    15.         points.Add(wRoot + (wRoot - dressing.gameObject.transform.position).normalized * dressing.rootRadius);
    16.     }
    17.     Handles.DrawLines(points.ToArray());
    18.     Handles.zTest = UnityEngine.Rendering.CompareFunction.Always;
    19. }
    upload_2020-10-4_22-44-7.png
     
    Last edited: Oct 4, 2020
  34. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    HairStudio 1.4 is now live and production ready!

    Thanks to all your feedback and patience, HairStudio is now stable and the early access phase is over. Of course the development will continue and the support doesn't go anywhere so please, continue to request features, ask for help and give feedback !

    New features:
    • Extrapolation can be enabled to avoid delay during animations
    • Better friction!
    • Hair can now be truly inextensible (at the cost of stability)
    • Added a method to teleport the hair
    • Added an option to display the roots/guides of an unselected hair object (@nenghuo !)

    Fixes:
    • The hair simulation was computed before animations, causing visual lags in some situations
    • A ghost collider could spawn if no collider where present in the hair range, which was a little creepy
    • Some colliders where ignored on MacOS and iOS

    Have fun !

    Ben
     
  35. trelobyte

    trelobyte

    Joined:
    Nov 17, 2010
    Posts:
    54
    Hi am very interested in buying this asset. Is there a way to import hair curves from third party software like maya or Houdini in alembic or other format and make it work with hair studio ?
    Thanks
     
  36. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    This feature does not exist for the moment. To be honest I thought I would have to implement it very quickly after the release but you are the very first one to ask for it.

    I'm ready to work on it because I think it could be a great addition to the asset, but I'm lacking knowledge on the subject. Would you be ok to send me a pm with one or more example files, and maybe some informations about the different formats you are talking about, so I can start straightforward?
     
  37. chrisabranch

    chrisabranch

    Joined:
    Aug 15, 2014
    Posts:
    146
    Does anyone have a video of the hair working on one of the unity character controllers?
     
  38. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    429
    Bought HairStudio ages ago, partly to support what looks like a great asset. Sadly kind of stuck with URP so not had a chance to try it properly. Is support still on the road map? You mentioned 'Coming soon' in reply to a review a couple of months back :D
     
  39. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    Sorry, due to HairStudio design, URP is a whole thing to do, not compatible with either the built-in or the HDRP code. Fact is, I've received only one request for the support of this pipeline (you ^^) and I admit it went down in the todo list.

    I will dig into it as soon as I can, which is not very soon I'm afraid.
     
    jeromeWork likes this.
  40. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    429
    lol. Oh well, since it's just me asking :)

    I know how much work supporting the different render pipelines can be. I'll have to wait until I can join in the fun
     
    methusalah999 likes this.
  41. trojant

    trojant

    Joined:
    May 8, 2015
    Posts:
    89
    Hope to see URP!:):):)
     
    jeromeWork and methusalah999 like this.
  42. cjjeffery

    cjjeffery

    Joined:
    Sep 26, 2015
    Posts:
    7
    Hello all,

    I imported the latest release into my project (Release 1.4) and it would appear the cutting tool isn't working for me. I just imported HairStudio into a new project to make sure something else in my project wasn't causing the problem and the cutting tool still does not work when I hold shift, it just combs the guides. Anyone else experiencing this or am I doing something wrong?
     
  43. huangzzzz

    huangzzzz

    Joined:
    Oct 28, 2020
    Posts:
    1
    URP +1 :);)
     
    methusalah999 likes this.
  44. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    That's the first time this behavior is reported, sorry for the inconvenience. First of all, I want to make it clear that the comb tool and cut tool are two different tools activated by two different buttons. Holding shift with the comb tool active will not do anything special.

    Now please check the following:
    - The cut tool has two modes: growing the hair guides or cutting them. By default (without shift press), it grows the hair guide. Does the growing function works?
    - You can't cut the hair guide shorter than a minimum value (0.005f). If you are working in a big scale like 100 or 1000 (which is not advised whatsoever), this value can become significant as it is not scaled.
    - Go into the the showcase scene and open the hair dressing of the first pedestal. Can you cut it?
     
  45. anomas

    anomas

    Joined:
    Jul 3, 2016
    Posts:
    47
    2- UMA 2.11 is coming soon and it will have lots of new features, among those there is a mounted item system which you could use to create hair "items" and attach them to the head bone at runtime.
     
    methusalah999 likes this.
  46. cjjeffery

    cjjeffery

    Joined:
    Sep 26, 2015
    Posts:
    7
    Hi, I just tested it again with two new projects in the same version of Unity (2020.1.3f1), but in different render pipelines. Everything works perfectly in the built-in render pipeline, but in the HDRP project only the combing tool works for me. The 'cutting', 'select guide', and 'add guide' tools all operate as if the combing tool is still selected, although clicking the 'select all' option in the 'select guide' tab does appear to work, it just doesn't give a visual indication. Not sure what might be causing it, there are no errors in the console. Hope this helps :)
     
  47. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    Thanks for the detailed report, I'll check that quickly
     
  48. MoYing

    MoYing

    Joined:
    Dec 24, 2013
    Posts:
    8
    Hello, do you support Maya to create xgen hair? In Unity, this step is very important for art designers
     
  49. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    643
    This is not currently supported but I really wish to add this feature. If you have some information about the export formats available with xGen, and maybe some samples to test, I could definitly work on it. Also, it should not be a big deal.
     
  50. Vegaplanet33

    Vegaplanet33

    Joined:
    Jan 26, 2019
    Posts:
    14
    Hi,
    does this asset support VR and AR?