25 lines
515 B
GLSL
Raw Normal View History

#version 310 es
2024-05-13 18:10:25 +02:00
precision highp float;
layout(location = 0) in vec2 vTexCoord;
layout(location = 0) out vec4 FragColor;
layout(set = 0, binding = 2) uniform highp sampler2D Source;
2024-05-13 18:10:25 +02:00
#include "hdr_common.glsl"
2024-05-13 18:10:25 +02:00
void main()
{
2024-05-13 18:10:25 +02:00
vec4 source = texture(Source, vTexCoord);
vec3 sdr = source.rgb;
vec3 hdr = sdr;
if (settings.inverse_tonemap > 0.0f)
{
2024-05-13 18:10:25 +02:00
hdr = InverseTonemap(sdr);
}
2024-05-13 18:10:25 +02:00
if (settings.hdr10 > 0.0f)
{
2024-05-13 18:10:25 +02:00
hdr = ConvertLinearToHDR10(hdr);
}
2024-05-13 18:10:25 +02:00
FragColor = vec4(hdr, source.a);
}