Add_CenterGlow.shader 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. Shader "ERB/Particles/Add_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. [Toggle]_Usecenterglow("Use center glow?", Float) = 0
  14. [MaterialToggle] _Usedepth ("Use depth?", Float ) = 0
  15. _Depthpower ("Depth power", Float ) = 1
  16. [Enum(Cull Off,0, Cull Front,1, Cull Back,2)] _CullMode("Culling", Float) = 0
  17. [HideInInspector] _texcoord( "", 2D ) = "white" {}
  18. }
  19. Category
  20. {
  21. SubShader
  22. {
  23. Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" }
  24. Blend One One
  25. ColorMask RGB
  26. Cull[_CullMode]
  27. Lighting Off
  28. ZWrite Off
  29. ZTest LEqual
  30. Pass {
  31. CGPROGRAM
  32. #pragma vertex vert
  33. #pragma fragment frag
  34. #pragma target 2.0
  35. #pragma multi_compile_particles
  36. #pragma multi_compile_fog
  37. #include "UnityShaderVariables.cginc"
  38. #include "UnityCG.cginc"
  39. struct appdata_t
  40. {
  41. float4 vertex : POSITION;
  42. fixed4 color : COLOR;
  43. float4 texcoord : TEXCOORD0;
  44. UNITY_VERTEX_INPUT_INSTANCE_ID
  45. };
  46. struct v2f
  47. {
  48. float4 vertex : SV_POSITION;
  49. fixed4 color : COLOR;
  50. float4 texcoord : TEXCOORD0;
  51. UNITY_FOG_COORDS(1)
  52. #ifdef SOFTPARTICLES_ON
  53. float4 projPos : TEXCOORD2;
  54. #endif
  55. UNITY_VERTEX_INPUT_INSTANCE_ID
  56. UNITY_VERTEX_OUTPUT_STEREO
  57. };
  58. #if UNITY_VERSION >= 560
  59. UNITY_DECLARE_DEPTH_TEXTURE( _CameraDepthTexture );
  60. #else
  61. uniform sampler2D_float _CameraDepthTexture;
  62. #endif
  63. //Don't delete this comment
  64. // uniform sampler2D_float _CameraDepthTexture;
  65. uniform sampler2D _MainTex;
  66. uniform float4 _MainTex_ST;
  67. uniform float _Usecenterglow;
  68. uniform float4 _SpeedMainTexUVNoiseZW;
  69. uniform sampler2D _Flow;
  70. uniform float4 _DistortionSpeedXYPowerZ;
  71. uniform float4 _Flow_ST;
  72. uniform sampler2D _Mask;
  73. uniform float4 _Mask_ST;
  74. uniform sampler2D _Noise;
  75. uniform float4 _Noise_ST;
  76. uniform float4 _Color;
  77. uniform float _Emission;
  78. uniform fixed _Usedepth;
  79. uniform float _Depthpower;
  80. v2f vert ( appdata_t v )
  81. {
  82. v2f o;
  83. UNITY_SETUP_INSTANCE_ID(v);
  84. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  85. UNITY_TRANSFER_INSTANCE_ID(v, o);
  86. v.vertex.xyz += float3( 0, 0, 0 ) ;
  87. o.vertex = UnityObjectToClipPos(v.vertex);
  88. #ifdef SOFTPARTICLES_ON
  89. o.projPos = ComputeScreenPos (o.vertex);
  90. COMPUTE_EYEDEPTH(o.projPos.z);
  91. #endif
  92. o.color = v.color;
  93. o.texcoord = v.texcoord;
  94. UNITY_TRANSFER_FOG(o,o.vertex);
  95. return o;
  96. }
  97. fixed4 frag ( v2f i ) : SV_Target
  98. {
  99. float lp = 1;
  100. #ifdef SOFTPARTICLES_ON
  101. float sceneZ = LinearEyeDepth (SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos)));
  102. float partZ = i.projPos.z;
  103. float fade = saturate ((sceneZ-partZ) / _Depthpower);
  104. lp *= lerp(1, fade, _Usedepth);
  105. i.color.a *= lp;
  106. #endif
  107. float2 appendResult21 = (float2(_SpeedMainTexUVNoiseZW.x , _SpeedMainTexUVNoiseZW.y));
  108. float2 uv0_MainTex = i.texcoord.xy * _MainTex_ST.xy + _MainTex_ST.zw;
  109. float2 panner107 = ( 1.0 * _Time.y * appendResult21 + uv0_MainTex);
  110. float2 appendResult100 = (float2(_DistortionSpeedXYPowerZ.x , _DistortionSpeedXYPowerZ.y));
  111. float3 uv0_Flow = i.texcoord.xyz;
  112. uv0_Flow.xy = i.texcoord.xy * _Flow_ST.xy + _Flow_ST.zw;
  113. float2 panner110 = ( 1.0 * _Time.y * appendResult100 + (uv0_Flow).xy);
  114. float2 uv_Mask = i.texcoord.xy * _Mask_ST.xy + _Mask_ST.zw;
  115. float4 tex2DNode33 = tex2D( _Mask, uv_Mask );
  116. float Flowpower102 = _DistortionSpeedXYPowerZ.z;
  117. float4 tex2DNode13 = tex2D( _MainTex, ( panner107 - ( (( tex2D( _Flow, panner110 ) * tex2DNode33 )).rg * Flowpower102 ) ) );
  118. float2 appendResult22 = (float2(_SpeedMainTexUVNoiseZW.z , _SpeedMainTexUVNoiseZW.w));
  119. float2 uv0_Noise = i.texcoord.xy * _Noise_ST.xy + _Noise_ST.zw;
  120. float2 panner108 = ( 1.0 * _Time.y * appendResult22 + uv0_Noise);
  121. float4 tex2DNode14 = tex2D( _Noise, panner108 );
  122. float4 temp_output_30_0 = ( tex2DNode13 * tex2DNode14 * _Color * i.color * tex2DNode13.a * tex2DNode14.a * _Color.a * i.color.a );
  123. float4 temp_cast_0 = ((1.0 + (uv0_Flow.z - 0.0) * (0.0 - 1.0) / (1.0 - 0.0))).xxxx;
  124. float4 clampResult38 = clamp( ( tex2DNode33 - temp_cast_0 ) , float4( 0,0,0,0 ) , float4( 1,1,1,1 ) );
  125. float4 clampResult40 = clamp( ( tex2DNode33 * clampResult38 ) , float4( 0,0,0,0 ) , float4( 1,1,1,1 ) );
  126. fixed4 col = ( lerp(temp_output_30_0,( temp_output_30_0 * clampResult40 ),_Usecenterglow) * _Emission );
  127. UNITY_APPLY_FOG_COLOR(i.fogCoord, col, fixed4(0,0,0,1));
  128. return col;
  129. }
  130. ENDCG
  131. }
  132. }
  133. }
  134. }
  135. /*ASEBEGIN
  136. Version=16700
  137. 696;164;1906;1004;2971.996;633.0641;2.191415;True;False
  138. 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
  139. 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
  140. 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
  141. 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
  142. Node;AmplifyShaderEditor.ComponentMaskNode;59;-3583.603,566.496;Float;False;True;True;False;False;1;0;FLOAT3;0,0,0;False;1;FLOAT2;0
  143. 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
  144. 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
  145. 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
  146. 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
  147. 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
  148. Node;AmplifyShaderEditor.RegisterLocalVarNode;102;-3556.945,748.0421;Float;False;Flowpower;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
  149. 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
  150. 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
  151. 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
  152. 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
  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.SimpleMultiplyOpNode;95;-2388.997,542.6455;Float;False;2;2;0;FLOAT2;0,0;False;1;FLOAT;0;False;1;FLOAT2;0
  156. 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
  157. 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
  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.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
  161. 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
  162. Node;AmplifyShaderEditor.SimpleSubtractOpNode;96;-1989.684,-41.77601;Float;False;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
  163. 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
  164. 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
  165. 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
  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.SimpleMultiplyOpNode;30;-1187.357,127.2037;Float;False;8;8;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;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT;0;False;7;FLOAT;0;False;1;COLOR;0
  169. 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
  170. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;41;-896.1669,248.9071;Float;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
  171. Node;AmplifyShaderEditor.RangedFloatNode;52;-621.877,229.5624;Float;False;Property;_Emission;Emission;6;0;Create;True;0;0;False;0;2;2;0;0;0;1;FLOAT;0
  172. Node;AmplifyShaderEditor.ToggleSwitchNode;90;-697.314,128.5203;Float;False;Property;_Usecenterglow;Use center glow?;8;0;Create;True;0;0;False;0;0;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
  173. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;51;-461.6268,132.2673;Float;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
  174. 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
  175. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;68;-322.6836,135.062;Float;False;True;2;Float;;0;7;EGA/Particles/Add_CenterGlow;0b6a9f8b4f707c74ca64c0be8e590de0;True;SubShader 0 Pass 0;0;0;SubShader 0 Pass 0;2;True;4;1;False;-1;1;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=AlphaTest=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
  176. WireConnection;100;0;99;1
  177. WireConnection;100;1;99;2
  178. WireConnection;59;0;98;0
  179. WireConnection;110;0;59;0
  180. WireConnection;110;2;100;0
  181. WireConnection;91;1;110;0
  182. WireConnection;102;0;99;3
  183. WireConnection;92;0;91;0
  184. WireConnection;92;1;33;0
  185. WireConnection;94;0;92;0
  186. WireConnection;21;0;15;1
  187. WireConnection;21;1;15;2
  188. WireConnection;36;0;98;3
  189. WireConnection;95;0;94;0
  190. WireConnection;95;1;103;0
  191. WireConnection;37;0;33;0
  192. WireConnection;37;1;36;0
  193. WireConnection;22;0;15;3
  194. WireConnection;22;1;15;4
  195. WireConnection;107;0;29;0
  196. WireConnection;107;2;21;0
  197. WireConnection;38;0;37;0
  198. WireConnection;108;0;89;0
  199. WireConnection;108;2;22;0
  200. WireConnection;96;0;107;0
  201. WireConnection;96;1;95;0
  202. WireConnection;39;0;33;0
  203. WireConnection;39;1;38;0
  204. WireConnection;14;1;108;0
  205. WireConnection;13;1;96;0
  206. WireConnection;30;0;13;0
  207. WireConnection;30;1;14;0
  208. WireConnection;30;2;31;0
  209. WireConnection;30;3;32;0
  210. WireConnection;30;4;13;4
  211. WireConnection;30;5;14;4
  212. WireConnection;30;6;31;4
  213. WireConnection;30;7;32;4
  214. WireConnection;40;0;39;0
  215. WireConnection;41;0;30;0
  216. WireConnection;41;1;40;0
  217. WireConnection;90;0;30;0
  218. WireConnection;90;1;41;0
  219. WireConnection;51;0;90;0
  220. WireConnection;51;1;52;0
  221. WireConnection;72;0;40;0
  222. WireConnection;68;0;51;0
  223. ASEEND*/
  224. //CHKSM=D5A44C7BD3081F4777C455821BF73DF59F0BC63F