2013-03-07 18:51:57 +00:00
|
|
|
void main()
|
2009-08-09 21:40:54 +00:00
|
|
|
{
|
2014-07-29 17:08:57 +00:00
|
|
|
float4 to_gray = float4(0.3,0.59,0.11,0);
|
2011-01-31 00:08:06 +00:00
|
|
|
|
2014-07-29 17:08:57 +00:00
|
|
|
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)));
|
2014-05-21 03:40:18 +00:00
|
|
|
|
|
|
|
float edge = (x1 - x0) * (x1 - x0) + (x3 - x2) * (x3 - x2);
|
|
|
|
|
2014-07-29 17:08:57 +00:00
|
|
|
float4 color = Sample();
|
2014-05-21 03:40:18 +00:00
|
|
|
|
2014-07-29 17:08:57 +00:00
|
|
|
SetOutput(color - float4(edge, edge, edge, edge) * 12.0);
|
2009-08-09 21:40:54 +00:00
|
|
|
}
|