Enable tonemap.

This commit is contained in:
vlj 2014-04-21 02:33:12 +02:00
parent 2e1b0ac9f4
commit a0e63dea46
2 changed files with 6 additions and 5 deletions

View File

@ -9,8 +9,8 @@ out vec4 FragColor;
vec3 getCIEYxy(vec3 rgbColor); vec3 getCIEYxy(vec3 rgbColor);
vec3 getRGBFromCIEXxy(vec3 YxyColor); vec3 getRGBFromCIEXxy(vec3 YxyColor);
float exposure = .4; float exposure = .3;
float whitePoint = 1.5; float whitePoint = 1.;
float delta = .1; float delta = .1;
void main() void main()
@ -22,5 +22,6 @@ void main()
vec3 Yxy = getCIEYxy(col.xyz); vec3 Yxy = getCIEYxy(col.xyz);
float Lp = Yxy.r * exposure / avgLuminance; float Lp = Yxy.r * exposure / avgLuminance;
Yxy.r = (Lp * (1. * Lp / (whitePoint * whitePoint))) / (1. + Lp); Yxy.r = (Lp * (1. * Lp / (whitePoint * whitePoint))) / (1. + Lp);
FragColor.xyz = getRGBFromCIEXxy(Yxy); FragColor = vec4(getRGBFromCIEXxy(Yxy), 1.);
} }

View File

@ -637,10 +637,10 @@ void PostProcessing::render()
glDisable(GL_DEPTH_TEST); glDisable(GL_DEPTH_TEST);
glDisable(GL_BLEND); glDisable(GL_BLEND);
/* computeLogLuminance(in_rtt); computeLogLuminance(in_rtt);
toneMap(out_fbo, in_rtt); toneMap(out_fbo, in_rtt);
std::swap(in_rtt, out_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); PROFILER_PUSH_CPU_MARKER("- Bloom", 0xFF, 0x00, 0x00);
if (UserConfigParams::m_bloom) if (UserConfigParams::m_bloom)