From 5f355a14cdda016535863a8e75332ba097628517 Mon Sep 17 00:00:00 2001 From: Thomas Lowe Date: Mon, 29 Nov 2021 07:18:49 -0500 Subject: [PATCH 1/7] Changed default setting for anti-alias alpha test to true. Added checkbox in advanced page for anti-alias alpha test, connected to AA combobox in the graphics page. --- apps/launcher/advancedpage.cpp | 12 ++++++++++++ apps/launcher/advancedpage.hpp | 1 + apps/launcher/graphicspage.cpp | 3 +++ apps/launcher/graphicspage.hpp | 4 ++++ apps/launcher/maindialog.cpp | 2 +- files/settings-default.cfg | 2 +- files/ui/advancedpage.ui | 10 ++++++++++ 7 files changed, 32 insertions(+), 2 deletions(-) diff --git a/apps/launcher/advancedpage.cpp b/apps/launcher/advancedpage.cpp index af1fa255db..c7e228878c 100644 --- a/apps/launcher/advancedpage.cpp +++ b/apps/launcher/advancedpage.cpp @@ -118,6 +118,11 @@ bool Launcher::AdvancedPage::loadSettings() loadSettingBool(bumpMapLocalLightingCheckBox, "apply lighting to environment maps", "Shaders"); loadSettingBool(radialFogCheckBox, "radial fog", "Shaders"); loadSettingBool(softParticlesCheckBox, "soft particles", "Shaders"); + loadSettingBool(antialiasAlphaTestCheckBox, "antialias alpha test", "Shaders"); + if (Settings::Manager::getInt("antialiasing", "Video") == 0) { + antialiasAlphaTestCheckBox->setCheckState(Qt::Unchecked); + antialiasAlphaTestCheckBox->setEnabled(false); + } loadSettingBool(magicItemAnimationsCheckBox, "use magic item animations", "Game"); connect(animSourcesCheckBox, SIGNAL(toggled(bool)), this, SLOT(slotAnimSourcesToggled(bool))); loadSettingBool(animSourcesCheckBox, "use additional anim sources", "Game"); @@ -268,6 +273,7 @@ void Launcher::AdvancedPage::saveSettings() saveSettingBool(bumpMapLocalLightingCheckBox, "apply lighting to environment maps", "Shaders"); saveSettingBool(radialFogCheckBox, "radial fog", "Shaders"); saveSettingBool(softParticlesCheckBox, "soft particles", "Shaders"); + saveSettingBool(antialiasAlphaTestCheckBox, "antialias alpha test", "Shaders"); saveSettingBool(magicItemAnimationsCheckBox, "use magic item animations", "Game"); saveSettingBool(animSourcesCheckBox, "use additional anim sources", "Game"); saveSettingBool(weaponSheathingCheckBox, "weapon sheathing", "Game"); @@ -439,6 +445,12 @@ void Launcher::AdvancedPage::slotLoadedCellsChanged(QStringList cellNames) loadCellsForAutocomplete(cellNames); } +void Launcher::AdvancedPage::slotAASettingChanged(int aaLevel) { + antialiasAlphaTestCheckBox->setEnabled(aaLevel > 0); + if (aaLevel == 0) + antialiasAlphaTestCheckBox->setCheckState(Qt::Unchecked); +} + void Launcher::AdvancedPage::slotAnimSourcesToggled(bool checked) { weaponSheathingCheckBox->setEnabled(checked); diff --git a/apps/launcher/advancedpage.hpp b/apps/launcher/advancedpage.hpp index 1d16fae706..e26f1690e9 100644 --- a/apps/launcher/advancedpage.hpp +++ b/apps/launcher/advancedpage.hpp @@ -24,6 +24,7 @@ namespace Launcher public slots: void slotLoadedCellsChanged(QStringList cellNames); + void slotAASettingChanged(int aaLevel); private slots: void on_skipMenuCheckBox_stateChanged(int state); diff --git a/apps/launcher/graphicspage.cpp b/apps/launcher/graphicspage.cpp index 8359834ddb..06cc98c741 100644 --- a/apps/launcher/graphicspage.cpp +++ b/apps/launcher/graphicspage.cpp @@ -47,7 +47,10 @@ Launcher::GraphicsPage::GraphicsPage(QWidget *parent) connect(screenComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(screenChanged(int))); connect(framerateLimitCheckBox, SIGNAL(toggled(bool)), this, SLOT(slotFramerateLimitToggled(bool))); connect(shadowDistanceCheckBox, SIGNAL(toggled(bool)), this, SLOT(slotShadowDistLimitToggled(bool))); +} +void Launcher::GraphicsPage::connectAntiAliasingChanged(const QObject* receiver, const char* slot) { + connect(antiAliasingComboBox, SIGNAL(currentIndexChanged(int)), receiver, slot); } bool Launcher::GraphicsPage::setupSDL() diff --git a/apps/launcher/graphicspage.hpp b/apps/launcher/graphicspage.hpp index a6754ccb04..9275bf8e3d 100644 --- a/apps/launcher/graphicspage.hpp +++ b/apps/launcher/graphicspage.hpp @@ -20,12 +20,16 @@ namespace Launcher public: explicit GraphicsPage(QWidget *parent = nullptr); + void connectAntiAliasingChanged(const QObject *receiver, const char *slot); void saveSettings(); bool loadSettings(); public slots: void screenChanged(int screen); + signals: + void signalAntiAliasingChanged(int aaValue); + private slots: void slotFullScreenChanged(int state); void slotStandardToggled(bool checked); diff --git a/apps/launcher/maindialog.cpp b/apps/launcher/maindialog.cpp index 75d4464b68..d58be7afcf 100644 --- a/apps/launcher/maindialog.cpp +++ b/apps/launcher/maindialog.cpp @@ -146,7 +146,7 @@ void Launcher::MainDialog::createPages() connect(mDataFilesPage, SIGNAL(signalProfileChanged(int)), mPlayPage, SLOT(setProfilesIndex(int))); // Using Qt::QueuedConnection because signal is emitted in a subthread and slot is in the main thread connect(mDataFilesPage, SIGNAL(signalLoadedCellsChanged(QStringList)), mAdvancedPage, SLOT(slotLoadedCellsChanged(QStringList)), Qt::QueuedConnection); - + mGraphicsPage->connectAntiAliasingChanged(mAdvancedPage, SLOT(slotAASettingChanged(int))); } Launcher::FirstRunDialogResult Launcher::MainDialog::showFirstRunDialog() diff --git a/files/settings-default.cfg b/files/settings-default.cfg index c0083e4238..0e2c329ff2 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -492,7 +492,7 @@ minimum interior brightness = 0.08 # Convert the alpha test (cutout/punchthrough alpha) to alpha-to-coverage. # This allows MSAA to work with alpha-tested meshes, producing better-looking edges without pixelation. # When MSAA is off, this setting will have no visible effect, but might have a performance cost. -antialias alpha test = false +antialias alpha test = true # Soften intersection of blended particle systems with opaque geometry soft particles = false diff --git a/files/ui/advancedpage.ui b/files/ui/advancedpage.ui index 0e80f02700..0952e660d8 100644 --- a/files/ui/advancedpage.ui +++ b/files/ui/advancedpage.ui @@ -454,6 +454,16 @@ + + + + <html><head/><body><p>Enables alpha testing for smoother anti-aliasing (Requires anti-aliasing to be enabled)</p></body></html> + + + Use anti-alias alpha testing. + + + From 4f77c18af4b2df9abd13f5106591e75683089d99 Mon Sep 17 00:00:00 2001 From: Thomas Lowe Date: Mon, 29 Nov 2021 20:44:47 -0500 Subject: [PATCH 2/7] Removed unneeded signal. --- apps/launcher/graphicspage.hpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/apps/launcher/graphicspage.hpp b/apps/launcher/graphicspage.hpp index 9275bf8e3d..d86b570914 100644 --- a/apps/launcher/graphicspage.hpp +++ b/apps/launcher/graphicspage.hpp @@ -27,9 +27,6 @@ namespace Launcher public slots: void screenChanged(int screen); - signals: - void signalAntiAliasingChanged(int aaValue); - private slots: void slotFullScreenChanged(int state); void slotStandardToggled(bool checked); From bdb7b6079ee073baa465b2c1c75f42f42a9ebfc8 Mon Sep 17 00:00:00 2001 From: Thomas Lowe Date: Mon, 29 Nov 2021 20:49:31 -0500 Subject: [PATCH 3/7] Removed a period from the checkbox's display text to conform with other buttons. --- files/ui/advancedpage.ui | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/files/ui/advancedpage.ui b/files/ui/advancedpage.ui index 0952e660d8..f782c6caa0 100644 --- a/files/ui/advancedpage.ui +++ b/files/ui/advancedpage.ui @@ -14,7 +14,7 @@ - 0 + 1 @@ -281,8 +281,8 @@ 0 0 - 645 - 413 + 665 + 525 @@ -454,16 +454,16 @@ - - - - <html><head/><body><p>Enables alpha testing for smoother anti-aliasing (Requires anti-aliasing to be enabled)</p></body></html> - - - Use anti-alias alpha testing. - - - + + + + <html><head/><body><p>Enables alpha testing for smoother anti-aliasing (Requires anti-aliasing to be enabled)</p></body></html> + + + Use anti-alias alpha testing + + + From 95d7bdd0c9b469c41dfc51613a45a42538aaab88 Mon Sep 17 00:00:00 2001 From: Thomas Lowe Date: Tue, 30 Nov 2021 07:50:30 -0500 Subject: [PATCH 4/7] alpha test defaults to false --- files/settings-default.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/settings-default.cfg b/files/settings-default.cfg index 0e2c329ff2..c0083e4238 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -492,7 +492,7 @@ minimum interior brightness = 0.08 # Convert the alpha test (cutout/punchthrough alpha) to alpha-to-coverage. # This allows MSAA to work with alpha-tested meshes, producing better-looking edges without pixelation. # When MSAA is off, this setting will have no visible effect, but might have a performance cost. -antialias alpha test = true +antialias alpha test = false # Soften intersection of blended particle systems with opaque geometry soft particles = false From f50cbcad812845e2712671c2e9db99d8333fbedc Mon Sep 17 00:00:00 2001 From: Thomas Lowe Date: Tue, 30 Nov 2021 20:07:29 -0500 Subject: [PATCH 5/7] * AA combo box no longer disables the AA alpha test checkbox. * Updated AA alpha test description to be more accurate --- apps/launcher/advancedpage.cpp | 7 ------- apps/launcher/advancedpage.hpp | 1 - apps/launcher/graphicspage.cpp | 4 ---- apps/launcher/graphicspage.hpp | 1 - apps/launcher/maindialog.cpp | 1 - files/ui/advancedpage.ui | 2 +- 6 files changed, 1 insertion(+), 15 deletions(-) diff --git a/apps/launcher/advancedpage.cpp b/apps/launcher/advancedpage.cpp index c7e228878c..d09704851a 100644 --- a/apps/launcher/advancedpage.cpp +++ b/apps/launcher/advancedpage.cpp @@ -121,7 +121,6 @@ bool Launcher::AdvancedPage::loadSettings() loadSettingBool(antialiasAlphaTestCheckBox, "antialias alpha test", "Shaders"); if (Settings::Manager::getInt("antialiasing", "Video") == 0) { antialiasAlphaTestCheckBox->setCheckState(Qt::Unchecked); - antialiasAlphaTestCheckBox->setEnabled(false); } loadSettingBool(magicItemAnimationsCheckBox, "use magic item animations", "Game"); connect(animSourcesCheckBox, SIGNAL(toggled(bool)), this, SLOT(slotAnimSourcesToggled(bool))); @@ -445,12 +444,6 @@ void Launcher::AdvancedPage::slotLoadedCellsChanged(QStringList cellNames) loadCellsForAutocomplete(cellNames); } -void Launcher::AdvancedPage::slotAASettingChanged(int aaLevel) { - antialiasAlphaTestCheckBox->setEnabled(aaLevel > 0); - if (aaLevel == 0) - antialiasAlphaTestCheckBox->setCheckState(Qt::Unchecked); -} - void Launcher::AdvancedPage::slotAnimSourcesToggled(bool checked) { weaponSheathingCheckBox->setEnabled(checked); diff --git a/apps/launcher/advancedpage.hpp b/apps/launcher/advancedpage.hpp index e26f1690e9..1d16fae706 100644 --- a/apps/launcher/advancedpage.hpp +++ b/apps/launcher/advancedpage.hpp @@ -24,7 +24,6 @@ namespace Launcher public slots: void slotLoadedCellsChanged(QStringList cellNames); - void slotAASettingChanged(int aaLevel); private slots: void on_skipMenuCheckBox_stateChanged(int state); diff --git a/apps/launcher/graphicspage.cpp b/apps/launcher/graphicspage.cpp index 06cc98c741..e6d857a943 100644 --- a/apps/launcher/graphicspage.cpp +++ b/apps/launcher/graphicspage.cpp @@ -49,10 +49,6 @@ Launcher::GraphicsPage::GraphicsPage(QWidget *parent) connect(shadowDistanceCheckBox, SIGNAL(toggled(bool)), this, SLOT(slotShadowDistLimitToggled(bool))); } -void Launcher::GraphicsPage::connectAntiAliasingChanged(const QObject* receiver, const char* slot) { - connect(antiAliasingComboBox, SIGNAL(currentIndexChanged(int)), receiver, slot); -} - bool Launcher::GraphicsPage::setupSDL() { bool sdlConnectSuccessful = initSDL(); diff --git a/apps/launcher/graphicspage.hpp b/apps/launcher/graphicspage.hpp index d86b570914..a6754ccb04 100644 --- a/apps/launcher/graphicspage.hpp +++ b/apps/launcher/graphicspage.hpp @@ -20,7 +20,6 @@ namespace Launcher public: explicit GraphicsPage(QWidget *parent = nullptr); - void connectAntiAliasingChanged(const QObject *receiver, const char *slot); void saveSettings(); bool loadSettings(); diff --git a/apps/launcher/maindialog.cpp b/apps/launcher/maindialog.cpp index d58be7afcf..d335d7cded 100644 --- a/apps/launcher/maindialog.cpp +++ b/apps/launcher/maindialog.cpp @@ -146,7 +146,6 @@ void Launcher::MainDialog::createPages() connect(mDataFilesPage, SIGNAL(signalProfileChanged(int)), mPlayPage, SLOT(setProfilesIndex(int))); // Using Qt::QueuedConnection because signal is emitted in a subthread and slot is in the main thread connect(mDataFilesPage, SIGNAL(signalLoadedCellsChanged(QStringList)), mAdvancedPage, SLOT(slotLoadedCellsChanged(QStringList)), Qt::QueuedConnection); - mGraphicsPage->connectAntiAliasingChanged(mAdvancedPage, SLOT(slotAASettingChanged(int))); } Launcher::FirstRunDialogResult Launcher::MainDialog::showFirstRunDialog() diff --git a/files/ui/advancedpage.ui b/files/ui/advancedpage.ui index f782c6caa0..4b7434dc35 100644 --- a/files/ui/advancedpage.ui +++ b/files/ui/advancedpage.ui @@ -457,7 +457,7 @@ - <html><head/><body><p>Enables alpha testing for smoother anti-aliasing (Requires anti-aliasing to be enabled)</p></body></html> + <html><head/><body><p>Allows MSAA to work with alpha-tested meshes, producing better-looking edges without pixelation. Can negatively impact performance if MSAA is off.</p></body></html> Use anti-alias alpha testing From 3daa716090ef1fd18c14875ef69c4b131e1cb25c Mon Sep 17 00:00:00 2001 From: Thomas Lowe Date: Fri, 3 Dec 2021 06:45:54 -0500 Subject: [PATCH 6/7] Updated button description. --- files/ui/advancedpage.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/ui/advancedpage.ui b/files/ui/advancedpage.ui index 4b7434dc35..3a2e7c49fc 100644 --- a/files/ui/advancedpage.ui +++ b/files/ui/advancedpage.ui @@ -457,7 +457,7 @@ - <html><head/><body><p>Allows MSAA to work with alpha-tested meshes, producing better-looking edges without pixelation. Can negatively impact performance if MSAA is off.</p></body></html> + <html><head/><body><p>Allows MSAA to work with alpha-tested meshes, producing better-looking edges without pixelation. Can negatively impact performance.</p></body></html> Use anti-alias alpha testing From fd025f69911ebe1f372d862f619d7318b7d15fcc Mon Sep 17 00:00:00 2001 From: Thomas Lowe Date: Wed, 8 Dec 2021 18:55:31 -0500 Subject: [PATCH 7/7] Added my name to authors list! --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 8ca9db90b9..8ed88a8c22 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -215,6 +215,7 @@ Programmers tlmullis tri4ng1e Thoronador + Tom Lowe (Vulpen) Tom Mason (wheybags) Torben Leif Carrington (TorbenC) unelsson