DitheringFade_niu5.shader 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. // Made with Amplify Shader Editor
  2. // Available at the Unity Asset Store - http://u3d.as/y3X
  3. Shader "ASESampleShaders/DitheringFade_niu5"
  4. {
  5. Properties
  6. {
  7. _Cutoff( "Mask Clip Value", Float ) = 0
  8. _Albedo("Albedo", 2D) = "white" {}
  9. _alpha("alpha", Float) = 1
  10. _Color0("Color 0", Color) = (0.0518868,0.1491979,1,1)
  11. _dis("dis", Float) = 50
  12. [HideInInspector] _texcoord( "", 2D ) = "white" {}
  13. [HideInInspector] __dirty( "", Int ) = 1
  14. }
  15. SubShader
  16. {
  17. Pass
  18. {
  19. ColorMask 0
  20. ZWrite On
  21. }
  22. Tags{ "RenderType" = "Custom" "Queue" = "AlphaTest+0" }
  23. Cull Back
  24. ZWrite On
  25. ZTest GEqual
  26. Blend One One , DstAlpha DstAlpha
  27. CGPROGRAM
  28. #include "UnityShaderVariables.cginc"
  29. #pragma target 3.0
  30. #pragma surface surf StandardSpecular keepalpha addshadow fullforwardshadows noshadow vertex:vertexDataFunc
  31. struct Input
  32. {
  33. float2 uv_texcoord;
  34. float4 screenPos;
  35. float eyeDepth;
  36. };
  37. uniform sampler2D _Albedo;
  38. uniform float4 _Albedo_ST;
  39. uniform float4 _Color0;
  40. uniform float _alpha;
  41. uniform float _dis;
  42. uniform float _Cutoff = 0;
  43. inline float4 ASE_ComputeGrabScreenPos( float4 pos )
  44. {
  45. #if UNITY_UV_STARTS_AT_TOP
  46. float scale = -1.0;
  47. #else
  48. float scale = 1.0;
  49. #endif
  50. float4 o = pos;
  51. o.y = pos.w * 0.5f;
  52. o.y = ( pos.y - o.y ) * _ProjectionParams.x * scale + o.y;
  53. return o;
  54. }
  55. void vertexDataFunc( inout appdata_full v, out Input o )
  56. {
  57. UNITY_INITIALIZE_OUTPUT( Input, o );
  58. o.eyeDepth = -UnityObjectToViewPos( v.vertex.xyz ).z;
  59. }
  60. void surf( Input i , inout SurfaceOutputStandardSpecular o )
  61. {
  62. float2 uv0_Albedo = i.uv_texcoord * _Albedo_ST.xy + _Albedo_ST.zw;
  63. float4 temp_output_74_0 = ( tex2D( _Albedo, uv0_Albedo ) * _Color0 * _Color0.a * _alpha );
  64. o.Normal = temp_output_74_0.rgb;
  65. o.Albedo = temp_output_74_0.rgb;
  66. o.Alpha = 1;
  67. float4 ase_screenPos = float4( i.screenPos.xyz , i.screenPos.w + 0.00000000001 );
  68. float4 ase_grabScreenPos = ASE_ComputeGrabScreenPos( ase_screenPos );
  69. float4 ase_grabScreenPosNorm = ase_grabScreenPos / ase_grabScreenPos.w;
  70. float4 temp_cast_2 = (i.eyeDepth).xxxx;
  71. clip( ( length( ( ase_grabScreenPosNorm - temp_cast_2 ) ) - _dis ) - _Cutoff );
  72. }
  73. ENDCG
  74. }
  75. Fallback "Diffuse"
  76. CustomEditor "ASEMaterialInspector"
  77. }
  78. /*ASEBEGIN
  79. Version=18000
  80. 0;310;1901;706;2099.881;2831.978;2.93934;True;False
  81. Node;AmplifyShaderEditor.SurfaceDepthNode;103;-749.2479,-1833.444;Inherit;False;0;1;0;FLOAT3;0,0,0;False;1;FLOAT;0
  82. Node;AmplifyShaderEditor.GrabScreenPosition;110;-1138.518,-1981.72;Inherit;False;0;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  83. Node;AmplifyShaderEditor.SimpleSubtractOpNode;104;-358.2479,-1941.445;Inherit;False;2;0;FLOAT4;0,0,0,0;False;1;FLOAT;0;False;1;FLOAT4;0
  84. Node;AmplifyShaderEditor.TextureCoordinatesNode;47;30.18783,-726.4668;Inherit;False;0;44;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
  85. Node;AmplifyShaderEditor.SamplerNode;44;784.2451,-1584.736;Inherit;True;Property;_Albedo;Albedo;2;0;Create;True;0;0;False;0;-1;None;9fbef4b79ca3b784ba023cb1331520d5;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;6;0;SAMPLER2D;0,0;False;1;FLOAT2;1,0;False;2;FLOAT;1;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
  86. Node;AmplifyShaderEditor.LengthOpNode;105;-164.248,-1975.445;Inherit;False;1;0;FLOAT4;0,0,0,0;False;1;FLOAT;0
  87. Node;AmplifyShaderEditor.CommentaryNode;36;-672.5664,-1721.608;Inherit;False;1047.541;403.52;Scale depth from start to end;8;30;65;28;29;34;31;33;15;;1,1,1,1;0;0
  88. Node;AmplifyShaderEditor.ColorNode;76;1103.644,-1522.996;Inherit;False;Property;_Color0;Color 0;10;0;Create;True;0;0;False;0;0.0518868,0.1491979,1,1;0,0.2018125,1,0.8588235;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  89. Node;AmplifyShaderEditor.RangedFloatNode;81;1132.247,-1198.289;Float;True;Property;_alpha;alpha;9;0;Create;True;0;0;False;0;1;1;0;0;0;1;FLOAT;0
  90. Node;AmplifyShaderEditor.RangedFloatNode;107;-235.2479,-1822.444;Inherit;False;Property;_dis;dis;12;0;Create;True;0;0;False;0;50;50;0;0;0;1;FLOAT;0
  91. Node;AmplifyShaderEditor.CommentaryNode;37;-1014.383,-1582.145;Inherit;False;297.1897;243;Correction for near plane clipping;1;19;;1,1,1,1;0;0
  92. Node;AmplifyShaderEditor.SamplerNode;48;573.4204,-753.324;Inherit;True;Property;_Occlusion;Occlusion;6;1;[NoScaleOffset];Create;True;0;0;False;0;-1;None;e477163a653bf6246954b3fea8ea8875;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;6;0;SAMPLER2D;0,0;False;1;FLOAT2;1,0;False;2;FLOAT;1;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
  93. Node;AmplifyShaderEditor.SamplerNode;46;503.0643,-850.6136;Inherit;True;Property;_Specular;Specular;5;1;[NoScaleOffset];Create;True;0;0;False;0;-1;None;6618005f6bafebf40b3d09f498401fba;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;6;0;SAMPLER2D;0,0;False;1;FLOAT2;1,0;False;2;FLOAT;1;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
  94. Node;AmplifyShaderEditor.SaturateNode;90;1239.874,-2136.653;Inherit;False;1;0;FLOAT;1.23;False;1;FLOAT;0
  95. Node;AmplifyShaderEditor.RangedFloatNode;30;-572.4907,-1502.613;Float;False;Property;_StartDitheringFade;Start Dithering Fade;7;0;Create;True;0;0;False;0;0;0;0;0;0;1;FLOAT;0
  96. Node;AmplifyShaderEditor.NegateNode;33;-186.6113,-1563.161;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
  97. Node;AmplifyShaderEditor.SimpleSubtractOpNode;109;267.2623,-1896.578;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  98. Node;AmplifyShaderEditor.SimpleAddOpNode;65;-350.6989,-1436.681;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  99. Node;AmplifyShaderEditor.DitheringNode;26;491.9016,-1461.155;Inherit;False;1;False;3;0;FLOAT;0;False;1;SAMPLER2D;;False;2;FLOAT4;0,0,0,0;False;1;FLOAT;0
  100. Node;AmplifyShaderEditor.SamplerNode;45;798.8137,-1066.844;Inherit;True;Property;_Normal;Normal;4;1;[NoScaleOffset];Create;True;0;0;False;0;-1;None;11f03d9db1a617e40b7ece71f0a84f6f;True;0;True;bump;Auto;True;Object;-1;Auto;Texture2D;6;0;SAMPLER2D;0,0;False;1;FLOAT2;1,0;False;2;FLOAT;1;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  101. Node;AmplifyShaderEditor.SimpleSubtractOpNode;27;747.9017,-1541.155;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  102. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;97;2007.935,-2312.344;Inherit;False;2;2;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
  103. Node;AmplifyShaderEditor.OneMinusNode;85;1443.428,-2138.271;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
  104. Node;AmplifyShaderEditor.SurfaceDepthNode;15;-586.0074,-1637.496;Inherit;False;0;1;0;FLOAT3;0,0,0;False;1;FLOAT;0
  105. Node;AmplifyShaderEditor.SimpleAddOpNode;28;-25.62654,-1640.908;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  106. Node;AmplifyShaderEditor.DotProductOpNode;89;1096.666,-2164.783;Inherit;False;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT;0
  107. Node;AmplifyShaderEditor.PowerNode;96;1698.505,-2002.529;Inherit;False;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  108. Node;AmplifyShaderEditor.WorldSpaceCameraPos;99;-746.1179,-2008.591;Inherit;False;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
  109. Node;AmplifyShaderEditor.RangedFloatNode;92;1390.631,-1962.862;Float;False;Property;_RimPower;RimPower;3;0;Create;True;0;0;False;0;0;10;0;10;0;1;FLOAT;0
  110. Node;AmplifyShaderEditor.NormalizeNode;88;844.7513,-2098.143;Inherit;False;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0
  111. Node;AmplifyShaderEditor.SimpleDivideOpNode;34;224.4735,-1627.308;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  112. Node;AmplifyShaderEditor.SimpleSubtractOpNode;29;53.57375,-1425.008;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  113. Node;AmplifyShaderEditor.SimpleAddOpNode;98;2250.359,-2184.604;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
  114. Node;AmplifyShaderEditor.ProjectionParams;19;-941.6829,-1532.844;Inherit;False;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  115. Node;AmplifyShaderEditor.ViewDirInputsCoordNode;87;486.4807,-2124.559;Float;False;Tangent;False;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
  116. Node;AmplifyShaderEditor.TFHCCompareLower;106;24.752,-1988.445;Inherit;False;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT;0
  117. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;74;1611.266,-1534.649;Inherit;False;4;4;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;COLOR;0
  118. Node;AmplifyShaderEditor.ColorNode;93;1631.499,-2258.231;Float;False;Property;_RimColor;RimColor;1;0;Create;True;0;0;False;0;0,0,0,0;0.3160377,0.7372298,1,1;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  119. Node;AmplifyShaderEditor.RangedFloatNode;31;-152.826,-1454.508;Float;False;Property;_EndDitheringFade;End Dithering Fade;8;0;Create;True;0;0;False;0;1;3.6;0;0;0;1;FLOAT;0
  120. Node;AmplifyShaderEditor.RangedFloatNode;82;1388.44,-859.5891;Inherit;False;Property;_touming;touming;11;0;Create;True;0;0;False;0;0.4660414;0;0;5;0;1;FLOAT;0
  121. Node;AmplifyShaderEditor.StandardSurfaceOutputNode;84;2473.118,-1881.201;Float;False;True;-1;2;ASEMaterialInspector;0;0;StandardSpecular;ASESampleShaders/DitheringFade_niu5;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;Back;1;False;-1;4;False;-1;False;0;False;-1;0;False;-1;True;0;Custom;0;True;True;0;True;Custom;;AlphaTest;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;1;7;False;-1;7;False;-1;0;False;-1;0;False;-1;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;Relative;0;;0;-1;-1;-1;0;False;0;0;False;-1;-1;0;False;-1;0;0;0;False;0.1;False;-1;0;False;-1;16;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT3;0,0,0;False;4;FLOAT;0;False;5;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
  122. WireConnection;104;0;110;0
  123. WireConnection;104;1;103;0
  124. WireConnection;44;1;47;0
  125. WireConnection;105;0;104;0
  126. WireConnection;48;1;47;0
  127. WireConnection;46;1;47;0
  128. WireConnection;90;0;89;0
  129. WireConnection;33;0;65;0
  130. WireConnection;109;0;105;0
  131. WireConnection;109;1;107;0
  132. WireConnection;65;0;30;0
  133. WireConnection;65;1;19;2
  134. WireConnection;45;1;47;0
  135. WireConnection;27;0;34;0
  136. WireConnection;27;1;26;0
  137. WireConnection;97;0;96;0
  138. WireConnection;97;1;93;0
  139. WireConnection;85;0;90;0
  140. WireConnection;28;0;15;0
  141. WireConnection;28;1;33;0
  142. WireConnection;89;1;88;0
  143. WireConnection;96;0;85;0
  144. WireConnection;96;1;92;0
  145. WireConnection;88;0;87;0
  146. WireConnection;34;0;28;0
  147. WireConnection;34;1;29;0
  148. WireConnection;29;0;31;0
  149. WireConnection;29;1;65;0
  150. WireConnection;98;0;97;0
  151. WireConnection;74;0;44;0
  152. WireConnection;74;1;76;0
  153. WireConnection;74;2;76;4
  154. WireConnection;74;3;81;0
  155. WireConnection;84;0;74;0
  156. WireConnection;84;1;74;0
  157. WireConnection;84;10;109;0
  158. ASEEND*/
  159. //CHKSM=096C4349DA798734FDD8572828AC64C95AF851A3