// Made with Amplify Shader Editor // Available at the Unity Asset Store - http://u3d.as/y3X Shader "ASESampleShaders/DitheringFade_niu5" { Properties { _Cutoff( "Mask Clip Value", Float ) = 0 _Albedo("Albedo", 2D) = "white" {} _alpha("alpha", Float) = 1 _Color0("Color 0", Color) = (0.0518868,0.1491979,1,1) _dis("dis", Float) = 50 [HideInInspector] _texcoord( "", 2D ) = "white" {} [HideInInspector] __dirty( "", Int ) = 1 } SubShader { Pass { ColorMask 0 ZWrite On } Tags{ "RenderType" = "Custom" "Queue" = "AlphaTest+0" } Cull Back ZWrite On ZTest GEqual Blend One One , DstAlpha DstAlpha CGPROGRAM #include "UnityShaderVariables.cginc" #pragma target 3.0 #pragma surface surf StandardSpecular keepalpha addshadow fullforwardshadows noshadow vertex:vertexDataFunc struct Input { float2 uv_texcoord; float4 screenPos; float eyeDepth; }; uniform sampler2D _Albedo; uniform float4 _Albedo_ST; uniform float4 _Color0; uniform float _alpha; uniform float _dis; uniform float _Cutoff = 0; inline float4 ASE_ComputeGrabScreenPos( float4 pos ) { #if UNITY_UV_STARTS_AT_TOP float scale = -1.0; #else float scale = 1.0; #endif float4 o = pos; o.y = pos.w * 0.5f; o.y = ( pos.y - o.y ) * _ProjectionParams.x * scale + o.y; return o; } void vertexDataFunc( inout appdata_full v, out Input o ) { UNITY_INITIALIZE_OUTPUT( Input, o ); o.eyeDepth = -UnityObjectToViewPos( v.vertex.xyz ).z; } void surf( Input i , inout SurfaceOutputStandardSpecular o ) { float2 uv0_Albedo = i.uv_texcoord * _Albedo_ST.xy + _Albedo_ST.zw; float4 temp_output_74_0 = ( tex2D( _Albedo, uv0_Albedo ) * _Color0 * _Color0.a * _alpha ); o.Normal = temp_output_74_0.rgb; o.Albedo = temp_output_74_0.rgb; o.Alpha = 1; float4 ase_screenPos = float4( i.screenPos.xyz , i.screenPos.w + 0.00000000001 ); float4 ase_grabScreenPos = ASE_ComputeGrabScreenPos( ase_screenPos ); float4 ase_grabScreenPosNorm = ase_grabScreenPos / ase_grabScreenPos.w; float4 temp_cast_2 = (i.eyeDepth).xxxx; clip( ( length( ( ase_grabScreenPosNorm - temp_cast_2 ) ) - _dis ) - _Cutoff ); } ENDCG } Fallback "Diffuse" CustomEditor "ASEMaterialInspector" } /*ASEBEGIN Version=18000 0;310;1901;706;2099.881;2831.978;2.93934;True;False Node;AmplifyShaderEditor.SurfaceDepthNode;103;-749.2479,-1833.444;Inherit;False;0;1;0;FLOAT3;0,0,0;False;1;FLOAT;0 Node;AmplifyShaderEditor.GrabScreenPosition;110;-1138.518,-1981.72;Inherit;False;0;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 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 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 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 Node;AmplifyShaderEditor.LengthOpNode;105;-164.248,-1975.445;Inherit;False;1;0;FLOAT4;0,0,0,0;False;1;FLOAT;0 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 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 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 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 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 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 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 Node;AmplifyShaderEditor.SaturateNode;90;1239.874,-2136.653;Inherit;False;1;0;FLOAT;1.23;False;1;FLOAT;0 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 Node;AmplifyShaderEditor.NegateNode;33;-186.6113,-1563.161;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleSubtractOpNode;109;267.2623,-1896.578;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleAddOpNode;65;-350.6989,-1436.681;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 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 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 Node;AmplifyShaderEditor.SimpleSubtractOpNode;27;747.9017,-1541.155;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 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 Node;AmplifyShaderEditor.OneMinusNode;85;1443.428,-2138.271;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.SurfaceDepthNode;15;-586.0074,-1637.496;Inherit;False;0;1;0;FLOAT3;0,0,0;False;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleAddOpNode;28;-25.62654,-1640.908;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 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 Node;AmplifyShaderEditor.PowerNode;96;1698.505,-2002.529;Inherit;False;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.WorldSpaceCameraPos;99;-746.1179,-2008.591;Inherit;False;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3 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 Node;AmplifyShaderEditor.NormalizeNode;88;844.7513,-2098.143;Inherit;False;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0 Node;AmplifyShaderEditor.SimpleDivideOpNode;34;224.4735,-1627.308;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleSubtractOpNode;29;53.57375,-1425.008;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 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 Node;AmplifyShaderEditor.ProjectionParams;19;-941.6829,-1532.844;Inherit;False;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.ViewDirInputsCoordNode;87;486.4807,-2124.559;Float;False;Tangent;False;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3 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 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 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 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 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 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 WireConnection;104;0;110;0 WireConnection;104;1;103;0 WireConnection;44;1;47;0 WireConnection;105;0;104;0 WireConnection;48;1;47;0 WireConnection;46;1;47;0 WireConnection;90;0;89;0 WireConnection;33;0;65;0 WireConnection;109;0;105;0 WireConnection;109;1;107;0 WireConnection;65;0;30;0 WireConnection;65;1;19;2 WireConnection;45;1;47;0 WireConnection;27;0;34;0 WireConnection;27;1;26;0 WireConnection;97;0;96;0 WireConnection;97;1;93;0 WireConnection;85;0;90;0 WireConnection;28;0;15;0 WireConnection;28;1;33;0 WireConnection;89;1;88;0 WireConnection;96;0;85;0 WireConnection;96;1;92;0 WireConnection;88;0;87;0 WireConnection;34;0;28;0 WireConnection;34;1;29;0 WireConnection;29;0;31;0 WireConnection;29;1;65;0 WireConnection;98;0;97;0 WireConnection;74;0;44;0 WireConnection;74;1;76;0 WireConnection;74;2;76;4 WireConnection;74;3;81;0 WireConnection;84;0;74;0 WireConnection;84;1;74;0 WireConnection;84;10;109;0 ASEEND*/ //CHKSM=096C4349DA798734FDD8572828AC64C95AF851A3