From 11c0e6389542d6c7f1f194a1ce7981c085441e73 Mon Sep 17 00:00:00 2001 From: Marcus Wanners Date: Wed, 12 Aug 2009 01:03:59 +0000 Subject: [PATCH] New shader: sketchy. Makes the screen look like a pencil sketch with a bit of color. --- sketchy.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 sketchy.txt diff --git a/sketchy.txt b/sketchy.txt new file mode 100644 index 0000000000..76f861c453 --- /dev/null +++ b/sketchy.txt @@ -0,0 +1,17 @@ +uniform samplerRECT samp0 : register(s0); + +void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0) +{ + float4 c0 = texRECT(samp0, uv0).rgba; + float4 tmp = float4(0, 0, 0, 0); + tmp += c0 - texRECT(samp0, uv0 + float2(2, 2)).rgba; + tmp += c0 - texRECT(samp0, uv0 - float2(2, 2)).rgba; + tmp += c0 - texRECT(samp0, uv0 + float2(2, -2)).rgba; + tmp += c0 - texRECT(samp0, uv0 - float2(2, -2)).rgba; + float grey = ((0.222 * tmp.r) + (0.707 * tmp.g) + (0.071 * tmp.b)); + // get rid of the bottom line, as it is incorrect. + if (uv0[1] < 163) + tmp = 1; + c0 = c0+1-grey*7; + ocol0 = float4(c0.r, c0.g, c0.b, 1); +} \ No newline at end of file