From 93f495ecb55226434f75897fd7fd00b022759975 Mon Sep 17 00:00:00 2001 From: psi29a Date: Mon, 2 Aug 2021 07:51:53 +0000 Subject: [PATCH] Merge branch 'properly_initialize_lightsettings' into 'master' Properly initialize light settings See merge request OpenMW/openmw!1083 (cherry picked from commit 1f8209158baf6301048bf023651e9b38a9a099b3) 1e52ca2b properly initialize light settings --- components/sceneutil/lightmanager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/sceneutil/lightmanager.cpp b/components/sceneutil/lightmanager.cpp index 2c83c43fe..63a475566 100644 --- a/components/sceneutil/lightmanager.cpp +++ b/components/sceneutil/lightmanager.cpp @@ -884,8 +884,6 @@ namespace SceneUtil std::string lightingMethodString = Settings::Manager::getString("lighting method", "Shaders"); auto lightingMethod = LightManager::getLightingMethodFromString(lightingMethodString); - updateSettings(); - static bool hasLoggedWarnings = false; if (lightingMethod == LightingMethod::SingleUBO && !hasLoggedWarnings) @@ -904,6 +902,8 @@ namespace SceneUtil else initSingleUBO(targetLights); + updateSettings(); + getOrCreateStateSet()->addUniform(new osg::Uniform("PointLightCount", 0)); addCullCallback(new LightManagerCullCallback(this));