From 77795c796fcf137bf5a03c0d895979f112b39ab5 Mon Sep 17 00:00:00 2001 From: vlj Date: Wed, 23 Apr 2014 18:18:43 +0200 Subject: [PATCH] Revert "Revert "Enable tonemap."" This reverts commit e57339841b7f6a58329e3e5997776f492bfccfd3. --- data/shaders/tonemap.frag | 7 ++++--- src/graphics/post_processing.cpp | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/data/shaders/tonemap.frag b/data/shaders/tonemap.frag index 4b08d2cc0..95fd7dc4e 100644 --- a/data/shaders/tonemap.frag +++ b/data/shaders/tonemap.frag @@ -9,8 +9,8 @@ out vec4 FragColor; vec3 getCIEYxy(vec3 rgbColor); vec3 getRGBFromCIEXxy(vec3 YxyColor); -float exposure = .4; -float whitePoint = 1.5; +float exposure = .3; +float whitePoint = 1.; float delta = .1; void main() @@ -22,5 +22,6 @@ void main() vec3 Yxy = getCIEYxy(col.xyz); float Lp = Yxy.r * exposure / avgLuminance; Yxy.r = (Lp * (1. * Lp / (whitePoint * whitePoint))) / (1. + Lp); - FragColor.xyz = getRGBFromCIEXxy(Yxy); + FragColor = vec4(getRGBFromCIEXxy(Yxy), 1.); + } diff --git a/src/graphics/post_processing.cpp b/src/graphics/post_processing.cpp index 38a325ffc..a7a5b6c7f 100644 --- a/src/graphics/post_processing.cpp +++ b/src/graphics/post_processing.cpp @@ -637,10 +637,10 @@ void PostProcessing::render() glDisable(GL_DEPTH_TEST); glDisable(GL_BLEND); -/* computeLogLuminance(in_rtt); + computeLogLuminance(in_rtt); toneMap(out_fbo, in_rtt); std::swap(in_rtt, out_rtt); - std::swap(in_fbo, out_fbo);*/ + std::swap(in_fbo, out_fbo); PROFILER_PUSH_CPU_MARKER("- Bloom", 0xFF, 0x00, 0x00); if (UserConfigParams::m_bloom)