diffren/shader/tone_map_frag.glsl

16 lines
311 B
Plaintext
Raw Permalink Normal View History

#version 460
layout (location = 0) out vec4 frag_color;
layout (location = 0) uniform sampler2D h_color;
in VS_OUT {
vec2 texcoord;
} fs_in;
void main() {
vec3 hdr = texture(h_color, fs_in.texcoord).rgb;
vec3 ldr = hdr / (hdr + vec3(1.0));
frag_color = vec4(pow(ldr, vec3(1.0/2.2)), 1.0);
}