Advertisement
Guest User

Untitled

a guest
Oct 31st, 2016
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Made with Amplify Shader Editor
  2. // Available at the Unity Asset Store - http://u3d.as/y3X
  3. Shader "Automatic/AutoTexture2"
  4. {
  5.     Properties
  6.     {
  7.         _Absolute("Absolute", Range( 0 , 1)) = 1
  8.         _Angle1("Angle1", Range( -1 , 1)) = 0.5
  9.         _Texture1("Texture1", 2D) = "white" {}
  10.         _Normal1("Normal1", 2D) = "bump" {}
  11.         _Texture2("Texture2", 2D) = "white" {}
  12.         _Normal2("Normal2", 2D) = "bump" {}
  13.         [HideInInspector] __dirty( "", Int ) = 1
  14.     }
  15.  
  16.     SubShader
  17.     {
  18.         Tags{ "RenderType" = "Opaque"  "Queue" = "Geometry+0" }
  19.         Cull Back
  20.         CGPROGRAM
  21.         #pragma target 3.0
  22.         #pragma surface surf Standard keepalpha addshadow fullforwardshadows
  23.         struct Input
  24.         {
  25.             float3 worldNormal;
  26.             INTERNAL_DATA
  27.             float2 uv_Normal1;
  28.             float2 uv_Normal2;
  29.             float2 uv_Texture1;
  30.             float2 uv_Texture2;
  31.         };
  32.  
  33.         uniform float _Absolute;
  34.         uniform float _Angle1;
  35.         uniform sampler2D _Normal1;
  36.         uniform sampler2D _Normal2;
  37.         uniform sampler2D _Texture1;
  38.         uniform sampler2D _Texture2;
  39.  
  40.         void surf( Input input , inout SurfaceOutputStandard output )
  41.         {
  42.             float _normal =  ( ( _Absolute > 0.0 ) ? abs( input.worldNormal.y ) :  input.worldNormal.y ) ;
  43.             float3 WorldNormal38 = WorldNormalVector( input , float3( 0,0,1 ));
  44.             output.Normal =  ( WorldNormal38.y - 0.0 > _Angle1 ? UnpackNormal( tex2D( _Normal1,input.uv_Normal1) ) : WorldNormal38.y - 0.0 <= _Angle1 && WorldNormal38.y + 0.0 >= _Angle1 ? UnpackNormal( tex2D( _Normal2,input.uv_Normal2) ) : UnpackNormal( tex2D( _Normal2,input.uv_Normal2) ) ) ;
  45.             float4 tex2DNode10 = tex2D( _Texture2,input.uv_Texture2);
  46.             output.Albedo =  ( WorldNormal38.y - 0.0 > _Angle1 ? tex2D( _Texture1,input.uv_Texture1) : WorldNormal38.y - 0.0 <= _Angle1 && WorldNormal38.y + 0.0 >= _Angle1 ? tex2DNode10 : tex2DNode10 ) ;
  47.         }
  48.  
  49.         ENDCG
  50.     }
  51.     Fallback "Diffuse"
  52. }
  53. /*ASEBEGIN
  54. Version=21
  55. 1927;29;1125;1014;1144.837;732.5684;1.9;True;False
  56. Node;AmplifyShaderEditor.CommentaryNode;37;-624.8143,-546.3958;1015.414;369.8057;Variable;7;42;38;39;40;41;44;51
  57. Node;AmplifyShaderEditor.StandardSurfaceOutputNode;0;1147.137,10.46317;True;Standard;Automatic/AutoTexture2;False;False;False;False;False;False;False;False;False;False;False;False;Back;On;LEqual;Opaque;0.5;True;True;0;False;Opaque;Geometry;0,0,0;0,0,0;0,0,0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0,0,0
  58. Node;AmplifyShaderEditor.WorldNormalInputsNode;38;-574.8143,-365.59
  59. Node;AmplifyShaderEditor.TFHCCompareGreater;51;-68.83755,-382.8677;0.0;0.0;0.0;0.0
  60. Node;AmplifyShaderEditor.RegisterLocalVarNode;41;189.6003,-371.7951;_normal;-100;0.0
  61. Node;AmplifyShaderEditor.SamplerNode;23;-123.3791,491.6841;Property;_Normal1;Normal1;-8;None;True;0;False;bump;Auto;True;Object;-1;0,0;1.0
  62. Node;AmplifyShaderEditor.SamplerNode;24;-377.8313,913.6588;Property;_Normal2;Normal2;-6;None;True;0;False;bump;Auto;True;Object;-1;0,0;1.0
  63. Node;AmplifyShaderEditor.AbsOpNode;39;-293.9795,-368.1901;0.0
  64. Node;AmplifyShaderEditor.SamplerNode;10;-380.2312,730.759;Property;_Texture2;Texture2;-7;None;True;0;False;white;Auto;False;Object;-1;0,0;1.0
  65. Node;AmplifyShaderEditor.SamplerNode;9;-125.3791,307.0836;Property;_Texture1;Texture1;-9;None;True;0;False;white;Auto;False;Object;-1;0,0;1.0
  66. Node;AmplifyShaderEditor.TFHCIf;52;645.7639,345.1325;0.0;0.0;0.0,0,0,0;0.0,0,0,0;0.0,0,0,0;0.0
  67. Node;AmplifyShaderEditor.TFHCIf;53;647.3637,610.7321;0.0;0.0;0.0,0,0;0.0,0,0;0.0,0,0;0.0
  68. Node;AmplifyShaderEditor.RangedFloatNode;44;-451.2381,-488.468;Property;_Absolute;Absolute;-100;1;0;1
  69. Node;AmplifyShaderEditor.RangedFloatNode;21;-126.8373,215.1047;Property;_Angle1;Angle1;-10;0.5;-1;1
  70. Node;AmplifyShaderEditor.GetLocalVarNode;27;322.3824,32.00516;41
  71. WireConnection;0;0;52;0
  72. WireConnection;0;1;53;0
  73. WireConnection;51;0;44;0
  74. WireConnection;51;2;39;0
  75. WireConnection;51;3;38;2
  76. WireConnection;41;0;51;0
  77. WireConnection;39;0;38;2
  78. WireConnection;52;0;38;2
  79. WireConnection;52;1;21;0
  80. WireConnection;52;2;9;0
  81. WireConnection;52;3;10;0
  82. WireConnection;52;4;10;0
  83. WireConnection;53;0;38;2
  84. WireConnection;53;1;21;0
  85. WireConnection;53;2;23;0
  86. WireConnection;53;3;24;0
  87. WireConnection;53;4;24;0
  88. ASEEND*/
  89. //CHKSM=E012B1A22D8BFF2E7F4E04DD41B84B5561002C45
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement