| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- // Made with Amplify Shader Editor
- // Available at the Unity Asset Store - http://u3d.as/y3X
- Shader "RO/UI_Effect_01"
- {
- 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
- _UV_Animation("UV_Animation", Vector) = (1,1,1,1)
- }
- SubShader
- {
- LOD 0
- Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" "CanUseSpriteAtlas"="True" }
-
- Stencil
- {
- Ref [_Stencil]
- ReadMask [_StencilReadMask]
- WriteMask [_StencilWriteMask]
- CompFront [_StencilComp]
- PassFront [_StencilOp]
- FailFront Keep
- ZFailFront Keep
- CompBack Always
- PassBack Keep
- FailBack Keep
- ZFailBack Keep
- }
- Cull Off
- Lighting Off
- ZWrite Off
- ZTest [unity_GUIZTestMode]
- Blend SrcAlpha OneMinusSrcAlpha
- 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 __ UNITY_UI_CLIP_RECT
- #pragma multi_compile __ UNITY_UI_ALPHACLIP
-
- #include "UnityShaderVariables.cginc"
-
- 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 _UV_Animation;
-
- 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
- {
- float2 uv03 = IN.texcoord.xy * float2( 1,1 ) + float2( 0,0 );
- // *** BEGIN Flipbook UV Animation vars ***
- // Total tiles of Flipbook Texture
- float fbtotaltiles4 = _UV_Animation.x * _UV_Animation.y;
- // Offsets for cols and rows of Flipbook Texture
- float fbcolsoffset4 = 1.0f / _UV_Animation.x;
- float fbrowsoffset4 = 1.0f / _UV_Animation.y;
- // Speed of animation
- float fbspeed4 = _Time.y * _UV_Animation.z;
- // UV Tiling (col and row offset)
- float2 fbtiling4 = float2(fbcolsoffset4, fbrowsoffset4);
- // UV Offset - calculate current tile linear index, and convert it to (X * coloffset, Y * rowoffset)
- // Calculate current tile linear index
- float fbcurrenttileindex4 = round( fmod( fbspeed4 + _UV_Animation.w, fbtotaltiles4) );
- fbcurrenttileindex4 += ( fbcurrenttileindex4 < 0) ? fbtotaltiles4 : 0;
- // Obtain Offset X coordinate from current tile linear index
- float fblinearindextox4 = round ( fmod ( fbcurrenttileindex4, _UV_Animation.x ) );
- // Multiply Offset X by coloffset
- float fboffsetx4 = fblinearindextox4 * fbcolsoffset4;
- // Obtain Offset Y coordinate from current tile linear index
- float fblinearindextoy4 = round( fmod( ( fbcurrenttileindex4 - fblinearindextox4 ) / _UV_Animation.x, _UV_Animation.y ) );
- // Reverse Y to get tiles from Top to Bottom
- fblinearindextoy4 = (int)(_UV_Animation.y-1) - fblinearindextoy4;
- // Multiply Offset Y by rowoffset
- float fboffsety4 = fblinearindextoy4 * fbrowsoffset4;
- // UV Offset
- float2 fboffset4 = float2(fboffsetx4, fboffsety4);
- // Flipbook UV
- half2 fbuv4 = uv03 * fbtiling4 + fboffset4;
- // *** END Flipbook UV Animation vars ***
-
- half4 color = ( _Color * tex2D( _MainTex, fbuv4 ) );
-
- #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"
-
-
- }
- /*ASEBEGIN
- Version=17500
- 2211;1;1618;1010;1196.562;270.86;1.1823;True;True
- Node;AmplifyShaderEditor.TextureCoordinatesNode;3;-1068.507,22.47659;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.SimpleTimeNode;7;-995.2363,406.1075;Inherit;False;1;0;FLOAT;1;False;1;FLOAT;0
- Node;AmplifyShaderEditor.Vector4Node;8;-1002.756,198.9695;Inherit;False;Property;_UV_Animation;UV_Animation;0;0;Create;True;0;0;False;0;1,1,1,1;4,4,30,0;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
- Node;AmplifyShaderEditor.TFHCFlipBookUVAnimation;4;-650.4561,139.6695;Inherit;False;0;0;6;0;FLOAT2;0,0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;3;FLOAT2;0;FLOAT;1;FLOAT;2
- Node;AmplifyShaderEditor.TemplateShaderPropertyNode;11;-629.01,-18.2664;Inherit;False;0;0;_MainTex;Shader;0;5;SAMPLER2D;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
- Node;AmplifyShaderEditor.SamplerNode;5;-345.4561,110.6695;Inherit;True;Property;_TextureSample0;Texture Sample 0;1;0;Create;True;0;0;False;1;Source Image;-1;68b14a17ced865043a441b2b0aa667fd;68b14a17ced865043a441b2b0aa667fd;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.TemplateShaderPropertyNode;13;-262.9222,-83.92506;Inherit;False;0;0;_Color;Shader;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
- Node;AmplifyShaderEditor.SimpleMultiplyOpNode;12;18.10223,81.65778;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
- Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;10;351.8512,83.66402;Float;False;True;-1;2;ASEMaterialInspector;0;4;RO/UI_Effect_01;5056123faa0c79b47ab6ad7e8bf059a4;True;Default;0;0;Default;2;True;2;5;False;-1;10;False;-1;0;1;False;-1;0;False;-1;False;False;True;2;False;-1;True;True;True;True;True;0;True;-9;True;True;0;True;-5;255;True;-8;255;True;-7;0;True;-4;0;True;-6;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;True;2;False;-1;True;0;True;-11;False;True;5;Queue=Transparent=Queue=0;IgnoreProjector=True;RenderType=Transparent=RenderType;PreviewType=Plane;CanUseSpriteAtlas=True;False;0;False;False;False;False;False;False;False;False;False;False;True;2;0;;0;0;Standard;0;0;1;True;False;;0
- WireConnection;4;0;3;0
- WireConnection;4;1;8;1
- WireConnection;4;2;8;2
- WireConnection;4;3;8;3
- WireConnection;4;4;8;4
- WireConnection;4;5;7;0
- WireConnection;5;0;11;0
- WireConnection;5;1;4;0
- WireConnection;12;0;13;0
- WireConnection;12;1;5;0
- WireConnection;10;0;12;0
- ASEEND*/
- //CHKSM=DF8889AA6B1CFD472AEA565B5D727CEA791AFEB8
|