// Made with Amplify Shader Editor v1.9.1.5 // Available at the Unity Asset Store - http://u3d.as/y3X Shader "Dong/ui_polar_add" { 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 _Tex_2("Tex_2", 2D) = "white" {} _Polar_UV("Polar_UV", Vector) = (0,0,0,0) [HDR]_Main_Color1("Main_Color", Color) = (1,1,1,1) [HDR]_Tex2_Color("Tex2_Color", Color) = (1,1,1,1) [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 One One ColorMask [_ColorMask] Pass { Name "Default" CGPROGRAM #pragma vertex vert #pragma fragment frag #pragma target 3.0 #include "UnityCG.cginc" #include "UnityUI.cginc" #pragma multi_compile_local _ UNITY_UI_CLIP_RECT #pragma multi_compile_local _ UNITY_UI_ALPHACLIP 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; float2 texcoord : TEXCOORD0; float4 worldPosition : TEXCOORD1; float4 mask : TEXCOORD2; UNITY_VERTEX_OUTPUT_STEREO }; sampler2D _MainTex; fixed4 _Color; fixed4 _TextureSampleAdd; float4 _ClipRect; float4 _MainTex_ST; float _UIMaskSoftnessX; float _UIMaskSoftnessY; uniform float4 _Main_Color1; uniform sampler2D _Tex_2; uniform float4 _Tex_2_ST; uniform float4 _Polar_UV; uniform float4 _Tex2_Color; v2f vert(appdata_t v ) { v2f OUT; UNITY_SETUP_INSTANCE_ID(v); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); v.vertex.xyz += float3( 0, 0, 0 ) ; float4 vPosition = UnityObjectToClipPos(v.vertex); OUT.worldPosition = v.vertex; OUT.vertex = vPosition; float2 pixelSize = vPosition.w; pixelSize /= float2(1, 1) * abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy)); float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); float2 maskUV = (v.vertex.xy - clampedRect.xy) / (clampedRect.zw - clampedRect.xy); OUT.texcoord = v.texcoord; OUT.mask = float4(v.vertex.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_UIMaskSoftnessX, _UIMaskSoftnessY) + abs(pixelSize.xy))); OUT.color = v.color * _Color; return OUT; } fixed4 frag(v2f IN ) : SV_Target { //Round up the alpha color coming from the interpolator (to 1.0/256.0 steps) //The incoming alpha could have numerical instability, which makes it very sensible to //HDR color transparency blend, when it blends with the world's texture. const half alphaPrecision = half(0xff); const half invAlphaPrecision = half(1.0/alphaPrecision); IN.color.a = round(IN.color.a * alphaPrecision)*invAlphaPrecision; float2 uv_MainTex = IN.texcoord.xy * _MainTex_ST.xy + _MainTex_ST.zw; float2 uv_Tex_2 = IN.texcoord.xy * _Tex_2_ST.xy + _Tex_2_ST.zw; float2 CenteredUV15_g4 = ( uv_Tex_2 - float2( 0,0 ) ); float2 break17_g4 = CenteredUV15_g4; float2 appendResult23_g4 = (float2(( length( CenteredUV15_g4 ) * _Polar_UV.x * 2.0 ) , ( atan2( break17_g4.x , break17_g4.y ) * ( 1.0 / 6.28318548202515 ) * _Polar_UV.y ))); float2 appendResult22 = (float2(_Polar_UV.z , _Polar_UV.w)); float2 panner23 = ( 1.0 * _Time.y * appendResult22 + float2( 0,0 )); half4 color = ( ( _Main_Color1 * tex2D( _MainTex, uv_MainTex ) * IN.color ) * ( tex2D( _Tex_2, ( appendResult23_g4 + panner23 ) ) * _Tex2_Color ) ); #ifdef UNITY_UI_CLIP_RECT half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(IN.mask.xy)) * IN.mask.zw); color.a *= m.x * m.y; #endif #ifdef UNITY_UI_ALPHACLIP clip (color.a - 0.001); #endif color.rgb *= color.a; return color; } ENDCG } } CustomEditor "ASEMaterialInspector" Fallback Off } /*ASEBEGIN Version=19105 Node;AmplifyShaderEditor.DynamicAppendNode;22;-1055.002,510.8409;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;3;FLOAT;1;False;1;FLOAT2;0 Node;AmplifyShaderEditor.TextureCoordinatesNode;24;-1058.3,319.0551;Inherit;False;0;32;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.PannerNode;23;-702.552,592.5784;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0 Node;AmplifyShaderEditor.TextureCoordinatesNode;106;-1583.2,756.3116;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.Vector2Node;107;-1343.2,980.3127;Float;False;Property;_Turb_UV;Turb_UV;7;0;Create;True;0;0;0;False;0;False;0,0;0,0;0;3;FLOAT2;0;FLOAT;1;FLOAT;2 Node;AmplifyShaderEditor.SimpleAddOpNode;108;-1279.2,756.3116;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.DynamicAppendNode;109;-1119.199,788.3116;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.PannerNode;110;-1151.2,964.3124;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0 Node;AmplifyShaderEditor.SimpleAddOpNode;111;-927.1984,788.3116;Inherit;False;2;2;0;FLOAT4;0,0,0,0;False;1;FLOAT2;0,0;False;1;FLOAT4;0 Node;AmplifyShaderEditor.SamplerNode;112;-751.1984,756.3116;Inherit;True;Property;_Turb_Noise;Turb_Noise;5;0;Create;True;0;0;0;False;0;False;-1;None;c5ac5330d9244d14cb1c6c6c99a7b663;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;113;-623.1987,964.3124;Float;False;Property;_Turb_Value;Turb_Value;6;0;Create;True;0;0;0;False;0;False;0;0;0;0;0;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;114;-399.1989,788.3116;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleAddOpNode;115;-239.199,788.3116;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT2;0,0;False;1;FLOAT2;0 Node;AmplifyShaderEditor.PannerNode;116;-756.0692,1317.685;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0 Node;AmplifyShaderEditor.TextureCoordinatesNode;117;-1017.344,1212.252;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.Vector2Node;118;-951.0133,1335.794;Float;False;Property;_Main_UV;Main_UV;4;0;Create;True;0;0;0;False;0;False;0,0;0,0;0;3;FLOAT2;0;FLOAT;1;FLOAT;2 Node;AmplifyShaderEditor.DynamicAppendNode;120;-69.64617,778.9763;Inherit;False;FLOAT4;4;0;FLOAT2;0,0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT4;0 Node;AmplifyShaderEditor.SimpleAddOpNode;29;-263.9255,431.2736;Inherit;True;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0 Node;AmplifyShaderEditor.SimpleAddOpNode;121;108.1068,727.0408;Inherit;False;2;2;0;FLOAT4;0,0,0,0;False;1;FLOAT4;0,0,0,0;False;1;FLOAT4;0 Node;AmplifyShaderEditor.SamplerNode;32;270.1609,476.5475;Inherit;True;Property;_Tex_2;Tex_2;0;0;Create;True;0;0;0;False;0;False;-1;a0e6325930754354483b6f4409fde20e;de761b58ecf4c51419fb73e06a4d0bfd;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.ColorNode;103;331.037,727.3848;Inherit;False;Property;_Tex2_Color;Tex2_Color;3;1;[HDR];Create;True;0;0;0;False;0;False;1,1,1,1;1,1,1,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;105;694.7439,627.999;Inherit;True;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0 Node;AmplifyShaderEditor.TemplateShaderPropertyNode;122;490.966,-291.7213;Inherit;False;0;0;_MainTex;Shader;True;0;5;SAMPLER2D;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.ColorNode;123;916.7042,-521.8741;Inherit;False;Property;_Main_Color1;Main_Color;2;1;[HDR];Create;True;0;0;0;False;0;False;1,1,1,1;1,1,1,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.SamplerNode;124;728.7277,-297.8036;Inherit;True;Property;_TextureSample1;Texture Sample 0;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.VertexColorNode;125;860.2272,33.78728;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;126;1237.846,-249.634;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.SimpleMultiplyOpNode;78;1377.541,286.4478;Inherit;True;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;100;2221.117,155.9713;Float;False;True;-1;2;ASEMaterialInspector;0;3;Dong/ui_polar_add;5056123faa0c79b47ab6ad7e8bf059a4;True;Default;0;0;Default;2;True;True;4;1;False;;1;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;;True;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.FunctionNode;26;-806.4318,365.1946;Inherit;True;Polar Coordinates;-1;;4;7dab8e02884cf104ebefaa2e788e4162;0;4;1;FLOAT2;0,0;False;2;FLOAT2;0,0;False;3;FLOAT;1;False;4;FLOAT;1;False;1;FLOAT2;0 Node;AmplifyShaderEditor.Vector4Node;21;-1323.122,378.6819;Float;False;Property;_Polar_UV;Polar_UV;1;0;Create;True;0;0;0;False;0;False;0,0,0,0;1,15,0,-1;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 WireConnection;22;0;21;3 WireConnection;22;1;21;4 WireConnection;23;2;22;0 WireConnection;108;0;106;1 WireConnection;109;0;108;0 WireConnection;109;1;106;2 WireConnection;110;0;106;0 WireConnection;110;2;107;0 WireConnection;111;0;109;0 WireConnection;111;1;110;0 WireConnection;112;1;111;0 WireConnection;114;0;112;1 WireConnection;114;1;113;0 WireConnection;115;0;114;0 WireConnection;115;1;116;0 WireConnection;116;0;117;0 WireConnection;116;2;118;0 WireConnection;120;0;115;0 WireConnection;29;0;26;0 WireConnection;29;1;23;0 WireConnection;121;1;120;0 WireConnection;32;1;29;0 WireConnection;105;0;32;0 WireConnection;105;1;103;0 WireConnection;124;0;122;0 WireConnection;126;0;123;0 WireConnection;126;1;124;0 WireConnection;126;2;125;0 WireConnection;78;0;126;0 WireConnection;78;1;105;0 WireConnection;100;0;78;0 WireConnection;26;1;24;0 WireConnection;26;3;21;1 WireConnection;26;4;21;2 ASEEND*/ //CHKSM=5B8EE40F80FE8069030AFC19ED9FDA3471E2FB28