2013-03-07 18:51:57 +00:00
|
|
|
void main()
|
2010-07-05 22:31:03 +00:00
|
|
|
{
|
2014-07-29 17:08:57 +00:00
|
|
|
float4 c0 = Sample();
|
|
|
|
float4 c1 = SampleOffset(int2(-1, 0));
|
|
|
|
float4 c2 = SampleOffset(int2( 0, -1));
|
|
|
|
float4 c3 = SampleOffset(int2( 1, 0));
|
|
|
|
float4 c4 = SampleOffset(int2( 0, 1));
|
2014-05-21 03:47:05 +00:00
|
|
|
|
|
|
|
float red = c0.r;
|
|
|
|
float blue = c0.b;
|
|
|
|
float green = c0.g;
|
|
|
|
|
|
|
|
float red2 = (c1.r + c2.r + c3.r + c4.r) / 4.0;
|
|
|
|
float blue2 = (c1.b + c2.b + c3.b + c4.b) / 4.0;
|
|
|
|
float green2 = (c1.g + c2.g + c3.g + c4.g) / 4.0;
|
|
|
|
|
|
|
|
if (red2 > 0.3)
|
|
|
|
red = c0.r + c0.r / 2.0;
|
|
|
|
else
|
|
|
|
red = c0.r - c0.r / 2.0;
|
|
|
|
|
|
|
|
if (green2 > 0.3)
|
2014-05-05 20:59:49 +00:00
|
|
|
green = c0.g+ c0.g / 2.0;
|
2014-05-21 03:47:05 +00:00
|
|
|
else
|
2014-05-05 20:59:49 +00:00
|
|
|
green = c0.g - c0.g / 2.0;
|
2014-05-21 03:47:05 +00:00
|
|
|
|
|
|
|
if (blue2 > 0.3)
|
2014-05-05 20:59:49 +00:00
|
|
|
blue = c0.b+ c0.b / 2.0;
|
2014-05-21 03:47:05 +00:00
|
|
|
else
|
2014-05-05 20:59:49 +00:00
|
|
|
blue = c0.b - c0.b / 2.0;
|
2014-05-21 03:47:05 +00:00
|
|
|
|
2014-07-29 17:08:57 +00:00
|
|
|
SetOutput(float4(red, green, blue, c0.a));
|
2014-05-05 20:59:49 +00:00
|
|
|
}
|