// Colorful FX - Unity Asset // Copyright (c) 2015 - Thomas Hourdel // http://www.thomashourdel.com Shader "Hidden/Colorful/Grayscale" { Properties { _MainTex ("Base (RGB)", 2D) = "white" {} _Params ("Luminance (RGB) Amount (A)", Vector) = (0.30, 0.59, 0.11, 1.0) } SubShader { Pass { ZTest Always Cull Off ZWrite Off Fog { Mode off } CGPROGRAM #pragma vertex vert_img #pragma fragment frag #pragma fragmentoption ARB_precision_hint_fastest #include "UnityCG.cginc" sampler2D _MainTex; half4 _Params; half4 frag(v2f_img i) : SV_Target { half4 color = tex2D(_MainTex, i.uv); half lum = dot(color.rgb, _Params.rgb); half4 result = half4(lum, lum, lum, color.a); return lerp(color, result, _Params.a); } ENDCG } } FallBack off }