Use settings values for Post Processing settings

macos_ci_fix
elsid 1 year ago
parent 575f43876b
commit 7b4b8763ff
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

@ -1,7 +1,7 @@
#include "luminancecalculator.hpp"
#include <components/misc/mathutil.hpp>
#include <components/settings/settings.hpp>
#include <components/settings/values.hpp>
#include <components/shader/shadermanager.hpp>
#include "pingpongcanvas.hpp"
@ -10,11 +10,8 @@ namespace MWRender
{
LuminanceCalculator::LuminanceCalculator(Shader::ShaderManager& shaderManager)
{
const float hdrExposureTime
= std::max(Settings::Manager::getFloat("auto exposure speed", "Post Processing"), 0.0001f);
Shader::ShaderManager::DefineMap defines = {
{ "hdrExposureTime", std::to_string(hdrExposureTime) },
{ "hdrExposureTime", std::to_string(Settings::postProcessing().mAutoExposureSpeed) },
};
auto vertex = shaderManager.getShader("fullscreen_tri.vert", {});

@ -18,7 +18,7 @@
#include <components/sceneutil/color.hpp>
#include <components/sceneutil/depth.hpp>
#include <components/sceneutil/nodecallback.hpp>
#include <components/settings/settings.hpp>
#include <components/settings/values.hpp>
#include <components/shader/shadermanager.hpp>
#include <components/stereo/multiview.hpp>
#include <components/stereo/stereomanager.hpp>
@ -121,7 +121,7 @@ namespace MWRender
, mTriggerShaderReload(false)
, mReload(false)
, mEnabled(false)
, mUsePostProcessing(false)
, mUsePostProcessing(Settings::postProcessing().mEnabled)
, mSoftParticles(false)
, mDisableDepthPasses(false)
, mLastFrameNumber(0)
@ -136,7 +136,6 @@ namespace MWRender
, mPrevPassLights(false)
{
mSoftParticles = Settings::Manager::getBool("soft particles", "Shaders");
mUsePostProcessing = Settings::Manager::getBool("enabled", "Post Processing");
osg::GraphicsContext* gc = viewer->getCamera()->getGraphicsContext();
osg::GLExtensions* ext = gc->getState()->get<osg::GLExtensions>();
@ -237,7 +236,7 @@ namespace MWRender
{
mReload = true;
mEnabled = true;
bool postPass = Settings::Manager::getBool("transparent postpass", "Post Processing");
const bool postPass = Settings::postProcessing().mTransparentPostpass;
mUsePostProcessing = usePostProcessing;
mDisableDepthPasses = !mSoftParticles && !postPass;
@ -839,9 +838,7 @@ namespace MWRender
mTechniques.clear();
std::vector<std::string> techniqueStrings = Settings::Manager::getStringArray("chain", "Post Processing");
for (auto& techniqueName : techniqueStrings)
for (const std::string& techniqueName : Settings::postProcessing().mChain.get())
{
if (techniqueName.empty())
continue;
@ -863,7 +860,7 @@ namespace MWRender
chain.push_back(technique->getName());
}
Settings::Manager::setStringArray("chain", "Post Processing", chain);
Settings::postProcessing().mChain.set(chain);
}
void PostProcessor::toggleMode()

@ -1441,7 +1441,7 @@ namespace MWRender
}
else if (it->first == "Post Processing" && it->second == "enabled")
{
if (Settings::Manager::getBool("enabled", "Post Processing"))
if (Settings::postProcessing().mEnabled)
mPostProcessor->enable();
else
{

@ -19,7 +19,7 @@ namespace Settings
using WithIndex::WithIndex;
SettingValue<bool> mEnabled{ mIndex, "Post Processing", "enabled" };
SettingValue<std::string> mChain{ mIndex, "Post Processing", "chain" };
SettingValue<std::vector<std::string>> mChain{ mIndex, "Post Processing", "chain" };
SettingValue<float> mAutoExposureSpeed{ mIndex, "Post Processing", "auto exposure speed",
makeMaxStrictSanitizerFloat(0.0001f) };
SettingValue<bool> mTransparentPostpass{ mIndex, "Post Processing", "transparent postpass" };

Loading…
Cancel
Save