FAE_TreeBillboard.shader 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. // Made with Amplify Shader Editor
  2. // Available at the Unity Asset Store - http://u3d.as/y3X
  3. Shader "FAE/Tree Billboard"
  4. {
  5. Properties
  6. {
  7. _Cutoff( "Mask Clip Value", Float ) = 0.5
  8. _Atlas("Atlas", 2D) = "white" {}
  9. _Variationcolor("Variation color", Color) = (1,0.5,0,0.184)
  10. _Normals("Normals", 2D) = "white" {}
  11. [HideInInspector] _texcoord( "", 2D ) = "white" {}
  12. [HideInInspector] __dirty( "", Int ) = 1
  13. }
  14. SubShader
  15. {
  16. Tags{ "RenderType" = "TransparentCutout" "Queue" = "AlphaTest+0" }
  17. Cull Front
  18. CGPROGRAM
  19. #include "UnityShaderVariables.cginc"
  20. #pragma target 3.0
  21. #pragma multi_compile_instancing
  22. #include "VS_InstancedIndirect.cginc"
  23. #pragma instancing_options assumeuniformscaling lodfade maxcount:50 procedural:setup forwardadd
  24. #pragma multi_compile GPU_FRUSTUM_ON __
  25. #pragma exclude_renderers xbox360 psp2 n3ds wiiu
  26. #pragma surface surf Lambert keepalpha addshadow fullforwardshadows nolightmap nodirlightmap dithercrossfade vertex:vertexDataFunc
  27. struct Input
  28. {
  29. half2 uv_texcoord;
  30. };
  31. uniform half _WindSpeed;
  32. uniform half _TrunkWindSpeed;
  33. uniform half4 _WindDirection;
  34. uniform half _TrunkWindSwinging;
  35. uniform half _TrunkWindWeight;
  36. uniform sampler2D _Normals;
  37. uniform float4 _Normals_ST;
  38. uniform sampler2D _Atlas;
  39. uniform float4 _Atlas_ST;
  40. uniform half4 _Variationcolor;
  41. uniform float _Cutoff = 0.5;
  42. void vertexDataFunc( inout appdata_full v, out Input o )
  43. {
  44. UNITY_INITIALIZE_OUTPUT( Input, o );
  45. float3 ase_objectScale = float3( length( unity_ObjectToWorld[ 0 ].xyz ), length( unity_ObjectToWorld[ 1 ].xyz ), length( unity_ObjectToWorld[ 2 ].xyz ) );
  46. float3 appendResult18 = (half3(_WindDirection.x , 0.0 , _WindDirection.z));
  47. half3 _Vector23 = half3(1,1,1);
  48. float3 break55 = (float3( 0,0,0 ) + (sin( ( ( ( ( _WindSpeed * 0.05 ) * _Time.w ) * ( _TrunkWindSpeed / ase_objectScale ) ) * appendResult18 ) ) - ( half3(-1,-1,-1) + _TrunkWindSwinging )) * (_Vector23 - float3( 0,0,0 )) / (_Vector23 - ( half3(-1,-1,-1) + _TrunkWindSwinging )));
  49. float3 appendResult56 = (half3(break55.x , 0.0 , break55.z));
  50. float3 Wind48 = ( ( appendResult56 * _TrunkWindWeight ) * v.color.a );
  51. v.vertex.xyz += Wind48;
  52. v.normal = half3(0,1,0);
  53. }
  54. void surf( Input i , inout SurfaceOutput o )
  55. {
  56. float2 uv_Normals = i.uv_texcoord * _Normals_ST.xy + _Normals_ST.zw;
  57. half3 tex2DNode11 = UnpackNormal( tex2D( _Normals, uv_Normals ) );
  58. o.Normal = tex2DNode11;
  59. float2 uv_Atlas = i.uv_texcoord * _Atlas_ST.xy + _Atlas_ST.zw;
  60. half4 tex2DNode1 = tex2D( _Atlas, uv_Atlas );
  61. float4 transform43 = mul(unity_ObjectToWorld,float4( 0,0,0,1 ));
  62. float4 lerpResult46 = lerp( tex2DNode1 , _Variationcolor , ( _Variationcolor.a * frac( ( ( transform43.x + transform43.y ) + transform43.z ) ) ));
  63. o.Albedo = lerpResult46.rgb;
  64. o.Alpha = 1;
  65. clip( tex2DNode1.a - _Cutoff );
  66. }
  67. ENDCG
  68. }
  69. Fallback "Diffuse"
  70. }
  71. /*ASEBEGIN
  72. Version=15700
  73. 1927;29;1906;1004;718.396;339.832;1;True;False
  74. Node;AmplifyShaderEditor.ObjectToWorldTransfNode;43;-1453.147,140.8373;Float;False;1;0;FLOAT4;0,0,0,1;False;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  75. Node;AmplifyShaderEditor.SimpleAddOpNode;40;-1237.012,160.2166;Float;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  76. Node;AmplifyShaderEditor.SimpleAddOpNode;41;-1049.013,193.016;Float;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  77. Node;AmplifyShaderEditor.FractNode;42;-885.2475,193.9371;Float;False;1;0;FLOAT;0;False;1;FLOAT;0
  78. Node;AmplifyShaderEditor.ColorNode;44;-894.7302,-43.89215;Float;False;Property;_Variationcolor;Variation color;2;0;Create;True;0;0;False;0;1,0.5,0,0.184;0,0,0,0;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  79. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;45;-638.8769,97.19617;Float;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  80. Node;AmplifyShaderEditor.SamplerNode;1;-825.0991,-299.9994;Float;True;Property;_Atlas;Atlas;1;0;Create;True;0;0;False;0;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;6;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  81. Node;AmplifyShaderEditor.CommentaryNode;49;-2516.138,-1505.089;Float;False;3322.649;1011.52;Comment;26;56;55;27;31;48;32;26;24;23;28;25;21;20;22;19;18;37;17;14;36;15;16;35;34;33;57;Wind engine;1,1,1,1;0;0
  82. Node;AmplifyShaderEditor.SamplerNode;11;-72.10028,45.0998;Float;True;Property;_Normals;Normals;3;0;Create;True;0;0;False;0;None;None;True;0;False;white;Auto;True;Object;-1;Auto;Texture2D;6;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  83. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;31;-2.56002,-1130.665;Float;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;1;FLOAT3;0
  84. Node;AmplifyShaderEditor.VertexColorNode;28;-60.77927,-893.9528;Float;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  85. Node;AmplifyShaderEditor.RangedFloatNode;27;-342.4654,-950.4337;Float;False;Global;_TrunkWindWeight;_TrunkWindWeight;10;0;Create;True;0;0;False;0;2;6;0;0;0;1;FLOAT;0
  86. Node;AmplifyShaderEditor.DynamicAppendNode;56;-303.8236,-1120.83;Float;False;FLOAT3;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT3;0
  87. Node;AmplifyShaderEditor.LerpOp;46;-307.0044,-53.29811;Float;False;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;1;COLOR;0
  88. Node;AmplifyShaderEditor.RegisterLocalVarNode;48;584.6132,-1107.404;Float;False;Wind;-1;True;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0
  89. Node;AmplifyShaderEditor.GetLocalVarNode;50;-30.18862,300.6029;Float;False;48;Wind;1;0;OBJECT;0;False;1;FLOAT3;0
  90. Node;AmplifyShaderEditor.VertexToFragmentNode;57;408.7239,-1109.255;Float;False;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0
  91. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;32;269.0231,-1120.742;Float;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;1;FLOAT3;0
  92. Node;AmplifyShaderEditor.OneMinusNode;54;303.7151,47.08692;Float;False;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0
  93. Node;AmplifyShaderEditor.Vector3Node;53;8.802795,418.4017;Float;False;Constant;_Vector0;Vector 0;4;0;Create;True;0;0;False;0;0,1,0;0,0,0;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
  94. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;37;-1865.635,-1399.488;Float;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  95. Node;AmplifyShaderEditor.ObjectScaleNode;16;-2135.238,-852.6451;Float;False;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
  96. Node;AmplifyShaderEditor.Vector4Node;14;-2143.935,-1126.542;Float;False;Global;_WindDirection;_WindDirection;9;0;Create;True;0;0;False;0;0,0,0,0;-0.9450631,0,-0.326888,0;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  97. Node;AmplifyShaderEditor.SimpleDivideOpNode;17;-1860.936,-908.9457;Float;False;2;0;FLOAT;0;False;1;FLOAT3;0,0,0;False;1;FLOAT3;0
  98. Node;AmplifyShaderEditor.RangedFloatNode;33;-2466.138,-1455.089;Float;False;Global;_WindSpeed;_WindSpeed;7;0;Create;True;0;0;False;0;0.3;0.5;0;1;0;1;FLOAT;0
  99. Node;AmplifyShaderEditor.RangedFloatNode;34;-2400.276,-1376.865;Float;False;Constant;_Float26;Float 26;10;0;Create;True;0;0;False;0;0.05;0;0;0;0;1;FLOAT;0
  100. Node;AmplifyShaderEditor.TimeNode;36;-2166.043,-1335.786;Float;False;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  101. Node;AmplifyShaderEditor.RangedFloatNode;15;-2172.73,-941.0371;Float;False;Global;_TrunkWindSpeed;_TrunkWindSpeed;10;0;Create;True;0;0;False;0;10;10;0;0;0;1;FLOAT;0
  102. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;19;-1562.932,-1223.736;Float;False;2;2;0;FLOAT;0;False;1;FLOAT3;0,0,0;False;1;FLOAT3;0
  103. Node;AmplifyShaderEditor.SinOpNode;23;-1114.033,-1119.242;Float;False;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0
  104. Node;AmplifyShaderEditor.Vector3Node;25;-1167.489,-767.9471;Float;False;Constant;_Vector23;Vector 23;10;0;Create;True;0;0;False;0;1,1,1;0,0,0;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
  105. Node;AmplifyShaderEditor.DynamicAppendNode;18;-1883.295,-1096.746;Float;False;FLOAT3;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT3;0
  106. Node;AmplifyShaderEditor.TFHCRemapNode;26;-869.7344,-1107.843;Float;False;5;0;FLOAT3;0,0,0;False;1;FLOAT3;-1,-1,-1;False;2;FLOAT3;1,1,1;False;3;FLOAT3;0,0,0;False;4;FLOAT3;1,1,1;False;1;FLOAT3;0
  107. Node;AmplifyShaderEditor.SimpleAddOpNode;24;-1096.338,-945.3469;Float;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;1;FLOAT3;0
  108. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;35;-2087.876,-1448.266;Float;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  109. Node;AmplifyShaderEditor.BreakToComponentsNode;55;-642.2948,-1112.043;Float;False;FLOAT3;1;0;FLOAT3;0,0,0;False;16;FLOAT;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT;5;FLOAT;6;FLOAT;7;FLOAT;8;FLOAT;9;FLOAT;10;FLOAT;11;FLOAT;12;FLOAT;13;FLOAT;14;FLOAT;15
  110. Node;AmplifyShaderEditor.RangedFloatNode;22;-1420.338,-835.3469;Float;False;Global;_TrunkWindSwinging;_TrunkWindSwinging;10;0;Create;True;0;0;False;0;0;0.2;0;0;0;1;FLOAT;0
  111. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;21;-1301.334,-1131.742;Float;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT3;0
  112. Node;AmplifyShaderEditor.Vector3Node;20;-1334.436,-1005.644;Float;False;Constant;_Vector21;Vector 21;10;0;Create;True;0;0;False;0;-1,-1,-1;0,0,0;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
  113. Node;AmplifyShaderEditor.StandardSurfaceOutputNode;0;662.8,-36.6;Half;False;True;2;Half;;0;0;Lambert;FAE/Tree Billboard;False;False;False;False;False;False;True;False;True;False;False;False;True;False;False;False;True;False;False;False;Front;0;False;-1;0;False;-1;False;0;False;-1;0;False;-1;False;0;Masked;0.5;True;True;0;False;TransparentCutout;;AlphaTest;All;True;True;True;True;True;True;True;False;True;True;False;False;False;True;True;True;True;0;False;-1;False;0;False;-1;255;False;-1;255;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;False;0;4;10;25;False;0.5;True;0;0;False;-1;0;False;-1;0;0;False;-1;0;False;-1;1;False;-1;1;False;-1;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;Relative;0;;0;-1;-1;-1;0;False;0;0;False;-1;-1;0;False;-1;3;Include;VS_InstancedIndirect.cginc;False;;Pragma;instancing_options assumeuniformscaling lodfade maxcount:50 procedural:setup forwardadd;False;;Pragma;multi_compile GPU_FRUSTUM_ON __;False;;0;0;15;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT;0;False;4;FLOAT;0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0;False;9;FLOAT;0;False;10;FLOAT;0;False;13;FLOAT3;0,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
  114. WireConnection;40;0;43;1
  115. WireConnection;40;1;43;2
  116. WireConnection;41;0;40;0
  117. WireConnection;41;1;43;3
  118. WireConnection;42;0;41;0
  119. WireConnection;45;0;44;4
  120. WireConnection;45;1;42;0
  121. WireConnection;31;0;56;0
  122. WireConnection;31;1;27;0
  123. WireConnection;56;0;55;0
  124. WireConnection;56;2;55;2
  125. WireConnection;46;0;1;0
  126. WireConnection;46;1;44;0
  127. WireConnection;46;2;45;0
  128. WireConnection;48;0;57;0
  129. WireConnection;57;0;32;0
  130. WireConnection;32;0;31;0
  131. WireConnection;32;1;28;4
  132. WireConnection;54;0;11;0
  133. WireConnection;37;0;35;0
  134. WireConnection;37;1;36;4
  135. WireConnection;17;0;15;0
  136. WireConnection;17;1;16;0
  137. WireConnection;19;0;37;0
  138. WireConnection;19;1;17;0
  139. WireConnection;23;0;21;0
  140. WireConnection;18;0;14;1
  141. WireConnection;18;2;14;3
  142. WireConnection;26;0;23;0
  143. WireConnection;26;1;24;0
  144. WireConnection;26;2;25;0
  145. WireConnection;26;4;25;0
  146. WireConnection;24;0;20;0
  147. WireConnection;24;1;22;0
  148. WireConnection;35;0;33;0
  149. WireConnection;35;1;34;0
  150. WireConnection;55;0;26;0
  151. WireConnection;21;0;19;0
  152. WireConnection;21;1;18;0
  153. WireConnection;0;0;46;0
  154. WireConnection;0;1;11;0
  155. WireConnection;0;10;1;4
  156. WireConnection;0;11;50;0
  157. WireConnection;0;12;53;0
  158. ASEEND*/
  159. //CHKSM=DC3C465AEE134FC28554E464FD727EE9C86FE8B8