Created
September 6, 2015 15:11
-
-
Save EsProgram/6ed85685d945d07cb64c to your computer and use it in GitHub Desktop.
This file contains hidden or 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/SepiaVF"{ | |
Properties{ | |
_MainTex("Main", 2D) = "black"{} | |
} | |
SubShader{ | |
Lighting Off | |
Pass{ | |
CGPROGRAM | |
#pragma vertex vert_img | |
#pragma fragment frag | |
#include "UnityCG.cginc" | |
sampler2D _MainTex; | |
float4 frag(v2f_img i) :COLOR{ | |
float4 tex = tex2D(_MainTex, i.uv); | |
float4 c; | |
c.r = tex.r*0.393 + tex.g*0.769 + tex.b*0.189; | |
c.g = tex.r*0.349 + tex.g*0.686 + tex.b*0.168; | |
c.b = tex.r*0.272 + tex.g*0.534 + tex.b*0.131; | |
return c; | |
} | |
ENDCG | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment