2013-03-07 11:51:57 -07:00
|
|
|
uniform sampler2D samp9;
|
2011-01-30 17:08:06 -07:00
|
|
|
|
2013-03-07 11:51:57 -07:00
|
|
|
out vec4 ocol0;
|
|
|
|
in vec2 uv0;
|
|
|
|
|
|
|
|
uniform vec4 resolution;
|
|
|
|
|
|
|
|
void main()
|
2011-01-30 17:08:06 -07:00
|
|
|
{
|
2013-03-07 11:51:57 -07:00
|
|
|
float4 c0 = texture(samp9, uv0);
|
2014-05-05 14:59:49 -06:00
|
|
|
float4 c1 = texture(samp9, uv0 - float2(1.0, 0.0)*resolution.zw);
|
|
|
|
float4 c2 = texture(samp9, uv0 - float2(0.0, 1.0)*resolution.zw);
|
|
|
|
float4 c3 = texture(samp9, uv0 + float2(1.0, 0.0)*resolution.zw);
|
|
|
|
float4 c4 = texture(samp9, uv0 + float2(0.0, 1.0)*resolution.zw);
|
2011-01-30 17:08:06 -07:00
|
|
|
|
|
|
|
float red = c0.r;
|
|
|
|
float blue = c0.b;
|
|
|
|
float green = c0.g;
|
|
|
|
|
2014-05-05 14:59:49 -06:00
|
|
|
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;
|
2011-01-30 17:08:06 -07:00
|
|
|
|
|
|
|
if(red2 > 0.3)
|
2014-05-05 14:59:49 -06:00
|
|
|
red = c0.r + c0.r / 2.0;
|
2011-01-30 17:08:06 -07:00
|
|
|
else
|
2014-05-05 14:59:49 -06:00
|
|
|
red = c0.r - c0.r / 2.0;
|
2011-01-30 17:08:06 -07:00
|
|
|
|
|
|
|
if(green2 > 0.3)
|
2014-05-05 14:59:49 -06:00
|
|
|
green = c0.g+ c0.g / 2.0;
|
2011-01-30 17:08:06 -07:00
|
|
|
else
|
2014-05-05 14:59:49 -06:00
|
|
|
green = c0.g - c0.g / 2.0;
|
2011-01-30 17:08:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
if(blue2 > 0.3)
|
2014-05-05 14:59:49 -06:00
|
|
|
blue = c0.b+ c0.b / 2.0;
|
2011-01-30 17:08:06 -07:00
|
|
|
else
|
2014-05-05 14:59:49 -06:00
|
|
|
blue = c0.b - c0.b / 2.0;
|
2011-01-30 17:08:06 -07:00
|
|
|
|
|
|
|
ocol0 = float4(red, green, blue, c0.a);
|
2014-05-05 14:59:49 -06:00
|
|
|
}
|