mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-05 14:05:27 +02:00
Secondary camera now has the same antialiasing settings as main one
This commit is contained in:
parent
2b0626e512
commit
00a28807d8
2 changed files with 38 additions and 25 deletions
|
@ -132,36 +132,49 @@ void RenderScriptingInterface::setAntialiasingMode(AntialiasingConfig::Mode mode
|
|||
}
|
||||
}
|
||||
|
||||
void setAntialiasingModeForView(AntialiasingConfig::Mode mode, JitterSampleConfig *jitterCamConfig, AntialiasingConfig *antialiasingConfig) {
|
||||
switch (mode) {
|
||||
case AntialiasingConfig::Mode::NONE:
|
||||
jitterCamConfig->none();
|
||||
antialiasingConfig->blend = 1;
|
||||
antialiasingConfig->setDebugFXAA(false);
|
||||
break;
|
||||
case AntialiasingConfig::Mode::TAA:
|
||||
jitterCamConfig->play();
|
||||
antialiasingConfig->blend = 0.25;
|
||||
antialiasingConfig->setDebugFXAA(false);
|
||||
break;
|
||||
case AntialiasingConfig::Mode::FXAA:
|
||||
jitterCamConfig->none();
|
||||
antialiasingConfig->blend = 0.25;
|
||||
antialiasingConfig->setDebugFXAA(true);
|
||||
break;
|
||||
default:
|
||||
jitterCamConfig->none();
|
||||
antialiasingConfig->blend = 1;
|
||||
antialiasingConfig->setDebugFXAA(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void RenderScriptingInterface::forceAntialiasingMode(AntialiasingConfig::Mode mode) {
|
||||
_renderSettingLock.withWriteLock([&] {
|
||||
_antialiasingMode = mode;
|
||||
|
||||
auto mainViewJitterCamConfig = qApp->getRenderEngine()->getConfiguration()->getConfig<JitterSample>("RenderMainView.JitterCam");
|
||||
auto mainViewAntialiasingConfig = qApp->getRenderEngine()->getConfiguration()->getConfig<Antialiasing>("RenderMainView.Antialiasing");
|
||||
auto secondViewJitterCamConfig = qApp->getRenderEngine()->getConfiguration()->getConfig<JitterSample>("RenderSecondView.JitterCam");
|
||||
auto secondViewAntialiasingConfig = qApp->getRenderEngine()->getConfiguration()->getConfig<Antialiasing>("RenderSecondView.Antialiasing");
|
||||
if (mode != AntialiasingConfig::Mode::NONE
|
||||
&& mode != AntialiasingConfig::Mode::TAA
|
||||
&& mode != AntialiasingConfig::Mode::FXAA) {
|
||||
_antialiasingMode = AntialiasingConfig::Mode::NONE;
|
||||
}
|
||||
if (mainViewJitterCamConfig && mainViewAntialiasingConfig) {
|
||||
switch (mode) {
|
||||
case AntialiasingConfig::Mode::NONE:
|
||||
mainViewJitterCamConfig->none();
|
||||
mainViewAntialiasingConfig->blend = 1;
|
||||
mainViewAntialiasingConfig->setDebugFXAA(false);
|
||||
break;
|
||||
case AntialiasingConfig::Mode::TAA:
|
||||
mainViewJitterCamConfig->play();
|
||||
mainViewAntialiasingConfig->blend = 0.25;
|
||||
mainViewAntialiasingConfig->setDebugFXAA(false);
|
||||
break;
|
||||
case AntialiasingConfig::Mode::FXAA:
|
||||
mainViewJitterCamConfig->none();
|
||||
mainViewAntialiasingConfig->blend = 0.25;
|
||||
mainViewAntialiasingConfig->setDebugFXAA(true);
|
||||
break;
|
||||
default:
|
||||
_antialiasingMode = AntialiasingConfig::Mode::NONE;
|
||||
mainViewJitterCamConfig->none();
|
||||
mainViewAntialiasingConfig->blend = 1;
|
||||
mainViewAntialiasingConfig->setDebugFXAA(false);
|
||||
break;
|
||||
}
|
||||
setAntialiasingModeForView( mode, mainViewJitterCamConfig, mainViewAntialiasingConfig);
|
||||
}
|
||||
if (secondViewJitterCamConfig && secondViewAntialiasingConfig) {
|
||||
setAntialiasingModeForView( mode, secondViewJitterCamConfig, secondViewAntialiasingConfig);
|
||||
}
|
||||
|
||||
_antialiasingModeSetting.set(_antialiasingMode);
|
||||
|
|
|
@ -194,7 +194,7 @@ private:
|
|||
int _renderMethod{ RENDER_FORWARD ? render::Args::RenderMethod::FORWARD : render::Args::RenderMethod::DEFERRED };
|
||||
bool _shadowsEnabled{ true };
|
||||
bool _ambientOcclusionEnabled{ false };
|
||||
AntialiasingConfig::Mode _antialiasingMode{ AntialiasingConfig::Mode::TAA };
|
||||
AntialiasingConfig::Mode _antialiasingMode{ AntialiasingConfig::Mode::NONE };
|
||||
float _viewportResolutionScale{ 1.0f };
|
||||
|
||||
// Actual settings saved on disk
|
||||
|
@ -202,7 +202,7 @@ private:
|
|||
Setting::Handle<bool> _shadowsEnabledSetting { "shadowsEnabled", true };
|
||||
Setting::Handle<bool> _ambientOcclusionEnabledSetting { "ambientOcclusionEnabled", false };
|
||||
//Setting::Handle<AntialiasingConfig::Mode> _antialiasingModeSetting { "antialiasingMode", AntialiasingConfig::Mode::TAA };
|
||||
Setting::Handle<int> _antialiasingModeSetting { "antialiasingMode", AntialiasingConfig::Mode::TAA };
|
||||
Setting::Handle<int> _antialiasingModeSetting { "antialiasingMode", AntialiasingConfig::Mode::NONE };
|
||||
Setting::Handle<float> _viewportResolutionScaleSetting { "viewportResolutionScale", 1.0f };
|
||||
|
||||
// Force assign both setting AND runtime value to the parameter value
|
||||
|
|
Loading…
Reference in a new issue