From 78d303b23909c2edcf6e91a9b4d106fc238c8c53 Mon Sep 17 00:00:00 2001 From: Jacob Smith Date: Sat, 26 Jul 2025 18:47:32 +0800 Subject: [PATCH 1/7] Added support for `Video -> resolution scale = 0.1 to 1.0`. --- apps/openmw/mwrender/postprocessor.cpp | 53 ++++++++++++++++++----- apps/openmw/mwrender/postprocessor.hpp | 2 + apps/openmw/mwrender/renderingmanager.cpp | 12 ++++- components/settings/categories/video.hpp | 2 + files/settings-default.cfg | 3 ++ 5 files changed, 60 insertions(+), 12 deletions(-) diff --git a/apps/openmw/mwrender/postprocessor.cpp b/apps/openmw/mwrender/postprocessor.cpp index a06b9a83de..cfa673d4a5 100644 --- a/apps/openmw/mwrender/postprocessor.cpp +++ b/apps/openmw/mwrender/postprocessor.cpp @@ -125,6 +125,8 @@ namespace MWRender , mSamples(Settings::video().mAntialiasing) , mPingPongCull(new PingPongCull(this)) , mDistortionCallback(new DistortionCallback) + , mScaledViewportStateSet(new osg::StateSet) + , mScaledViewport(new osg::Viewport) { auto& shaderManager = mRendering.getResourceSystem()->getSceneManager()->getShaderManager(); @@ -148,6 +150,9 @@ namespace MWRender mHUDCamera->setCullCallback(new HUDCullCallback); mViewer->getCamera()->addCullCallback(mPingPongCull); + // Initialize scaled viewport state set + mScaledViewportStateSet->setAttribute(mScaledViewport); + // resolves the multisampled depth buffer and optionally draws an additional depth postpass mTransparentDepthPostPass = new TransparentDepthBinCallback(mRendering.getResourceSystem()->getSceneManager()->getShaderManager(), @@ -276,13 +281,27 @@ namespace MWRender void PostProcessor::traverse(osg::NodeVisitor& nv) { size_t frameId = nv.getTraversalNumber() % 2; + bool pushedStateSet = false; if (nv.getVisitorType() == osg::NodeVisitor::CULL_VISITOR) - cull(frameId, static_cast(&nv)); + { + // Push a small, scaled viewport for all children. This will be overridden by the HUD camera's callback. + osgUtil::CullVisitor* cv = static_cast(&nv); + mScaledViewport->setViewport(0, 0, renderWidth(), renderHeight()); + cv->pushStateSet(mScaledViewportStateSet.get()); + pushedStateSet = true; + + cull(frameId, cv); + } else if (nv.getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR) update(frameId); osg::Group::traverse(nv); + + if (pushedStateSet) + { + static_cast(&nv)->popStateSet(); + } } void PostProcessor::cull(size_t frameId, osgUtil::CullVisitor* cv) @@ -567,9 +586,10 @@ namespace MWRender std::vector attachmentsToDirty; - for (const auto& technique : mTechniques) + for (auto tech_it = mTechniques.begin(); tech_it != mTechniques.end(); ++tech_it) { - if (!technique->isValid()) + const auto& technique = *tech_it; + if (!technique || !technique->isValid()) continue; if (technique->getGLSLVersion() > mGLSLVersion) @@ -635,8 +655,9 @@ namespace MWRender uniform->mName.c_str(), *type, uniform->getNumElements())); } - for (const auto& pass : technique->getPasses()) + for (auto pass_it = technique->getPasses().begin(); pass_it != technique->getPasses().end(); ++pass_it) { + const auto& pass = *pass_it; int subTexUnit = texUnit; Fx::DispatchNode::SubPass subPass; @@ -644,6 +665,10 @@ namespace MWRender node.mHandle = technique; + // Check if this is the absolute final pass of the entire post-processing chain. + bool isFinalPass + = (std::next(tech_it) == mTechniques.end() && std::next(pass_it) == technique->getPasses().end()); + if (!pass->getTarget().empty()) { auto& renderTarget = technique->getRenderTargetsMap()[pass->getTarget()]; @@ -676,6 +701,14 @@ namespace MWRender attachmentsToDirty.push_back(Fx::Types::RenderTarget(renderTarget)); } } + else if (!isFinalPass) + { + // This is an intermediate pass that renders to a ping-pong buffer. + // It must use the small, scaled viewport. + subPass.mStateSet->setAttribute(new osg::Viewport(0, 0, renderWidth(), renderHeight())); + } + // else: This is the final pass. We do *not* set a viewport, allowing it + // to inherit the full-sized one from the HUD camera to correctly fill the screen. for (const auto& name : pass->getRenderTargets()) { @@ -858,16 +891,16 @@ namespace MWRender int PostProcessor::renderWidth() const { - if (Stereo::getStereo()) - return Stereo::Manager::instance().eyeResolution().x(); - return mWidth; + float scale = static_cast(Settings::video().mResolutionScale); + int baseWidth = Stereo::getStereo() ? Stereo::Manager::instance().eyeResolution().x() : mWidth; + return std::max(1, static_cast(baseWidth * scale)); } int PostProcessor::renderHeight() const { - if (Stereo::getStereo()) - return Stereo::Manager::instance().eyeResolution().y(); - return mHeight; + float scale = static_cast(Settings::video().mResolutionScale); + int baseHeight = Stereo::getStereo() ? Stereo::Manager::instance().eyeResolution().y() : mHeight; + return std::max(1, static_cast(baseHeight * scale)); } void PostProcessor::triggerShaderReload() diff --git a/apps/openmw/mwrender/postprocessor.hpp b/apps/openmw/mwrender/postprocessor.hpp index f81a50e9d6..489df5606b 100644 --- a/apps/openmw/mwrender/postprocessor.hpp +++ b/apps/openmw/mwrender/postprocessor.hpp @@ -268,6 +268,8 @@ namespace MWRender std::array, 2> mCanvases; osg::ref_ptr mTransparentDepthPostPass; osg::ref_ptr mDistortionCallback; + osg::ref_ptr mScaledViewportStateSet; + osg::ref_ptr mScaledViewport; Fx::DispatchArray mTemplateData; }; diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index 67d1cfb587..d03fb5d89f 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -1,5 +1,6 @@ #include "renderingmanager.hpp" +#include #include #include @@ -1382,15 +1383,18 @@ namespace MWRender mSharedUniformStateUpdater->setNear(mNearClip); mSharedUniformStateUpdater->setFar(mViewDistance); + + float scale = static_cast(Settings::video().mResolutionScale); + if (Stereo::getStereo()) { auto res = Stereo::Manager::instance().eyeResolution(); - mSharedUniformStateUpdater->setScreenRes(res.x(), res.y()); + mSharedUniformStateUpdater->setScreenRes(res.x() * scale, res.y() * scale); Stereo::Manager::instance().setMasterProjectionMatrix(mPerViewUniformStateUpdater->getProjectionMatrix()); } else { - mSharedUniformStateUpdater->setScreenRes(width, height); + mSharedUniformStateUpdater->setScreenRes(width * scale, height * scale); } // Since our fog is not radial yet, we should take FOV in account, otherwise terrain near viewing distance may @@ -1520,6 +1524,10 @@ namespace MWRender { updateProjection = true; } + else if (it->first == "Video" && it->second == "resolution scale") + { + mPostProcessor->resize(); + } else if (it->first == "Camera" && it->second == "viewing distance") { setViewDistance(Settings::camera().mViewingDistance); diff --git a/components/settings/categories/video.hpp b/components/settings/categories/video.hpp index fed3fd8489..e34166b6b1 100644 --- a/components/settings/categories/video.hpp +++ b/components/settings/categories/video.hpp @@ -22,6 +22,8 @@ namespace Settings SettingValue mResolutionX{ mIndex, "Video", "resolution x", makeMaxSanitizerInt(1) }; SettingValue mResolutionY{ mIndex, "Video", "resolution y", makeMaxSanitizerInt(1) }; + SettingValue mResolutionScale{ mIndex, "Video", "resolution scale", + makeClampStrictMaxSanitizerFloat(0.1, 1.0) }; SettingValue mWindowMode{ mIndex, "Video", "window mode" }; SettingValue mScreen{ mIndex, "Video", "screen", makeMaxSanitizerInt(0) }; SettingValue mMinimizeOnFocusLoss{ mIndex, "Video", "minimize on focus loss" }; diff --git a/files/settings-default.cfg b/files/settings-default.cfg index 2c4bbab953..9a50ee1ba0 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -639,6 +639,9 @@ doppler factor = 0.25 resolution x = 800 resolution y = 600 +# Resolution scaling +resolution scale = 1.0 + # Specify the window mode. # 0 = Fullscreen, 1 = Windowed Fullscreen, 2 = Windowed window mode = 2 From e4740996d297b913440ea8de6b669aaf0d25c999 Mon Sep 17 00:00:00 2001 From: bmdhacks Date: Sat, 30 Aug 2025 14:50:24 -0700 Subject: [PATCH 2/7] added Resolution Scale to the UI with some LLM translations and removed some excessive comments. --- apps/openmw/mwrender/postprocessor.cpp | 9 +---- files/data/l10n/OMWEngine/de.yaml | 1 + files/data/l10n/OMWEngine/en.yaml | 1 + files/data/l10n/OMWEngine/fr.yaml | 1 + files/data/l10n/OMWEngine/pl.yaml | 1 + files/data/l10n/OMWEngine/ru.yaml | 1 + files/data/l10n/OMWEngine/sv.yaml | 1 + .../data/mygui/openmw_settings_window.layout | 40 +++++++++++++++---- 8 files changed, 40 insertions(+), 15 deletions(-) diff --git a/apps/openmw/mwrender/postprocessor.cpp b/apps/openmw/mwrender/postprocessor.cpp index cfa673d4a5..754719d2b0 100644 --- a/apps/openmw/mwrender/postprocessor.cpp +++ b/apps/openmw/mwrender/postprocessor.cpp @@ -150,7 +150,6 @@ namespace MWRender mHUDCamera->setCullCallback(new HUDCullCallback); mViewer->getCamera()->addCullCallback(mPingPongCull); - // Initialize scaled viewport state set mScaledViewportStateSet->setAttribute(mScaledViewport); // resolves the multisampled depth buffer and optionally draws an additional depth postpass @@ -285,7 +284,6 @@ namespace MWRender if (nv.getVisitorType() == osg::NodeVisitor::CULL_VISITOR) { - // Push a small, scaled viewport for all children. This will be overridden by the HUD camera's callback. osgUtil::CullVisitor* cv = static_cast(&nv); mScaledViewport->setViewport(0, 0, renderWidth(), renderHeight()); cv->pushStateSet(mScaledViewportStateSet.get()); @@ -665,7 +663,6 @@ namespace MWRender node.mHandle = technique; - // Check if this is the absolute final pass of the entire post-processing chain. bool isFinalPass = (std::next(tech_it) == mTechniques.end() && std::next(pass_it) == technique->getPasses().end()); @@ -703,12 +700,10 @@ namespace MWRender } else if (!isFinalPass) { - // This is an intermediate pass that renders to a ping-pong buffer. - // It must use the small, scaled viewport. subPass.mStateSet->setAttribute(new osg::Viewport(0, 0, renderWidth(), renderHeight())); } - // else: This is the final pass. We do *not* set a viewport, allowing it - // to inherit the full-sized one from the HUD camera to correctly fill the screen. + // else do *not* set a scaled viewport, allowing it to inherit the full-sized one from the + // HUD camera to correctly fill the screen for (const auto& name : pass->getRenderTargets()) { diff --git a/files/data/l10n/OMWEngine/de.yaml b/files/data/l10n/OMWEngine/de.yaml index 782ae50824..d561a3f5c0 100644 --- a/files/data/l10n/OMWEngine/de.yaml +++ b/files/data/l10n/OMWEngine/de.yaml @@ -176,6 +176,7 @@ ReflectionShaderDetailTerrain: "Terrain" ReflectionShaderDetailWorld: "Welt" Refraction: "Lichtbrechung" ResetControls: "Tastenbelegungen zurücksetzen" +ResolutionScale: "Auflösungsskalierung" Screenshot: "Screenshot" Scripts: "Skripte" ScriptsDisabled: "Laden Sie einen Spielstand, um auf die Skripteinstellungen zugreifen zu können." diff --git a/files/data/l10n/OMWEngine/en.yaml b/files/data/l10n/OMWEngine/en.yaml index 4ec744ce80..e89b97b4ab 100644 --- a/files/data/l10n/OMWEngine/en.yaml +++ b/files/data/l10n/OMWEngine/en.yaml @@ -176,6 +176,7 @@ ReflectionShaderDetailTerrain: "Terrain" ReflectionShaderDetailWorld: "World" Refraction: "Refraction" ResetControls: "Reset Controls" +ResolutionScale: "Resolution Scale" Screenshot: "Screenshot" Scripts: "Scripts" ScriptsDisabled: "Load a game to access script settings." diff --git a/files/data/l10n/OMWEngine/fr.yaml b/files/data/l10n/OMWEngine/fr.yaml index 808d15b4d8..eeb4e12ccc 100644 --- a/files/data/l10n/OMWEngine/fr.yaml +++ b/files/data/l10n/OMWEngine/fr.yaml @@ -176,6 +176,7 @@ ReflectionShaderDetailTerrain: "Terrain" ReflectionShaderDetailWorld: "Monde" Refraction: "Réfraction" ResetControls: "Réinitialiser les contrôles" +ResolutionScale: "Échelle de résolution" Screenshot: "Capture d'écran" Scripts: "Scripts" ScriptsDisabled: "Chargez une sauvegarde pour accéder aux paramètres des scripts." diff --git a/files/data/l10n/OMWEngine/pl.yaml b/files/data/l10n/OMWEngine/pl.yaml index 58310954e2..38cc12a49b 100644 --- a/files/data/l10n/OMWEngine/pl.yaml +++ b/files/data/l10n/OMWEngine/pl.yaml @@ -176,6 +176,7 @@ ReflectionShaderDetailTerrain: "Teren" ReflectionShaderDetailWorld: "Świat" Refraction: "Załamanie światła" ResetControls: "Przywróć sterowanie" +ResolutionScale: "Skalowanie rozdzielczości" Screenshot: "Zrzut ekranu" Scripts: "Skrypty" ScriptsDisabled: "Wczytaj grę, aby uzyskać dostęp do ustawień skryptów." diff --git a/files/data/l10n/OMWEngine/ru.yaml b/files/data/l10n/OMWEngine/ru.yaml index b780ba1e05..b53d84bb2e 100644 --- a/files/data/l10n/OMWEngine/ru.yaml +++ b/files/data/l10n/OMWEngine/ru.yaml @@ -176,6 +176,7 @@ ReflectionShaderDetailTerrain: "Ландшафт" ReflectionShaderDetailWorld: "Мир" Refraction: "Рефракция" ResetControls: "Сбросить" +ResolutionScale: "Масштаб разрешения" Screenshot: "Снимок экрана" Scripts: "Скрипты" ScriptsDisabled: "Загрузите игру, чтобы получить доступ к настройкам скриптов." diff --git a/files/data/l10n/OMWEngine/sv.yaml b/files/data/l10n/OMWEngine/sv.yaml index c5ad166849..0b006cc6d9 100644 --- a/files/data/l10n/OMWEngine/sv.yaml +++ b/files/data/l10n/OMWEngine/sv.yaml @@ -177,6 +177,7 @@ ReflectionShaderDetailTerrain: "Terräng" ReflectionShaderDetailWorld: "Värld" Refraction: "Refraktion" ResetControls: "Återställ kontroller" +ResolutionScale: "Upplösningsskala" Screenshot: "Skärmdump" Scripts: "Skript" ScriptsDisabled: "Ladda ett spel för att nå skriptinställningar." diff --git a/files/data/mygui/openmw_settings_window.layout b/files/data/mygui/openmw_settings_window.layout index e6f42248dd..7d221261e0 100644 --- a/files/data/mygui/openmw_settings_window.layout +++ b/files/data/mygui/openmw_settings_window.layout @@ -327,9 +327,33 @@ - + + - + + + + + + + + + + + + + + + + + + + + + + + + @@ -341,18 +365,18 @@ - + - + - + - + @@ -362,11 +386,11 @@ - + - + From 1360e6eac574fbbdda0c77d36ed2dd99e4e508c2 Mon Sep 17 00:00:00 2001 From: bmdhacks Date: Thu, 4 Sep 2025 14:54:19 -0700 Subject: [PATCH 3/7] add lua bindings --- apps/openmw/mwlua/camerabindings.cpp | 4 ++++ apps/openmw/mwrender/renderingmanager.cpp | 16 ++++++++++++++++ apps/openmw/mwrender/renderingmanager.hpp | 3 +++ 3 files changed, 23 insertions(+) diff --git a/apps/openmw/mwlua/camerabindings.cpp b/apps/openmw/mwlua/camerabindings.cpp index 454f966538..b2bc2793b3 100644 --- a/apps/openmw/mwlua/camerabindings.cpp +++ b/apps/openmw/mwlua/camerabindings.cpp @@ -96,6 +96,10 @@ namespace MWLua api["setViewDistance"] = [renderingManager](const FiniteFloat d) { renderingManager->setViewDistance(d, true); }; + api["getResolutionScale"] = [renderingManager]() { return renderingManager->getResolutionScale(); }; + api["setResolutionScale"] + = [renderingManager](const FiniteFloat scale) { renderingManager->setResolutionScale(scale); }; + api["getViewTransform"] = [camera]() { return LuaUtil::TransformM{ camera->getViewMatrix() }; }; api["viewportToWorldVector"] = [camera, renderingManager](osg::Vec2f pos) -> osg::Vec3f { diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index d03fb5d89f..d317b7098a 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -1618,6 +1618,22 @@ namespace MWRender updateProjectionMatrix(); } + float RenderingManager::getResolutionScale() const + { + return Settings::video().mResolutionScale; + } + + void RenderingManager::setResolutionScale(float scale) + { + scale = std::clamp(scale, 0.1f, 1.0f); + Settings::video().mResolutionScale.set(scale); + + if (mPostProcessor) + { + mPostProcessor->resize(); + } + } + float RenderingManager::getTerrainHeightAt(const osg::Vec3f& pos, ESM::RefId worldspace) { return getWorldspaceChunkMgr(worldspace).mTerrain->getHeightAt(pos); diff --git a/apps/openmw/mwrender/renderingmanager.hpp b/apps/openmw/mwrender/renderingmanager.hpp index 4723c59b8a..6c3d153f4e 100644 --- a/apps/openmw/mwrender/renderingmanager.hpp +++ b/apps/openmw/mwrender/renderingmanager.hpp @@ -230,6 +230,9 @@ namespace MWRender void setViewDistance(float distance, bool delay = false); + float getResolutionScale() const; + void setResolutionScale(float scale); + float getTerrainHeightAt(const osg::Vec3f& pos, ESM::RefId worldspace); // camera stuff From 280f3f1af90f0f8f934789114502764c40b281d4 Mon Sep 17 00:00:00 2001 From: bmdhacks Date: Thu, 4 Sep 2025 19:13:55 -0700 Subject: [PATCH 4/7] incorporate feedback about invalid techniques --- apps/openmw/mwrender/postprocessor.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/apps/openmw/mwrender/postprocessor.cpp b/apps/openmw/mwrender/postprocessor.cpp index 754719d2b0..8cc467a8c3 100644 --- a/apps/openmw/mwrender/postprocessor.cpp +++ b/apps/openmw/mwrender/postprocessor.cpp @@ -584,10 +584,11 @@ namespace MWRender std::vector attachmentsToDirty; - for (auto tech_it = mTechniques.begin(); tech_it != mTechniques.end(); ++tech_it) + // Filter techniques to only include valid ones + std::vector> validTechniques; + for (const auto& technique : mTechniques) { - const auto& technique = *tech_it; - if (!technique || !technique->isValid()) + if (!technique->isValid()) continue; if (technique->getGLSLVersion() > mGLSLVersion) @@ -596,6 +597,12 @@ namespace MWRender << technique->getGLSLVersion() << " which is unsupported by your hardware."; continue; } + validTechniques.push_back(technique); + } + + for (size_t tech_idx = 0; tech_idx < validTechniques.size(); ++tech_idx) + { + const auto& technique = validTechniques[tech_idx]; Fx::DispatchNode node; @@ -653,9 +660,10 @@ namespace MWRender uniform->mName.c_str(), *type, uniform->getNumElements())); } - for (auto pass_it = technique->getPasses().begin(); pass_it != technique->getPasses().end(); ++pass_it) + const auto& passes = technique->getPasses(); + for (size_t pass_idx = 0; pass_idx < passes.size(); ++pass_idx) { - const auto& pass = *pass_it; + const auto& pass = passes[pass_idx]; int subTexUnit = texUnit; Fx::DispatchNode::SubPass subPass; @@ -663,8 +671,7 @@ namespace MWRender node.mHandle = technique; - bool isFinalPass - = (std::next(tech_it) == mTechniques.end() && std::next(pass_it) == technique->getPasses().end()); + bool isFinalPass = (tech_idx == validTechniques.size() - 1 && pass_idx == passes.size() - 1); if (!pass->getTarget().empty()) { @@ -702,8 +709,6 @@ namespace MWRender { subPass.mStateSet->setAttribute(new osg::Viewport(0, 0, renderWidth(), renderHeight())); } - // else do *not* set a scaled viewport, allowing it to inherit the full-sized one from the - // HUD camera to correctly fill the screen for (const auto& name : pass->getRenderTargets()) { From be07f6f44970cc60296e417e76e49cd679971dfb Mon Sep 17 00:00:00 2001 From: bmdhacks Date: Sat, 6 Sep 2025 10:06:00 -0700 Subject: [PATCH 5/7] add documentation for resolution scale --- .../source/reference/modding/settings/video.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/source/reference/modding/settings/video.rst b/docs/source/reference/modding/settings/video.rst index 1180403d30..63881e0398 100644 --- a/docs/source/reference/modding/settings/video.rst +++ b/docs/source/reference/modding/settings/video.rst @@ -23,6 +23,23 @@ Video Settings Larger values produce more detailed images within the constraints of your graphics hardware, but may reduce the frame rate. +.. omw-setting:: + :title: resolution scale + :type: float + :range: 0.1 to 1.0 + :default: 1.0 + :location: :bdg-info:`In Game > Options > Video` + + This setting controls the internal rendering resolution as a percentage of the window resolution. + Values below 1.0 render the game at a lower resolution and upscale to the window size. + For example, 0.5 on a 2560x1440 display would render at 1280x720 internally, + providing substantial performance improvements on GPU-limited systems while maintaining UI elements at full resolution. + + .. note:: + This setting is primarily intended for low-powered devices with high-DPI displays + (such as retro handhelds or low-powered Android phones). On desktop systems with adequate GPUs, + this should typically remain at 1.0 for optimal image quality. + .. omw-setting:: :title: window mode :type: int From 82338e221a6ad03853d69b9a881dbb07d3b4ea41 Mon Sep 17 00:00:00 2001 From: bmdhacks Date: Sat, 6 Sep 2025 12:48:20 -0700 Subject: [PATCH 6/7] In which our hero doesn't read his reviews and misses simple feedback --- apps/openmw/mwrender/postprocessor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwrender/postprocessor.cpp b/apps/openmw/mwrender/postprocessor.cpp index 8cc467a8c3..20cda88558 100644 --- a/apps/openmw/mwrender/postprocessor.cpp +++ b/apps/openmw/mwrender/postprocessor.cpp @@ -586,8 +586,9 @@ namespace MWRender // Filter techniques to only include valid ones std::vector> validTechniques; - for (const auto& technique : mTechniques) + for (auto tech_it = mTechniques.begin(); tech_it != mTechniques.end(); ++tech_it) { + const auto& technique = *tech_it; if (!technique->isValid()) continue; From 49379ecea3e53cee47187d278bca2df2ed288b82 Mon Sep 17 00:00:00 2001 From: bmdhacks Date: Sat, 6 Sep 2025 15:16:04 -0700 Subject: [PATCH 7/7] clang-tidy --- apps/openmw/mwrender/postprocessor.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/openmw/mwrender/postprocessor.cpp b/apps/openmw/mwrender/postprocessor.cpp index 20cda88558..7f75d5512b 100644 --- a/apps/openmw/mwrender/postprocessor.cpp +++ b/apps/openmw/mwrender/postprocessor.cpp @@ -586,9 +586,9 @@ namespace MWRender // Filter techniques to only include valid ones std::vector> validTechniques; - for (auto tech_it = mTechniques.begin(); tech_it != mTechniques.end(); ++tech_it) + for (auto techIt = mTechniques.begin(); techIt != mTechniques.end(); ++techIt) { - const auto& technique = *tech_it; + const auto& technique = *techIt; if (!technique->isValid()) continue; @@ -601,9 +601,9 @@ namespace MWRender validTechniques.push_back(technique); } - for (size_t tech_idx = 0; tech_idx < validTechniques.size(); ++tech_idx) + for (size_t techIdx = 0; techIdx < validTechniques.size(); ++techIdx) { - const auto& technique = validTechniques[tech_idx]; + const auto& technique = validTechniques[techIdx]; Fx::DispatchNode node; @@ -662,9 +662,9 @@ namespace MWRender } const auto& passes = technique->getPasses(); - for (size_t pass_idx = 0; pass_idx < passes.size(); ++pass_idx) + for (size_t passIdx = 0; passIdx < passes.size(); ++passIdx) { - const auto& pass = passes[pass_idx]; + const auto& pass = passes[passIdx]; int subTexUnit = texUnit; Fx::DispatchNode::SubPass subPass; @@ -672,7 +672,7 @@ namespace MWRender node.mHandle = technique; - bool isFinalPass = (tech_idx == validTechniques.size() - 1 && pass_idx == passes.size() - 1); + bool isFinalPass = (techIdx == validTechniques.size() - 1 && passIdx == passes.size() - 1); if (!pass->getTarget().empty()) {