Advertisement
Guest User

Untitled

a guest
Oct 4th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. // Toony Colors Pro+Mobile 2
  3. // (c) 2014,2015 Jean Moreno
  4.  
  5.  
  6. Shader "Animmal/ToonTerrainBase"
  7. {
  8.     Properties
  9.     {
  10.         //TOONY COLORS
  11.         _Color ("Color", Color) = (1.0,1.0,1.0,1.0)
  12.         _HColor ("Highlight Color", Color) = (0.6,0.6,0.6,1.0)
  13.         _SColor ("Shadow Color", Color) = (0.4,0.4,0.4,1.0)
  14.        
  15.         //DIFFUSE
  16.         _MainTex ("Main Texture (RGB) Spec/Refl Mask (A) ", 2D) = "white" {}
  17.        
  18.         //TOONY COLORS RAMP
  19.         _Ramp ("#RAMPT# Toon Ramp (RGB)", 2D) = "gray" {}
  20.         _RampThreshold ("#RAMPF# Ramp Threshold", Range(0,1)) = 0.5
  21.         _RampSmooth ("#RAMPF# Ramp Smoothing", Range(0.01,1)) = 0.1
  22.        
  23.         //BUMP
  24.         _BumpMap ("#NORM# Normal map (RGB)", 2D) = "bump" {}
  25.        
  26.     }
  27.    
  28.     SubShader
  29.     {
  30.         Tags { "RenderType"="Opaque" }
  31.         LOD 200
  32.        
  33.         CGPROGRAM
  34.        
  35.         #include "Include/TCP2_Include.cginc"
  36.        
  37.         #pragma surface surf ToonyColors
  38.         #pragma target 3.0
  39.         #pragma glsl
  40.        
  41.         #pragma shader_feature TCP2_RAMPTEXT
  42.         #pragma shader_feature TCP2_BUMP
  43.         #pragma shader_feature TCP2_LIGHTMAP
  44.        
  45.  
  46.         //================================================================
  47.         // VARIABLES
  48.        
  49.         fixed4 _Color;
  50.         sampler2D _MainTex;
  51.        
  52.     #if TCP2_BUMP
  53.         sampler2D _BumpMap;
  54.     #endif
  55.        
  56.         struct Input
  57.         {
  58.             half2 uv_MainTex : TEXCOORD0;
  59.     #if TCP2_BUMP
  60.             half2 uv_BumpMap : TEXCOORD1;
  61.     #endif
  62.         };
  63.        
  64.         //================================================================
  65.         // SURFACE FUNCTION
  66.        
  67.         void surf (Input IN, inout SurfaceOutput o)
  68.         {
  69.             half4 c = tex2D(_MainTex, IN.uv_MainTex);
  70.             o.Albedo = c.rgb * _Color.rgb;
  71.             o.Alpha = c.a * _Color.a;
  72.            
  73.     #if TCP2_BUMP
  74.             //Normal map
  75.             o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));
  76.     #endif
  77.         }
  78.        
  79.         ENDCG
  80.        
  81.     }
  82.    
  83.     Fallback "Diffuse"
  84.     CustomEditor "TCP2_MaterialInspector"
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement