Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 20th, 2012  |  syntax: None  |  size: 0.56 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Shader "Custom/DiffuseVertexColor" {
  2.         Properties {
  3.                 _MainTex ("Base (RGB)", 2D) = "white" {}
  4.                 _Color("Color",Color) = (1,1,1,1)
  5.         }
  6.         SubShader {
  7.                 Tags { "RenderType"="Opaque" }
  8.                 LOD 200
  9.                
  10.                 CGPROGRAM
  11.                 #pragma surface surf Lambert
  12.  
  13.                 sampler2D _MainTex;
  14.                 float4 _Color;
  15.                
  16.                 struct Input {
  17.                         float2 uv_MainTex;
  18.                         float4 color : COLOR;
  19.                 };
  20.  
  21.                 void surf (Input IN, inout SurfaceOutput o) {
  22.                         half4 c = tex2D (_MainTex, IN.uv_MainTex);
  23.                         o.Albedo = c.rgb * IN.color.rgb * _Color.rgb;
  24.                         o.Alpha = c.a * IN.color.a * _Color.rgb;
  25.                 }
  26.                 ENDCG
  27.         }
  28.         FallBack "Diffuse"
  29. }