Advertisement
dnnkeeper

Untitled

Jul 10th, 2014
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.86 KB | None | 0 0
  1. Shader "Custom/TransparentBlend" {
  2.  
  3. Properties
  4. {
  5.         _Tex1 ("Base (RGB) Alpha (A)", 2D) = "white" {}
  6.         _Tex2 ("Base (RGB) Alpha (A)", 2D) = "white" {}
  7. }
  8.  
  9. SubShader
  10. {
  11.         Tags {"Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="TransparentCutout"}
  12.         LOD 200
  13.  
  14.         CGPROGRAM
  15.         #pragma surface surf Lambert alphatest
  16.  
  17.         sampler2D _Tex1;
  18.         sampler2D _Tex2;
  19.  
  20.         struct Input {
  21.                 float2 uv_Tex1;
  22.                 float4 color: COLOR;
  23.         };
  24.  
  25.         void surf (Input IN, inout SurfaceOutput o) {
  26.                 float4 tex1 = tex2D(_Tex1, IN.uv_Tex1);
  27.                 float4 tex2 = tex2D(_Tex2, IN.uv_Tex1);
  28.                 o.Albedo = IN.color.rgb * tex1 + (1.0 - IN.color.rgb) * tex2;
  29.                 o.Alpha = IN.color.a;
  30.         }
  31.         ENDCG
  32. }
  33.  
  34. Fallback "Diffuse"
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement