Heroes_of_Hiis/Assets/Fantasy Adventure Environment/Shaders/FAE_TreeBillboard.shader

160 lines
11 KiB
GLSL

// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "FAE/Tree Billboard"
{
Properties
{
_Cutoff( "Mask Clip Value", Float ) = 0.5
_Atlas("Atlas", 2D) = "white" {}
_Variationcolor("Variation color", Color) = (1,0.5,0,0.184)
[NoScaleOffset][Normal]_Normals("Normals", 2D) = "bump" {}
[HideInInspector] _texcoord( "", 2D ) = "white" {}
[HideInInspector] __dirty( "", Int ) = 1
}
SubShader
{
Tags{ "RenderType" = "TransparentCutout" "Queue" = "AlphaTest+0" }
Cull Front
CGPROGRAM
#include "UnityShaderVariables.cginc"
#pragma target 3.0
#pragma multi_compile_instancing
#include "VS_InstancedIndirect.cginc"
#pragma instancing_options assumeuniformscaling lodfade maxcount:50 procedural:setup forwardadd
#pragma multi_compile GPU_FRUSTUM_ON __
#pragma exclude_renderers vulkan xbox360 psp2 n3ds wiiu
#pragma surface surf Lambert keepalpha addshadow fullforwardshadows nolightmap nodirlightmap dithercrossfade vertex:vertexDataFunc
struct Input
{
float2 uv_texcoord;
};
uniform float _WindSpeed;
uniform float _TrunkWindSpeed;
uniform float4 _WindDirection;
uniform float _TrunkWindSwinging;
uniform float _TrunkWindWeight;
uniform sampler2D _Normals;
uniform sampler2D _Atlas;
uniform half4 _Atlas_ST;
uniform float4 _Variationcolor;
uniform float _Cutoff = 0.5;
void vertexDataFunc( inout appdata_full v, out Input o )
{
UNITY_INITIALIZE_OUTPUT( Input, o );
float3 ase_objectScale = float3( length( unity_ObjectToWorld[ 0 ].xyz ), length( unity_ObjectToWorld[ 1 ].xyz ), length( unity_ObjectToWorld[ 2 ].xyz ) );
half3 appendResult18 = (half3(_WindDirection.x , 0.0 , _WindDirection.z));
float3 _Vector23 = float3(1,1,1);
half3 break55 = (float3( 0,0,0 ) + (sin( ( ( ( ( _WindSpeed * 0.05 ) * _Time.w ) * ( _TrunkWindSpeed / ase_objectScale ) ) * appendResult18 ) ) - ( float3(-1,-1,-1) + _TrunkWindSwinging )) * (_Vector23 - float3( 0,0,0 )) / (_Vector23 - ( float3(-1,-1,-1) + _TrunkWindSwinging )));
half3 appendResult56 = (half3(break55.x , 0.0 , break55.z));
float3 Wind48 = ( ( appendResult56 * _TrunkWindWeight ) * v.texcoord.xy.y );
v.vertex.xyz += Wind48;
v.normal = half3(0,1,0);
}
void surf( Input i , inout SurfaceOutput o )
{
float2 uv_Normals11 = i.uv_texcoord;
o.Normal = UnpackNormal( tex2D( _Normals, uv_Normals11 ) );
float2 uv_Atlas = i.uv_texcoord * _Atlas_ST.xy + _Atlas_ST.zw;
half4 tex2DNode1 = tex2D( _Atlas, uv_Atlas );
half4 transform43 = mul(unity_ObjectToWorld,float4( 0,0,0,1 ));
half4 lerpResult46 = lerp( tex2DNode1 , _Variationcolor , ( _Variationcolor.a * frac( ( ( transform43.x + transform43.y ) + transform43.z ) ) ));
o.Albedo = lerpResult46.rgb;
o.Alpha = 1;
clip( tex2DNode1.a - _Cutoff );
}
ENDCG
}
Fallback "Diffuse"
}
/*ASEBEGIN
Version=17400
1927;31;1906;981;1020.562;502.7204;1.3;True;False
Node;AmplifyShaderEditor.CommentaryNode;49;-2516.138,-1505.089;Inherit;False;3322.649;1011.52;Comment;26;56;55;27;31;48;32;26;24;23;25;21;20;22;19;18;37;17;14;36;15;16;35;34;33;57;58;Wind engine;1,1,1,1;0;0
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
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
Node;AmplifyShaderEditor.ObjectScaleNode;16;-2135.238,-852.6451;Inherit;False;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
Node;AmplifyShaderEditor.TimeNode;36;-2166.043,-1335.786;Inherit;False;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;35;-2087.876,-1448.266;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
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
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
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;37;-1865.635,-1399.488;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleDivideOpNode;17;-1860.936,-908.9457;Inherit;False;2;0;FLOAT;0;False;1;FLOAT3;0,0,0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;19;-1562.932,-1223.736;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT3;0,0,0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.DynamicAppendNode;18;-1883.295,-1096.746;Inherit;False;FLOAT3;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT3;0
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
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;21;-1301.334,-1131.742;Inherit;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT3;0
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
Node;AmplifyShaderEditor.SimpleAddOpNode;24;-1096.338,-945.3469;Inherit;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;1;FLOAT3;0
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
Node;AmplifyShaderEditor.SinOpNode;23;-1114.033,-1119.242;Inherit;False;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.TFHCRemapNode;26;-869.7344,-1107.843;Inherit;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
Node;AmplifyShaderEditor.BreakToComponentsNode;55;-642.2948,-1112.043;Inherit;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
Node;AmplifyShaderEditor.ObjectToWorldTransfNode;43;-1453.147,140.8373;Inherit;False;1;0;FLOAT4;0,0,0,1;False;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.DynamicAppendNode;56;-303.8236,-1120.83;Inherit;False;FLOAT3;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.RangedFloatNode;27;-342.4654,-950.4337;Float;False;Global;_TrunkWindWeight;_TrunkWindWeight;10;0;Create;True;0;0;False;0;2;0.5;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;31;-2.56002,-1130.665;Inherit;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.TextureCoordinatesNode;58;1.192383,-881.6708;Inherit;False;0;-1;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SimpleAddOpNode;40;-1237.012,160.2166;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;32;269.0231,-1120.742;Inherit;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.SimpleAddOpNode;41;-1049.013,193.016;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
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;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.FractNode;42;-885.2475,193.9371;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.VertexToFragmentNode;57;408.7239,-1109.255;Inherit;False;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;48;584.6132,-1107.404;Float;False;Wind;-1;True;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;45;-638.8769,97.19617;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SamplerNode;1;-825.0991,-299.9994;Inherit;True;Property;_Atlas;Atlas;1;0;Create;True;0;0;False;0;-1;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
Node;AmplifyShaderEditor.LerpOp;46;-307.0044,-53.29811;Inherit;False;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;50;-30.18862,300.6029;Inherit;False;48;Wind;1;0;OBJECT;0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.SamplerNode;11;75.89972,45.0998;Inherit;True;Property;_Normals;Normals;3;2;[NoScaleOffset];[Normal];Create;True;0;0;False;0;-1;None;None;True;0;False;bump;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
Node;AmplifyShaderEditor.Vector3Node;60;474.438,363.0796;Inherit;False;Constant;_UP;UP;4;0;Create;True;0;0;False;0;0,1,0;0,0,0;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
Node;AmplifyShaderEditor.StandardSurfaceOutputNode;0;662.8,-36.6;Half;False;True;-1;2;;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;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;9;d3d9;d3d11_9x;d3d11;glcore;gles;gles3;metal;xboxone;ps4;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;;Custom;Pragma;instancing_options assumeuniformscaling lodfade maxcount:50 procedural:setup forwardadd;False;;Custom;Pragma;multi_compile GPU_FRUSTUM_ON __;False;;Custom;0;0;False;0.1;False;-1;0;False;-1;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
WireConnection;35;0;33;0
WireConnection;35;1;34;0
WireConnection;37;0;35;0
WireConnection;37;1;36;4
WireConnection;17;0;15;0
WireConnection;17;1;16;0
WireConnection;19;0;37;0
WireConnection;19;1;17;0
WireConnection;18;0;14;1
WireConnection;18;2;14;3
WireConnection;21;0;19;0
WireConnection;21;1;18;0
WireConnection;24;0;20;0
WireConnection;24;1;22;0
WireConnection;23;0;21;0
WireConnection;26;0;23;0
WireConnection;26;1;24;0
WireConnection;26;2;25;0
WireConnection;26;4;25;0
WireConnection;55;0;26;0
WireConnection;56;0;55;0
WireConnection;56;2;55;2
WireConnection;31;0;56;0
WireConnection;31;1;27;0
WireConnection;40;0;43;1
WireConnection;40;1;43;2
WireConnection;32;0;31;0
WireConnection;32;1;58;2
WireConnection;41;0;40;0
WireConnection;41;1;43;3
WireConnection;42;0;41;0
WireConnection;57;0;32;0
WireConnection;48;0;57;0
WireConnection;45;0;44;4
WireConnection;45;1;42;0
WireConnection;46;0;1;0
WireConnection;46;1;44;0
WireConnection;46;2;45;0
WireConnection;0;0;46;0
WireConnection;0;1;11;0
WireConnection;0;10;1;4
WireConnection;0;11;50;0
WireConnection;0;12;60;0
ASEEND*/
//CHKSM=FB41A0148F60E152F089ADC1D149A1B911E1EEAE