uniform sampler2D tex;
uniform float glow;
void main(void)
{
	
	vec2 newTCoord=vec2(gl_TexCoord[0]);
         newTCoord*=400.0;
         newTCoord = ceil(newTCoord);
         newTCoord/=400.0;
        vec4 value = texture2D(tex,newTCoord);
vec4 value2 = texture2D(tex,vec2(newTCoord.x-0.01,newTCoord.y));
vec4 value3 = texture2D(tex,vec2(newTCoord.x+0.01,newTCoord.y));
vec4 value4 = texture2D(tex,vec2(newTCoord.x,newTCoord.y+0.01));
vec4 value5 = texture2D(tex,vec2(newTCoord.x,newTCoord.y-0.01));

vec4 value6 = texture2D(tex,vec2(newTCoord.x-0.01,newTCoord.y+0.01));
vec4 value7 = texture2D(tex,vec2(newTCoord.x-0.01,newTCoord.y+0.01));
vec4 value8 = texture2D(tex,vec2(newTCoord.x-0.01,newTCoord.y+0.01));
vec4 value9 = texture2D(tex,vec2(newTCoord.x-0.01,newTCoord.y+0.01));

        float checker =(value.r+value.g+value.b);
checker+= (value2.r+value2.g+value2.b);
checker+= (value3.r+value3.g+value3.b); //length(dot(value,value));
checker+= (value4.r+value4.g+value4.b);
checker+= (value5.r+value5.g+value5.b);

checker+= (value2.r+value6.g+value6.b);
checker+= (value7.r+value3.g+value7.b);
checker+= (value8.r+value8.g+value4.b);
checker+= (value9.r+value9.g+value9.b);

checker/=27.0;


float glower = (101.0-glow)/25.5;//clamp(glow,0.0,99.999);
 checker/=glower*glower;//-99.9;
          value= texture2D(tex,vec2(gl_TexCoord[0]));
          value+=checker;

//now please blur this sample ;)
	gl_FragColor = value;
}

