mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 13:27:45 -07:00
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:
parent
212aa292bc
commit
3717578d7c
16
Data/User/Shaders/auto_toon.txt
Normal file
16
Data/User/Shaders/auto_toon.txt
Normal 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));
|
||||
}
|
Loading…
Reference in New Issue
Block a user