// Made with Amplify Shader Editor v1.9.1 // Available at the Unity Asset Store - http://u3d.as/y3X Shader "ASE/UI/FlowLight" { Properties { [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} _Color ("Tint", Color) = (1,1,1,1) _StencilComp ("Stencil Comparison", Float) = 8 _Stencil ("Stencil ID", Float) = 0 _StencilOp ("Stencil Operation", Float) = 0 _StencilWriteMask ("Stencil Write Mask", Float) = 255 _StencilReadMask ("Stencil Read Mask", Float) = 255 _ColorMask ("Color Mask", Float) = 15 [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 _FlowColor("FlowColor", Color) = (1,1,1,0.6980392) _LightWidth("LightWidth", Range( 0 , 1)) = 0.334 _LightAngle("LightAngle", Range( 0 , 360)) = 228.569 _speed("speed", Float) = 3 [HideInInspector] _texcoord( "", 2D ) = "white" {} } SubShader { LOD 0 Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" "CanUseSpriteAtlas"="True" } Stencil { Ref [_Stencil] ReadMask [_StencilReadMask] WriteMask [_StencilWriteMask] Comp [_StencilComp] Pass [_StencilOp] } Cull Off Lighting Off ZWrite Off ZTest [unity_GUIZTestMode] Blend SrcAlpha OneMinusSrcAlpha ColorMask [_ColorMask] Pass { Name "Default" 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 3.0 #include "UnityCG.cginc" #include "UnityUI.cginc" #pragma multi_compile __ UNITY_UI_CLIP_RECT #pragma multi_compile __ UNITY_UI_ALPHACLIP #include "UnityShaderVariables.cginc" #define ASE_NEEDS_FRAG_COLOR struct appdata_t { float4 vertex : POSITION; float4 color : COLOR; float2 texcoord : TEXCOORD0; UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : SV_POSITION; fixed4 color : COLOR; half2 texcoord : TEXCOORD0; float4 worldPosition : TEXCOORD1; UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_OUTPUT_STEREO }; uniform fixed4 _Color; uniform fixed4 _TextureSampleAdd; uniform float4 _ClipRect; uniform sampler2D _MainTex; uniform float4 _MainTex_ST; uniform float4 _FlowColor; uniform float _LightWidth; uniform float _speed; uniform float _LightAngle; v2f vert( appdata_t IN ) { v2f OUT; UNITY_SETUP_INSTANCE_ID( IN ); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); UNITY_TRANSFER_INSTANCE_ID(IN, OUT); OUT.worldPosition = IN.vertex; OUT.worldPosition.xyz += float3( 0, 0, 0 ) ; OUT.vertex = UnityObjectToClipPos(OUT.worldPosition); OUT.texcoord = IN.texcoord; OUT.color = IN.color * _Color; return OUT; } fixed4 frag(v2f IN ) : SV_Target { UNITY_SETUP_INSTANCE_ID( IN ); UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); float2 uv_MainTex = IN.texcoord.xy * _MainTex_ST.xy + _MainTex_ST.zw; float4 tex2DNode3 = tex2D( _MainTex, uv_MainTex ); float4 MainTex_RGB63 = tex2DNode3; float temp_output_14_0_g4 = (0.01 + (0.5 - 0.0) * (1.0 - 0.01) / (1.0 - 0.0)); float temp_output_11_0_g4 = (( -1.0 * temp_output_14_0_g4 ) + (0.5 - 0.0) * (( 1.0 + temp_output_14_0_g4 ) - ( -1.0 * temp_output_14_0_g4 )) / (1.0 - 0.0)); float4 temp_cast_0 = (( temp_output_11_0_g4 - temp_output_14_0_g4 )).xxxx; float4 temp_cast_1 = (( temp_output_11_0_g4 + temp_output_14_0_g4 )).xxxx; float temp_output_14_0_g3 = (0.01 + (0.01 - 0.0) * (1.0 - 0.01) / (1.0 - 0.0)); float temp_output_11_0_g3 = (( -1.0 * temp_output_14_0_g3 ) + (_LightWidth - 0.0) * (( 1.0 + temp_output_14_0_g3 ) - ( -1.0 * temp_output_14_0_g3 )) / (1.0 - 0.0)); float4 temp_cast_2 = (( temp_output_11_0_g3 - temp_output_14_0_g3 )).xxxx; float4 temp_cast_3 = (( temp_output_11_0_g3 + temp_output_14_0_g3 )).xxxx; float mulTime43 = _Time.y * _speed; float2 appendResult39 = (float2(0.0 , (-1.0 + (sin( mulTime43 ) - 0.0) * (2.2 - -1.0) / (1.0 - 0.0)))); float2 texCoord14 = IN.texcoord.xy * float2( 1,1 ) + appendResult39; float cos27 = cos( radians( _LightAngle ) ); float sin27 = sin( radians( _LightAngle ) ); float2 rotator27 = mul( texCoord14 - float2( 1,1 ) , float2x2( cos27 , -sin27 , sin27 , cos27 )) + float2( 1,1 ); float2 panner35 = ( 1.0 * _Time.y * float2( 0,0 ) + rotator27); float temp_output_29_0 = (panner35).y; float4 temp_cast_4 = (temp_output_29_0).xxxx; float4 smoothstepResult1_g3 = smoothstep( temp_cast_2 , temp_cast_3 , temp_cast_4); float temp_output_14_0_g2 = (0.01 + (0.01 - 0.0) * (1.0 - 0.01) / (1.0 - 0.0)); float temp_output_11_0_g2 = (( -1.0 * temp_output_14_0_g2 ) + (_LightWidth - 0.0) * (( 1.0 + temp_output_14_0_g2 ) - ( -1.0 * temp_output_14_0_g2 )) / (1.0 - 0.0)); float4 temp_cast_5 = (( temp_output_11_0_g2 - temp_output_14_0_g2 )).xxxx; float4 temp_cast_6 = (( temp_output_11_0_g2 + temp_output_14_0_g2 )).xxxx; float4 temp_cast_7 = (( 1.0 - temp_output_29_0 )).xxxx; float4 smoothstepResult1_g2 = smoothstep( temp_cast_5 , temp_cast_6 , temp_cast_7); float4 smoothstepResult1_g4 = smoothstep( temp_cast_0 , temp_cast_1 , ( smoothstepResult1_g3 * smoothstepResult1_g2 )); float4 lerpResult64 = lerp( ( MainTex_RGB63 * IN.color ) , _FlowColor , ( _FlowColor.a * smoothstepResult1_g4 )); float4 FlowLight49 = lerpResult64; float MainTex_A53 = tex2DNode3.a; float4 appendResult11 = (float4(FlowLight49.rgb , MainTex_A53)); half4 color = appendResult11; #ifdef UNITY_UI_CLIP_RECT color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect); #endif #ifdef UNITY_UI_ALPHACLIP clip (color.a - 0.001); #endif return color; } ENDCG } } CustomEditor "ASEMaterialInspector" Fallback Off } /*ASEBEGIN Version=19100 Node;AmplifyShaderEditor.CommentaryNode;57;-1529.726,417.2375;Inherit;False;2678.597;924.3909;Comment;25;14;19;46;33;34;27;35;17;16;15;18;20;21;49;29;41;43;42;39;44;64;65;66;67;69;;1,1,1,1;0;0 Node;AmplifyShaderEditor.RangedFloatNode;41;-1177.81,466.0394;Inherit;False;Property;_speed;speed;3;0;Create;True;0;0;0;False;0;False;3;3;0;0;0;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleTimeNode;43;-1036.828,472.5459;Inherit;False;1;0;FLOAT;1;False;1;FLOAT;0 Node;AmplifyShaderEditor.SinOpNode;42;-855.3234,472.3608;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.TFHCRemapNode;44;-713.4651,470.8418;Inherit;False;5;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;3;FLOAT;-1;False;4;FLOAT;2.2;False;1;FLOAT;0 Node;AmplifyShaderEditor.DynamicAppendNode;39;-517.5894,469.2376;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.TextureCoordinatesNode;14;-1326.472,703.5888;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.RotatorNode;27;-1025.116,777.1555;Inherit;True;3;0;FLOAT2;0,0;False;1;FLOAT2;1,1;False;2;FLOAT;1;False;1;FLOAT2;0 Node;AmplifyShaderEditor.PannerNode;35;-768.4219,778.1795;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0 Node;AmplifyShaderEditor.ComponentMaskNode;29;-570.6258,773.1149;Inherit;True;False;True;False;False;1;0;FLOAT2;0,0;False;1;FLOAT;0 Node;AmplifyShaderEditor.RangedFloatNode;16;-579.4234,975.2232;Inherit;False;Property;_LightWidth;LightWidth;1;0;Create;True;0;0;0;False;0;False;0.334;0.334;0;1;0;1;FLOAT;0 Node;AmplifyShaderEditor.RangedFloatNode;17;-579.5447,1059.209;Inherit;False;Constant;_LightSmooth;LightSmooth;2;0;Create;True;0;0;0;False;0;False;0.01;0.01;0;1;0;1;FLOAT;0 Node;AmplifyShaderEditor.OneMinusNode;19;-304.0357,1155.552;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.FunctionNode;18;-125.7259,1007.417;Inherit;True;Smooth_Custom_Tex;-1;;2;09a04ff740a36a143a305789dadcd04d;0;3;8;COLOR;0,0,0,0;False;4;FLOAT;0.5;False;6;FLOAT;0.5;False;1;COLOR;0 Node;AmplifyShaderEditor.FunctionNode;15;-128.4415,775.0126;Inherit;True;Smooth_Custom_Tex;-1;;3;09a04ff740a36a143a305789dadcd04d;0;3;8;COLOR;0,0,0,0;False;4;FLOAT;0.5;False;6;FLOAT;0.5;False;1;COLOR;0 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;20;162.5189,860.8961;Inherit;True;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0 Node;AmplifyShaderEditor.CommentaryNode;56;-1291.944,92.32384;Inherit;False;934.9547;280;Comment;4;2;3;53;63;;1,1,1,1;0;0 Node;AmplifyShaderEditor.TemplateShaderPropertyNode;2;-1241.944,146.1538;Inherit;False;0;0;_MainTex;Shader;False;0;5;SAMPLER2D;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.SamplerNode;3;-1027.4,150.6898;Inherit;True;Property;_TextureSample0;Texture Sample 0;2;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;0,0,0,0;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.GetLocalVarNode;50;257.937,199.0031;Inherit;False;49;FlowLight;1;0;OBJECT;;False;1;COLOR;0 Node;AmplifyShaderEditor.DynamicAppendNode;11;512.4209,205.2764;Inherit;False;FLOAT4;4;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT4;0 Node;AmplifyShaderEditor.RegisterLocalVarNode;53;-673.7341,247.8153;Inherit;False;MainTex_A;-1;True;1;0;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.RegisterLocalVarNode;63;-687.2012,163.8276;Inherit;False;MainTex_RGB;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0 Node;AmplifyShaderEditor.RegisterLocalVarNode;49;923.8708,855.5264;Inherit;False;FlowLight;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0 Node;AmplifyShaderEditor.FunctionNode;21;385.812,861.0012;Inherit;True;Smooth_Custom_Tex;-1;;4;09a04ff740a36a143a305789dadcd04d;0;3;8;COLOR;0,0,0,0;False;4;FLOAT;0.5;False;6;FLOAT;0.5;False;1;COLOR;0 Node;AmplifyShaderEditor.VertexColorNode;67;163.8511,499.1956;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.GetLocalVarNode;65;350.1164,466.7239;Inherit;False;63;MainTex_RGB;1;0;OBJECT;;False;1;COLOR;0 Node;AmplifyShaderEditor.LerpOp;64;804.3926,647.6392;Inherit;False;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.TemplateMultiPassMasterNode;61;764.6458,205.9685;Float;False;True;-1;2;ASEMaterialInspector;0;3;ASE/UI/FlowLight;5056123faa0c79b47ab6ad7e8bf059a4;True;Default;0;0;Default;2;True;True;2;5;False;;10;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;;False;True;True;True;True;True;0;True;_ColorMask;False;False;False;False;False;False;False;True;True;0;True;_Stencil;255;True;_StencilReadMask;255;True;_StencilWriteMask;0;True;_StencilComp;0;True;_StencilOp;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;2;False;;True;0;True;unity_GUIZTestMode;False;True;5;Queue=Transparent=Queue=0;IgnoreProjector=True;RenderType=Transparent=RenderType;PreviewType=Plane;CanUseSpriteAtlas=True;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;2;False;0;;0;0;Standard;0;0;1;True;False;;False;0 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;69;646.312,762.2231;Inherit;False;2;2;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;1;COLOR;0 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;66;647.9319,471.6498;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0 Node;AmplifyShaderEditor.RangedFloatNode;33;-1476.726,820.2818;Inherit;False;Property;_LightAngle;LightAngle;2;0;Create;True;0;0;0;False;0;False;228.569;228.569;0;360;0;1;FLOAT;0 Node;AmplifyShaderEditor.RadiansOpNode;34;-1200.224,825.6086;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.GetLocalVarNode;55;261.6209,290.7735;Inherit;False;53;MainTex_A;1;0;OBJECT;;False;1;FLOAT;0 Node;AmplifyShaderEditor.ColorNode;46;364.632,661.5661;Inherit;False;Property;_FlowColor;FlowColor;0;0;Create;True;0;0;0;False;0;False;1,1,1,0.6980392;1,1,1,0.6980392;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 WireConnection;43;0;41;0 WireConnection;42;0;43;0 WireConnection;44;0;42;0 WireConnection;39;1;44;0 WireConnection;14;1;39;0 WireConnection;27;0;14;0 WireConnection;27;2;34;0 WireConnection;35;0;27;0 WireConnection;29;0;35;0 WireConnection;19;0;29;0 WireConnection;18;8;19;0 WireConnection;18;4;16;0 WireConnection;18;6;17;0 WireConnection;15;8;29;0 WireConnection;15;4;16;0 WireConnection;15;6;17;0 WireConnection;20;0;15;0 WireConnection;20;1;18;0 WireConnection;3;0;2;0 WireConnection;11;0;50;0 WireConnection;11;3;55;0 WireConnection;53;0;3;4 WireConnection;63;0;3;0 WireConnection;49;0;64;0 WireConnection;21;8;20;0 WireConnection;64;0;66;0 WireConnection;64;1;46;0 WireConnection;64;2;69;0 WireConnection;61;0;11;0 WireConnection;69;0;46;4 WireConnection;69;1;21;0 WireConnection;66;0;65;0 WireConnection;66;1;67;0 WireConnection;34;0;33;0 ASEEND*/ //CHKSM=60397FE5A4D138F3F144D63C420178FE648A5F83