| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215 |
- // Made with Amplify Shader Editor
- // Available at the Unity Asset Store - http://u3d.as/y3X
- Shader "Leaves"
- {
- Properties
- {
- _Texture("Texture", 2D) = "white" {}
- _Cutoff( "Mask Clip Value", Float ) = 0.5
- _Color("Color ", Color) = (0,0,0,0)
- _Smoothness("Smoothness", Range( 0 , 1)) = 0
- _OveralTrasslucensy("Overal Trasslucensy", Range( 0 , 1)) = 0
- [Header(Translucency)]
- _Translucency("Strength", Range( 0 , 50)) = 1
- _TransNormalDistortion("Normal Distortion", Range( 0 , 1)) = 0.1
- _TransScattering("Scaterring Falloff", Range( 1 , 50)) = 2
- _TransDirect("Direct", Range( 0 , 1)) = 1
- _TransAmbient("Ambient", Range( 0 , 1)) = 0.2
- _TransShadow("Shadow", Range( 0 , 1)) = 0.9
- [Header(Wind)]
- _TimeScale("Time Scale", Float) = 1
- _NoiseScale("Noise Scale", Float) = 0
- _Intensity("Intensity", Range( 0 , 1)) = 0.56
- [HideInInspector] _texcoord( "", 2D ) = "white" {}
- [HideInInspector] __dirty( "", Int ) = 1
- }
- SubShader
- {
- Tags{ "RenderType" = "TransparentCutout" "Queue" = "AlphaTest+0" }
- Cull Off
- CGPROGRAM
- #include "UnityShaderVariables.cginc"
- #include "UnityPBSLighting.cginc"
- #pragma target 3.0
- #pragma surface surf StandardCustom keepalpha addshadow fullforwardshadows exclude_path:deferred vertex:vertexDataFunc
- struct Input
- {
- float3 worldPos;
- float2 uv_texcoord;
- };
- struct SurfaceOutputStandardCustom
- {
- half3 Albedo;
- half3 Normal;
- half3 Emission;
- half Metallic;
- half Smoothness;
- half Occlusion;
- half Alpha;
- half3 Translucency;
- };
- uniform float _TimeScale;
- uniform float _NoiseScale;
- uniform float _Intensity;
- uniform sampler2D _Texture;
- uniform float4 _Texture_ST;
- uniform float4 _Color;
- uniform float _Smoothness;
- uniform half _Translucency;
- uniform half _TransNormalDistortion;
- uniform half _TransScattering;
- uniform half _TransDirect;
- uniform half _TransAmbient;
- uniform half _TransShadow;
- uniform float _OveralTrasslucensy;
- uniform float _Cutoff = 0.5;
- float3 mod2D289( float3 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; }
- float2 mod2D289( float2 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; }
- float3 permute( float3 x ) { return mod2D289( ( ( x * 34.0 ) + 1.0 ) * x ); }
- float snoise( float2 v )
- {
- const float4 C = float4( 0.211324865405187, 0.366025403784439, -0.577350269189626, 0.024390243902439 );
- float2 i = floor( v + dot( v, C.yy ) );
- float2 x0 = v - i + dot( i, C.xx );
- float2 i1;
- i1 = ( x0.x > x0.y ) ? float2( 1.0, 0.0 ) : float2( 0.0, 1.0 );
- float4 x12 = x0.xyxy + C.xxzz;
- x12.xy -= i1;
- i = mod2D289( i );
- float3 p = permute( permute( i.y + float3( 0.0, i1.y, 1.0 ) ) + i.x + float3( 0.0, i1.x, 1.0 ) );
- float3 m = max( 0.5 - float3( dot( x0, x0 ), dot( x12.xy, x12.xy ), dot( x12.zw, x12.zw ) ), 0.0 );
- m = m * m;
- m = m * m;
- float3 x = 2.0 * frac( p * C.www ) - 1.0;
- float3 h = abs( x ) - 0.5;
- float3 ox = floor( x + 0.5 );
- float3 a0 = x - ox;
- m *= 1.79284291400159 - 0.85373472095314 * ( a0 * a0 + h * h );
- float3 g;
- g.x = a0.x * x0.x + h.x * x0.y;
- g.yz = a0.yz * x12.xz + h.yz * x12.yw;
- return 130.0 * dot( m, g );
- }
- void vertexDataFunc( inout appdata_full v, out Input o )
- {
- UNITY_INITIALIZE_OUTPUT( Input, o );
- float3 ase_worldPos = mul( unity_ObjectToWorld, v.vertex );
- float2 appendResult7 = (float2(ase_worldPos.x , ase_worldPos.z));
- float mulTime10 = _Time.y * _TimeScale;
- float simplePerlin2D8 = snoise( ( appendResult7 + mulTime10 )*_NoiseScale );
- simplePerlin2D8 = simplePerlin2D8*0.5 + 0.5;
- float3 break13 = float3( 0,0,0 );
- float3 appendResult14 = (float3(( ( ( ( simplePerlin2D8 - 0.5 ) * _Intensity ) * v.texcoord.xy.y ) + break13.x ) , break13.y , break13.z));
- v.vertex.xyz += appendResult14;
- }
- inline half4 LightingStandardCustom(SurfaceOutputStandardCustom s, half3 viewDir, UnityGI gi )
- {
- #if !DIRECTIONAL
- float3 lightAtten = gi.light.color;
- #else
- float3 lightAtten = lerp( _LightColor0.rgb, gi.light.color, _TransShadow );
- #endif
- half3 lightDir = gi.light.dir + s.Normal * _TransNormalDistortion;
- half transVdotL = pow( saturate( dot( viewDir, -lightDir ) ), _TransScattering );
- half3 translucency = lightAtten * (transVdotL * _TransDirect + gi.indirect.diffuse * _TransAmbient) * s.Translucency;
- half4 c = half4( s.Albedo * translucency * _Translucency, 0 );
- SurfaceOutputStandard r;
- r.Albedo = s.Albedo;
- r.Normal = s.Normal;
- r.Emission = s.Emission;
- r.Metallic = s.Metallic;
- r.Smoothness = s.Smoothness;
- r.Occlusion = s.Occlusion;
- r.Alpha = s.Alpha;
- return LightingStandard (r, viewDir, gi) + c;
- }
- inline void LightingStandardCustom_GI(SurfaceOutputStandardCustom s, UnityGIInput data, inout UnityGI gi )
- {
- #if defined(UNITY_PASS_DEFERRED) && UNITY_ENABLE_REFLECTION_BUFFERS
- gi = UnityGlobalIllumination(data, s.Occlusion, s.Normal);
- #else
- UNITY_GLOSSY_ENV_FROM_SURFACE( g, s, data );
- gi = UnityGlobalIllumination( data, s.Occlusion, s.Normal, g );
- #endif
- }
- void surf( Input i , inout SurfaceOutputStandardCustom o )
- {
- float2 uv_Texture = i.uv_texcoord * _Texture_ST.xy + _Texture_ST.zw;
- float4 tex2DNode1 = tex2D( _Texture, uv_Texture );
- o.Albedo = ( tex2DNode1 * _Color ).rgb;
- o.Smoothness = _Smoothness;
- float3 temp_cast_1 = (_OveralTrasslucensy).xxx;
- o.Translucency = temp_cast_1;
- o.Alpha = 1;
- clip( tex2DNode1.r - _Cutoff );
- }
- ENDCG
- }
- Fallback "Diffuse"
- CustomEditor "ASEMaterialInspector"
- }
- /*ASEBEGIN
- Version=17800
- 365.6;107.2;998;555;1470.285;-211.4571;1.926908;True;False
- Node;AmplifyShaderEditor.WorldPosInputsNode;6;-1258.837,453.7143;Inherit;False;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
- Node;AmplifyShaderEditor.RangedFloatNode;11;-1249.917,632.6704;Inherit;False;Property;_TimeScale;Time Scale;12;0;Create;True;0;0;False;0;1;0;0;0;0;1;FLOAT;0
- Node;AmplifyShaderEditor.SimpleTimeNode;10;-1105.77,614.7917;Inherit;False;1;0;FLOAT;1;False;1;FLOAT;0
- Node;AmplifyShaderEditor.DynamicAppendNode;7;-1061.648,507.3891;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
- Node;AmplifyShaderEditor.SimpleAddOpNode;9;-916.9277,549.9821;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT;0;False;1;FLOAT2;0
- Node;AmplifyShaderEditor.RangedFloatNode;12;-983.2989,699.1873;Inherit;False;Property;_NoiseScale;Noise Scale;13;0;Create;True;0;0;False;0;0;0;0;0;0;1;FLOAT;0
- Node;AmplifyShaderEditor.NoiseGeneratorNode;8;-774.7252,600.2847;Inherit;False;Simplex2D;True;False;2;0;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT;0
- Node;AmplifyShaderEditor.RangedFloatNode;18;-702.8166,748.0563;Inherit;False;Property;_Intensity;Intensity;14;0;Create;True;0;0;False;0;0.56;0.56;0;1;0;1;FLOAT;0
- Node;AmplifyShaderEditor.SimpleSubtractOpNode;16;-573.7995,619.0392;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0.5;False;1;FLOAT;0
- Node;AmplifyShaderEditor.SimpleMultiplyOpNode;17;-420.8221,661.4305;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.TextureCoordinatesNode;22;-559.4156,840.6301;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.BreakToComponentsNode;13;-594.2363,460.3222;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.SimpleMultiplyOpNode;26;-302.6714,803.9523;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.ColorNode;3;-457.7523,-121.2623;Inherit;False;Property;_Color;Color ;2;0;Create;True;0;0;False;0;0,0,0,0;0,0,0,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
- Node;AmplifyShaderEditor.SamplerNode;1;-521.421,64.43827;Inherit;True;Property;_Texture;Texture;0;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.SimpleAddOpNode;21;-136.5932,643.4832;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.RangedFloatNode;5;-328.6462,333.262;Inherit;False;Property;_OveralTrasslucensy;Overal Trasslucensy;4;0;Create;True;0;0;False;0;0;0;0;1;0;1;FLOAT;0
- Node;AmplifyShaderEditor.RangedFloatNode;4;-332.1833,257.2131;Inherit;False;Property;_Smoothness;Smoothness;3;0;Create;True;0;0;False;0;0;0;0;1;0;1;FLOAT;0
- Node;AmplifyShaderEditor.SimpleMultiplyOpNode;2;-157.0942,-8.073392;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
- Node;AmplifyShaderEditor.DynamicAppendNode;14;-227.8748,459.9063;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.StandardSurfaceOutputNode;0;188.9836,95.82609;Float;False;True;-1;2;ASEMaterialInspector;0;0;Standard;Leaves;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;Off;0;False;-1;0;False;-1;False;0;False;-1;0;False;-1;False;0;Masked;0.5;True;True;0;False;TransparentCutout;;AlphaTest;ForwardOnly;14;all;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;2;15;10;25;False;0.5;True;0;0;False;-1;0;False;-1;0;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;Relative;0;;1;5;-1;-1;0;False;0;0;False;-1;-1;0;False;-1;0;0;0;False;0.1;False;-1;0;False;-1;16;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;5;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;10;0;11;0
- WireConnection;7;0;6;1
- WireConnection;7;1;6;3
- WireConnection;9;0;7;0
- WireConnection;9;1;10;0
- WireConnection;8;0;9;0
- WireConnection;8;1;12;0
- WireConnection;16;0;8;0
- WireConnection;17;0;16;0
- WireConnection;17;1;18;0
- WireConnection;26;0;17;0
- WireConnection;26;1;22;2
- WireConnection;21;0;26;0
- WireConnection;21;1;13;0
- WireConnection;2;0;1;0
- WireConnection;2;1;3;0
- WireConnection;14;0;21;0
- WireConnection;14;1;13;1
- WireConnection;14;2;13;2
- WireConnection;0;0;2;0
- WireConnection;0;4;4;0
- WireConnection;0;7;5;0
- WireConnection;0;10;1;0
- WireConnection;0;11;14;0
- ASEEND*/
- //CHKSM=A89C06103A671A9A3E932329DA63386DA6F54924
|