From 64a64a963bd1ecfe48a2d3edca74e60a53e3a8f3 Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Tue, 18 Nov 2014 01:53:02 +0100 Subject: [PATCH] Make shadow condition more coherent --- src/graphics/render.cpp | 2 +- src/graphics/render_lighting.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/graphics/render.cpp b/src/graphics/render.cpp index 9c5352837..9b19c076f 100644 --- a/src/graphics/render.cpp +++ b/src/graphics/render.cpp @@ -342,7 +342,7 @@ void IrrDriver::renderScene(scene::ICameraSceneNode * const camnode, unsigned po { // To avoid wrong culling, use the largest view possible m_scene_manager->setActiveCamera(m_suncam); - if (!m_mipviz && !m_wireframe && UserConfigParams::m_dynamic_lights && + if (UserConfigParams::m_dynamic_lights && UserConfigParams::m_shadows && !irr_driver->needUBOWorkaround() && hasShadow) { PROFILER_PUSH_CPU_MARKER("- Shadow", 0x30, 0x6F, 0x90); diff --git a/src/graphics/render_lighting.cpp b/src/graphics/render_lighting.cpp index fd77c9398..7d6d31253 100644 --- a/src/graphics/render_lighting.cpp +++ b/src/graphics/render_lighting.cpp @@ -163,7 +163,7 @@ void IrrDriver::renderLights(unsigned pointlightcount, bool hasShadow) if (!World::getWorld() || World::getWorld()->getTrack()->hasShadows()) { ScopedGPUTimer timer(irr_driver->getGPUTimer(Q_SUN)); - if (World::getWorld() && UserConfigParams::m_shadows && !irr_driver->needUBOWorkaround()) + if (World::getWorld() && UserConfigParams::m_shadows && !irr_driver->needUBOWorkaround() && hasShadow) m_post_processing->renderShadowedSunlight(sun_ortho_matrix, m_rtts->getShadowFBO().getRTT()[0]); else m_post_processing->renderSunlight();