summaryrefslogtreecommitdiff
path: root/Data/Sys/Shaders/auto_toon.glsl
blob: d4fd1a0bcf3e672fe68ef8c874a689e3d931bf13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
void main()
{
	float4 to_gray = float4(0.3,0.59,0.11,0);

	float x1 = dot(to_gray, SampleOffset(int2( 1, 1)));
	float x0 = dot(to_gray, SampleOffset(int2(-1,-1)));
	float x3 = dot(to_gray, SampleOffset(int2( 1,-1)));
	float x2 = dot(to_gray, SampleOffset(int2(-1, 1)));

	float edge = (x1 - x0) * (x1 - x0) + (x3 - x2) * (x3 - x2);

	float4 color = Sample();

	SetOutput(color - float4(edge, edge, edge, edge) * 12.0);
}