Blend_CenterGlow.shader 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. Shader "ERB/Particles/Blend_CenterGlow"
  2. {
  3. Properties
  4. {
  5. _MainTex("MainTex", 2D) = "white" {}
  6. _Noise("Noise", 2D) = "white" {}
  7. _Flow("Flow", 2D) = "white" {}
  8. _Mask("Mask", 2D) = "white" {}
  9. _SpeedMainTexUVNoiseZW("Speed MainTex U/V + Noise Z/W", Vector) = (0,0,0,0)
  10. _DistortionSpeedXYPowerZ("Distortion Speed XY Power Z", Vector) = (0,0,0,0)
  11. _Emission("Emission", Float) = 2
  12. _Color("Color", Color) = (0.5,0.5,0.5,1)
  13. _Opacity("Opacity", Range( 0 , 1)) = 1
  14. [Toggle]_Usecenterglow("Use center glow?", Float) = 0
  15. [MaterialToggle] _Usedepth ("Use depth?", Float ) = 0
  16. _Depthpower ("Depth power", Float ) = 1
  17. [Enum(Cull Off,0, Cull Front,1, Cull Back,2)] _CullMode("Culling", Float) = 0
  18. [HideInInspector] _texcoord( "", 2D ) = "white" {}
  19. }
  20. Category
  21. {
  22. SubShader
  23. {
  24. Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" }
  25. Blend SrcAlpha OneMinusSrcAlpha
  26. ColorMask RGB
  27. Cull[_CullMode]
  28. Lighting Off
  29. ZWrite Off
  30. ZTest LEqual
  31. Pass {
  32. CGPROGRAM
  33. #pragma vertex vert
  34. #pragma fragment frag
  35. #pragma target 2.0
  36. #pragma multi_compile_particles
  37. #pragma multi_compile_fog
  38. #include "UnityShaderVariables.cginc"
  39. #include "UnityCG.cginc"
  40. struct appdata_t
  41. {
  42. float4 vertex : POSITION;
  43. fixed4 color : COLOR;
  44. float4 texcoord : TEXCOORD0;
  45. UNITY_VERTEX_INPUT_INSTANCE_ID
  46. };
  47. struct v2f
  48. {
  49. float4 vertex : SV_POSITION;
  50. fixed4 color : COLOR;
  51. float4 texcoord : TEXCOORD0;
  52. UNITY_FOG_COORDS(1)
  53. #ifdef SOFTPARTICLES_ON
  54. float4 projPos : TEXCOORD2;
  55. #endif
  56. UNITY_VERTEX_INPUT_INSTANCE_ID
  57. UNITY_VERTEX_OUTPUT_STEREO
  58. };
  59. #if UNITY_VERSION >= 560
  60. UNITY_DECLARE_DEPTH_TEXTURE( _CameraDepthTexture );
  61. #else
  62. uniform sampler2D_float _CameraDepthTexture;
  63. #endif
  64. //Don't delete this comment
  65. // uniform sampler2D_float _CameraDepthTexture;
  66. uniform sampler2D _MainTex;
  67. uniform float4 _MainTex_ST;
  68. uniform float _Usecenterglow;
  69. uniform float4 _SpeedMainTexUVNoiseZW;
  70. uniform sampler2D _Flow;
  71. uniform float4 _DistortionSpeedXYPowerZ;
  72. uniform float4 _Flow_ST;
  73. uniform sampler2D _Mask;
  74. uniform float4 _Mask_ST;
  75. uniform sampler2D _Noise;
  76. uniform float4 _Noise_ST;
  77. uniform float4 _Color;
  78. uniform float _Emission;
  79. uniform float _Opacity;
  80. uniform fixed _Usedepth;
  81. uniform float _Depthpower;
  82. v2f vert ( appdata_t v )
  83. {
  84. v2f o;
  85. UNITY_SETUP_INSTANCE_ID(v);
  86. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  87. UNITY_TRANSFER_INSTANCE_ID(v, o);
  88. v.vertex.xyz += float3( 0, 0, 0 ) ;
  89. o.vertex = UnityObjectToClipPos(v.vertex);
  90. #ifdef SOFTPARTICLES_ON
  91. o.projPos = ComputeScreenPos (o.vertex);
  92. COMPUTE_EYEDEPTH(o.projPos.z);
  93. #endif
  94. o.color = v.color;
  95. o.texcoord = v.texcoord;
  96. UNITY_TRANSFER_FOG(o,o.vertex);
  97. return o;
  98. }
  99. fixed4 frag ( v2f i ) : SV_Target
  100. {
  101. float lp = 1;
  102. #ifdef SOFTPARTICLES_ON
  103. float sceneZ = LinearEyeDepth (SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos)));
  104. float partZ = i.projPos.z;
  105. float fade = saturate ((sceneZ-partZ) / _Depthpower);
  106. lp *= lerp(1, fade, _Usedepth);
  107. i.color.a *= lp;
  108. #endif
  109. float2 appendResult21 = (float2(_SpeedMainTexUVNoiseZW.x , _SpeedMainTexUVNoiseZW.y));
  110. float2 uv0_MainTex = i.texcoord.xy * _MainTex_ST.xy + _MainTex_ST.zw;
  111. float2 panner107 = ( 1.0 * _Time.y * appendResult21 + uv0_MainTex);
  112. float2 appendResult100 = (float2(_DistortionSpeedXYPowerZ.x , _DistortionSpeedXYPowerZ.y));
  113. float3 uv0_Flow = i.texcoord.xyz;
  114. uv0_Flow.xy = i.texcoord.xy * _Flow_ST.xy + _Flow_ST.zw;
  115. float2 panner110 = ( 1.0 * _Time.y * appendResult100 + (uv0_Flow).xy);
  116. float2 uv_Mask = i.texcoord.xy * _Mask_ST.xy + _Mask_ST.zw;
  117. float4 tex2DNode33 = tex2D( _Mask, uv_Mask );
  118. float Flowpower102 = _DistortionSpeedXYPowerZ.z;
  119. float4 tex2DNode13 = tex2D( _MainTex, ( panner107 - ( (( tex2D( _Flow, panner110 ) * tex2DNode33 )).rg * Flowpower102 ) ) );
  120. float2 appendResult22 = (float2(_SpeedMainTexUVNoiseZW.z , _SpeedMainTexUVNoiseZW.w));
  121. float2 uv0_Noise = i.texcoord.xy * _Noise_ST.xy + _Noise_ST.zw;
  122. float2 panner108 = ( 1.0 * _Time.y * appendResult22 + uv0_Noise);
  123. float4 tex2DNode14 = tex2D( _Noise, panner108 );
  124. float3 temp_output_78_0 = (( tex2DNode13 * tex2DNode14 * _Color * i.color )).rgb;
  125. float4 temp_cast_0 = ((1.0 + (uv0_Flow.z - 0.0) * (0.0 - 1.0) / (1.0 - 0.0))).xxxx;
  126. float4 clampResult38 = clamp( ( tex2DNode33 - temp_cast_0 ) , float4( 0,0,0,0 ) , float4( 1,1,1,1 ) );
  127. float4 clampResult40 = clamp( ( tex2DNode33 * clampResult38 ) , float4( 0,0,0,0 ) , float4( 1,1,1,1 ) );
  128. float4 appendResult87 = (float4(( lerp(temp_output_78_0,( temp_output_78_0 * (clampResult40).rgb ),_Usecenterglow) * _Emission ) , ( tex2DNode13.a * tex2DNode14.a * _Color.a * i.color.a * _Opacity )));
  129. fixed4 col = appendResult87;
  130. UNITY_APPLY_FOG(i.fogCoord, col);
  131. return col;
  132. }
  133. ENDCG
  134. }
  135. }
  136. }
  137. }
  138. /*ASEBEGIN
  139. Version=16700
  140. 7;29;1906;1004;6056.22;2131.388;4.009903;True;False
  141. Node;AmplifyShaderEditor.CommentaryNode;104;-4130.993,490.5418;Float;False;1910.996;537.6462;Texture distortion;12;91;33;100;102;99;94;95;103;92;59;98;110;;1,1,1,1;0;0
  142. Node;AmplifyShaderEditor.TextureCoordinatesNode;98;-3920.299,848.9976;Float;False;0;91;3;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  143. Node;AmplifyShaderEditor.Vector4Node;99;-3968.293,619.481;Float;False;Property;_DistortionSpeedXYPowerZ;Distortion Speed XY Power Z;5;0;Create;True;0;0;False;0;0,0,0,0;0,0,0,0;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  144. Node;AmplifyShaderEditor.ComponentMaskNode;59;-3583.603,566.496;Float;False;True;True;False;False;1;0;FLOAT3;0,0,0;False;1;FLOAT2;0
  145. Node;AmplifyShaderEditor.DynamicAppendNode;100;-3535.482,654.5021;Float;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
  146. Node;AmplifyShaderEditor.PannerNode;110;-3339.196,596.5295;Float;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0
  147. Node;AmplifyShaderEditor.CommentaryNode;109;-3401.27,-330.4436;Float;False;1037.896;533.6285;Textures movement;7;107;108;29;21;89;22;15;;1,1,1,1;0;0
  148. Node;AmplifyShaderEditor.SamplerNode;91;-3152.937,567.9764;Float;True;Property;_Flow;Flow;2;0;Create;True;0;0;False;0;None;61c0b9c0523734e0e91bc6043c72a490;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
  149. Node;AmplifyShaderEditor.SamplerNode;33;-3146.373,763.0061;Float;True;Property;_Mask;Mask;3;0;Create;True;0;0;False;0;None;None;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
  150. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;92;-2762.212,550.0183;Float;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
  151. Node;AmplifyShaderEditor.RegisterLocalVarNode;102;-3556.945,748.0421;Float;False;Flowpower;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
  152. Node;AmplifyShaderEditor.Vector4Node;15;-3351.27,-101.4007;Float;False;Property;_SpeedMainTexUVNoiseZW;Speed MainTex U/V + Noise Z/W;4;0;Create;True;0;0;False;0;0,0,0,0;0,0,0,0;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  153. Node;AmplifyShaderEditor.TFHCRemapNode;36;-2530.289,1355.094;Float;False;5;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;3;FLOAT;1;False;4;FLOAT;0;False;1;FLOAT;0
  154. Node;AmplifyShaderEditor.GetLocalVarNode;103;-2605.07,630.9626;Float;False;102;Flowpower;1;0;OBJECT;0;False;1;FLOAT;0
  155. Node;AmplifyShaderEditor.DynamicAppendNode;21;-2778.501,-153.1786;Float;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
  156. Node;AmplifyShaderEditor.ComponentMaskNode;94;-2609.926,543.6367;Float;False;True;True;False;False;1;0;COLOR;0,0,0,0;False;1;FLOAT2;0
  157. Node;AmplifyShaderEditor.TextureCoordinatesNode;29;-2856.788,-280.4436;Float;False;0;13;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
  158. Node;AmplifyShaderEditor.PannerNode;107;-2570.374,-239.5098;Float;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0
  159. Node;AmplifyShaderEditor.TextureCoordinatesNode;89;-2861.858,-55.04038;Float;False;0;14;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
  160. Node;AmplifyShaderEditor.DynamicAppendNode;22;-2766.722,70.18491;Float;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
  161. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;95;-2388.997,542.6455;Float;False;2;2;0;FLOAT2;0,0;False;1;FLOAT;0;False;1;FLOAT2;0
  162. Node;AmplifyShaderEditor.SimpleSubtractOpNode;37;-2289.906,1280.763;Float;False;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
  163. Node;AmplifyShaderEditor.SimpleSubtractOpNode;96;-1989.684,-41.77601;Float;False;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
  164. Node;AmplifyShaderEditor.PannerNode;108;-2577.237,-21.63752;Float;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0
  165. Node;AmplifyShaderEditor.ClampOpNode;38;-2130.64,1280.587;Float;False;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;COLOR;1,1,1,1;False;1;COLOR;0
  166. Node;AmplifyShaderEditor.ColorNode;31;-1728.612,316.0578;Float;False;Property;_Color;Color;7;0;Create;True;0;0;False;0;0.5,0.5,0.5,1;0.5,0.5,0.5,1;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  167. Node;AmplifyShaderEditor.VertexColorNode;32;-1670.612,486.0577;Float;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  168. Node;AmplifyShaderEditor.SamplerNode;13;-1803.192,-66.2159;Float;True;Property;_MainTex;MainTex;0;0;Create;True;0;0;False;0;None;None;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
  169. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;39;-1937.593,1156.593;Float;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
  170. Node;AmplifyShaderEditor.SamplerNode;14;-1804.579,119.2214;Float;True;Property;_Noise;Noise;1;0;Create;True;0;0;False;0;None;None;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
  171. Node;AmplifyShaderEditor.ClampOpNode;40;-1764.275,1143.857;Float;False;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;COLOR;1,1,1,1;False;1;COLOR;0
  172. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;30;-1135.791,-2.490838;Float;False;4;4;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;3;COLOR;0,0,0,0;False;1;COLOR;0
  173. Node;AmplifyShaderEditor.ComponentMaskNode;72;-1580.242,1135.946;Float;False;True;True;True;False;1;0;COLOR;0,0,0,0;False;1;FLOAT3;0
  174. Node;AmplifyShaderEditor.ComponentMaskNode;78;-945.7914,41.06877;Float;False;True;True;True;False;1;0;COLOR;0,0,0,0;False;1;FLOAT3;0
  175. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;41;-714.9078,127.0253;Float;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT3;0
  176. Node;AmplifyShaderEditor.ToggleSwitchNode;90;-536.6786,48.89112;Float;False;Property;_Usecenterglow;Use center glow?;9;0;Create;True;0;0;False;0;0;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT3;0
  177. Node;AmplifyShaderEditor.RangedFloatNode;52;-446.0907,153.7209;Float;False;Property;_Emission;Emission;6;0;Create;True;0;0;False;0;2;2;0;0;0;1;FLOAT;0
  178. Node;AmplifyShaderEditor.RangedFloatNode;62;-826.0103,543.6755;Float;False;Property;_Opacity;Opacity;8;0;Create;True;0;0;False;0;1;1;0;1;0;1;FLOAT;0
  179. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;51;-285.8404,56.42584;Float;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;1;FLOAT3;0
  180. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;88;-460.9,315.4933;Float;False;5;5;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;4;FLOAT;0;False;1;FLOAT;0
  181. Node;AmplifyShaderEditor.DynamicAppendNode;87;-123.9274,58.99411;Float;False;FLOAT4;4;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT4;0
  182. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;68;48.80347,59.22049;Float;False;True;2;Float;;0;7;EGA/Particles/Blend_CenterGlow;0b6a9f8b4f707c74ca64c0be8e590de0;True;SubShader 0 Pass 0;0;0;SubShader 0 Pass 0;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;False;0;False;-1;False;True;2;False;-1;True;3;False;-1;False;True;4;Queue=Transparent=Queue=0;IgnoreProjector=True;RenderType=Transparent=RenderType;PreviewType=Plane;False;0;False;False;False;False;False;False;False;False;False;False;True;0;0;;0;0;Standard;0;0;1;True;False;2;0;FLOAT4;0,0,0,0;False;1;FLOAT3;0,0,0;False;0
  183. WireConnection;59;0;98;0
  184. WireConnection;100;0;99;1
  185. WireConnection;100;1;99;2
  186. WireConnection;110;0;59;0
  187. WireConnection;110;2;100;0
  188. WireConnection;91;1;110;0
  189. WireConnection;92;0;91;0
  190. WireConnection;92;1;33;0
  191. WireConnection;102;0;99;3
  192. WireConnection;36;0;98;3
  193. WireConnection;21;0;15;1
  194. WireConnection;21;1;15;2
  195. WireConnection;94;0;92;0
  196. WireConnection;107;0;29;0
  197. WireConnection;107;2;21;0
  198. WireConnection;22;0;15;3
  199. WireConnection;22;1;15;4
  200. WireConnection;95;0;94;0
  201. WireConnection;95;1;103;0
  202. WireConnection;37;0;33;0
  203. WireConnection;37;1;36;0
  204. WireConnection;96;0;107;0
  205. WireConnection;96;1;95;0
  206. WireConnection;108;0;89;0
  207. WireConnection;108;2;22;0
  208. WireConnection;38;0;37;0
  209. WireConnection;13;1;96;0
  210. WireConnection;39;0;33;0
  211. WireConnection;39;1;38;0
  212. WireConnection;14;1;108;0
  213. WireConnection;40;0;39;0
  214. WireConnection;30;0;13;0
  215. WireConnection;30;1;14;0
  216. WireConnection;30;2;31;0
  217. WireConnection;30;3;32;0
  218. WireConnection;72;0;40;0
  219. WireConnection;78;0;30;0
  220. WireConnection;41;0;78;0
  221. WireConnection;41;1;72;0
  222. WireConnection;90;0;78;0
  223. WireConnection;90;1;41;0
  224. WireConnection;51;0;90;0
  225. WireConnection;51;1;52;0
  226. WireConnection;88;0;13;4
  227. WireConnection;88;1;14;4
  228. WireConnection;88;2;31;4
  229. WireConnection;88;3;32;4
  230. WireConnection;88;4;62;0
  231. WireConnection;87;0;51;0
  232. WireConnection;87;3;88;0
  233. WireConnection;68;0;87;0
  234. ASEEND*/
  235. //CHKSM=B03AE7D5B18AF14F983A8B921731CC0D04B368DD