#version 400

uniform sampler2DMS  theRenderTex;
uniform int querySample; 
in vec2 fragTexCoord;
out vec4 result;


// This is the actual code that is executed.
void main( void )
{
	ivec2 iTexCoord = ivec2(textureSize(theRenderTex) * vec2(fragTexCoord.x, 1-fragTexCoord.y));
	
	for(int i = 0; i < 32; i++)
		result += texelFetch(theRenderTex, iTexCoord, i);

	result = result / 32.0f;
}