// Made with Amplify Shader Editor v1.9.1.5
// Available at the Unity Asset Store - http://u3d.as/y3X 
Shader "ZepVFX/WaterVFX-CVS"
{
	Properties
	{
		_InvFade ("Soft Particles Factor", Range(0.01,3.0)) = 1.0
		[HDR]_Color("Color", Color) = (1,1,1,1)
		_OffSet("OffSet", Vector) = (0,0,0,0)
		_MainTexture("MainTexture", 2D) = "white" {}
		_NoiseTexture("NoiseTexture", 2D) = "white" {}
		_RotationOffset("RotationOffset", Vector) = (0.5,0.5,0,0)
		_NoisePower("NoisePower", Float) = 2
		_AlphaMask("AlphaMask", 2D) = "white" {}
		_Distortion("Distortion", Float) = -0.08
		[HideInInspector] _texcoord( "", 2D ) = "white" {}

	}


	Category 
	{
		SubShader
		{
		LOD 0

			Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" }
			Blend SrcAlpha OneMinusSrcAlpha, DstColor Zero
			ColorMask RGB
			Cull Off
			Lighting Off 
			ZWrite Off
			ZTest LEqual
			
			Pass {
			
				CGPROGRAM
				
				#ifndef UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX
				#define UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input)
				#endif
				
				#pragma vertex vert
				#pragma fragment frag
				#pragma target 2.0
				#pragma multi_compile_instancing
				#pragma multi_compile_particles
				#pragma multi_compile_fog
				#include "UnityShaderVariables.cginc"
				#define ASE_NEEDS_FRAG_COLOR


				#include "UnityCG.cginc"

				struct appdata_t 
				{
					float4 vertex : POSITION;
					fixed4 color : COLOR;
					float4 texcoord : TEXCOORD0;
					UNITY_VERTEX_INPUT_INSTANCE_ID
					float4 ase_texcoord3 : TEXCOORD3;
					float4 ase_texcoord1 : TEXCOORD1;
					float4 ase_texcoord2 : TEXCOORD2;
				};

				struct v2f 
				{
					float4 vertex : SV_POSITION;
					fixed4 color : COLOR;
					float4 texcoord : TEXCOORD0;
					UNITY_FOG_COORDS(1)
					#ifdef SOFTPARTICLES_ON
					float4 projPos : TEXCOORD2;
					#endif
					UNITY_VERTEX_INPUT_INSTANCE_ID
					UNITY_VERTEX_OUTPUT_STEREO
					float4 ase_texcoord3 : TEXCOORD3;
					float4 ase_texcoord4 : TEXCOORD4;
					float4 ase_texcoord5 : TEXCOORD5;
				};
				
				
				#if UNITY_VERSION >= 560
				UNITY_DECLARE_DEPTH_TEXTURE( _CameraDepthTexture );
				#else
				uniform sampler2D_float _CameraDepthTexture;
				#endif

				//Don't delete this comment
				// uniform sampler2D_float _CameraDepthTexture;

				uniform sampler2D _MainTex;
				uniform fixed4 _TintColor;
				uniform float4 _MainTex_ST;
				uniform float _InvFade;
				uniform sampler2D _AlphaMask;
				uniform half4 _AlphaMask_ST;
				uniform half4 _Color;
				uniform sampler2D _MainTexture;
				uniform half2 _OffSet;
				uniform half2 _RotationOffset;
				uniform sampler2D _NoiseTexture;
				uniform half _NoisePower;
				uniform half _Distortion;


				v2f vert ( appdata_t v  )
				{
					v2f o;
					UNITY_SETUP_INSTANCE_ID(v);
					UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
					UNITY_TRANSFER_INSTANCE_ID(v, o);
					o.ase_texcoord3 = v.ase_texcoord3;
					o.ase_texcoord4.xy = v.ase_texcoord1.xy;
					o.ase_texcoord5 = v.ase_texcoord2;
					
					//setting value to unused interpolator channels and avoid initialization warnings
					o.ase_texcoord4.zw = 0;

					v.vertex.xyz +=  float3( 0, 0, 0 ) ;
					o.vertex = UnityObjectToClipPos(v.vertex);
					#ifdef SOFTPARTICLES_ON
						o.projPos = ComputeScreenPos (o.vertex);
						COMPUTE_EYEDEPTH(o.projPos.z);
					#endif
					o.color = v.color;
					o.texcoord = v.texcoord;
					UNITY_TRANSFER_FOG(o,o.vertex);
					return o;
				}

				fixed4 frag ( v2f i  ) : SV_Target
				{
					UNITY_SETUP_INSTANCE_ID( i );
					UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( i );

					#ifdef SOFTPARTICLES_ON
						float sceneZ = LinearEyeDepth (SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos)));
						float partZ = i.projPos.z;
						float fade = saturate (_InvFade * (sceneZ-partZ));
						i.color.a *= fade;
					#endif

					float2 uv_AlphaMask = i.texcoord.xy * _AlphaMask_ST.xy + _AlphaMask_ST.zw;
					half2 texCoord136 = i.texcoord.xy * float2( 1,1 ) + _OffSet;
					half4 texCoord106 = i.ase_texcoord3;
					texCoord106.xy = i.ase_texcoord3.xy * float2( 1,1 ) + float2( 0,0 );
					half4 appendResult105 = (half4(0.0 , 0.0 , texCoord106.z , texCoord106.w));
					float cos41 = cos( appendResult105.x );
					float sin41 = sin( appendResult105.x );
					half2 rotator41 = mul( texCoord136 - _RotationOffset , float2x2( cos41 , -sin41 , sin41 , cos41 )) + _RotationOffset;
					half2 texCoord24 = i.ase_texcoord4.xy * float2( 1,1 ) + float2( 0,0 );
					half2 _TilingNoise = half2(1,1);
					half2 appendResult11 = (half2(_TilingNoise.x , _TilingNoise.y));
					half4 texCoord103 = i.ase_texcoord5;
					texCoord103.xy = i.ase_texcoord5.xy * float2( 1,1 ) + float2( 0,0 );
					half2 appendResult104 = (half2(texCoord103.z , texCoord103.w));
					half2 panner13 = ( 1.0 * _Time.y * appendResult104 + float2( 0,0 ));
					half2 texCoord8 = i.texcoord.xy * appendResult11 + panner13;
					half2 appendResult10 = (half2(texCoord8.x , texCoord8.y));
					half3 appendResult72 = (half3(appendResult10 , 0.0));
					half4 lerpResult23 = lerp( half4( texCoord24, 0.0 , 0.0 ) , ( tex2D( _NoiseTexture, appendResult72.xy ) * _NoisePower ) , _Distortion);
					half2 temp_output_1_0_g8 = lerpResult23.rg;
					half2 temp_output_11_0_g8 = ( temp_output_1_0_g8 - half2( 0.5,0.5 ) );
					half2 break18_g8 = temp_output_11_0_g8;
					half2 appendResult19_g8 = (half2(break18_g8.y , -break18_g8.x));
					half dotResult12_g8 = dot( temp_output_11_0_g8 , temp_output_11_0_g8 );
					

					fixed4 col = ( ( tex2D( _AlphaMask, uv_AlphaMask ) * _Color * i.color ) * tex2D( _MainTexture, ( rotator41 * ( temp_output_1_0_g8 + ( appendResult19_g8 * ( dotResult12_g8 * appendResult105.xy ) ) + half2( 0,0 ) ) ) ) );
					UNITY_APPLY_FOG(i.fogCoord, col);
					return col;
				}
				ENDCG 
			}
		}	
	}
	CustomEditor "ASEMaterialInspector"
	
	Fallback Off
}
/*ASEBEGIN
Version=19105
Node;AmplifyShaderEditor.DynamicAppendNode;10;-2446.972,-56.35501;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.DynamicAppendNode;72;-2321.483,87.5807;Inherit;False;FLOAT3;4;0;FLOAT2;0,0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.SamplerNode;6;-2174.947,19.13482;Inherit;True;Property;_NoiseTexture;NoiseTexture;3;0;Create;True;0;0;0;False;0;False;-1;992f637405a280446ad290566eea19d2;992f637405a280446ad290566eea19d2;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;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;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.RangedFloatNode;22;-2089.64,218.8324;Inherit;False;Property;_NoisePower;NoisePower;5;0;Create;True;0;0;0;False;0;False;2;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;26;-1617.985,352.7771;Inherit;False;Property;_Distortion;Distortion;7;0;Create;True;0;0;0;False;0;False;-0.08;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.TextureCoordinatesNode;24;-1841.961,261.0929;Inherit;True;1;-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.SimpleMultiplyOpNode;20;-1854.664,22.08468;Inherit;True;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.LerpOp;23;-1550.062,26.3297;Inherit;True;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.ColorNode;1;-578.5964,-522.6123;Inherit;False;Property;_Color;Color;0;1;[HDR];Create;True;0;0;0;False;0;False;1,1,1,1;0,0,0,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.VertexColorNode;2;-537.295,-703.438;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SamplerNode;5;-704.0822,-147.04;Inherit;True;Property;_MainTexture;MainTexture;2;0;Create;True;0;0;0;False;0;False;-1;a71076126d5eb7040b52fe7b669caa57;a71076126d5eb7040b52fe7b669caa57;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;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;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;57;-111.4791,-346.7276;Inherit;True;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.DynamicAppendNode;11;-2814.871,-65.55508;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.PannerNode;13;-2853.767,64.5733;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0
Node;AmplifyShaderEditor.DynamicAppendNode;104;-3048.188,87.03401;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.FunctionNode;79;-1201.142,236.1014;Inherit;True;Radial Shear;-1;;8;c6dc9fc7fa9b08c4d95138f2ae88b526;0;4;1;FLOAT2;0,0;False;2;FLOAT2;0,0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.RotatorNode;41;-1300.803,-334.7774;Inherit;True;3;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;2;FLOAT;1;False;1;FLOAT2;0
Node;AmplifyShaderEditor.TextureCoordinatesNode;8;-2664.928,-64.35283;Inherit;True;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.TextureCoordinatesNode;103;-3295.07,15.1312;Inherit;False;2;-1;4;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;37;-952.9813,-121.8241;Inherit;True;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.DynamicAppendNode;105;-1561.063,-165.2105;Inherit;False;FLOAT4;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT4;0
Node;AmplifyShaderEditor.TextureCoordinatesNode;106;-1809.198,-188.0025;Inherit;False;3;-1;4;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;3;-352.167,-354.9249;Inherit;True;3;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.SamplerNode;73;-667.3745,-344.4257;Inherit;True;Property;_AlphaMask;AlphaMask;6;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;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;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.Vector2Node;43;-1557.915,-315.6844;Inherit;False;Property;_RotationOffset;RotationOffset;4;0;Create;True;0;0;0;False;0;False;0.5,0.5;0.5,0.5;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
Node;AmplifyShaderEditor.TextureCoordinatesNode;136;-1606.563,-506.3719;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.TemplateMultiPassMasterNode;84;164.5353,-343.4547;Half;False;True;-1;2;ASEMaterialInspector;0;11;ZepVFX/WaterVFX-CVS;0b6a9f8b4f707c74ca64c0be8e590de0;True;SubShader 0 Pass 0;0;0;SubShader 0 Pass 0;2;True;True;2;5;False;;10;False;;6;2;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;;False;True;True;True;True;False;0;False;;False;False;False;False;False;False;False;False;False;True;2;False;;True;3;False;;False;True;4;Queue=Transparent=Queue=0;IgnoreProjector=True;RenderType=Transparent=RenderType;PreviewType=Plane;False;False;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;0;;0;0;Standard;0;0;1;True;False;;False;0
Node;AmplifyShaderEditor.Vector2Node;12;-3009.871,-95.45513;Inherit;False;Constant;_TilingNoise;TilingNoise;2;0;Create;True;0;0;0;False;0;False;1,1;0,0;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
Node;AmplifyShaderEditor.Vector2Node;137;-1796.188,-462.6659;Inherit;False;Property;_OffSet;OffSet;1;0;Create;True;0;0;0;False;0;False;0,0;0,0;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
WireConnection;10;0;8;1
WireConnection;10;1;8;2
WireConnection;72;0;10;0
WireConnection;6;1;72;0
WireConnection;20;0;6;0
WireConnection;20;1;22;0
WireConnection;23;0;24;0
WireConnection;23;1;20;0
WireConnection;23;2;26;0
WireConnection;5;1;37;0
WireConnection;57;0;3;0
WireConnection;57;1;5;0
WireConnection;11;0;12;1
WireConnection;11;1;12;2
WireConnection;13;2;104;0
WireConnection;104;0;103;3
WireConnection;104;1;103;4
WireConnection;79;1;23;0
WireConnection;79;3;105;0
WireConnection;41;0;136;0
WireConnection;41;1;43;0
WireConnection;41;2;105;0
WireConnection;8;0;11;0
WireConnection;8;1;13;0
WireConnection;37;0;41;0
WireConnection;37;1;79;0
WireConnection;105;2;106;3
WireConnection;105;3;106;4
WireConnection;3;0;73;0
WireConnection;3;1;1;0
WireConnection;3;2;2;0
WireConnection;136;1;137;0
WireConnection;84;0;57;0
ASEEND*/
//CHKSM=3423E20FAB51A55A0FFBBCABCB7DD47EBEE99783