Advertisement
Guest User

Unity HLSL/ShaderLab Vertex Colored + pixel lit shader

a guest
Feb 7th, 2014
842
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.69 KB | None | 0 0
  1. Shader "Alpha/VertexLit Colored" {
  2.     Properties {
  3.         _Color ("Main Color", Color) = (1,1,1,1)
  4.         _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
  5.     }
  6.  
  7.     SubShader {
  8.         Tags {
  9.             "Queue" = "Transparent"
  10.             "RenderType" = "Transparent"
  11.         }
  12.         CGPROGRAM
  13.         #pragma surface surf Lambert alpha
  14.         struct Input {
  15.             float4 color : color;
  16.             float2 uv_mainTex;
  17.         };
  18.         sampler2D _MainTex;
  19.         fixed4 _Color;
  20.        
  21.         void surf(Input IN, inout SurfaceOutput o) {
  22.             o.Albedo = tex2D(_MainTex, IN.uv_mainTex).rgb * IN.color.rgb * _Color.rgb;
  23.             o.Alpha = tex2D(_MainTex, IN.uv_mainTex).a * IN.color.a * _Color.a;
  24.             o.Specular = 0.2;
  25.             o.Gloss = 1.0;
  26.         }
  27.         ENDCG
  28.     }
  29.     Fallback "Alpha/VertexLit", 1
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement