Cross_Model_Shader.shader 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. Shader "NatureManufacture Shaders/Trees/Cross Model Shader"
  2. {
  3. Properties
  4. {
  5. _Cutoff( "Mask Clip Value", Float ) = 0.65
  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. [Toggle(_TOUCHREACTACTIVE_ON)] _TouchReactActive("TouchReactActive", Float) = 0
  18. [HideInInspector] _texcoord( "", 2D ) = "white" {}
  19. [HideInInspector] __dirty( "", Int ) = 1
  20. }
  21. SubShader
  22. {
  23. Tags{ "RenderType" = "TransparentCutout" "Queue" = "AlphaTest+0" }
  24. Cull Back
  25. CGPROGRAM
  26. #include "UnityStandardUtils.cginc"
  27. #pragma target 3.0
  28. #pragma multi_compile_instancing
  29. #pragma shader_feature _TOUCHREACTACTIVE_ON
  30. #include "NMWindNoShiver.cginc"
  31. #include "NM_indirect.cginc"
  32. #pragma vertex vert
  33. #pragma instancing_options procedural:setup
  34. #pragma multi_compile GPU_FRUSTUM_ON __
  35. #pragma surface surf StandardSpecular keepalpha addshadow fullforwardshadows dithercrossfade
  36. struct Input
  37. {
  38. float2 uv_texcoord;
  39. };
  40. uniform float _BumpScale;
  41. uniform sampler2D _BumpMap;
  42. uniform sampler2D _MainTex;
  43. uniform float4 _MainTex_ST;
  44. uniform float4 _HealthyColor;
  45. uniform float3 _ColorAdjustment;
  46. uniform float _Smooothness;
  47. uniform float _AO;
  48. uniform float _Cutoff = 0.65;
  49. void surf( Input i , inout SurfaceOutputStandardSpecular o )
  50. {
  51. float2 uv0_MainTex = i.uv_texcoord * _MainTex_ST.xy + _MainTex_ST.zw;
  52. o.Normal = UnpackScaleNormal( tex2D( _BumpMap, uv0_MainTex ), _BumpScale );
  53. float4 tex2DNode2 = tex2D( _MainTex, uv0_MainTex );
  54. o.Albedo = ( ( tex2DNode2 * _HealthyColor ) * float4( _ColorAdjustment , 0.0 ) ).rgb;
  55. float3 temp_cast_2 = (0.0).xxx;
  56. o.Specular = temp_cast_2;
  57. o.Smoothness = _Smooothness;
  58. o.Occlusion = _AO;
  59. o.Alpha = 1;
  60. clip( tex2DNode2.a - _Cutoff );
  61. }
  62. ENDCG
  63. }
  64. Fallback "Diffuse"
  65. }