Cross_Model_Shader.shader 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. Shader "NatureManufacture Shaders/Trees/Cross Model Shader"
  2. {
  3. Properties
  4. {
  5. _Cutoff( "Mask Clip Value", Float ) = 0.4
  6. _ColorAdjustment("Color Adjustment", Vector) = (1,1,1,0)
  7. _MainTex("MainTex", 2D) = "white" {}
  8. _HealthyColor("Healthy Color", Color) = (1,0.9735294,0.9338235,1)
  9. _Smooothness("Smooothness", Float) = 0.3
  10. _AO("AO", Float) = 1
  11. [NoScaleOffset]_BumpMap("BumpMap", 2D) = "bump" {}
  12. _BumpScale("BumpScale", Range( 0 , 3)) = 1
  13. _InitialBend("Wind Initial Bend", Float) = 1
  14. _Stiffness("Wind Stiffness", Float) = 1
  15. _Drag("Wind Drag", Float) = 0.2
  16. _NewNormal("Vertex Normal Multiply", Vector) = (0,0,0,0)
  17. [HideInInspector] _texcoord( "", 2D ) = "white" {}
  18. [HideInInspector] __dirty( "", Int ) = 1
  19. }
  20. SubShader
  21. {
  22. Tags{ "RenderType" = "TransparentCutout" "Queue" = "AlphaTest+0" }
  23. Cull Back
  24. CGPROGRAM
  25. #include "UnityStandardUtils.cginc"
  26. #pragma target 3.0
  27. #pragma multi_compile_instancing
  28. #include "NMWindNoShiver.cginc"
  29. #include "NM_indirect.cginc"
  30. #pragma vertex vert
  31. #pragma instancing_options procedural:setup
  32. #pragma multi_compile GPU_FRUSTUM_ON __
  33. #pragma surface surf StandardSpecular keepalpha addshadow fullforwardshadows dithercrossfade
  34. struct Input
  35. {
  36. float2 uv_texcoord;
  37. };
  38. uniform float _BumpScale;
  39. uniform sampler2D _BumpMap;
  40. uniform sampler2D _MainTex;
  41. uniform float4 _MainTex_ST;
  42. uniform float4 _HealthyColor;
  43. uniform float3 _ColorAdjustment;
  44. uniform float _Smooothness;
  45. uniform float _AO;
  46. uniform float _Cutoff = 0.4;
  47. void surf( Input i , inout SurfaceOutputStandardSpecular o )
  48. {
  49. float2 uv_MainTex = i.uv_texcoord * _MainTex_ST.xy + _MainTex_ST.zw;
  50. o.Normal = UnpackScaleNormal( tex2D( _BumpMap, uv_MainTex ), _BumpScale );
  51. float4 tex2DNode2 = tex2D( _MainTex, uv_MainTex );
  52. o.Albedo = ( ( tex2DNode2 * _HealthyColor ) * float4( _ColorAdjustment , 0.0 ) ).rgb;
  53. float3 temp_cast_2 = (0.0).xxx;
  54. o.Specular = temp_cast_2;
  55. o.Smoothness = _Smooothness;
  56. o.Occlusion = _AO;
  57. o.Alpha = 1;
  58. clip( tex2DNode2.a - _Cutoff );
  59. }
  60. ENDCG
  61. }
  62. Fallback "Diffuse"
  63. }