-
-
Save isaveu/82a7dcb4d9fcda80c6fd0ecf1861f6c0 to your computer and use it in GitHub Desktop.
セピア調シェーダ作ってみた ref: http://qiita.com/Es_Program/items/d6b504550e34522d62bc
This file contains 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; | |
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