Allow to toggle dof off

This commit is contained in:
vlj 2014-05-02 13:44:10 +02:00
parent 3ce6dde466
commit 401471fc18
2 changed files with 9 additions and 3 deletions

View File

@ -458,6 +458,9 @@ namespace UserConfigParams
PARAM_PREFIX BoolUserConfigParam m_dynamic_lights
PARAM_DEFAULT(BoolUserConfigParam(false, "enable_dynamic_lights",
&m_video_group, "Enable Dynamic Lights"));
PARAM_PREFIX BoolUserConfigParam m_dof
PARAM_DEFAULT(BoolUserConfigParam(false, "enable_dof",
&m_video_group, "Enable Depth of Field"));
// ---- Debug - not saved to config file
/** If gamepad debugging is enabled. */

View File

@ -650,9 +650,12 @@ void PostProcessing::render()
glDisable(GL_DEPTH_TEST);
glDisable(GL_BLEND);
renderDoF(out_fbo, in_rtt);
std::swap(in_rtt, out_rtt);
std::swap(in_fbo, out_fbo);
if (UserConfigParams::m_dof)
{
renderDoF(out_fbo, in_rtt);
std::swap(in_rtt, out_rtt);
std::swap(in_fbo, out_fbo);
}
PROFILER_PUSH_CPU_MARKER("- Godrays", 0xFF, 0x00, 0x00);
const bool hasgodrays = World::getWorld()->getTrack()->hasGodRays();