Advertisement
Guest User

2-Texture Blending Shader

a guest
Mar 12th, 2017
327
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Shader "Raven-Woods/Map/BlendWithShadows"
  2. {
  3.     Properties
  4.     {
  5.         _BaseColor("Ground Hue",Color)=(0,0,0,1)
  6.         _Base ("Ground", 2D) = "white" {}
  7.         _SnowColor("Snow Hue",Color)=(0,0,0,1)
  8.         _Snow ("Snow", 2D) = "white" {}
  9.     }
  10.  
  11.     SubShader
  12.     {
  13.         Tags { "Queue"="Geometry+3" "RenderType"="Opaque" }
  14.  
  15.         CGPROGRAM
  16.         #pragma surface surf Lambert addshadow
  17.         #pragma target 4.0
  18.  
  19.         sampler2D _Base, _Snow;
  20.  
  21.         float4 _SnowColor, _BaseColor;
  22.  
  23.         struct Input
  24.         {
  25.             float2 uv_Base, uv_Snow;
  26.         };
  27.  
  28.         void surf (Input IN, inout SurfaceOutput o)
  29.         {
  30.             o.Albedo = tex2D(_Snow, IN.uv_Snow).rgb * _SnowColor.a;
  31.             o.Albedo += tex2D(_Base, IN.uv_Base).rgb * _BaseColor * (1.0 - _SnowColor.a);
  32.         }
  33.         ENDCG
  34.     }
  35. }
Advertisement
RAW Paste Data Copied
Advertisement