Advertisement
Guest User

Untitled

a guest
Aug 3rd, 2014
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.23 KB | None | 0 0
  1. Shader "Transparent/Diffuse2" {
  2. Properties {
  3.     _Color ("Main Color", Color) = (1,1,1,1)
  4.     _Color2 ("Main Color2", Color) = (1,1,1,1)
  5.     _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
  6.     _Tex2 ("B", 2D) = "white" {}
  7. }
  8.  
  9. SubShader {
  10.     Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
  11.     LOD 200
  12.  
  13. Pass {
  14.         Material {
  15.                 Diffuse [_Tex2]
  16.                 Diffuse [_MainTex]
  17.                
  18.             }
  19.            
  20.            
  21.             // Apply base texture
  22.             SetTexture [_MainTex] {
  23.                 combine texture
  24.             }
  25.             // Blend in the alpha texture using the lerp operator
  26.             SetTexture [_Tex2] {
  27.                 //constantColor [_Color2]
  28.                 combine texture lerp (texture) previous
  29.             }
  30.         }
  31. CGPROGRAM
  32. #pragma surface surf Lambert alpha
  33.  
  34. sampler2D _MainTex;
  35. sampler2D _Tex2;
  36. fixed4 _Color;
  37. fixed4 _Color2;
  38.  
  39.  
  40.  
  41.  
  42. struct Input {
  43.     float2 uv_MainTex;
  44.     float2 uv_Tex2;
  45. };
  46.  
  47. void surf (Input IN, inout SurfaceOutput o) {
  48.    
  49.    
  50.     fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color;
  51.     fixed4 b = tex2D(_Tex2, IN.uv_Tex2) * _Color2;
  52.    
  53.     o.Albedo = c.rgb;
  54.     o.Alpha = c.a;
  55. }
  56. ENDCG
  57. }
  58.  
  59. Fallback "Transparent/VertexLit"
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement