1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274
| // Made with Amplify Shader Editor v1.9.3.2 // Available at the Unity Asset Store - http://u3d.as/y3X Shader "Shiki/Screen_TX" { Properties { [Enum(Off,0,On,1)]_toggleUV("主贴图UV是否极坐标", Float) = 1 _MainTex("MainTex", 2D) = "white" {} _Mask("Mask", 2D) = "white" {} _Color("Color", Color) = (1,1,1,1) _Alpha("Alpha", Float) = 1 _RGBA_Mask("RGBA_Mask", Vector) = (1,0,0,0) _TillingOffset("TillingOffset", Vector) = (1,1,0,0) _MaskTillingOffset("MaskTillingOffset", Vector) = (1,1,0,0) _Scale("Scale", Float) = 1 _MaskScale("MaskScale", Float) = 1 _Speed("Speed", Vector) = (1,1,0,0) _TimeScaleOffset("TimeScaleOffset", Vector) = (1,1,0,0)
} SubShader { Tags { "RenderType"="Opaque" "Queue"="Transparent" } LOD 100
CGINCLUDE #pragma target 3.0 ENDCG Blend SrcAlpha OneMinusSrcAlpha AlphaToMask Off Cull Off ColorMask RGBA ZWrite Off ZTest LEqual Offset 0 , 0 Pass { Name "Unlit"
CGPROGRAM
#ifndef UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX //only defining to not throw compilation error over Unity 5.5 #define UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input) #endif #pragma vertex vert #pragma fragment frag #pragma multi_compile_instancing #include "UnityCG.cginc" #include "UnityShaderVariables.cginc"
struct appdata { float4 vertex : POSITION; float4 color : COLOR; UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : SV_POSITION; #ifdef ASE_NEEDS_FRAG_WORLD_POSITION float3 worldPos : TEXCOORD0; #endif float4 ase_texcoord1 : TEXCOORD1; float4 ase_color : COLOR; UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_OUTPUT_STEREO };
uniform sampler2D _MainTex; uniform float2 _TimeScaleOffset; uniform float2 _Speed; uniform float _toggleUV; uniform float4 _TillingOffset; uniform float4 _Color; uniform float _Scale; uniform float _Alpha; uniform float4 _RGBA_Mask; uniform sampler2D _Mask; uniform float4 _MaskTillingOffset; uniform float _MaskScale;
v2f vert ( appdata v ) { v2f o; UNITY_SETUP_INSTANCE_ID(v); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); UNITY_TRANSFER_INSTANCE_ID(v, o);
float4 ase_clipPos = UnityObjectToClipPos(v.vertex); float4 screenPos = ComputeScreenPos(ase_clipPos); o.ase_texcoord1 = screenPos; o.ase_color = v.color; float3 vertexValue = float3(0, 0, 0); #if ASE_ABSOLUTE_VERTEX_POS vertexValue = v.vertex.xyz; #endif vertexValue = vertexValue; #if ASE_ABSOLUTE_VERTEX_POS v.vertex.xyz = vertexValue; #else v.vertex.xyz += vertexValue; #endif o.vertex = UnityObjectToClipPos(v.vertex);
#ifdef ASE_NEEDS_FRAG_WORLD_POSITION o.worldPos = mul(unity_ObjectToWorld, v.vertex).xyz; #endif return o; } float4 frag (v2f i ) : SV_Target { UNITY_SETUP_INSTANCE_ID(i); UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); float4 finalColor; #ifdef ASE_NEEDS_FRAG_WORLD_POSITION float3 WorldPosition = i.worldPos; #endif float mulTime18 = _Time.y * _TimeScaleOffset.x; float2 appendResult16 = (float2(_Speed.x , _Speed.y)); float4 screenPos = i.ase_texcoord1; float4 ase_screenPosNorm = screenPos / screenPos.w; ase_screenPosNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_screenPosNorm.z : ase_screenPosNorm.z * 0.5 + 0.5; float2 appendResult9 = (float2(ase_screenPosNorm.x , ase_screenPosNorm.y)); float2 appendResult35 = (float2(ase_screenPosNorm.x , ase_screenPosNorm.y)); float2 temp_output_36_0 = (appendResult35*2.0 + -1.0); float2 break43 = temp_output_36_0; float2 appendResult46 = (float2(length( temp_output_36_0 ) , (0.0 + (atan2( break43.y , break43.x ) - 0.0) * (1.0 - 0.0) / (UNITY_PI - 0.0)))); float2 lerpResult48 = lerp( appendResult9 , appendResult46 , _toggleUV); float2 appendResult13 = (float2(_TillingOffset.x , _TillingOffset.y)); float2 appendResult14 = (float2(_TillingOffset.z , _TillingOffset.w)); float2 panner10 = ( ( mulTime18 + _TimeScaleOffset.y ) * appendResult16 + (lerpResult48*appendResult13 + appendResult14)); float4 tex2DNode1 = tex2D( _MainTex, panner10 ); float2 appendResult33 = (float2(_MaskTillingOffset.x , _MaskTillingOffset.y)); float2 appendResult32 = (float2(_MaskTillingOffset.z , _MaskTillingOffset.w)); float4 appendResult5 = (float4(( tex2DNode1 * _Color * _Scale * i.ase_color ).rgb , ( _Alpha * ( ( tex2DNode1.r * _RGBA_Mask.x ) + ( tex2DNode1.g * _RGBA_Mask.y ) + ( tex2DNode1.b * _RGBA_Mask.z ) + ( tex2DNode1.a * _RGBA_Mask.w ) ) * ( tex2D( _Mask, (appendResult9*appendResult33 + appendResult32) ) * _MaskScale ) ).r)); finalColor = appendResult5; return finalColor; } ENDCG } } CustomEditor "ASEMaterialInspector" Fallback Off } /*ASEBEGIN Version=19302 Node;AmplifyShaderEditor.ScreenPosInputsNode;8;-3424.466,-503.7861;Float;False;0;False;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.DynamicAppendNode;35;-3189.624,-261.7405;Inherit;True;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0 Node;AmplifyShaderEditor.ScaleAndOffsetNode;36;-2867.845,-257.2079;Inherit;True;3;0;FLOAT2;0,0;False;1;FLOAT;2;False;2;FLOAT;-1;False;1;FLOAT2;0 Node;AmplifyShaderEditor.BreakToComponentsNode;43;-2595.251,77.86584;Inherit;False;FLOAT2;1;0;FLOAT2;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.PiNode;55;-2457.88,369.1848;Inherit;False;1;0;FLOAT;1;False;1;FLOAT;0 Node;AmplifyShaderEditor.ATan2OpNode;44;-2421.251,83.86584;Inherit;True;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.LengthOpNode;37;-2464.544,-243.7079;Inherit;True;1;0;FLOAT2;0,0;False;1;FLOAT;0 Node;AmplifyShaderEditor.TFHCRemapNode;45;-2168.252,115.8658;Inherit;False;5;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;3.141593;False;3;FLOAT;0;False;4;FLOAT;1;False;1;FLOAT;0 Node;AmplifyShaderEditor.Vector4Node;12;-1617.439,-203.2669;Inherit;False;Property;_TillingOffset;TillingOffset;6;0;Create;True;0;0;0;False;0;False;1,1,0,0;1,1,0,0;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.Vector2Node;51;-1485.661,136.278;Inherit;False;Property;_TimeScaleOffset;TimeScaleOffset;11;0;Create;True;0;0;0;False;0;False;1,1;1,0;0;3;FLOAT2;0;FLOAT;1;FLOAT;2 Node;AmplifyShaderEditor.DynamicAppendNode;9;-1480.383,-443.9041;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.RangedFloatNode;49;-1707.343,-335.0562;Inherit;False;Property;_toggleUV;主贴图UV是否极坐标;0;1;[Enum];Create;False;0;2;Off;0;On;1;0;False;0;False;1;1;0;0;0;1;FLOAT;0 Node;AmplifyShaderEditor.DynamicAppendNode;46;-1975.829,-150.7183;Inherit;True;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0 Node;AmplifyShaderEditor.DynamicAppendNode;14;-1396.439,-113.2668;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;13;-1397.439,-206.2669;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.Vector2Node;50;-1441.661,10.27795;Inherit;False;Property;_Speed;Speed;10;0;Create;True;0;0;0;False;0;False;1,1;1,1;0;3;FLOAT2;0;FLOAT;1;FLOAT;2 Node;AmplifyShaderEditor.SimpleTimeNode;18;-1134.07,126.9291;Inherit;False;1;0;FLOAT;1;False;1;FLOAT;0 Node;AmplifyShaderEditor.LerpOp;48;-1222.343,-422.0562;Inherit;False;3;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;1;FLOAT2;0 Node;AmplifyShaderEditor.DynamicAppendNode;16;-1125.502,2.695892;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.Vector4Node;31;-1095.063,854.8722;Inherit;False;Property;_MaskTillingOffset;MaskTillingOffset;7;0;Create;True;0;0;0;False;0;False;1,1,0,0;1,1,0,0;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.SimpleAddOpNode;19;-939.0702,162.9291;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.ScaleAndOffsetNode;11;-1133.439,-234.267;Inherit;False;3;0;FLOAT2;0,0;False;1;FLOAT2;1,0;False;2;FLOAT2;0,0;False;1;FLOAT2;0 Node;AmplifyShaderEditor.DynamicAppendNode;32;-874.064,944.8725;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;33;-875.064,851.8722;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;10;-816.4438,-101.9479;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0 Node;AmplifyShaderEditor.SamplerNode;1;-610.2937,-137.6392;Inherit;True;Property;_MainTex;MainTex;1;0;Create;True;0;0;0;False;0;False;-1;None;4ad524818053b0949b65ba4d061ccac5;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.Vector4Node;26;-651.1687,470.1977;Inherit;False;Property;_RGBA_Mask;RGBA_Mask;5;0;Create;True;0;0;0;False;0;False;1,0,0,0;1,1,1,0;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.ScaleAndOffsetNode;34;-611.064,823.8719;Inherit;False;3;0;FLOAT2;0,0;False;1;FLOAT2;1,0;False;2;FLOAT2;0,0;False;1;FLOAT2;0 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;22;-266.1687,350.1977;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;23;-263.1687,464.1977;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;24;-261.1687,571.1977;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;25;-261.1687,671.1977;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.SamplerNode;28;-305.9966,849.3268;Inherit;True;Property;_Mask;Mask;2;0;Create;True;0;0;0;False;0;False;-1;None;c87093dfaecbca442a86bc15accd31d0;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;29;-221.4968,1111.927;Inherit;False;Property;_MaskScale;MaskScale;9;0;Create;True;0;0;0;False;0;False;1;1;0;0;0;1;FLOAT;0 Node;AmplifyShaderEditor.ColorNode;7;-601.2937,71.36084;Inherit;False;Property;_Color;Color;3;0;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.RangedFloatNode;4;-556.2937,280.3608;Inherit;False;Property;_Scale;Scale;8;0;Create;True;0;0;0;False;0;False;1;0.85;0;0;0;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleAddOpNode;27;-53.98921,494.2824;Inherit;False;4;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.RangedFloatNode;6;-53.30715,292.8151;Inherit;False;Property;_Alpha;Alpha;4;0;Create;True;0;0;0;False;0;False;1;0.5;0;0;0;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;30;67.10324,988.4271;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0 Node;AmplifyShaderEditor.VertexColorNode;52;-596.7842,-359.4721;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;3;-297.2937,77.36084;Inherit;False;4;4;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;3;COLOR;0,0,0,0;False;1;COLOR;0 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;21;178.6203,372.3519;Inherit;False;3;3;0;FLOAT;0;False;1;FLOAT;0;False;2;COLOR;0,0,0,0;False;1;COLOR;0 Node;AmplifyShaderEditor.DynamicAppendNode;5;417.8781,79.6699;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.TemplateMultiPassMasterNode;0;643.1719,-16.69092;Float;False;True;-1;2;ASEMaterialInspector;100;5;BLK/Screen_TX;0770190933193b94aaa3065e307002fa;True;Unlit;0;0;Unlit;2;True;True;2;5;False;;10;False;;0;1;False;;0;False;;True;0;False;;0;False;;False;False;False;False;False;False;False;False;False;True;0;False;;True;True;2;False;;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;True;True;2;False;;True;3;False;;True;True;0;False;;0;False;;True;2;RenderType=Opaque=RenderType;Queue=Transparent=Queue=0;True;2;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;False;False;0;;0;0;Standard;1;Vertex Position,InvertActionOnDeselection;1;0;0;1;True;False;;False;0 WireConnection;35;0;8;1 WireConnection;35;1;8;2 WireConnection;36;0;35;0 WireConnection;43;0;36;0 WireConnection;44;0;43;1 WireConnection;44;1;43;0 WireConnection;37;0;36;0 WireConnection;45;0;44;0 WireConnection;45;2;55;0 WireConnection;9;0;8;1 WireConnection;9;1;8;2 WireConnection;46;0;37;0 WireConnection;46;1;45;0 WireConnection;14;0;12;3 WireConnection;14;1;12;4 WireConnection;13;0;12;1 WireConnection;13;1;12;2 WireConnection;18;0;51;1 WireConnection;48;0;9;0 WireConnection;48;1;46;0 WireConnection;48;2;49;0 WireConnection;16;0;50;1 WireConnection;16;1;50;2 WireConnection;19;0;18;0 WireConnection;19;1;51;2 WireConnection;11;0;48;0 WireConnection;11;1;13;0 WireConnection;11;2;14;0 WireConnection;32;0;31;3 WireConnection;32;1;31;4 WireConnection;33;0;31;1 WireConnection;33;1;31;2 WireConnection;10;0;11;0 WireConnection;10;2;16;0 WireConnection;10;1;19;0 WireConnection;1;1;10;0 WireConnection;34;0;9;0 WireConnection;34;1;33;0 WireConnection;34;2;32;0 WireConnection;22;0;1;1 WireConnection;22;1;26;1 WireConnection;23;0;1;2 WireConnection;23;1;26;2 WireConnection;24;0;1;3 WireConnection;24;1;26;3 WireConnection;25;0;1;4 WireConnection;25;1;26;4 WireConnection;28;1;34;0 WireConnection;27;0;22;0 WireConnection;27;1;23;0 WireConnection;27;2;24;0 WireConnection;27;3;25;0 WireConnection;30;0;28;0 WireConnection;30;1;29;0 WireConnection;3;0;1;0 WireConnection;3;1;7;0 WireConnection;3;2;4;0 WireConnection;3;3;52;0 WireConnection;21;0;6;0 WireConnection;21;1;27;0 WireConnection;21;2;30;0 WireConnection;5;0;3;0 WireConnection;5;3;21;0 WireConnection;0;0;5;0 ASEEND*/ //CHKSM=8361E30B4D3F1B6506DE49E77982A3146C215563
|