From 3717578d7c0ba48deab43d010aaac28dcb15ecd2 Mon Sep 17 00:00:00 2001 From: hrydgard Date: Tue, 9 Jun 2009 23:23:33 +0000 Subject: [PATCH] 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 --- Data/User/Shaders/auto_toon.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Data/User/Shaders/auto_toon.txt diff --git a/Data/User/Shaders/auto_toon.txt b/Data/User/Shaders/auto_toon.txt new file mode 100644 index 0000000000..7c7e94387d --- /dev/null +++ b/Data/User/Shaders/auto_toon.txt @@ -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)); +}