Postprocessing - lame toon shader. (ok ok I'll stop :p)

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3400 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard 2009-06-09 23:23:33 +00:00
parent 212aa292bc
commit 3717578d7c

View File

@ -0,0 +1,16 @@
uniform samplerRECT samp0 : register(s0);
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
{
float4 to_gray = float4(0.3,0.59,0.11,0);
float x1 = dot(to_gray, texRECT(samp0, uv0+float2(1,1)));
float x0 = dot(to_gray, texRECT(samp0, uv0+float2(-1,-1)));
float x3 = dot(to_gray, texRECT(samp0, uv0+float2(1,-1)));
float x2 = dot(to_gray, texRECT(samp0, uv0+float2(-1,1)));
float edge = (x1 - x0) * (x1 - x0);
float edge2 = (x3 - x2) * (x3 - x2);
edge += edge2;
float4 color = texRECT(samp0, uv0).rgba;
ocol0 = max(color - float4(edge, edge, edge, edge) * 12, float4(0,0,0,0));
}