
#version 150

out vec4 out_Color;
in vec2 uv;
uniform sampler2DMS tex;
uniform float exposure;
uniform float maxbright;

void main(void)
{
	vec3 g=vec3(0.0);
	for(int i=0;i<8;i++){
		g = texelFetch(tex, ivec2(gl_FragCoord.xy), i).rgb;
	}
	g *= 0.125;
	vec4 f = vec4(g.r,g.g,g.b,1.0);
	out_Color = f*exposure * (exposure / (maxbright + 1.0)) / (exposure + 1.0);
	//out_Color *= out_Color;
	out_Color = out_Color;

}
