Skip to content

Instantly share code, notes, and snippets.

@isaveu
Forked from EsProgram/SepiaVF.shader
Created May 16, 2016 00:35
Show Gist options
  • Save isaveu/82a7dcb4d9fcda80c6fd0ecf1861f6c0 to your computer and use it in GitHub Desktop.
Save isaveu/82a7dcb4d9fcda80c6fd0ecf1861f6c0 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