123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211 |
- // Made with Amplify Shader Editor
- // Available at the Unity Asset Store - http://u3d.as/y3X
- Shader "ASESampleShaders/DitheringFade_niu3"
- {
- Properties
- {
- _Cutoff( "Mask Clip Value", Float ) = 0
- _Albedo("Albedo", 2D) = "white" {}
- [NoScaleOffset]_BlueNoise1("Blue Noise", 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" = "Geometry+0" }
- Tags{ "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
- Blend SrcAlpha One
- AlphaTest Greater .01
- ColorMask RGBA
- Cull Off Lighting Off
- //ZWrite Greater
- Fog { Color (0,0,0,0) }
- //Cull Off
- 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 screenPosition;
- float eyeDepth;
- };
- uniform sampler2D _Albedo;
- uniform float4 _Albedo_ST;
- uniform float4 _Color0;
- uniform float _dis;
- uniform float _alpha;
- uniform sampler2D _BlueNoise1;
- uniform float4 _BlueNoise1_TexelSize;
- 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;
- }
- inline float DitherNoiseTex( float4 screenPos, sampler2D noiseTexture, float4 noiseTexelSize )
- {
- float dither = tex2Dlod( noiseTexture, float4( screenPos.xy * _ScreenParams.xy * noiseTexelSize.xy, 0, 0 ) ).g;
- float ditherRate = noiseTexelSize.x * noiseTexelSize.y;
- dither = ( 1 - ditherRate ) * dither + ditherRate;
- return dither;
- }
- void vertexDataFunc( inout appdata_full v, out Input o )
- {
- UNITY_INITIALIZE_OUTPUT( Input, o );
- float4 ase_screenPos = ComputeScreenPos( UnityObjectToClipPos( v.vertex ) );
- o.screenPosition = ase_screenPos;
- 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 ase_screenPos = i.screenPosition;
- float4 ase_grabScreenPos = ASE_ComputeGrabScreenPos( ase_screenPos );
- float4 ase_grabScreenPosNorm = ase_grabScreenPos / ase_grabScreenPos.w;
- float4 temp_cast_0 = (i.eyeDepth).xxxx;
- float temp_output_105_0 = length( ( ase_grabScreenPosNorm - temp_cast_0 ) );
- float4 temp_output_74_0 = ( tex2D( _Albedo, uv0_Albedo ) * _Color0 * ( temp_output_105_0 / ( _dis + 1.0 ) ) * _alpha );
- o.Normal = temp_output_74_0.rgb;
- o.Albedo = temp_output_74_0.rgb;
- o.Alpha = 1;
- float4 ase_screenPosNorm = ase_screenPos / ase_screenPos.w;
- ase_screenPosNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_screenPosNorm.z : ase_screenPosNorm.z * 0.5 + 0.5;
- float dither112 = DitherNoiseTex( ase_screenPosNorm, _BlueNoise1, _BlueNoise1_TexelSize);
- clip( ( ( temp_output_105_0 - _dis ) - ( dither112 * 20.0 ) ) - _Cutoff );
- }
- ENDCG
- }
- Fallback "Diffuse"
- CustomEditor "ASEMaterialInspector"
- }
- /*ASEBEGIN
- Version=18000
- -107;307;1901;712;1591.41;2578.091;1.954062;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.RangedFloatNode;107;-235.2479,-1822.444;Inherit;False;Property;_dis;dis;13;0;Create;True;0;0;False;0;50;50;0;0;0;1;FLOAT;0
- Node;AmplifyShaderEditor.RangedFloatNode;121;124.3537,-1789.708;Inherit;False;Constant;_Float0;Float 0;14;0;Create;True;0;0;False;0;1;0;0;0;0;1;FLOAT;0
- Node;AmplifyShaderEditor.TexturePropertyNode;111;-397.6635,-2307.083;Float;True;Property;_BlueNoise1;Blue Noise;6;1;[NoScaleOffset];Create;True;0;0;False;0;None;16d574e53541bba44a84052fa38778df;False;white;Auto;Texture2D;-1;0;1;SAMPLER2D;0
- Node;AmplifyShaderEditor.DitheringNode;112;-125.6635,-2307.083;Inherit;False;2;False;3;0;FLOAT;0;False;1;SAMPLER2D;;False;2;FLOAT4;0,0,0,0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.RangedFloatNode;123;-112.1705,-2178.206;Inherit;False;Constant;_Float1;Float 1;14;0;Create;True;0;0;False;0;20;0;0;0;0;1;FLOAT;0
- Node;AmplifyShaderEditor.SimpleAddOpNode;120;258.6139,-1878.264;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.LengthOpNode;105;-164.248,-1975.445;Inherit;False;1;0;FLOAT4;0,0,0,0;False;1;FLOAT;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.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.SimpleMultiplyOpNode;122;206.3407,-2393.879;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;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.SimpleDivideOpNode;119;454.6065,-1954.326;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.SamplerNode;44;497.4083,-1260.015;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.SimpleSubtractOpNode;109;246.4196,-2278.578;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.ColorNode;76;1024.981,-1447.044;Inherit;False;Property;_Color0;Color 0;11;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;10;0;Create;True;0;0;False;0;1;1;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.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.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;9;0;Create;True;0;0;False;0;1;3.6;0;0;0;1;FLOAT;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.RangedFloatNode;30;-572.4907,-1502.613;Float;False;Property;_StartDitheringFade;Start Dithering Fade;8;0;Create;True;0;0;False;0;0;0;0;0;0;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.SimpleMultiplyOpNode;74;1712,-1740.373;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.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.RangedFloatNode;82;1388.44,-859.5891;Inherit;False;Property;_touming;touming;12;0;Create;True;0;0;False;0;0.4660414;0;0;5;0;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.WorldSpaceCameraPos;99;-746.1179,-2008.591;Inherit;False;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
- Node;AmplifyShaderEditor.ViewDirInputsCoordNode;87;486.4807,-2124.559;Float;False;Tangent;False;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
- 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.PowerNode;96;1698.505,-2002.529;Inherit;False;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.SurfaceDepthNode;15;-586.0074,-1637.496;Inherit;False;0;1;0;FLOAT3;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.SimpleAddOpNode;28;-25.62654,-1640.908;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.SaturateNode;90;1239.874,-2136.653;Inherit;False;1;0;FLOAT;1.23;False;1;FLOAT;0
- Node;AmplifyShaderEditor.OneMinusNode;85;1443.428,-2138.271;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;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.SamplerNode;48;384,-112;Inherit;True;Property;_Occlusion;Occlusion;7;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.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.SimpleAddOpNode;65;-350.6989,-1436.681;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;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.SimpleSubtractOpNode;113;712.9796,-2459.102;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.SimpleSubtractOpNode;27;747.9017,-1541.155;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.SamplerNode;46;384,-304;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.StandardSurfaceOutputNode;84;2473.118,-1881.201;Float;False;True;-1;2;ASEMaterialInspector;0;0;StandardSpecular;ASESampleShaders/DitheringFade_niu3;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;112;1;111;0
- WireConnection;120;0;107;0
- WireConnection;120;1;121;0
- WireConnection;105;0;104;0
- WireConnection;122;0;112;0
- WireConnection;122;1;123;0
- WireConnection;119;0;105;0
- WireConnection;119;1;120;0
- WireConnection;44;1;47;0
- WireConnection;109;0;105;0
- WireConnection;109;1;107;0
- WireConnection;33;0;65;0
- WireConnection;98;0;97;0
- WireConnection;74;0;44;0
- WireConnection;74;1;76;0
- WireConnection;74;2;119;0
- WireConnection;74;3;81;0
- WireConnection;89;1;88;0
- WireConnection;97;0;96;0
- WireConnection;97;1;93;0
- WireConnection;96;0;85;0
- WireConnection;96;1;92;0
- WireConnection;29;0;31;0
- WireConnection;29;1;65;0
- WireConnection;45;1;47;0
- WireConnection;28;0;15;0
- WireConnection;28;1;33;0
- WireConnection;90;0;89;0
- WireConnection;85;0;90;0
- WireConnection;34;0;28;0
- WireConnection;34;1;29;0
- WireConnection;48;1;47;0
- WireConnection;65;0;30;0
- WireConnection;65;1;19;2
- WireConnection;88;0;87;0
- WireConnection;113;0;109;0
- WireConnection;113;1;122;0
- WireConnection;27;0;34;0
- WireConnection;27;1;26;0
- WireConnection;46;1;47;0
- WireConnection;84;0;74;0
- WireConnection;84;1;74;0
- WireConnection;84;10;113;0
- ASEEND*/
- //CHKSM=8DEBFB4E2B9429781E22B5D42FF8E0F71AA3F35F
|