Showing the changes to interface/src/scripting/RenderScriptingInterface.cpp (1 of 6 files). Show all
Unified · Split
| @@ -20,7 +20,6 @@ · 19 unmodified lines | |||
| 20 | #include "ScreenName.h" | 20 | #include "ScreenName.h" |
| 21 | 21 | ||
| 22 | #include <procedural/Procedural.h> | 22 | #include <procedural/Procedural.h> |
| 23 | #include "LightClusters.h" | ||
| 24 | 23 | ||
| 25 | STATIC_SCRIPT_TYPES_INITIALIZER((+[](ScriptManager* manager){ | 24 | STATIC_SCRIPT_TYPES_INITIALIZER((+[](ScriptManager* manager){ |
| 26 | auto scriptEngine = manager->engine().get(); | 25 | auto scriptEngine = manager->engine().get(); |
| @@ -247,36 +246,6 @@ void RenderScriptingInterface::forceAmbientOcclusionEnabled(bool enabled) { · 220 unmodified lines | |||
| 247 | }); | 246 | }); |
| 248 | } | 247 | } |
| 249 | 248 | ||
| 250 | static void recursivelyUpdateLocalLightingSetting(const QString& parentTaskName, bool enabled, int depth = -1) { | ||
| 251 | auto renderConfig = qApp->getRenderEngine()->getConfiguration(); | ||
| 252 | |||
| 253 | if (depth == -1) { | ||
| 254 | auto secondaryLightPassConfig = renderConfig->getConfig<LightClusteringPass>("RenderSecondView.LightClustering"); | ||
| 255 | if (secondaryLightPassConfig) { | ||
| 256 | secondaryLightPassConfig->setLocalLightingEnabled(enabled); | ||
| 257 | } | ||
| 258 | |||
| 259 | auto mainLightPassConfig = renderConfig->getConfig<LightClusteringPass>("RenderMainView.LightClustering"); | ||
| 260 | if (mainLightPassConfig) { | ||
| 261 | mainLightPassConfig->setLocalLightingEnabled(enabled); | ||
| 262 | qDebug() << "RenderMainView.LightClustering" << mainLightPassConfig->localLightingEnabled; | ||
| 263 | } | ||
| 264 | |||
| 265 | recursivelyUpdateLocalLightingSetting("RenderMainView", enabled, depth + 1); | ||
| 266 | } else if (depth == RenderMirrorTask::MAX_MIRROR_DEPTH) { | ||
| 267 | return; | ||
| 268 | } | ||
| 269 | |||
| 270 | for (size_t mirrorIndex = 0; mirrorIndex < RenderMirrorTask::MAX_MIRRORS_PER_LEVEL; mirrorIndex++) { | ||
| 271 | std::string mirrorTaskString = parentTaskName.toStdString() + ".RenderMirrorView" + std::to_string(mirrorIndex) + "Depth" + std::to_string(depth); | ||
| 272 | auto lightPassConfig = renderConfig->getConfig<LightClusteringPass>(mirrorTaskString + ".LightClustering"); | ||
| 273 | if (lightPassConfig) { | ||
| 274 | lightPassConfig->setLocalLightingEnabled(enabled); | ||
| 275 | recursivelyUpdateLocalLightingSetting(QString::fromStdString(mirrorTaskString), enabled, depth + 1); | ||
| 276 | } | ||
| 277 | } | ||
| 278 | } | ||
| 279 | |||
| 280 | bool RenderScriptingInterface::getLocalLightingEnabled() const { | 249 | bool RenderScriptingInterface::getLocalLightingEnabled() const { |
| 281 | return _localLightingEnabled; | 250 | return _localLightingEnabled; |
| 282 | } | 251 | } |
| @@ -294,7 +263,7 @@ void RenderScriptingInterface::forceLocalLightingEnabled(bool enabled) { · 11 unmodified lines | |||
| 294 | _localLightingSetting.set(enabled); | 263 | _localLightingSetting.set(enabled); |
| 295 | Menu::getInstance()->setIsOptionChecked(MenuOption::LocalLights, enabled); | 264 | Menu::getInstance()->setIsOptionChecked(MenuOption::LocalLights, enabled); |
| 296 | 265 | ||
| 297 | recursivelyUpdateLocalLightingSetting("", enabled); | 266 | recursivelyUpdateLightingModel("", [enabled] (MakeLightingModelConfig *config) { config->setLocalLighting(enabled); }); |
| 298 | }); | 267 | }); |
| 299 | } | 268 | } |
| 300 | 269 | ||