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:
    398
    Genesis Hair Shader
    This was part of my Community Initiative to give very high quality easy to integrate products to the Unity Community for Free. Yes...that means...Full Source and Fully Working...no trial periods...no BS. Please see the Stand Sure Studio link below for other available and soon to be available products.

    Files at the link below.
    Details Link: http://standsurestudio.com/unity5content/

    Unity 2018.1 :: Imported and works perfectly (no change).

    Unity 5.6+ Update and Fade Support:
    I placed a new shader code down below in the forum posts here. You can use that as an alternative until Unity supports Fade Mode receiving shadows. At this point not certain this will ever be solved by Unity.

    Included:
    • Unity 5-2017-2018 (All Versions. Created in 5.1.2). Does not require Pro
    • Very fast 2-sided shader with excellent soft alpha blending
    • Only uses a Diffuse Alpha (rgba) (PNG), and Normal Map (PNG)
    • 2 Sliders to control the material for Wet, Dry, Plastic, Metal, and Marble. (Can be controlled by script)
    • Works in all Unity 5-2017-2018 rendering modes: Forward Gamma, Forward Linear, Deferred Gamma, Deferred Linear
    • Detailed step-by-step PDF to show exactly how to Export hair from DAZ Studio, set up Textures, and Import all into Unity 5-2017-2018
    • DAZ Hair not required, any hair mesh with Diffuse Alpha will work. DAZ is an excellent resource for great hair and a lot of options
    • DAZ Licensing Information PDF to help clear up licensing for commercial projects (written by myself)
    Not Included:
    • Hair and Genesis 2 Female figure shown in pictures are not included but are easily attainable.
    • No Demo scene since there are no models/meshes (shader only).
    Asset Store Link: None...Free from Stand Sure Studio link above

    Hair used in the pictures below:

    Forest Princess Hair: http://www.daz3d.com/forest-princess-hair

    Pure Hair: Catwalk for Genesis: http://www.daz3d.com/pure-hair-catwalk

    Pure Hair: Candy for Genesis: http://www.daz3d.com/pure-hair-candy

    Fiora Hair for Genesis 2 Females and Victoria 4: http://www.daz3d.com/fiora-hair-for-genesis-2-females-and-victoria-4

    Lighting Mode: Deferred Linear

    Camera Effects (Standard Unity 5): Antialiasing, Bloom (Optimized), Depth of Field, Tonemapping, Global Fog
    • These are not the new Cinematic Effects package from Unity
    All settings are shown in the Olander's DAZ Hair to Unity PDF

    Bug Report with Unity 5.6.2p4+ and Rendering:
    What we found is that Unity recently changed their Alpha Test Rendering Queue.
    - Click on the Materials and set Rendering Queue to 2550

    Genesis Hair Shader FX 01.png Genesis Hair Shader FX 02.png Genesis Hair Shader FX 03.png Genesis Hair Shader FX 04.png
     
    Last edited: May 26, 2018
    justb, gremberman, cwmanley and 5 others like this.
  2. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    398
    More Pics Genesis Hair Shader Wetness.png Genesis Hair Shader Dryness.png Genesis Hair Shader Plastics.png Genesis Hair Shader Metals.png Genesis Hair Shader Marble.png
     
    mons00n, Gozdek, S4G4N and 1 other person like this.
  3. Gozdek

    Gozdek

    Joined:
    Jun 21, 2015
    Posts:
    356
    Looks cool
     
  4. S4G4N

    S4G4N

    Joined:
    Mar 13, 2013
    Posts:
    2,704
    Congrats of first submission, welcome to being a publisher.
    Now the fun starts ;)
     
  5. futurewavecs

    futurewavecs

    Joined:
    Jul 26, 2012
    Posts:
    69
    Congrats for the submission Don.
     
    S4G4N likes this.
  6. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,667
    Looking forward to seeing lots of awesomeness from Don :)
     
    S4G4N likes this.
  7. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    398
    Thank You. Appreciated.
     
    XCO and S4G4N like this.
  8. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    398
    The hair shader was declined but no reason was given. I sent a reply message to Unity Technologies in question if I needed to fix something in the package or if they are simply not interested in the hair shader on the asset store. Once I know I will post here.

    Cheers
     
    S4G4N likes this.
  9. futurewavecs

    futurewavecs

    Joined:
    Jul 26, 2012
    Posts:
    69
    A couple of things. How does this compare to the Hair shader you can extract from the Unity Technologies Blacksmith scene?

    I know Nathan had multiple sword pack declined a year ago and we suspected it was due to how many swords are on the site.

    I hope they give you an answer you can work with.
     
  10. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    398
    The Blacksmitth Hair Shader is very specialized and difficult to set up. The results are solid. The Genesis Hair Shader is very simple to set up the Diffuse RGBA PNG and Normal Map as well as giving many options in how the hair needs to look. One other nice thing is the Genesis Hair Shader may be used for many other things that require Soft Alpha Blend, Plastics, Metals, and Glossy Stonework. A really solid shader that is very difficult to break.

    In any case. Thank you for the response. If this ends up being a no go on the asset store I may simply give this away for free since it is very handy and there are very very few hair shaders for Unity out there.

    Cheers
    O
     
    XCO, StevenP94 and theANMATOR2b like this.
  11. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    398
    Updated for my Unity Community Initiative.

    Cheers and Enjoy
    O
     
  12. blackbird

    blackbird

    Joined:
    Aug 9, 2011
    Posts:
    526
    i tested your asset it's great ! but i have one question when i pass a room using reflection probes the hair had white dots every where any idea how to over come that issue ?
     
  13. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    398
    Sorry for late reply. You may have already found a solution but...in general make sure your bounding box for the reflection probe is the same size as your room. If you enter the room with the probes I believe it is the Specular that is doing what you are seeing....and my answer....

    Personally I have stopped using reflection probes in general. I still use them for very specific things but even then I have moved away from reflection probes. You may have seen in other games and such where a shiny droid or shiny object 'appears' to have a reflective surface. Well...it is smoke an mirrors if you look closely. Basically it is a texture overlay in a shader with a a metallic and slick surface...not really reflecting the actual surroundings. Happens all the time. This is the path I went to for reflective objects.

    Since I have stopped using reflection probes I have a lot less shader issues (particularly the custom ones). I know it sounds like the easy way out but there are many things in Unity 5 that sort of work...are being improved...but are just not ready yet. It is what it is.

    Cheers
    O
     
    XCO, Chrisdbhr and blackbird like this.
  14. Bullet93

    Bullet93

    Joined:
    Jan 6, 2017
    Posts:
    2
    Hi!

    I tried it with my IClone characters hair and it looks okay using unity 5.5, but I'm having an issue after deploying my application (which works in a transparent click-through window) where the hair is completely invisible while white a image is under it and somehow transparent when darker colored images are under it.
    Any suggestions?
     
  15. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    398
    Your description is difficult to understand. What you could be experiencing is a render queue ordering or Z-Buffer issues with transparency and/or your images. A picture may help.

    The pictures at the top of this forum or my site are taken in 5.4 beta version but did work in all the updates. I have upgraded my project to 5.5 but I have not used Unity much at all since moving to UE4 completely. You can see in them that the Body/Skin is 'Under' the hair and both the transparency and shadowing is working correctly.

    One thing to possibly check for is what Unity Tech changed in v5.5. One thing in particular is that the Z-Buffer is inverted now and other shader changes have taken place. I had to fix a lot of custom shader code to get the project converted to v5.5 but I have not done any testing at all in it. The Genesis Hair Shader is a custom soft alpha that was really finicky to get solid. It may be an easy fix from the v5.5 changes Unity did. Or maybe not.

    Changes link:
    https://docs.unity3d.com/Manual/UpgradeGuide55.html

    Cheers
    O
     
  16. blackbird

    blackbird

    Joined:
    Aug 9, 2011
    Posts:
    526
    any chance to fix the shader for unity 5.5 and above
     
  17. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    398
    @blackbird
    May have to have two separate versions. I can take a look.
     
    StevenP94 and blackbird like this.
  18. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    398
    @blackbird

    So...I was actually getting ready to get back into the character side of things so this would have been a test in any case. The good news is the Genesis Hair Shader continues to work as expected. I am not certain what is broken on your end.

    Current Project:
    Unity v5.6.0f3
    DirectX11
    Full GI...this pic has no Post FX or any other added camera layers. Just raw camera and Directional Light.
    Note: For best lighting results your directional light should be from 0.1-ish to 1.75-ish lower can ruin your normal map and higher will create bad lighting rendering exposure issues.

    So as it stands....this Hair Shader continues to work with all versions...especially 5.4+ :):cool:;)
    **I tested my Eye Shader as well....same result with version.

    Genesis Hair Test v5.6.0f3.png Genesis Hair TestB v5.6.0f3.png
     
  19. blackbird

    blackbird

    Joined:
    Aug 9, 2011
    Posts:
    526
    thank you very much , i don t know why i got pink shader ! i will reimport the shader again and will see if things work out
     
  20. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    398
    Anytime. Has to be something simple.

    Cheers
    O
     
    blackbird likes this.
  21. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    398
    A small update folks. Something to correct on your end.

    We were just doing some testing this evening. I am using 5.6.0f3 myself and a dev friend of mine is using 5.6.2p4 and he was having troubles with the rendering....particularly with the transparency. What we found is that Unity recently changed their Alpha Test Rendering Queue without telling anyone.
    - Click on the Materials and set Rendering Queue to 2550

    Once he did this the hair was once again beautiful....actually....the transparency is better now than it was. I had to make the alpha really soft to blend well with older Unity....now it really looks awesome with the same shader.
    Unity Post FX Stack v1 & v2 are both working well. This picture is working with Antialiasing (FXAA), AO, Bloom, Color Grading, Vignette. (this is my tuned Post FX Stack)....also Global Fog 0-1500 (I use for Atmospheric Scattering)

    Genesis Hair TestC.png
     
    ikazrima likes this.
  22. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    398
    Hi folks. Here is a new shader that I just made for hair. Since Unity does not support yet Fade Mode receiving shadows I am providing a 'Good Enough' option for Genesis Hair. I made this in Amplify Shader Editor....took about 6 hours to figured it out. The results are quite good. I'll post the code in the next posting....here is what it looks like.
    Genesis Hair (Current is on the Left) and new Genesis Hair code is on the Right.

    Camera is using my fully tuned Post FX Stack

    One thing to note....with this hair you only need one Hair Texture then color it with the selector. When preparing the Hair Texture....before saving as a PNG do a Guassian Blur on the hair texture set to roughly 4 or 5. You can compare and see it happen on the material from no Blur to having some Blur. This will help get the look in the pics.

    Genesis Hair New Test A.png Genesis Hair New Test B.png
     
    hopeful likes this.
  23. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    398
    And here is the shader code.

    Code (CSharp):
    1. Shader "Genesis/Character/gHairShaderNew"
    2. {
    3.     Properties
    4.     {
    5.         [HideInInspector] __dirty("", Int) = 1      
    6.         _MainTex("_MainTex", 2D) = "white" {}
    7.         _NormalMap("_NormalMap", 2D) = "bump" {}
    8.         _AlphaCutout("Mask Clip Value", Float) = 0.25
    9.         _Specular("_Specular", Range(0 , 0.5)) = 0.35
    10.         _Emission("_Emission", Range(0 , 0.2)) = 0.8
    11.         _Smoothness("_Smoothness", Range(0 , 1)) = 0.8
    12.         _Color("_Color", Color) = (1,1,1,0)
    13.         [HideInInspector] _texcoord("", 2D) = "white" {}
    14.     }
    15.  
    16.     SubShader
    17.     {
    18.         Tags{ "RenderType" = "Overlay"  "Queue" = "AlphaTest+0" "IgnoreProjector" = "True" "IsEmissive" = "true" }
    19.         LOD 200
    20.         Cull Off
    21.         Blend One Zero , OneMinusDstColor One
    22.         BlendOp Add , Add
    23.         CGPROGRAM
    24.         #pragma target 3.0
    25.         #pragma multi_compile_instancing
    26.         #pragma surface surf StandardSpecular keepalpha addshadow fullforwardshadows
    27.         struct Input
    28.         {
    29.             float2 uv_texcoord;
    30.         };
    31.  
    32.         uniform sampler2D _NormalMap;
    33.         uniform float4 _NormalMap_ST;
    34.         uniform sampler2D _MainTex;
    35.         uniform float4 _MainTex_ST;
    36.         uniform float4 _Color;
    37.         uniform float _Emission;
    38.         uniform float _Specular;
    39.         uniform float _Smoothness;
    40.         uniform float _AlphaCutout = 0.25;
    41.  
    42.         void surf(Input i , inout SurfaceOutputStandardSpecular o)
    43.         {
    44.             float2 uv_NormalMap = i.uv_texcoord * _NormalMap_ST.xy + _NormalMap_ST.zw;
    45.             float3 txNormalMap69 = UnpackNormal(tex2D(_NormalMap, uv_NormalMap));
    46.             o.Normal = txNormalMap69;
    47.             float2 uv_MainTex = i.uv_texcoord * _MainTex_ST.xy + _MainTex_ST.zw;
    48.             float4 tex2DNode1 = tex2D(_MainTex, uv_MainTex);
    49.             float4 txMainTex40 = tex2DNode1;
    50.             float4 cColor39 = _Color;
    51.             float4 blendOpSrc17 = txMainTex40;
    52.             float4 blendOpDest17 = cColor39;
    53.             float4 blendOpSrc56 = float4(0.1985294,0.1985294,0.1985294,1);
    54.             float4 blendOpDest56 = (saturate((blendOpSrc17 * blendOpDest17)));
    55.             float4 blendOpSrc25 = (saturate((blendOpDest56 > 0.5 ? (1.0 - (1.0 - 2.0 * (blendOpDest56 - 0.5)) * (1.0 - blendOpSrc56)) : (2.0 * blendOpDest56 * blendOpSrc56))));
    56.             float4 blendOpDest25 = txMainTex40;
    57.             float4 cFinalColor62 = (saturate(2.0f*blendOpSrc25*blendOpDest25 + blendOpSrc25*blendOpSrc25*(1.0f - 2.0f*blendOpDest25)));
    58.             o.Albedo = cFinalColor62.xyz;
    59.             o.Emission = (cFinalColor62 * _Emission).xyz;
    60.             o.Specular = (cFinalColor62 * _Specular).xyz;
    61.             o.Smoothness = (txMainTex40 * _Smoothness).x;
    62.             float3 desaturateVar26 = lerp(txMainTex40.xyz,dot(txMainTex40.xyz,float3(0.299,0.587,0.114)),0.0);
    63.             o.Occlusion = desaturateVar26.x;
    64.             o.Alpha = 1;
    65.             float txMainTexAlpha67 = tex2DNode1.a;
    66.             clip(txMainTexAlpha67 - _AlphaCutout);
    67.         }
    68.  
    69.         ENDCG
    70.     }
    71.     Fallback "Standard"
    72.     Fallback "Diffuse"
    73. }
     
    blackbird likes this.
  24. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,070
    @Olander - This looks great! Thanks for making it available.

    Would it make sense to provide the ASE graph?

    (BTW, that long hair model also looks great. I'll bet it took a long time to make it!)
     
  25. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    398
    I suppose. Not sure if it transfers but...here is the ASE version. :)

    Code (CSharp):
    1. // Made with Amplify Shader Editor
    2. // Available at the Unity Asset Store - http://u3d.as/y3X
    3. Shader "gHairShaderAmp"
    4. {
    5.     Properties
    6.     {
    7.         [HideInInspector] __dirty( "", Int ) = 1
    8.         _MaskClipValue( "Mask Clip Value", Float ) = 0.25
    9.         _MainTex("_MainTex", 2D) = "white" {}
    10.         _NormalMap("_NormalMap", 2D) = "bump" {}
    11.         _Specular("_Specular", Range( 0 , 0.5)) = 0.35
    12.         _Emission("_Emission", Range( 0 , 0.2)) = 0.8
    13.         _Smoothness("_Smoothness", Range( 0 , 1)) = 0.8
    14.         _Color("_Color", Color) = (1,1,1,0)
    15.         [HideInInspector] _texcoord( "", 2D ) = "white" {}
    16.     }
    17.  
    18.     SubShader
    19.     {
    20.         Tags{ "RenderType" = "Overlay"  "Queue" = "AlphaTest+0" "IgnoreProjector" = "True" "IsEmissive" = "true"  }
    21.         LOD 200
    22.         Cull Off
    23.         Blend One Zero , OneMinusDstColor One
    24.         BlendOp Add , Add
    25.         CGPROGRAM
    26.         #pragma target 3.0
    27.         #pragma multi_compile_instancing
    28.         #pragma surface surf StandardSpecular keepalpha addshadow fullforwardshadows
    29.         struct Input
    30.         {
    31.             float2 uv_texcoord;
    32.         };
    33.  
    34.         uniform sampler2D _NormalMap;
    35.         uniform float4 _NormalMap_ST;
    36.         uniform sampler2D _MainTex;
    37.         uniform float4 _MainTex_ST;
    38.         uniform float4 _Color;
    39.         uniform float _Emission;
    40.         uniform float _Specular;
    41.         uniform float _Smoothness;
    42.         uniform float _MaskClipValue = 0.25;
    43.  
    44.         void surf( Input i , inout SurfaceOutputStandardSpecular o )
    45.         {
    46.             float2 uv_NormalMap = i.uv_texcoord * _NormalMap_ST.xy + _NormalMap_ST.zw;
    47.             float3 txNormalMap69 = UnpackNormal( tex2D( _NormalMap, uv_NormalMap ) );
    48.             o.Normal = txNormalMap69;
    49.             float2 uv_MainTex = i.uv_texcoord * _MainTex_ST.xy + _MainTex_ST.zw;
    50.             float4 tex2DNode1 = tex2D( _MainTex, uv_MainTex );
    51.             float4 txMainTex40 = tex2DNode1;
    52.             float4 cColor39 = _Color;
    53.             float4 blendOpSrc17 = txMainTex40;
    54.             float4 blendOpDest17 = cColor39;
    55.             float4 blendOpSrc56 = float4(0.1985294,0.1985294,0.1985294,1);
    56.             float4 blendOpDest56 = ( saturate( ( blendOpSrc17 * blendOpDest17 ) ));
    57.             float4 blendOpSrc25 = ( saturate( ( blendOpDest56 > 0.5 ? ( 1.0 - ( 1.0 - 2.0 * ( blendOpDest56 - 0.5 ) ) * ( 1.0 - blendOpSrc56 ) ) : ( 2.0 * blendOpDest56 * blendOpSrc56 ) ) ));
    58.             float4 blendOpDest25 = txMainTex40;
    59.             float4 cFinalColor62 = ( saturate( 2.0f*blendOpSrc25*blendOpDest25 + blendOpSrc25*blendOpSrc25*(1.0f - 2.0f*blendOpDest25) ));
    60.             o.Albedo = cFinalColor62.xyz;
    61.             o.Emission = ( cFinalColor62 * _Emission ).xyz;
    62.             o.Specular = ( cFinalColor62 * _Specular ).xyz;
    63.             o.Smoothness = ( txMainTex40 * _Smoothness ).x;
    64.             float3 desaturateVar26 = lerp( txMainTex40.xyz,dot(txMainTex40.xyz,float3(0.299,0.587,0.114)),0.0);
    65.             o.Occlusion = desaturateVar26.x;
    66.             o.Alpha = 1;
    67.             float txMainTexAlpha67 = tex2DNode1.a;
    68.             clip( txMainTexAlpha67 - _MaskClipValue );
    69.         }
    70.  
    71.         ENDCG
    72.     }
    73.     Fallback "Standard"
    74.     Fallback "Diffuse"
    75.     CustomEditor "ASEMaterialInspector"
    76. }
    77. /*ASEBEGIN
    78. Version=12001
    79. -1916;39;1901;909;2653.998;944.901;2.2;True;True
    80. Node;AmplifyShaderEditor.ColorNode;16;-1366.405,-274.701;Float;False;Property;_Color;_Color;6;0;1,1,1,0;0;5;COLOR;FLOAT;FLOAT;FLOAT;FLOAT
    81. Node;AmplifyShaderEditor.SamplerNode;1;-1361.995,-101.3999;Float;True;Property;_MainTex;_MainTex;1;0;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;6;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0.0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1.0;False;5;FLOAT4;FLOAT;FLOAT;FLOAT;FLOAT
    82. Node;AmplifyShaderEditor.RegisterLocalVarNode;40;-1000.796,-101.503;Float;False;txMainTex;-1;True;1;0;FLOAT4;0,0,0,0;False;1;FLOAT4
    83. Node;AmplifyShaderEditor.GetLocalVarNode;42;-1167.188,-490.4036;Float;False;39;0;1;COLOR
    84. Node;AmplifyShaderEditor.GetLocalVarNode;41;-1167.188,-560.8038;Float;False;40;0;1;FLOAT4
    85. Node;AmplifyShaderEditor.RegisterLocalVarNode;39;-1111.001,-274.7029;Float;False;cColor;-1;True;1;0;COLOR;0.0;False;1;COLOR
    86. Node;AmplifyShaderEditor.BlendOpsNode;17;-890.9962,-556.603;Float;False;Multiply;True;2;0;FLOAT4;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR
    87. Node;AmplifyShaderEditor.ColorNode;61;-941.884,-719.404;Float;False;Constant;_Color0;Color 0;7;0;0.1985294,0.1985294,0.1985294,1;0;5;COLOR;FLOAT;FLOAT;FLOAT;FLOAT
    88. Node;AmplifyShaderEditor.GetLocalVarNode;43;-662.9948,-623.8038;Float;False;40;0;1;FLOAT4
    89. Node;AmplifyShaderEditor.BlendOpsNode;56;-647.2861,-714.7031;Float;False;Overlay;True;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR
    90. Node;AmplifyShaderEditor.BlendOpsNode;25;-404.0996,-715.2054;Float;False;SoftLight;True;2;0;COLOR;0,0,0,0;False;1;FLOAT4;0,0,0,0;False;1;FLOAT4
    91. Node;AmplifyShaderEditor.RangedFloatNode;6;-578.0001,-90.60017;Float;False;Property;_Specular;_Specular;3;0;0.35;0;0.5;0;1;FLOAT
    92. Node;AmplifyShaderEditor.RegisterLocalVarNode;62;-192.9076,-720.2026;Float;False;cFinalColor;-1;True;1;0;FLOAT4;0,0,0,0;False;1;FLOAT4
    93. Node;AmplifyShaderEditor.SamplerNode;2;-1364.893,98.39755;Float;True;Property;_NormalMap;_NormalMap;2;0;None;True;0;True;bump;Auto;True;Object;-1;Auto;Texture2D;6;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0.0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1.0;False;5;FLOAT3;FLOAT;FLOAT;FLOAT;FLOAT
    94. Node;AmplifyShaderEditor.RangedFloatNode;5;-584.0996,344;Float;False;Property;_Smoothness;_Smoothness;5;0;0.8;0;1;0;1;FLOAT
    95. Node;AmplifyShaderEditor.GetLocalVarNode;66;-533.8846,75.8983;Float;False;40;0;1;FLOAT4
    96. Node;AmplifyShaderEditor.RangedFloatNode;27;-577.4026,-235.1029;Float;False;Property;_Emission;_Emission;4;0;0.8;0;0.2;0;1;FLOAT
    97. Node;AmplifyShaderEditor.GetLocalVarNode;65;-521.0936,269.7984;Float;False;40;0;1;FLOAT4
    98. Node;AmplifyShaderEditor.GetLocalVarNode;64;-514.4081,-160.2046;Float;False;62;0;1;FLOAT4
    99. Node;AmplifyShaderEditor.DesaturateOpNode;26;-284.9995,80.99825;Float;False;2;0;FLOAT3;0,0,0;False;1;FLOAT;0.0;False;1;FLOAT3
    100. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;15;-238.8986,-107.899;Float;False;2;2;0;FLOAT4;0;False;1;FLOAT;0,0,0,0;False;1;FLOAT4
    101. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;28;-237.4007,-200.3017;Float;False;2;2;0;FLOAT4;0,0,0,0;False;1;FLOAT;0.0,0,0,0;False;1;FLOAT4
    102. Node;AmplifyShaderEditor.GetLocalVarNode;70;-85.99923,-217.7016;Float;False;69;0;1;FLOAT3
    103. Node;AmplifyShaderEditor.GetLocalVarNode;63;-45.61165,-290.5042;Float;False;62;0;1;FLOAT4
    104. Node;AmplifyShaderEditor.GetLocalVarNode;68;-24.1917,344.0987;Float;False;67;0;1;FLOAT
    105. Node;AmplifyShaderEditor.RegisterLocalVarNode;69;-1005,103.9978;Float;False;txNormalMap;-1;True;1;0;FLOAT3;0,0,0,0;False;1;FLOAT3
    106. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;21;-248.3968,274.8994;Float;False;2;2;0;FLOAT4;0,0,0,0;False;1;FLOAT;0.0,0,0,0;False;1;FLOAT4
    107. Node;AmplifyShaderEditor.RegisterLocalVarNode;67;-1003.487,6.49826;Float;False;txMainTexAlpha;-1;True;1;0;FLOAT;0,0,0,0;False;1;FLOAT
    108. Node;AmplifyShaderEditor.StandardSurfaceOutputNode;0;416.7996,122.5;Float;False;True;2;Float;ASEMaterialInspector;200;StandardSpecular;gHairShaderAmp;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;False;True;Off;0;0;False;0;0;Custom;0.25;True;True;0;True;Overlay;AlphaTest;All;True;True;True;True;True;True;True;True;True;True;True;True;True;True;True;True;True;False;0;255;255;0;0;0;0;False;0;4;10;25;False;0.5;True;0;SrcAlpha;SrcColor;5;OneMinusDstColor;One;Sub;Add;0;False;0;0,0,0,0;VertexOffset;False;Cylindrical;False;Relative;200;Standard;0;-1;-1;-1;0;0;15;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT3;0,0,0;False;4;FLOAT;0.0;False;5;FLOAT;0.0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0.0;False;9;FLOAT;0.0;False;10;OBJECT;0.0;False;11;FLOAT3;0,0,0;False;12;FLOAT3;0,0,0;False;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0
    109. WireConnection;40;0;1;0
    110. WireConnection;39;0;16;0
    111. WireConnection;17;0;41;0
    112. WireConnection;17;1;42;0
    113. WireConnection;56;0;61;0
    114. WireConnection;56;1;17;0
    115. WireConnection;25;0;56;0
    116. WireConnection;25;1;43;0
    117. WireConnection;62;0;25;0
    118. WireConnection;26;0;66;0
    119. WireConnection;15;0;64;0
    120. WireConnection;15;1;6;0
    121. WireConnection;28;0;64;0
    122. WireConnection;28;1;27;0
    123. WireConnection;69;0;2;0
    124. WireConnection;21;0;65;0
    125. WireConnection;21;1;5;0
    126. WireConnection;67;0;1;4
    127. WireConnection;0;0;63;0
    128. WireConnection;0;1;70;0
    129. WireConnection;0;2;28;0
    130. WireConnection;0;3;15;0
    131. WireConnection;0;4;21;0
    132. WireConnection;0;5;26;0
    133. WireConnection;0;10;68;0
    134. ASEEND*/
    135. //CHKSM=394F433D6B2990C70BD2F34B7F741C37272CD844
     
  26. blackbird

    blackbird

    Joined:
    Aug 9, 2011
    Posts:
    526
    thank you for sharing this ! but to be honest the old one looks way better than the new
     
  27. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    398
    Yes indeed. Myself and a good friend completely agree.

    The thing is I really don't notice the shadow receiving issue with the hair since I control the light intensity in the scene dynamically with the weather as well as having light follow the player object. The hair does cast shadows seems to have light on it from something almost always. So with the very good look....it is quite fine.

    Lastly, once Unity 2017 does change where there shadow renders on Fade Mode type objects then the current Genesis Hair Shader 'should/will' work right out of the box immediately.

    Cheers
    O
     
    blackbird likes this.
  28. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    398
    Web site updated and links available again.
    Cheers
    O
     
  29. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    377
    Can we still follow the old guide if we are using Unity 5.6 ? As far as I know I have to create new shader and use the code you posted above and thats it right?
    I also didn't understand how to apply the blur.
     
  30. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    398
    Old Guide still applies. That is all about Mesh and Textures. The shader posted above does actually color better from the Color Selector that the original shader....so really all you need is Texture Color 2 (light blonde) as your base color. Then simply choose your color from the selector. Looks good enough. Nothing substitutes getting your hands dirty in the actual textures though for the best results. But....good enough is good enough....especially when the character is in motion and doing things.

    Cheers
    O
     
    theANMATOR2b likes this.
  31. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    377
    I just got a new hair model and the edges look like this (rounded), no matter which shader I try. I haven't done anything other than exporting from Daz and importing into Unity, then applying a genesis shader and some different shaders from the asset store, but the edges still look rounded, any tips?

    Edit : Fixed, it was a problem with the alpha, for some reason DAZ merged the wrong diffuse and opacity textures so I had to deselect that option when exporting the FBX and merge them manually in Photoshop, then use the shader's cut out feature.

     
    Last edited: Feb 18, 2018
    Olander likes this.
  32. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    398
    For any who are interested. Here are a couple photo shots of my base model in animated poses in Unity 2017. The hair in these photo shots are the => Genesis Original Hair Shader <= ... not the ASE version I posted. This is a specially made Black Photo Shoot Room/Scene that I made to make 3D Object Icons and Test Lighting on materials. Very good at calibrating textures and normal maps.

    This is the type of hair rendering capable by dynamically controlling the lights and adding a little oil/silk/shine to the hair....which I fully control by script in the Character Properties Script...which the hair and any other 'attachments' glean information from. Unity does not make it a simple task to control lighting and keep it balanced....but once you fully understand how to manipulate it (meaning...Not Try to Bend it To Your Will =) )...it looks great.

    Side note...the eyes are using my Genesis Eyes Shader. =) And the skin is using my Genesis Skin Shader. =)

    Cheers
    O

    Brighid_Head.png

    Brighid_PounceMoveRogueSuit.png
     
  33. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,070
    I'm not entirely sure about the hair, but the art for the bottom shot is great. Looks very professional. :)
     
    Olander likes this.
  34. Gabriel_SG

    Gabriel_SG

    Joined:
    Apr 7, 2017
    Posts:
    184
    Any thoughts about integrating this into UMA2+ ? It's another open source community project.. (that could do with better hair days) :p
     
  35. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,070
    Any shader can be used with UMA, I believe. Unless things have changed, it's just a minor bit of fiddling to hook one up.
     
  36. Gabriel_SG

    Gabriel_SG

    Joined:
    Apr 7, 2017
    Posts:
    184
    Will be looking into that.. just started meddling with UMA2.7. :)

    Olander, any chance you will be releasing that skin shader? :)
     
  37. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    398
    If reference to the Hair Shader (or Eye Shader) the hair needs to be a stand alone type of object/prop/item....meaning it could not be part of a Uni-Mesh.

    Sorry...the Skin Shader is for private use. I was part of the community initiative at one point but just private now.
     
  38. Gabriel_SG

    Gabriel_SG

    Joined:
    Apr 7, 2017
    Posts:
    184
    Ah np. guess somebody has burned the bridge.
    Did you have to get a daz game dev licence to use the extracted hair styles from the genesis 2 models? the $500 one?
     
  39. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    398
    You don't have to get the license until you actually sell a game/product. I did pick up the $1500 version (on a huge sale) but DAZ has changed to an 'Interactive License' per item so the previous license types are no longer available. Still viable if already purchased though. Up for debate whether this new licensing system will work.
     
    Gabriel_SG likes this.
  40. Gabriel_SG

    Gabriel_SG

    Joined:
    Apr 7, 2017
    Posts:
    184
    I guess that all depends on how much they are asking "per item"?
     
  41. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    398
    Still working after Unity 2018.1.0f2. I was expecting to have to fix this...but both versions work perfectly....still. (lots of other 3rd party asset store products broken though...crazy upgrades!!!)
     
    camta005 likes this.
  42. Rotock

    Rotock

    Joined:
    Jun 29, 2014
    Posts:
    18
    Sadly both versions are not working correctly for me.

    The shop version has smooth edges but recives no shadows.
    The last fixed versions(with/without alpha:fade) has only cutout edges and recives no shadows.

    But the transparent-sorting seem correct.

    Using Unity 5.6.5f1

    Semi Transparent Objects/Hair seems to be a pain forever in unity.

    A Kingdom for a Standard Cutout Shader with soft edges.
     
    Last edited: Jun 15, 2018
  43. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    398
    Sorry for late reply.

    They are working correctly...and you only need two PNG textures (Diffuse is RGBA and a Normal Map RGB). Not sure how they are 'Not Working'.

    Yes...the 'Shop' version works very well still. v5.4+ the speed is about as fast as it can get...and it is fast and looks fantastic....but...still no Shadow Receiving on 'Fade' / 'Translucent' mode.

    The...ASE shader I made for hair really needs to be prepared properly in Photoshop/GIMP with the Gaussian Blur technique I explained above. If you do that then that shader will be fine. Especially if you use VertExmotion to add some bouncing around the edges. You will barely notice. Proved this a couple of times already....but no argument....the original soft hair looks better.

    Next post are a couple of shots of the current in Unity v2018 and the 2nd is the Genesis Hair Shader in UE4. Both look great.

    Cheers
    O
     
    Last edited: Jul 2, 2018
  44. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    398
    Genesis Hair Shader in Unity v2018 (Not ASE version). Hair is 85k Poly 'Thin Strips' hair. Set to Dry Hair here.
    Unity_GenesisHair_HighPoly_A.png

    Genesis Hair Shader in UE4. Same mesh. (Still adjusting Coloring and Wetness/Oily adjustment for connection to Genesis Weather)
    UE4_GenesisHair_HighPoly_A.png
     
    Splosions likes this.
  45. Splosions

    Splosions

    Joined:
    Apr 29, 2017
    Posts:
    20
    HOLY BUCKETS you saved me so much headache!
    Before

    After
    upload_2018-7-31_21-57-5.png
    upload_2018-7-31_21-59-43.png

    The Linda ponytail hair has been an absolute nightmare to look anywhere close to how good your shader got it.

    THANK YOU!

    I am going to go through the full workflow tomorrow and see if I can't get it to look even better.

    EDIT: You are in the Phoenix area? I owe you a beer and a pizza :p
     
    Last edited: Aug 1, 2018
    Olander likes this.
  46. blackbird

    blackbird

    Joined:
    Aug 9, 2011
    Posts:
    526
    how do i compile the amplify version ?
     
  47. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    398
    Indeed. Tempe AZ. Cold Beer and Cheeseburgers in Old Town Scottsdale is awesome. You don't owe me anything...I may buy. Nice to talk to others struggling with this S***e. :D:p
    You are missing the Normal Map. It helps a lot. In the work flow I make lots of colors...you do not have to do this. A desaturated or one with the really light blonde works great for a base to add color to.

    You have to copy the one with all the ASE bottom rungs of code in it so that when you open it the blocks and connecting links will show. If you have that version when you single click on the shader you should see the box show up to Open in Amplify Shader Editor.
     
    Last edited: Aug 7, 2018
    blackbird likes this.
  48. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    398
    I don't show up here often but here is the final Genesis Hair Shader in UE4. Nailed the color sampling with Richness (Oil) and Wetness. This 'Soft Hair' also receives shadows (no Fade/Translucency issues). UE4 Shader Graph logic show below for ASE peeps.

    EDIT: Added UE4 Shader Graph Below for Hair and Scalp.

    UE4_GenesisHair_HighPoly_B.png
     
    Last edited: Aug 8, 2018
  49. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,070
    Might be able to do it in ASE?
     
  50. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    398
    The dithering in ASE (and Unity for that matter) will not distribute the dithering properly for the Alpha Map. Even took me a bit to solve it in UE4 and had to do a special end gradient LERP under the Hair Alpha. Next post I will post the shader graph so if anyone wants to give it a go in ASE/Unity.
     
    Last edited: Aug 8, 2018
    hopeful likes this.
unityunity