Skip to content

Instantly share code, notes, and snippets.

@EsProgram
Created September 6, 2015 15:11
Show Gist options
  • Save EsProgram/6ed85685d945d07cb64c to your computer and use it in GitHub Desktop.
Save EsProgram/6ed85685d945d07cb64c to your computer and use it in GitHub Desktop.
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