2021-01-29 01:07:43 +01:00
|
|
|
#version 330 core
|
|
|
|
out vec4 FragColor;
|
|
|
|
|
|
|
|
in vec2 vTexCoords;
|
|
|
|
|
|
|
|
uniform sampler2D scene;
|
|
|
|
uniform sampler2D bloomBlur;
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2021-01-29 02:03:00 +01:00
|
|
|
const float gamma = 1.2;
|
2021-01-29 01:07:43 +01:00
|
|
|
vec3 hdrColor = texture(scene, vTexCoords).rgb;
|
|
|
|
vec3 bloomColor = texture(bloomBlur, vTexCoords).rgb;
|
2021-01-29 02:03:00 +01:00
|
|
|
hdrColor += bloomColor;
|
|
|
|
vec3 result = vec3(1.0) - exp(-hdrColor * 1.0f);
|
2021-01-29 01:07:43 +01:00
|
|
|
result = pow(result, vec3(1.0 / gamma));
|
|
|
|
FragColor = vec4(result, 1.0);
|
|
|
|
}
|