Skip to content

Instantly share code, notes, and snippets.

@EsProgram
Last active May 16, 2016 00:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save EsProgram/48fb97df3cea0c56172b to your computer and use it in GitHub Desktop.
Save EsProgram/48fb97df3cea0c56172b to your computer and use it in GitHub Desktop.
セピア調シェーダ作ってみた ref: http://qiita.com/Es_Program/items/d6b504550e34522d62bc
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;
c.a = tex.a;
return c;
}
ENDCG
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment