#version 400

in vec2 fragTexCoord;
out vec4 result;

uniform vec2      texelOffset;
uniform sampler2D inputTex;

void main( void )
{
	bool outOfImage = (fragTexCoord.x < texelOffset.x) || (fragTexCoord.y < texelOffset.y);

	vec4 pixSample = texture( inputTex, fragTexCoord );
	vec4 offSample = outOfImage ? vec4(0.0f) : texture( inputTex, fragTexCoord-texelOffset );
	result = pixSample+offSample;
}