// Made with Amplify Shader Editor // Available at the Unity Asset Store - http://u3d.as/y3X Shader "ADON/Building" { Properties { _Color0("Color 0", Color) = (0,0,0,0) _Cutoff( "Mask Clip Value", Float ) = 0 _StartDitheringFade("Start Dithering Fade", Float) = 0 _EndDitheringFade("End Dithering Fade", Float) = 1 [HideInInspector] __dirty( "", Int ) = 1 } SubShader { Tags{ "RenderType" = "TransparentCutout" "Queue" = "AlphaTest+0" "IgnoreProjector" = "True" } Cull Back CGPROGRAM #include "UnityShaderVariables.cginc" #pragma target 3.0 #pragma surface surf StandardSpecular keepalpha addshadow fullforwardshadows vertex:vertexDataFunc struct Input { float eyeDepth; float4 screenPosition; }; uniform float4 _Color0; uniform float _StartDitheringFade; uniform float _EndDitheringFade; uniform float _Cutoff = 0; inline float Dither8x8Bayer( int x, int y ) { const float dither[ 64 ] = { 1, 49, 13, 61, 4, 52, 16, 64, 33, 17, 45, 29, 36, 20, 48, 32, 9, 57, 5, 53, 12, 60, 8, 56, 41, 25, 37, 21, 44, 28, 40, 24, 3, 51, 15, 63, 2, 50, 14, 62, 35, 19, 47, 31, 34, 18, 46, 30, 11, 59, 7, 55, 10, 58, 6, 54, 43, 27, 39, 23, 42, 26, 38, 22}; int r = y * 8 + x; return dither[r] / 64; // same # of instructions as pre-dividing due to compiler magic } void vertexDataFunc( inout appdata_full v, out Input o ) { UNITY_INITIALIZE_OUTPUT( Input, o ); o.eyeDepth = -UnityObjectToViewPos( v.vertex.xyz ).z; float4 ase_screenPos = ComputeScreenPos( UnityObjectToClipPos( v.vertex ) ); o.screenPosition = ase_screenPos; } void surf( Input i , inout SurfaceOutputStandardSpecular o ) { o.Albedo = _Color0.rgb; o.Alpha = 1; float temp_output_25_0 = ( _StartDitheringFade + _ProjectionParams.y ); float4 ase_screenPos = i.screenPosition; 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; float2 clipScreen31 = ase_screenPosNorm.xy * _ScreenParams.xy; float dither31 = Dither8x8Bayer( fmod(clipScreen31.x, 8), fmod(clipScreen31.y, 8) ); clip( ( ( ( i.eyeDepth + -temp_output_25_0 ) / ( _EndDitheringFade - temp_output_25_0 ) ) - dither31 ) - _Cutoff ); } ENDCG } Fallback "Diffuse" CustomEditor "ASEMaterialInspector" } /*ASEBEGIN Version=18909 505;198;1473;711;2973.224;678.0644;2.980381;True;True Node;AmplifyShaderEditor.CommentaryNode;22;-1518.002,1514.104;Inherit;False;297.1897;243;Correction for near plane clipping;1;23;;1,1,1,1;0;0 Node;AmplifyShaderEditor.ProjectionParams;23;-1445.302,1563.404;Inherit;False;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.RangedFloatNode;24;-1492.217,1341.683;Float;False;Property;_StartDitheringFade;Start Dithering Fade;3;0;Create;True;0;0;0;False;0;False;0;0;0;0;0;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleAddOpNode;25;-1206.725,1345.215;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.RangedFloatNode;26;-1025.753,1302.688;Float;False;Property;_EndDitheringFade;End Dithering Fade;4;0;Create;True;0;0;0;False;0;False;1;12;0;0;0;1;FLOAT;0 Node;AmplifyShaderEditor.NegateNode;28;-1015.338,1221.335;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.SurfaceDepthNode;27;-1465.634,1157.101;Inherit;False;0;1;0;FLOAT3;0,0,0;False;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleAddOpNode;29;-806.2531,1161.789;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleSubtractOpNode;30;-808.9528,1316.588;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleDivideOpNode;32;-622.453,1218.289;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.DitheringNode;31;-428.2169,1303.594;Inherit;False;1;False;4;0;FLOAT;0;False;1;SAMPLER2D;;False;2;FLOAT4;0,0,0,0;False;3;SAMPLERSTATE;;False;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleSubtractOpNode;33;-172.2169,1223.594;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.ColorNode;19;-665.246,-7.055243;Inherit;False;Property;_Color0;Color 0;0;0;Create;True;0;0;0;False;0;False;0,0,0,0;0.2713153,0.4291188,0.8584906,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.RangedFloatNode;21;-303.4442,182.8889;Inherit;False;Property;_Float0;Float 0;1;0;Create;True;0;0;0;False;0;False;0;1;0;0;0;1;FLOAT;0 Node;AmplifyShaderEditor.StandardSurfaceOutputNode;0;-2.816066,-2.816066;Float;False;True;-1;2;ASEMaterialInspector;0;0;StandardSpecular;ADON/Building;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;False;False;False;False;False;False;Back;0;False;-1;0;False;-1;False;0;False;-1;0;False;-1;False;0;Masked;0;True;True;0;False;TransparentCutout;;AlphaTest;All;16;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;True;0;5;False;-1;10;False;-1;0;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;0;0.6084906,0.8249723,1,0;VertexOffset;True;False;Cylindrical;False;Relative;0;;2;-1;-1;-1;0;False;0;0;False;-1;-1;0;False;-1;0;0;0;False;0.1;False;-1;0;False;-1;False;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;25;0;24;0 WireConnection;25;1;23;2 WireConnection;28;0;25;0 WireConnection;29;0;27;0 WireConnection;29;1;28;0 WireConnection;30;0;26;0 WireConnection;30;1;25;0 WireConnection;32;0;29;0 WireConnection;32;1;30;0 WireConnection;33;0;32;0 WireConnection;33;1;31;0 WireConnection;0;0;19;0 WireConnection;0;10;33;0 ASEEND*/ //CHKSM=5C26860FDF8FA85BF3E1B6CF06ACA37698F02E80