
#version 150

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

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