History

Move localLightingEnabled *back* to LightingModel :p

Ada committed 11 months ago

Commit 723ae4a1 parent 475d45e6 files · +23 −46Browse files

Showing the changes to interface/src/scripting/RenderScriptingInterface.cpp (1 of 6 files). Show all

Unified · Split

interface/src/scripting/RenderScriptingInterface.cpp+1−32
@@ -20,7 +20,6 @@ · 19 unmodified lines
2020 #include "ScreenName.h"
2121
2222 #include <procedural/Procedural.h>
23−#include "LightClusters.h"
2423
2524 STATIC_SCRIPT_TYPES_INITIALIZER((+[](ScriptManager* manager){
2625 auto scriptEngine = manager->engine().get();
@@ -247,36 +246,6 @@ void RenderScriptingInterface::forceAmbientOcclusionEnabled(bool enabled) { · 220 unmodified lines
247246 });
248247 }
249248
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−
280249 bool RenderScriptingInterface::getLocalLightingEnabled() const {
281250 return _localLightingEnabled;
282251 }
@@ -294,7 +263,7 @@ void RenderScriptingInterface::forceLocalLightingEnabled(bool enabled) { · 11 unmodified lines
294263 _localLightingSetting.set(enabled);
295264 Menu::getInstance()->setIsOptionChecked(MenuOption::LocalLights, enabled);
296265
297− recursivelyUpdateLocalLightingSetting("", enabled);
266+ recursivelyUpdateLightingModel("", [enabled] (MakeLightingModelConfig *config) { config->setLocalLighting(enabled); });
298267 });
299268 }
300269