Created
February 11, 2012 07:31
-
-
Save boj/1797460 to your computer and use it in GitHub Desktop.
Grayscale Shader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader "Custom/Grey Texture" { | |
Properties { | |
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} | |
} | |
SubShader { | |
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"} | |
LOD 200 | |
CGPROGRAM | |
#pragma surface surf Lambert alpha | |
sampler2D _MainTex; | |
struct Input { | |
float2 uv_MainTex; | |
}; | |
void surf (Input IN, inout SurfaceOutput o) { | |
half4 c = tex2D(_MainTex, IN.uv_MainTex); | |
o.Albedo = dot(c.rgb, float3(0.3, 0.59, 0.11)); | |
o.Alpha = c.a; | |
} | |
ENDCG | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment