Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Toony Colors Pro+Mobile 2
- // (c) 2014,2015 Jean Moreno
- Shader "Animmal/ToonTerrainBase"
- {
- Properties
- {
- //TOONY COLORS
- _Color ("Color", Color) = (1.0,1.0,1.0,1.0)
- _HColor ("Highlight Color", Color) = (0.6,0.6,0.6,1.0)
- _SColor ("Shadow Color", Color) = (0.4,0.4,0.4,1.0)
- //DIFFUSE
- _MainTex ("Main Texture (RGB) Spec/Refl Mask (A) ", 2D) = "white" {}
- //TOONY COLORS RAMP
- _Ramp ("#RAMPT# Toon Ramp (RGB)", 2D) = "gray" {}
- _RampThreshold ("#RAMPF# Ramp Threshold", Range(0,1)) = 0.5
- _RampSmooth ("#RAMPF# Ramp Smoothing", Range(0.01,1)) = 0.1
- //BUMP
- _BumpMap ("#NORM# Normal map (RGB)", 2D) = "bump" {}
- }
- SubShader
- {
- Tags { "RenderType"="Opaque" }
- LOD 200
- CGPROGRAM
- #include "Include/TCP2_Include.cginc"
- #pragma surface surf ToonyColors
- #pragma target 3.0
- #pragma glsl
- #pragma shader_feature TCP2_RAMPTEXT
- #pragma shader_feature TCP2_BUMP
- #pragma shader_feature TCP2_LIGHTMAP
- //================================================================
- // VARIABLES
- fixed4 _Color;
- sampler2D _MainTex;
- #if TCP2_BUMP
- sampler2D _BumpMap;
- #endif
- struct Input
- {
- half2 uv_MainTex : TEXCOORD0;
- #if TCP2_BUMP
- half2 uv_BumpMap : TEXCOORD1;
- #endif
- };
- //================================================================
- // SURFACE FUNCTION
- void surf (Input IN, inout SurfaceOutput o)
- {
- half4 c = tex2D(_MainTex, IN.uv_MainTex);
- o.Albedo = c.rgb * _Color.rgb;
- o.Alpha = c.a * _Color.a;
- #if TCP2_BUMP
- //Normal map
- o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));
- #endif
- }
- ENDCG
- }
- Fallback "Diffuse"
- CustomEditor "TCP2_MaterialInspector"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement