mask shader.shader 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. // Made with Amplify Shader Editor
  2. // Available at the Unity Asset Store - http://u3d.as/y3X
  3. Shader "gcl/mask shader"
  4. {
  5. Properties
  6. {
  7. _wave("wave", 2D) = "white" {}
  8. _uv_speed("uv_speed", Vector) = (0,0,0,0)
  9. _noise_speed("noise_speed", Vector) = (0,0,0,0)
  10. _Color("Color ", Color) = (1,1,1,1)
  11. _colorintensity("color intensity", Range( 0 , 10)) = 2.6
  12. _Mask("Mask ", Range( 0 , 50)) = 0.5926225
  13. _Float0("Float 0", Range( 0 , 5)) = 0
  14. [NoScaleOffset]_MaskTexture("Mask Texture", 2D) = "white" {}
  15. _noise("noise", 2D) = "white" {}
  16. _noiseintensity("noise intensity", Range( 0 , 1)) = 0
  17. [HideInInspector] _texcoord( "", 2D ) = "white" {}
  18. [HideInInspector] __dirty( "", Int ) = 1
  19. }
  20. SubShader
  21. {
  22. Tags{ "RenderType" = "Custom" "Queue" = "Transparent+0" "IsEmissive" = "true" }
  23. Cull Off
  24. ZWrite Off
  25. Blend One One
  26. CGPROGRAM
  27. #include "UnityShaderVariables.cginc"
  28. #pragma target 3.0
  29. #pragma surface surf Unlit keepalpha noshadow noambient novertexlights nolightmap nodynlightmap nodirlightmap nofog nometa noforwardadd
  30. struct Input
  31. {
  32. float4 vertexColor : COLOR;
  33. float2 uv_texcoord;
  34. };
  35. uniform half4 _Color;
  36. uniform half _colorintensity;
  37. uniform sampler2D _wave;
  38. uniform half2 _uv_speed;
  39. uniform float4 _wave_ST;
  40. uniform sampler2D _noise;
  41. uniform half2 _noise_speed;
  42. uniform half _noiseintensity;
  43. uniform sampler2D _MaskTexture;
  44. uniform half _Mask;
  45. uniform half _Float0;
  46. float3 mod2D289( float3 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; }
  47. float2 mod2D289( float2 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; }
  48. float3 permute( float3 x ) { return mod2D289( ( ( x * 34.0 ) + 1.0 ) * x ); }
  49. float snoise( float2 v )
  50. {
  51. const float4 C = float4( 0.211324865405187, 0.366025403784439, -0.577350269189626, 0.024390243902439 );
  52. float2 i = floor( v + dot( v, C.yy ) );
  53. float2 x0 = v - i + dot( i, C.xx );
  54. float2 i1;
  55. i1 = ( x0.x > x0.y ) ? float2( 1.0, 0.0 ) : float2( 0.0, 1.0 );
  56. float4 x12 = x0.xyxy + C.xxzz;
  57. x12.xy -= i1;
  58. i = mod2D289( i );
  59. float3 p = permute( permute( i.y + float3( 0.0, i1.y, 1.0 ) ) + i.x + float3( 0.0, i1.x, 1.0 ) );
  60. float3 m = max( 0.5 - float3( dot( x0, x0 ), dot( x12.xy, x12.xy ), dot( x12.zw, x12.zw ) ), 0.0 );
  61. m = m * m;
  62. m = m * m;
  63. float3 x = 2.0 * frac( p * C.www ) - 1.0;
  64. float3 h = abs( x ) - 0.5;
  65. float3 ox = floor( x + 0.5 );
  66. float3 a0 = x - ox;
  67. m *= 1.79284291400159 - 0.85373472095314 * ( a0 * a0 + h * h );
  68. float3 g;
  69. g.x = a0.x * x0.x + h.x * x0.y;
  70. g.yz = a0.yz * x12.xz + h.yz * x12.yw;
  71. return 130.0 * dot( m, g );
  72. }
  73. inline half4 LightingUnlit( SurfaceOutput s, half3 lightDir, half atten )
  74. {
  75. return half4 ( 0, 0, 0, s.Alpha );
  76. }
  77. void surf( Input i , inout SurfaceOutput o )
  78. {
  79. float2 uv0_wave = i.uv_texcoord * _wave_ST.xy + _wave_ST.zw;
  80. half2 panner15 = ( 1.0 * _Time.y * _uv_speed + uv0_wave);
  81. half2 panner47 = ( 1.0 * _Time.y * _noise_speed + uv0_wave);
  82. half4 tex2DNode13 = tex2D( _wave, ( panner15 + ( tex2D( _noise, panner47 ).r * _noiseintensity ) ) );
  83. float2 uv_MaskTexture34 = i.uv_texcoord;
  84. half4 temp_output_21_0 = ( ( tex2DNode13.r * ( tex2D( _MaskTexture, uv_MaskTexture34 ) / _Mask ) ) + float4( 0,0,0,0 ) );
  85. o.Emission = ( ( _Color * _colorintensity ) * i.vertexColor * temp_output_21_0 * _colorintensity ).rgb;
  86. half simplePerlin2D40 = snoise( tex2DNode13.rg*_Float0 );
  87. simplePerlin2D40 = simplePerlin2D40*0.5 + 0.5;
  88. o.Alpha = ( ( _Color.a * 0.0 ) * i.vertexColor.a * temp_output_21_0 * simplePerlin2D40 ).r;
  89. }
  90. ENDCG
  91. }
  92. CustomEditor "ASEMaterialInspector"
  93. }
  94. /*ASEBEGIN
  95. Version=18000
  96. 48;543;1236;438;2942.741;842.1532;4.06745;True;False
  97. Node;AmplifyShaderEditor.TextureCoordinatesNode;45;-1321.025,-259.9102;Inherit;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
  98. Node;AmplifyShaderEditor.Vector2Node;54;-1282.254,-108.7597;Inherit;False;Property;_noise_speed;noise_speed;2;0;Create;True;0;0;False;0;0,0;0,0;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
  99. Node;AmplifyShaderEditor.PannerNode;47;-1013.921,-175.5578;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0
  100. Node;AmplifyShaderEditor.RangedFloatNode;49;-796.7155,-37.53139;Inherit;False;Property;_noiseintensity;noise intensity;12;0;Create;True;0;0;False;0;0;0;0;1;0;1;FLOAT;0
  101. Node;AmplifyShaderEditor.Vector2Node;53;-826.9512,-468.9495;Inherit;False;Property;_uv_speed;uv_speed;1;0;Create;True;0;0;False;0;0,0;0,0;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
  102. Node;AmplifyShaderEditor.TextureCoordinatesNode;14;-879.9949,-614.0422;Inherit;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
  103. Node;AmplifyShaderEditor.SamplerNode;48;-792.8969,-270.572;Inherit;True;Property;_noise;noise;11;0;Create;True;0;0;False;0;-1;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
  104. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;50;-457.811,-252.3398;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  105. Node;AmplifyShaderEditor.PannerNode;15;-572.8914,-529.6895;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0
  106. Node;AmplifyShaderEditor.CommentaryNode;33;-297.8499,283.2036;Inherit;False;657.0546;404.0196;Mask;3;36;34;35;;1,1,1,1;0;0
  107. Node;AmplifyShaderEditor.RangedFloatNode;36;-215.4049,570.0264;Inherit;False;Property;_Mask;Mask ;8;0;Create;True;0;0;False;0;0.5926225;0;0;50;0;1;FLOAT;0
  108. Node;AmplifyShaderEditor.SimpleAddOpNode;51;-305.0671,-400.3582;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT;0;False;1;FLOAT2;0
  109. Node;AmplifyShaderEditor.SamplerNode;34;-207.2272,369.0836;Inherit;True;Property;_MaskTexture;Mask Texture;10;1;[NoScaleOffset];Create;True;0;0;False;0;-1;4ab1105029632d0488e92ac230b38ea7;357512022a5710f45a71173c2a418f1b;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
  110. Node;AmplifyShaderEditor.SimpleDivideOpNode;35;122.2112,359.3152;Inherit;True;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
  111. Node;AmplifyShaderEditor.SamplerNode;13;-151.7203,-526.4808;Inherit;True;Property;_wave;wave;0;0;Create;True;0;0;False;0;-1;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
  112. Node;AmplifyShaderEditor.RangedFloatNode;32;-126.9665,-321.5277;Inherit;False;Property;_Float0;Float 0;9;0;Create;True;0;0;False;0;0;0;0;5;0;1;FLOAT;0
  113. Node;AmplifyShaderEditor.RangedFloatNode;28;344.5285,-462.1376;Inherit;False;Property;_colorintensity;color intensity;4;0;Create;True;0;0;False;0;2.6;0;0;10;0;1;FLOAT;0
  114. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;20;421.3152,317.4289;Inherit;True;2;2;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
  115. Node;AmplifyShaderEditor.ColorNode;10;317.0191,-659.1863;Inherit;False;Property;_Color;Color ;3;0;Create;True;0;0;False;0;1,1,1,1;1,1,1,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  116. Node;AmplifyShaderEditor.NoiseGeneratorNode;40;513.2692,-174.2499;Inherit;True;Simplex2D;True;False;2;0;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT;0
  117. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;30;578.2402,-317.0876;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  118. Node;AmplifyShaderEditor.SimpleAddOpNode;21;773.4741,27.09887;Inherit;True;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
  119. Node;AmplifyShaderEditor.VertexColorNode;9;659.3012,-462.5353;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  120. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;29;689.1183,-628.3233;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
  121. Node;AmplifyShaderEditor.ClampOpNode;24;-423.9919,777.9498;Inherit;True;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0
  122. Node;AmplifyShaderEditor.ViewDirInputsCoordNode;2;-2256.26,143.3102;Inherit;True;World;False;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
  123. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;11;940.1565,-588.6494;Inherit;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;FLOAT;0;False;1;COLOR;0
  124. Node;AmplifyShaderEditor.OneMinusNode;25;-110.6866,780.0644;Inherit;True;1;0;FLOAT;0;False;1;FLOAT;0
  125. Node;AmplifyShaderEditor.OneMinusNode;5;-1347.455,195.6328;Inherit;True;1;0;FLOAT;0;False;1;FLOAT;0
  126. Node;AmplifyShaderEditor.SaturateNode;26;-1556.042,203.1098;Inherit;True;1;0;FLOAT;0;False;1;FLOAT;0
  127. Node;AmplifyShaderEditor.RangedFloatNode;8;-1442.955,454.6812;Inherit;False;Property;_range;range;5;0;Create;True;0;0;False;0;1.226309;1;0;5;0;1;FLOAT;0
  128. Node;AmplifyShaderEditor.DepthFade;19;-727.2369,804.3815;Inherit;False;True;False;True;2;1;FLOAT3;0,0,0;False;0;FLOAT;1;False;1;FLOAT;0
  129. Node;AmplifyShaderEditor.RangedFloatNode;23;-917.1901,824.8322;Inherit;False;Property;_depthfade;depth fade;7;0;Create;True;0;0;False;0;7.7;0;0;0;0;1;FLOAT;0
  130. Node;AmplifyShaderEditor.WorldNormalVector;3;-2254.001,353.0568;Inherit;True;False;1;0;FLOAT3;0,0,1;False;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
  131. Node;AmplifyShaderEditor.DotProductOpNode;4;-2015.061,237.8574;Inherit;True;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT;0
  132. Node;AmplifyShaderEditor.PowerNode;7;-1038.58,174.8107;Inherit;True;False;2;0;FLOAT;0;False;1;FLOAT;1;False;1;FLOAT;0
  133. Node;AmplifyShaderEditor.AbsOpNode;6;-1798.403,160.5328;Inherit;True;1;0;FLOAT;0;False;1;FLOAT;0
  134. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;12;1067.983,-212.7201;Inherit;False;4;4;0;FLOAT;0;False;1;FLOAT;0;False;2;COLOR;0,0,0,0;False;3;FLOAT;0;False;1;COLOR;0
  135. Node;AmplifyShaderEditor.StandardSurfaceOutputNode;0;1359.535,-379.6364;Half;False;True;-1;2;ASEMaterialInspector;0;0;Unlit;gcl/mask shader;False;False;False;False;True;True;True;True;True;True;True;True;False;False;False;False;False;False;False;False;False;Off;2;False;-1;0;False;-1;False;0;False;-1;0;False;-1;False;0;Custom;0.5;True;False;0;True;Custom;;Transparent;All;14;all;True;True;True;True;0;False;-1;False;0;False;-1;255;False;-1;255;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;False;2;15;10;25;False;0.5;False;4;1;False;-1;1;False;-1;0;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;Relative;0;;6;-1;-1;-1;0;False;0;0;False;-1;-1;0;False;-1;0;0;0;False;0.1;False;-1;0;False;-1;15;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT;0;False;4;FLOAT;0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0;False;9;FLOAT;0;False;10;FLOAT;0;False;13;FLOAT3;0,0,0;False;11;FLOAT3;0,0,0;False;12;FLOAT3;0,0,0;False;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0
  136. WireConnection;47;0;45;0
  137. WireConnection;47;2;54;0
  138. WireConnection;48;1;47;0
  139. WireConnection;50;0;48;1
  140. WireConnection;50;1;49;0
  141. WireConnection;15;0;14;0
  142. WireConnection;15;2;53;0
  143. WireConnection;51;0;15;0
  144. WireConnection;51;1;50;0
  145. WireConnection;35;0;34;0
  146. WireConnection;35;1;36;0
  147. WireConnection;13;1;51;0
  148. WireConnection;20;0;13;1
  149. WireConnection;20;1;35;0
  150. WireConnection;40;0;13;0
  151. WireConnection;40;1;32;0
  152. WireConnection;30;0;10;4
  153. WireConnection;21;0;20;0
  154. WireConnection;29;0;10;0
  155. WireConnection;29;1;28;0
  156. WireConnection;24;0;19;0
  157. WireConnection;11;0;29;0
  158. WireConnection;11;1;9;0
  159. WireConnection;11;2;21;0
  160. WireConnection;11;3;28;0
  161. WireConnection;25;0;24;0
  162. WireConnection;5;0;26;0
  163. WireConnection;26;0;6;0
  164. WireConnection;19;1;23;0
  165. WireConnection;4;0;2;0
  166. WireConnection;4;1;3;0
  167. WireConnection;7;0;5;0
  168. WireConnection;7;1;8;0
  169. WireConnection;6;0;4;0
  170. WireConnection;12;0;30;0
  171. WireConnection;12;1;9;4
  172. WireConnection;12;2;21;0
  173. WireConnection;12;3;40;0
  174. WireConnection;0;2;11;0
  175. WireConnection;0;9;12;0
  176. ASEEND*/
  177. //CHKSM=4FC05296897F225D3D86324E5E97DD759DCF6B31