Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Shader "Custom/ToonTerrainFirstPass" {
- Properties {
- [HideInInspector] _Control ("Control (RGBA)", 2D) = "red" {}
- [HideInInspector] _Splat3 ("Layer 3 (A)", 2D) = "white" {}
- [HideInInspector] _Splat2 ("Layer 2 (B)", 2D) = "white" {}
- [HideInInspector] _Splat1 ("Layer 1 (G)", 2D) = "white" {}
- [HideInInspector] _Splat0 ("Layer 0 (R)", 2D) = "white" {}
- [HideInInspector] _Normal3 ("Normal 3 (A)", 2D) = "bump" {}
- [HideInInspector] _Normal2 ("Normal 2 (B)", 2D) = "bump" {}
- [HideInInspector] _Normal1 ("Normal 1 (G)", 2D) = "bump" {}
- [HideInInspector] _Normal0 ("Normal 0 (R)", 2D) = "bump" {}
- // used in fallback on old cards & base map
- [HideInInspector] _MainTex ("BaseMap (RGB)", 2D) = "white" {}
- [HideInInspector] _Color ("Main Color", Color) = (1,1,1,1)
- // TOON STUFF START
- //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" {}
- // TOON STUFF END
- }
- SubShader {
- Tags {
- "Queue" = "Geometry-99"
- "RenderType" = "Opaque"
- }
- LOD 200
- CGPROGRAM
- #pragma surface surf ToonyColors vertex:SplatmapVert finalcolor:SplatmapFinalColor finalprepass:SplatmapFinalPrepass finalgbuffer:SplatmapFinalGBuffer noinstancing
- #pragma multi_compile_fog
- #include "TerrainSplatmapCommon.cginc"
- //TOON STUFF START
- #include "Include/TCP2_Include.cginc"
- #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
- };
- //TOON STUF END
- void surf(Input IN, inout SurfaceOutput o)
- {
- half4 splat_control;
- half weight;
- fixed4 mixedDiffuse;
- SplatmapMix(IN, splat_control, weight, mixedDiffuse, o.Normal);
- o.Albedo = mixedDiffuse.rgb;
- o.Alpha = weight;
- 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
- } // End SubShader
- Dependency "AddPassShader" = "Hidden/TerrainEngine/Splatmap/Diffuse-AddPass"
- Dependency "BaseMapShader" = "Animmal/ToonTerrainBase"
- Dependency "Details0" = "Hidden/TerrainEngine/Details/Vertexlit"
- Dependency "Details1" = "Hidden/TerrainEngine/Details/WavingDoublePass"
- Dependency "Details2" = "Hidden/TerrainEngine/Details/BillboardWavingDoublePass"
- Dependency "Tree0" = "Hidden/TerrainEngine/BillboardTree"
- Fallback "Diffuse"
- } // Ehd Shader
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement