Search Unity

Hair Designer - Dynamic hair & fur tool

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

  1. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    Ok I found the bug for the fur in linear color space :D
    The texture settings for the mask are not set properly, I'll fix that in the next version.
    You can easily fix it :
    - Go to the material tab of the fur layer.
    - Click on the Mask texture
    - Find it in your project folder and opent its inspector
    - uncheck "sRGB" and apply the changes
    ;)
     
  2. itchyOwl

    itchyOwl

    Joined:
    Feb 28, 2013
    Posts:
    25
    Hey, thanks for the quick reply! That's it: it works :)

    I made the test in a clean project in Unity 5.6, so no updating was required. However, I re-downloaded and re-imported Hair Designer, and now I cannot reproduce the issue on Deferred Rendering Mode anymore. Weird.

    By the way, is there really no other way to use the Standard Shader than making a copy and adding the including statements, like you are now doing? Can't you just create a custom surface shader using #pragma surface surf Standard and then add your custom functionality there? That's what I've done with my own shaders, because updating the Standard shader manually each time they make changes to the Standard shader is tedious and error prone. Of course, you have to manually implement a lot of stuff, but then you don't need to worry about updating the Standard shader stuff.
     
    twda likes this.
  3. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    Yes, I'll probably add some simple compatible shaders :)
    instead of fixing the standard :p
    I'll also do a shaderforge integration, like I did for my other extension VertExmotion.
     
  4. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    When you download the package from 5.5, you get the 5.4 compatible version from the assetstore, with the patch.
    I've updated a specific version for 5.6 on the asset store, that's why you there's no more errors. ;)
     
  5. itchyOwl

    itchyOwl

    Joined:
    Feb 28, 2013
    Posts:
    25
    Hello again. Now I have problems with models imported from Blender in ascii format, as the vertices are interpreted in the wrong orientation. The orientation is always different, but usually it is fixed when the layer is locked. However, sometimes it's slightly off. In any case, it makes painting quite difficult. The issue manifests itself only when the model is imported with an animation (default take for example). In my view the issue is due to problems of reading the rest pose. In binary format, Hair Designer apparently puts the skeleton into it's rest position, but for some reason it fails to do this on models in ascii format. Temporary solution to this would be to import the model in rest position. However, when using Mecanim humanoid rigs this is not always an option, because the rest pose may not be optimal for Meacanim avatar configuration. For example an A-pose, often used in modeling, may result to badly retargeted animation, because Mecanim interprets skeletons in T-pose. Applying an optimal pose (in Mecanim's perspective) as the rest pose would work, but when the rest pose is active, the exported animations are empty, which means that the animations would need to be in another file than the model. So, would it be possible to handle ascii like binary format, and use the rest pose when painting the hair? Ascii format is required for blendshapes to work in Unity, so in many cases, using binary format is not an option.

    I also encountered another bug. When trying to paint to a fur mask layer, Unity complains that the texture is in wrong format:

    Unsupported texture format - needs to be ARGB32, RGBA32, RGB24, Alpha8 or one of float formats
    UnityEngine.Texture2D:SetPixel(Int32, Int32, Color)
    Kalagaan.HairDesignerExtension.HairDesignerGeneratorFurShellBaseEditor:paintToolAction()
    Kalagaan.HairDesignerExtension.HairDesignerEditor:OnSceneGUI()
    UnityEditor.DockArea:OnGUI()

    Changing the texture compression from Normal Quality to None seems to solve the issue. This is not related to the Linear Color Space, as currently the fur mode does not work with it.
     

    Attached Files:

  6. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    Hi, I did some tests with Blender 2.78
    I can use hairdesigner on the character with ASCII and Binary exports without problems, both are set to the T-pose for painting and both have blenshapes available.

    Could you send me a sample (fbx and/or .blend file) contact@kalagaan.com
    I'll check it. ;)

    I didn't noticed that unity 5.6 have changed the default value of the texture compression... :confused:
    I did my tests on textures that where generated by 5.4
    It must be set to None.
    I'll fix that in next version, thx for the feedback :)
     
  7. itchyOwl

    itchyOwl

    Joined:
    Feb 28, 2013
    Posts:
    25
    Ok, so it seems that I'm lagging 'a bit' behind, for the shape key support was implemented into the Blender binary fbx exporter already in version 2.72. I simply had not un-clicked "Apply Modifiers" in the export settings, because I assumed that it won't work, as it did not pre 2.72.

    Unfortunately I cannot provide you the file I'm currently working on, but I'll throw you a message if I encounter the issue with some other file. I tested with another file with which I was not able to reproduce the issue, so it may in some way be related to my setup. Anyway, it works on binary, so I can use that now since the blend shapes also work on binary.

    Another question then: What is the preferred workflow when you update a character model for which you have created hair with Hair Designer? There is the save button, but where is the load button? I copied a character with hair on it and tried to transfer the hair to another instance of the same mesh, but this does not create a new instance of the hair. Updating the mesh outside of Unity seems to work, but is this the only way to do it?
     
  8. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    You should create a prefab of your character,
    So when you'll update your fbx file, only the mesh will be updated, not all the hierarchy.
    Anyway, I recommand to finish your mesh before adding some extra features like HairDesigner.
     
  9. itchyOwl

    itchyOwl

    Joined:
    Feb 28, 2013
    Posts:
    25
    Ok, that's what I'm doing. In the future, though, I would like to see an option to transfer the hair from a character to another - even if it requires tweaking the position etc. In iterative production, you often want to keep multiple versions of the same model, and currently this would require that you make the hair from scratch for each character - right?
     
  10. Dark-Muppeteer

    Dark-Muppeteer

    Joined:
    Feb 24, 2013
    Posts:
    26
    Hi, I am currently having lots of issues trying to get hair to work correctly on models in Unity 5.6.0f3 using version 1.3.1

    I'm getting 3 issues:
    1. which I think is a similar issue to the one that Steviebops had, with essentially 1 hair being created at the feet of a model if the model had any sort of scaling within the prefab hierarchy, even if I reset it to 1.1.1 (shells do work on this particular model but I cannot manually edit/paint/remove hair from any parts of the model, so I can't clean up eyes or claws etc.)

    2. When generating a mask the texture format is always incorrect so I have to manually change it to a valid format.

    3. On a different non-scaled prefab model I'm getting the shell generate so it only shows on one half or odd areas of the model and I cannot brush or color the hair. (This model does let me manually apply hair and brush/scale it, but the shells would give a better result)

    Any ideas as to what I may be doing wrong?

    The Bear is related to issue 1
    BadHair.png

    The gorilla is issue 3.
    BadShell.png
     
  11. itchyOwl

    itchyOwl

    Joined:
    Feb 28, 2013
    Posts:
    25
    Hi Dark-Muppeteer, actually you are having the same issues that I was. I didn't complain about the first one here, but it seems indeed that HairDesigner have some issues with scaled models with scales other than 1. I fixed this by reimporting my model from Blender with different settings, so that the skeleton and all the submeshes were scaled to one instead of 100. The second issue was discussed here before and it's a known bug to be fixed. The third issue seems to be due to the Linear Color Space, and it's also a known bug. Temporary fix: 1) work in Gamma Space 2) if you want to use Linear Color Space, disable sRGB for all the textures. When working in Fur Mode, you also have to manually change the mask texture compression to None to edit the mask.
     
    kalagaan likes this.
  12. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    HairDesigner layers are based on the character skin model (vertices and skin weight), I didn't do a retargeting system.
    One way to do this could be to genearate a scalp mesh for HairDesigner, so you could link it to the head of any models.
     
    itchyOwl likes this.
  13. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Ahhh! I also have this "Gorilla issue", I assumed a UV map problem or the texture map was wrong…. I thought I'd read this whole thread, but didn't remember any fix…. I even built a skullcap but couldn't solve it.

    Thanks for suggestions extraneus. Will try tweaking the texture import when I get back to it…
     
    itchyOwl likes this.
  14. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    1. It looks like the hairDesigner collider doesn't scale as expected.
    I've fixed that problem for all the characters I've tested...

    You can modify the collider manually :
    - Select the gameObject with the HairDesigner component
    - Switch to the inspector debug mode (Right click on the Inspector tab)
    - Check "Debug Dont Hide Collider"
    - Switch the inspector to normal mode
    - Now when you go to the polygon mode, the collider appears as a child
    - you can set its transform manually
    Edit : try to set the position to (0,0,0) and the scale to the skeleton root scale.
    Edit2 : try to set the scale of the skinned mesh to the same scale as the parent of the bone root.


    Could you send me a model with this problem? (contact@kalagaan.com)
    What is your 3D software?


    2. Unity 5.6 has changed the default compression mode, I'll fix that in 1.3.2

    3.Here the fix for the fur problem:
    - Go to the material tab of the fur layer.
    - Click on the Mask texture
    - Find it in your project folder and opent its inspector
    - uncheck "sRGB" and apply the changes


    I'll fix this in 1.3.2
     
    Last edited: Apr 28, 2017
    wetcircuit likes this.
  15. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    Thank you for the reply,
    I've found a way to create a 'bad' export from blender.
    It doesn' work properly when the skeleton is scaled.
    1. I tried some export with blender using different scale.
    I found that the collider is ok when the skinMesh object has the same scale than the parent of the bone root.



    Could you check that on your model?
     
  16. Dark-Muppeteer

    Dark-Muppeteer

    Joined:
    Feb 24, 2013
    Posts:
    26
    Thanks for replies.

    I'm at work at the minute but when I get home I'll try some of the suggestions.
     
  17. Dark-Muppeteer

    Dark-Muppeteer

    Joined:
    Feb 24, 2013
    Posts:
    26
    Quick update,

    I managed to get the Gorilla looking great with the fixes to the mask texture (I'm in linear as I find the results nicer when working in VR) and also tested it out on a lion model, which turned out awesome.

    The Bear is still a no go but looks to be more to do with the odd way it's been created (asset store model), so I may be out of luck.
     
  18. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    @wetcircuit I'm intrigue by your avatar's hair? is there a way where I can look at the model closely?
     
  19. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    It's just a prop, sadly… I know you have been looking for good African hair. Me too!
     
    hopeful and neoshaman like this.
  20. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    I have made significant learning in that domain, stay tunes for when I start applying them.
     
    wetcircuit and kalagaan like this.
  21. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    Some messages have been deleted :(
    @neoshaman could you post the video link again?
     
  22. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    When the character has a rigidbody,
    the parameter 'Is Kinematic' must be set to true for enabling the painting tools.
    I'll fix this problem in 1.3.2

    Thx @Dark-Muppeteer for the feedback and the tests. :)
     
    Dark-Muppeteer likes this.
  23. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    pixel depth offset at 35:35
     
    kalagaan likes this.
  24. twda

    twda

    Joined:
    Oct 25, 2012
    Posts:
    111
  25. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    This plugin is really good!
    But I don't think that it would work for a unity export, meshes and shaders won't be compatible.
    You can use this kind of tool for cinematic, you should try the free demo :)
    HairDesigner is a solution for unity, it generates mesh for real time, it will never look better than a cinematic tool can do.
    I'll continue to improve HairDesigner, I hope that the result will be more and more close than this kind of tool.
     
  26. twda

    twda

    Joined:
    Oct 25, 2012
    Posts:
    111
    I know kalagaan from other VertEx Motion, so I guess his coding is amazing, and it has great support.

    Could anybody please post a video of how the hair looks with AA and image effects?

    I would like to see if the jagged, sharp edges will go away with AA. This will help me in my decision whether I already purchase now or later.

    Thank you.
     
    acaroppos and kalagaan like this.
  27. acaroppos

    acaroppos

    Joined:
    Jul 16, 2015
    Posts:
    31
    I also want to see how realistic the hair can get with FX. Or with anything. :) I'm not a hair expert, but it still doesn't look perfectly right for me. Unfortunately I don't have any experience with how to achieve a very realistic look.
     
    Last edited: May 4, 2017
    twda likes this.
  28. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    There's a lot of samples on the asset store page, I don't think that adding more FX will improve the hair quality.
    I'll continue to work on the shaders for a more realistic look ;)
    You can also use custom shaders with HairDesigner, and I'll add a support for Shaderforge :)
     
  29. mbbmbbmm

    mbbmbbmm

    Joined:
    Dec 28, 2013
    Posts:
    59
    Hi, I like to ask a couple of questions regarding Hair Designer:

    Is it possible to have a body hair layer and a scalp hair layer on a animated figure (Mecanim/Skinned Mesh Renderer) if the figure also gets scaled via the transform and gets morphed with a number of blendshapes?

    Would it be also possible to make the hair layers grow/shrink independently at runtime on that same figure?

    Additionally it would be necessary that this would work in Unity 5.4.0f3.

    Thank you!
     
    twda likes this.
  30. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    You can create layers for different parts of the skinned mesh. The mesh can be scaled because the layers are set as children of the main character gameObject.
    The blend shape are not compatible yet for the polygons hair layers ( only for the fur layers ).

    The hair can be changed at runtime with the shader parameters (length, color...) for each layer.
    You can use unity 5.4.0f3 or higher :)
    unity 5.3 is no longer supported, because unity has changed the shader API.
     
    twda likes this.
  31. mbbmbbmm

    mbbmbbmm

    Joined:
    Dec 28, 2013
    Posts:
    59
    Thank you!
     
  32. twda

    twda

    Joined:
    Oct 25, 2012
    Posts:
    111
    The hair wouldn't be affected by AA because your shader is a vertex shader, and to antialias something, we need a pixel shader, am I right?
     
  33. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    The hair shaders use both vertex and pixel programs, and a custom lighting.
    the AA works on the final camera rendering, so it will affect the hair.
     
  34. twda

    twda

    Joined:
    Oct 25, 2012
    Posts:
    111
    Is it possible that you (by default) use the Volund Hair Shader like this asset does?

    Or is Dynamic Hair and Fur so special that it needs its own shader?
    Sorry, I don't want to compare 2 products, yours seems much more flexible and more elaborated, I'm only trying to understand why your hair is jagged and not as smooth as I want it to be.

    Thank you for a reply!
     
  35. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    You can use your own shader with HairDesigner :)
    The motion system is based on the shader, so if you need it, you'll have to add the HairDesigner function in the vertex program of your shader.
     
  36. twda

    twda

    Joined:
    Oct 25, 2012
    Posts:
    111
    Ok, but why don't you use the Volund Hair shader? I'm asking because I'm afraid of the trouble that I might get when I try to do it myself.
    Also, Unity itself and Morph 3D and the author of the other asset that I've mentioned all use the Volund Hair shader.
    Why don't you do it by default? This would help a lot, I think.
     
    r3ndesigner likes this.
  37. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    If I add the volund hair to the package, I'll have to do support for it...
    So if it doesn't work with the next version of unity, it could be difficult to fix it.
    I only sell content that I made ;)
     
  38. r3ndesigner

    r3ndesigner

    Joined:
    Mar 21, 2013
    Posts:
    143
    do you have a road map to what come next?
     
  39. twda

    twda

    Joined:
    Oct 25, 2012
    Posts:
    111
    But I think now that so many people use Volund Hair shader, I think Unity will try to avoid breaking it.
    And if I use it, I will ask you for a fix anyway when it doesn't work anymore with Hair and Fur designer. :)
     
  40. r3ndesigner

    r3ndesigner

    Joined:
    Mar 21, 2013
    Posts:
    143
    whats the main difference from volund hair shader?
     
  41. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    I have bad news for you ...
     
    hopeful likes this.
  42. twda

    twda

    Joined:
    Oct 25, 2012
    Posts:
    111
    Why? It works with Unity 2017.1.0b5.
     
  43. twda

    twda

    Joined:
    Oct 25, 2012
    Posts:
    111
    I don't own Hair and Fur Designer yet, so I can't say.
    But Hair and Fur looks jagged and edgy, while the Volund hair shader looks absolutely smooth.
    I can't use jagged / edgy hair in my game, that's why I'm hoping kalagaan will include the Volund hair shader.
     
  44. r3ndesigner

    r3ndesigner

    Joined:
    Mar 21, 2013
    Posts:
    143
    Maybe if he want we can make a deal, i am thinking to buy too, can you make its work and send a separate stuff
    kalagaan, so you ll not need to always fix for new updates.
     
  45. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    ok, I've downloaded the package on 5.6, and the shader is working ;)
    I'll try it with HairDesigner and I'll post some screenshots.
     
    neoshaman and twda like this.
  46. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    I mean popularity hasn't stop unity from breaking stuff at all (see reverse depth buffer).
     
    wetcircuit, hopeful and kalagaan like this.
  47. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    Yes, that's why I don't want to do an official support this kind of shader :p
    I have enough work with my own shaders :D
     
    neoshaman likes this.
  48. twda

    twda

    Joined:
    Oct 25, 2012
    Posts:
    111
    If anybody is lurking here who also wants to have the Volund Hair shader integrated, please show up!

    These screenshots are SOOOO GOOD:










    I totally LOVE these, but they're not aimed at production.
    We need smooth, AA hair, please.
    I have no idea how this should be done, but the Volund Hair Shader is absolutely smooth, so I hope and think kalagaan can achieve the same.

    Thank you.
     
    kalagaan and neoshaman like this.
  49. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,503
    I'm working on a way to generate hair textures (diffuse, normal...) with procedural parameters.
    So you'll be able to use these textures with other shaders.
    I'll also write my own shader for using the generated textures ;)
    It will be smoother than the current procedural shader.
     
    Last edited: May 24, 2017
    twda, punk and neoshaman like this.
  50. r3ndesigner

    r3ndesigner

    Joined:
    Mar 21, 2013
    Posts:
    143
    very good kalagaan i am certain buy your asset. thanks.
     
    twda and kalagaan like this.