Search Unity

Olander's Genesis Hair Shader [Free]

Discussion in 'Assets and Asset Store' started by Olander, Jun 10, 2016.

  1. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    405
    A lot of trial and experimentation on this one. Kind of like how the Original Genesis Hair Shader for Unity was made. A LOT of trial and error under different lighting conditions.

    - Hair Color (RGB Hex or Decimal)
    - Hair Texture (Hair with very Light Blonde or Desaturated with More Brightness and Contrast...No Gaussian Blur)
    - Hair Alpha Overlay (Alpha Overlay Map for Hair...can be made or picked up. I made this one.)
    - Hair Alpha Map (This is the special gradient map Only for the Ends of the hair. Made in Photoshop)
    - Hair Normal Map (made from the Hair Texture above. GIMP Normal Map addon...see workflow)
    - DitherTemporalAA is the dithering available in UE4. (the Random Input is defaulted to 1.0f)

    Note: In Unity Specular should always start at RGB 15,15,15 then go from there (Hint...because of their lighting).

    Hair Shader Graph (UE4)
    UE4_GenesisHair_Shader_Hair.png

    Scalp Shader Graph (UE4)
    UE4_GenesisHair_Shader_Scalp.png
     
    Last edited: Aug 8, 2018
    hopeful likes this.
  2. Splosions

    Splosions

    Joined:
    Apr 29, 2017
    Posts:
    30
    Olander, correct me if I am wrong, but your workflow does not account for any bones? Is the hair you end up with jsut a static mesh or do you rig it at some point?

    I am using Linda hair from Daz and I am having to add a few extra bones to it to get it to move properly in Unity. When following your workflow I don't get any bones in Blender, so I am working on adding bones in Daz
     
  3. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    405
    Works with (skin weighted rigged hair) or without bones (OBJ mesh collision type). The easiest process is the OBJ route then use something like VertExmotion by Kalagaan (assetstore.unity.com/packages/tools/animation/vertexmotion-23930).

    With a character it is always expected to have capsule colliders at the neck and upper torso (2 lateral) so the hair or ear rings or weapons or many other things can message the 'Body' what and where something contacted it....to run the appropriate script or something.The Hair from VertExmotion can collide with these easily and provide very realistic hair bounce and properties. This is the workflow I added to the PDF.

    For Skin Weighted Rig Hair...you can still use VertExmotion to add some bounce life to the 'Ends' and 'Wispy Bits' but it will fight with the skinned bone weights since the hair will be 'Stuck' to the body in animation. Benefit here is no need for clipping collision checks since it is actually a piece of clothing weighted to the bones.

    For UE4 since there is no awesome VertExmotion I am using the built in Cloth Simulator to do the realistic hair. There is a little clipping but it is acceptable in the end. This uses capsule colliders for collision. So the same process as Unity with VertExmotion.

    So you can see I do prefer the OBJ method better since it is more flexible and gives better hair results.
    *OBJ method is still FBX import into the game engine.

    Cheers
    O
     
  4. Splosions

    Splosions

    Joined:
    Apr 29, 2017
    Posts:
    30
    Ah VertExmotion I see. That does look like a handy tool. I have been using Dynamic Bone instead. Hence the questions on bones :p

    Does your skin include the eyebrows? The skin I have doesn't and trying to get Daz eyebrows to work in unity looks ok up close but quickly look like garbage the farther you get away.
     
    Last edited: Aug 23, 2018
  5. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    405
    Dynamic Bone is pretty nice. Great for tails and other things that need some shimtrickery. :) Rigging and weighting sucks...so I pretty much stopped using it in lieu of 'cloth' simulation (vertex motion).

    The eyebrows are a separate texture. In fact they are a texture mask. I do some work on it in Photoshop CC to make them more grey scale by doing some layer color tricks and overlays and soft light to get the good look. Takes practice...need 3 layers to make them look right. Not really simple to explain either.

    Any skin textures I like which have eyebrows included I simply clone the forehead skin over the eyebrows. Then use healing to get the final look.

    If you are curious or want some really good Merchant Resources (meaning no license required)....head to www.daz3d.com and search for Skin Builder 3 and Skin Overlay for V5 and M5. (*Just manually download the zip from your account for easy access) There are others but these have tons of options to make awesome skin textures. All the textures are in JPG and need some work (UVs and prep and such) in Photoshop to make them game ready for what you need.

    In fact...I only use Diffuse (Albedo) and a Normal Map both PNG for the base skin. Specular is set to 15,15,15 which allows me to adjust Metallic & Roughness to get sweaty/oily skin. Both Unity and UE4 are identical textures. Lastly...I use TGA for any textures that have Transparency to use a true alpha channel. Both Unity and UE4 (especially) have transparency artifacts if not a true alpha channel. Eyebrows....Blush....Eyeshadow....Eye Liner....Freckles....Cuts and Blood splatter....these types of 'Overlay' textures.


    Hope that helps explain. :)

    Cheers
    O
     
    nirvanajie and sharkapps like this.
  6. Splosions

    Splosions

    Joined:
    Apr 29, 2017
    Posts:
    30
    So I got VertExmotion and I am having some trouble getting your awesome genesis hair shader to work with it. I am going over teh PDF trying to add the proper lines of code, but I am no shader coder. Would you happen to have a modified version of your hair shader that has the VertExmotion bits added already?
     
  7. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    405
    This may not be the answer you want to hear but...page 11 in the VertExmotion Doc is exactly what you need. Also VertExmotion support is really good. You will need to zip the model, textures, and shader that you are using for them to make it VE compatible.

    I cannot provide a shader with their 'stuff' in it. Even for something as simple as what you are asking. Cannot 'Grey Area' this type of thing. Apologies.

    Cheers
    O
     
  8. freenomon

    freenomon

    Joined:
    Mar 21, 2019
    Posts:
    35
    hello~

    Does this shader work with Unity 2019 and with LWRP? (or HDRP) I'm having lots of problems with hair transparency using daz polygon hairs. can't get them to look right.. any help would be appreciated.. I will buy your beer and tons of chicken wings!

    pelase someone help: freenomon@gmail.com


    thanks again

    Kenneth C
     
  9. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    405
    So far yes it does without any issues. It is a custom shader and uses the Unity 5 based shader stuff. Eventually the way Unity does things this shader will break....and there will certainly be no fix to it. Not going down this road again.

    So in light of this....you can get 'Soft Hair' with the original Genesis Hair Shader and the only thing that does not work is receiving shadows. If lighting intensity is controlled well in script then this can be mostly mitigated visually. Going forward to the future because of Unity's consistency of breaking custom shaders you should really use a similar method to the Amplify Shader provided above.....meaning....do the softness in the Textures and use Unity Standard Shaders (LWRP and/or HDRP). I gave the Amplify Shader above but one can do essentially the same thing with the texture prep I also gave above.

    The key is to get really good at manipulating Gaussian Blurs with Alpha Maps. Practice makes perfect. Both Photoshop CC 2018 and GIMP (v2.88 and Latest) do really nice work with blurring.

    Good luck.
    O
     
    nirvanajie likes this.
  10. Acatist

    Acatist

    Joined:
    Jun 7, 2016
    Posts:
    45
    Where can I find your Genesis Skin Shader?
     
  11. blackbird

    blackbird

    Joined:
    Aug 9, 2011
    Posts:
    591
    any hdrp solution even paid one ?
     
  12. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    405
    2020AUG Note: Folks. I have 100% moved away from Unity to UE4....never returning.

    This Hair Shader works as is and is based upon the Unity 5 shader(s). There is no further development for HDRP on this or future Unity versions. Both Unity Hair Versions above will work in HDRP but the conversion is not '1-Click' and I am not going to simply give how to convert it to this Unity crowd (also not interested in the U.A.S.). Sorry.

    Good Luck! Cheers.
    O.
     
  13. blackbird

    blackbird

    Joined:
    Aug 9, 2011
    Posts:
    591
    oh thank you for your reply but could explain why you sounds angry at your fellow users here ?
     
  14. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    405
    Not angry at all. You (maybe others) are reading into it. :) Sorry for sounding/seeming this way. :) I also answered the HDRP post in post #59 above in detail.

    If I was still working in Unity I would probably just swallow hard and provide 4 different shaders for this hair (weather and eyes also fall into this). My small company moved on. Nothing breaks in UE4 when keeping to the latest versions (only issue was converting the project to 4.18 which broke a few things). All my UE4 versions of these Unity Shaders still work with no issues. We are currently at 4.25.3 and are prepping for 4.26.1 and UE5 for future proofing. I still do use Unity 5.6.7f1 (very infrequently) since I have a Pro License and use it for some comparison reference and tools I made for conversions.

    I will say that the Unity crowd tends to want lots of things handled for them and seem to have no issue in asking for technical updates for all Unity versions. As example...my free weather had a really snarky reply about it being broken and not currently working with 'the latest Unity' when in fact it does but not the latest Unity Post FX.

    HDRP is now (finally as of 2019.3) production ready but is not very stable. So any of the graphical type shaders need to have LWRP and HDRP with ongoing testing and maintenance. A tough swallow for someone who has no stake in this.

    I did think about removing the download links on my website as they only really apply to 2018.4 (actual latest LTS for production) but they do actually work in 2019.# but need a couple minor adjustments. I keep them there for folks to download and use for their own use.

    Too bad Unity is not more forgiving in its update strategy. Terrible system in my opinion. ;):)

    Cheers
    O.
     
    blackbird likes this.
  15. videocanvas

    videocanvas

    Joined:
    Jul 27, 2015
    Posts:
    1
    I cannot find the download link of source code, who can give me the link? Thanks!
     
  16. Tay5

    Tay5

    Joined:
    Jul 17, 2023
    Posts:
    2
    Anyone can share this great shader? The link is unavailable.
     
  17. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    405
    It is still up but I am not supporting it. It works in 5.6.7 and up to Unity 2018 LTS. It does work in Unity 2019 but needs some tweaks which are not easy but worth it to migrate to Unity 202# if you can get through the current Unity pains.

    I fixed the link in the opening post and works. The link in my signature is correct though.
     
    Last edited: Jul 18, 2023
    Tay5 likes this.
  18. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    405
    All files are no longer available. I have been cleaning up my FTP and decided that it has been plenty long enough to host these. I have them on my NAS drive so if needed I can FTP specifically if needed. Send a PM request. Email notifications do not work well from Unity Forums but I log in a couple times a month.

    Cheers
    O
     
  19. S4G4N

    S4G4N

    Joined:
    Mar 13, 2013
    Posts:
    3,215
    Hello old friend ;)
    Good to see that you alive and well