RO_Effect_01.shader 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. // Made with Amplify Shader Editor
  2. // Available at the Unity Asset Store - http://u3d.as/y3X
  3. Shader "RO/RO_Effect_01"
  4. {
  5. Properties
  6. {
  7. _ColorStr("ColorStr", Float) = 1
  8. _AlphaStr("AlphaStr", Float) = 1
  9. _MainTex("主帖图", 2D) = "white" {}
  10. [KeywordEnum(R,G,B,A)] _RGBA1("透明通道选择", Float) = 3
  11. _UVspeed("UVspeed", Vector) = (0,0,1,1)
  12. [Toggle(_WT_ON)] _WT("WT", Float) = 0
  13. [Toggle(_KEYWORD1_ON)] _Keyword1("是否使用原始图片颜色", Float) = 1
  14. [KeywordEnum(R,G,B,A)] _RGBA("混合颜色通道选择", Float) = 3
  15. _Color_A("混合色A", Color) = (1,1,1,1)
  16. _Color_B("混合色B", Color) = (1,1,1,1)
  17. _Vector0("颜色控制", Vector) = (0,1,0,1)
  18. [Enum(UnityEngine.Rendering.BlendMode)]_Src("Src", Float) = 5
  19. [Enum(UnityEngine.Rendering.BlendMode)]_Dst("Dst", Float) = 10
  20. [Enum(UnityEngine.Rendering.CullMode)]_CullMode("CullMode", Float) = 0
  21. [Enum(Off,0,On,1)]_ZWrite("ZWrite", Float) = 1
  22. [Enum(UnityEngine.Rendering.CompareFunction)]_ZTest("ZTest", Float) = 4
  23. }
  24. SubShader
  25. {
  26. Tags { "RenderType" = "Custom" "Queue" = "Transparent+0" "IsEmissive" = "true" "PreviewType"="Plane" }
  27. LOD 100
  28. CGINCLUDE
  29. #pragma target 3.0
  30. ENDCG
  31. Blend [_Src] [_Dst]
  32. Cull [_CullMode]
  33. ColorMask RGBA
  34. ZWrite [_ZWrite]
  35. ZTest [_ZTest]
  36. Offset 0 , 0
  37. Pass
  38. {
  39. Name "Unlit"
  40. Tags { "LightMode"="ForwardBase" }
  41. CGPROGRAM
  42. #ifndef UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX
  43. //only defining to not throw compilation error over Unity 5.5
  44. #define UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input)
  45. #endif
  46. #pragma vertex vert
  47. #pragma fragment frag
  48. #pragma multi_compile_instancing
  49. #include "UnityCG.cginc"
  50. #include "UnityShaderVariables.cginc"
  51. #pragma shader_feature _KEYWORD1_ON
  52. #pragma shader_feature _RGBA_R _RGBA_G _RGBA_B _RGBA_A
  53. #pragma shader_feature _WT_ON
  54. #pragma shader_feature _RGBA1_R _RGBA1_G _RGBA1_B _RGBA1_A
  55. struct appdata
  56. {
  57. float4 vertex : POSITION;
  58. float4 color : COLOR;
  59. UNITY_VERTEX_INPUT_INSTANCE_ID
  60. float4 ase_texcoord : TEXCOORD0;
  61. };
  62. struct v2f
  63. {
  64. float4 vertex : SV_POSITION;
  65. UNITY_VERTEX_INPUT_INSTANCE_ID
  66. UNITY_VERTEX_OUTPUT_STEREO
  67. float4 ase_texcoord : TEXCOORD0;
  68. float4 ase_color : COLOR;
  69. };
  70. uniform float _Src;
  71. uniform float _Dst;
  72. uniform float _CullMode;
  73. uniform float _ZTest;
  74. uniform float _ZWrite;
  75. uniform float4 _Color_B;
  76. uniform float4 _Color_A;
  77. uniform sampler2D _MainTex;
  78. uniform float4 _UVspeed;
  79. uniform float4 _MainTex_ST;
  80. uniform float4 _Vector0;
  81. uniform float _ColorStr;
  82. uniform float _AlphaStr;
  83. v2f vert ( appdata v )
  84. {
  85. v2f o;
  86. UNITY_SETUP_INSTANCE_ID(v);
  87. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  88. UNITY_TRANSFER_INSTANCE_ID(v, o);
  89. o.ase_texcoord = v.ase_texcoord;
  90. o.ase_color = v.color;
  91. float3 vertexValue = float3(0, 0, 0);
  92. #if ASE_ABSOLUTE_VERTEX_POS
  93. vertexValue = v.vertex.xyz;
  94. #endif
  95. vertexValue = vertexValue;
  96. #if ASE_ABSOLUTE_VERTEX_POS
  97. v.vertex.xyz = vertexValue;
  98. #else
  99. v.vertex.xyz += vertexValue;
  100. #endif
  101. o.vertex = UnityObjectToClipPos(v.vertex);
  102. return o;
  103. }
  104. fixed4 frag (v2f i ) : SV_Target
  105. {
  106. UNITY_SETUP_INSTANCE_ID(i);
  107. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
  108. fixed4 finalColor;
  109. float Src35 = _Src;
  110. float Dst36 = _Dst;
  111. float2 appendResult31 = (float2(_UVspeed.x , _UVspeed.y));
  112. float2 uv0_MainTex = i.ase_texcoord * _MainTex_ST.xy + _MainTex_ST.zw;
  113. float2 panner27 = ( 1.0 * _Time.y * appendResult31 + uv0_MainTex);
  114. float2 appendResult51 = (float2(_UVspeed.z , _UVspeed.w));
  115. float4 uv047 = i.ase_texcoord;
  116. uv047.xy = i.ase_texcoord.xy * float2( 1,1 ) + float2( 0,0 );
  117. float2 appendResult48 = (float2(uv047.z , uv047.w));
  118. float2 uv050 = i.ase_texcoord.xy * appendResult51 + appendResult48;
  119. #ifdef _WT_ON
  120. float2 staticSwitch49 = uv050;
  121. #else
  122. float2 staticSwitch49 = panner27;
  123. #endif
  124. float4 tex2DNode2 = tex2D( _MainTex, staticSwitch49 );
  125. #if defined(_RGBA_R)
  126. float staticSwitch24 = tex2DNode2.r;
  127. #elif defined(_RGBA_G)
  128. float staticSwitch24 = tex2DNode2.g;
  129. #elif defined(_RGBA_B)
  130. float staticSwitch24 = tex2DNode2.b;
  131. #elif defined(_RGBA_A)
  132. float staticSwitch24 = tex2DNode2.a;
  133. #else
  134. float staticSwitch24 = tex2DNode2.a;
  135. #endif
  136. float clampResult44 = clamp( staticSwitch24 , _Vector0.x , _Vector0.y );
  137. float4 lerpResult10 = lerp( _Color_B , _Color_A , (_Vector0.z + (clampResult44 - _Vector0.x) * (_Vector0.w - _Vector0.z) / (_Vector0.y - _Vector0.x)));
  138. #ifdef _KEYWORD1_ON
  139. float4 staticSwitch25 = tex2DNode2;
  140. #else
  141. float4 staticSwitch25 = lerpResult10;
  142. #endif
  143. float4 temp_output_6_0 = ( staticSwitch25 * i.ase_color * _ColorStr );
  144. #if defined(_RGBA1_R)
  145. float staticSwitch41 = tex2DNode2.r;
  146. #elif defined(_RGBA1_G)
  147. float staticSwitch41 = tex2DNode2.g;
  148. #elif defined(_RGBA1_B)
  149. float staticSwitch41 = tex2DNode2.b;
  150. #elif defined(_RGBA1_A)
  151. float staticSwitch41 = tex2DNode2.a;
  152. #else
  153. float staticSwitch41 = tex2DNode2.a;
  154. #endif
  155. float temp_output_21_0 = saturate( ( staticSwitch41 * i.ase_color.a * _AlphaStr ) );
  156. float4 appendResult55 = (float4(( (( Src35 == Dst36 ) ? ( temp_output_6_0 * temp_output_21_0 ) : temp_output_6_0 ) ).rgb , temp_output_21_0));
  157. finalColor = appendResult55;
  158. return finalColor;
  159. }
  160. ENDCG
  161. }
  162. }
  163. // CustomEditor "ASEMaterialInspector"
  164. }
  165. /*ASEBEGIN
  166. Version=17500
  167. 2389;1;1442;1010;-662.5281;530.0574;1;True;False
  168. Node;AmplifyShaderEditor.Vector4Node;30;-2828.148,78.1478;Inherit;False;Property;_UVspeed;UVspeed;4;0;Create;True;0;0;False;0;0,0,1,1;0,-1,1,1;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  169. Node;AmplifyShaderEditor.TextureCoordinatesNode;47;-2787.007,304.2948;Inherit;False;0;-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
  170. Node;AmplifyShaderEditor.TextureCoordinatesNode;26;-2821.264,-76.31065;Inherit;False;0;2;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
  171. Node;AmplifyShaderEditor.DynamicAppendNode;31;-2574.654,83.10573;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
  172. Node;AmplifyShaderEditor.DynamicAppendNode;48;-2556.007,326.2948;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
  173. Node;AmplifyShaderEditor.DynamicAppendNode;51;-2527.396,219.504;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
  174. Node;AmplifyShaderEditor.PannerNode;27;-2382.644,-81.93423;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0
  175. Node;AmplifyShaderEditor.TextureCoordinatesNode;50;-2345.396,184.504;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
  176. Node;AmplifyShaderEditor.StaticSwitch;49;-2175.007,-53.7052;Inherit;False;Property;_WT;WT;5;0;Create;True;0;0;False;0;0;0;1;True;;Toggle;2;Key0;Key1;Create;False;9;1;FLOAT2;0,0;False;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT2;0,0;False;6;FLOAT2;0,0;False;7;FLOAT2;0,0;False;8;FLOAT2;0,0;False;1;FLOAT2;0
  177. Node;AmplifyShaderEditor.SamplerNode;2;-1914.491,-77.23545;Inherit;True;Property;_MainTex;主帖图;2;0;Create;False;0;0;False;0;-1;None;f8e6eedf6efa01d40b49e8713be98f55;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
  178. Node;AmplifyShaderEditor.Vector4Node;42;-1328.682,-141.9242;Inherit;False;Property;_Vector0;颜色控制;10;0;Create;False;0;0;False;0;0,1,0,1;0.62,0.67,0,1;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  179. Node;AmplifyShaderEditor.StaticSwitch;24;-1338.613,-293.065;Inherit;False;Property;_RGBA;混合颜色通道选择;7;0;Create;False;0;0;False;0;0;3;3;True;;KeywordEnum;4;R;G;B;A;Create;False;9;1;FLOAT;0;False;0;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT;0;False;7;FLOAT;0;False;8;FLOAT;0;False;1;FLOAT;0
  180. Node;AmplifyShaderEditor.ClampOpNode;44;-1061.682,-280.9242;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0
  181. Node;AmplifyShaderEditor.ColorNode;12;-1348.25,-487.1304;Inherit;False;Property;_Color_A;混合色A;8;0;Create;False;0;0;False;0;1,1,1,1;1,0.6265823,0,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  182. Node;AmplifyShaderEditor.ColorNode;13;-1353.482,-677.6719;Inherit;False;Property;_Color_B;混合色B;9;0;Create;False;0;0;False;0;1,1,1,1;1,0,0,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  183. Node;AmplifyShaderEditor.TFHCRemapNode;43;-782.682,-290.9242;Inherit;False;5;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;3;FLOAT;0;False;4;FLOAT;1;False;1;FLOAT;0
  184. Node;AmplifyShaderEditor.StaticSwitch;41;-1335.224,110.0692;Inherit;False;Property;_RGBA1;透明通道选择;3;0;Create;False;0;0;False;0;0;3;3;True;;KeywordEnum;4;R;G;B;A;Create;False;9;1;FLOAT;0;False;0;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT;0;False;7;FLOAT;0;False;8;FLOAT;0;False;1;FLOAT;0
  185. Node;AmplifyShaderEditor.RangedFloatNode;22;-906.5184,476.4466;Inherit;False;Property;_AlphaStr;AlphaStr;1;0;Create;True;0;0;False;0;1;1;0;0;0;1;FLOAT;0
  186. Node;AmplifyShaderEditor.VertexColorNode;8;-1325.058,318.8527;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  187. Node;AmplifyShaderEditor.LerpOp;10;-569.0887,-362.3988;Inherit;False;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;1;COLOR;0
  188. Node;AmplifyShaderEditor.RangedFloatNode;17;118.2787,-768.6063;Inherit;False;Property;_Src;Src;11;1;[Enum];Create;True;0;1;UnityEngine.Rendering.BlendMode;True;0;5;1;0;0;0;1;FLOAT;0
  189. Node;AmplifyShaderEditor.RangedFloatNode;23;-298.4626,122.5226;Inherit;False;Property;_ColorStr;ColorStr;0;0;Create;True;0;0;False;0;1;1;0;0;0;1;FLOAT;0
  190. Node;AmplifyShaderEditor.StaticSwitch;25;-368.6535,-216.3698;Inherit;False;Property;_Keyword1;是否使用原始图片颜色;6;0;Create;False;0;0;False;0;0;1;0;True;;Toggle;2;Key0;Key1;Create;False;9;1;COLOR;0,0,0,0;False;0;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;3;COLOR;0,0,0,0;False;4;COLOR;0,0,0,0;False;5;COLOR;0,0,0,0;False;6;COLOR;0,0,0,0;False;7;COLOR;0,0,0,0;False;8;COLOR;0,0,0,0;False;1;COLOR;0
  191. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;7;-426.2298,239.7148;Inherit;False;3;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0
  192. Node;AmplifyShaderEditor.RangedFloatNode;18;116.1798,-609.2338;Inherit;False;Property;_Dst;Dst;12;1;[Enum];Create;True;0;1;UnityEngine.Rendering.BlendMode;True;0;10;1;0;0;0;1;FLOAT;0
  193. Node;AmplifyShaderEditor.RegisterLocalVarNode;35;377.29,-761.6071;Inherit;False;Src;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
  194. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;6;-76.81242,-23.39552;Inherit;False;3;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;1;COLOR;0
  195. Node;AmplifyShaderEditor.RegisterLocalVarNode;36;386.8782,-599.9767;Inherit;False;Dst;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
  196. Node;AmplifyShaderEditor.SaturateNode;21;-240.831,244.8913;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
  197. Node;AmplifyShaderEditor.GetLocalVarNode;38;208.8111,-247.9514;Inherit;False;35;Src;1;0;OBJECT;;False;1;FLOAT;0
  198. Node;AmplifyShaderEditor.GetLocalVarNode;37;208.8111,-116.4555;Inherit;False;36;Dst;1;0;OBJECT;;False;1;FLOAT;0
  199. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;9;182.2611,45.04154;Inherit;True;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
  200. Node;AmplifyShaderEditor.TFHCCompareEqual;19;499.1458,-88.19511;Inherit;False;4;0;FLOAT;0;False;1;FLOAT;0;False;2;COLOR;0,0,0,0;False;3;COLOR;1,0,0,0;False;1;COLOR;0
  201. Node;AmplifyShaderEditor.SaturateNode;45;759.5353,-20.968;Inherit;False;1;0;COLOR;0,0,0,0;False;1;COLOR;0
  202. Node;AmplifyShaderEditor.ComponentMaskNode;54;992.6457,-1.555559;Inherit;False;True;True;True;False;1;0;COLOR;0,0,0,0;False;1;FLOAT3;0
  203. Node;AmplifyShaderEditor.RangedFloatNode;15;-97.98126,-774.0619;Inherit;False;Property;_CullMode;CullMode;13;1;[Enum];Create;True;0;1;UnityEngine.Rendering.CullMode;True;0;0;0;0;0;0;1;FLOAT;0
  204. Node;AmplifyShaderEditor.RangedFloatNode;14;-249.9812,-777.0619;Inherit;False;Property;_ZTest;ZTest;15;1;[Enum];Create;True;0;1;UnityEngine.Rendering.CompareFunction;True;0;4;4;0;0;0;1;FLOAT;0
  205. Node;AmplifyShaderEditor.RangedFloatNode;16;-425.9813,-777.0619;Inherit;False;Property;_ZWrite;ZWrite;14;1;[Enum];Create;True;2;On;0;Off;1;0;True;0;1;0;0;0;0;1;FLOAT;0
  206. Node;AmplifyShaderEditor.DynamicAppendNode;55;1284.803,-6.507372;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
  207. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;52;1435.796,-11.03671;Float;False;True;-1;2;ASEMaterialInspector;100;1;RO/RO_Effect_03;0770190933193b94aaa3065e307002fa;True;Unlit;0;0;Unlit;2;True;1;0;True;17;0;True;18;0;1;False;-1;0;False;-1;True;0;False;-1;0;False;-1;True;False;True;0;True;15;True;True;True;True;True;0;False;-1;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;True;1;True;16;True;3;True;14;True;True;0;False;-1;0;False;-1;True;1;RenderType=Opaque=RenderType;True;2;0;False;False;False;False;False;False;False;False;False;True;1;LightMode=ForwardBase;False;0;;0;0;Standard;1;Vertex Position,InvertActionOnDeselection;1;0;1;True;False;;0
  208. WireConnection;31;0;30;1
  209. WireConnection;31;1;30;2
  210. WireConnection;48;0;47;3
  211. WireConnection;48;1;47;4
  212. WireConnection;51;0;30;3
  213. WireConnection;51;1;30;4
  214. WireConnection;27;0;26;0
  215. WireConnection;27;2;31;0
  216. WireConnection;50;0;51;0
  217. WireConnection;50;1;48;0
  218. WireConnection;49;1;27;0
  219. WireConnection;49;0;50;0
  220. WireConnection;2;1;49;0
  221. WireConnection;24;1;2;1
  222. WireConnection;24;0;2;2
  223. WireConnection;24;2;2;3
  224. WireConnection;24;3;2;4
  225. WireConnection;44;0;24;0
  226. WireConnection;44;1;42;1
  227. WireConnection;44;2;42;2
  228. WireConnection;43;0;44;0
  229. WireConnection;43;1;42;1
  230. WireConnection;43;2;42;2
  231. WireConnection;43;3;42;3
  232. WireConnection;43;4;42;4
  233. WireConnection;41;1;2;1
  234. WireConnection;41;0;2;2
  235. WireConnection;41;2;2;3
  236. WireConnection;41;3;2;4
  237. WireConnection;10;0;13;0
  238. WireConnection;10;1;12;0
  239. WireConnection;10;2;43;0
  240. WireConnection;25;1;10;0
  241. WireConnection;25;0;2;0
  242. WireConnection;7;0;41;0
  243. WireConnection;7;1;8;4
  244. WireConnection;7;2;22;0
  245. WireConnection;35;0;17;0
  246. WireConnection;6;0;25;0
  247. WireConnection;6;1;8;0
  248. WireConnection;6;2;23;0
  249. WireConnection;36;0;18;0
  250. WireConnection;21;0;7;0
  251. WireConnection;9;0;6;0
  252. WireConnection;9;1;21;0
  253. WireConnection;19;0;38;0
  254. WireConnection;19;1;37;0
  255. WireConnection;19;2;9;0
  256. WireConnection;19;3;6;0
  257. WireConnection;45;0;19;0
  258. WireConnection;54;0;45;0
  259. WireConnection;55;0;54;0
  260. WireConnection;55;3;21;0
  261. WireConnection;52;0;55;0
  262. ASEEND*/
  263. //CHKSM=334F3AA430E6CCB5061D22D58F1157CE87398A92