/*
   Hejl Dawson tonemap from MariENB
   People claim this one looks realistic???
   (C)2012-2023 Marisa the Magician
*/
vec3 TonemapHejlDawson( vec3 res )
{
	vec3 x = max(vec3(0.),res-.004);
	return (x*(6.2*x+.5))/(x*(6.2*x+1.7)+.06);
}
void main()
{
	vec2 coord = TexCoord;
	vec4 res = texture(InputTexture,coord);
	vec3 mapped = TonemapHejlDawson(pow(max(res.rgb*texposure,0.),vec3(2.2)));
	res.rgb = mix(res.rgb,mapped,tblend);
	FragColor = res;
}
