Merge branch 'light_settings' into 'master'

Enhance light settings tweaking

See merge request OpenMW/openmw!3782
ini_importer_tests
psi29a 12 months ago
commit 639b7b0b17

@ -213,21 +213,6 @@ bool Launcher::SettingsPage::loadSettings()
loadSettingBool(Settings::fog().mSkyBlending, *skyBlendingCheckBox);
skyBlendingStartComboBox->setValue(Settings::fog().mSkyBlendingStart);
int lightingMethod = 1;
switch (Settings::shaders().mLightingMethod)
{
case SceneUtil::LightingMethod::FFP:
lightingMethod = 0;
break;
case SceneUtil::LightingMethod::PerObjectUniform:
lightingMethod = 1;
break;
case SceneUtil::LightingMethod::SingleUBO:
lightingMethod = 2;
break;
}
lightingMethodComboBox->setCurrentIndex(lightingMethod);
loadSettingBool(Settings::shadows().mActorShadows, *actorShadowsCheckBox);
loadSettingBool(Settings::shadows().mPlayerShadows, *playerShadowsCheckBox);
loadSettingBool(Settings::shadows().mTerrainShadows, *terrainShadowsCheckBox);
@ -261,6 +246,31 @@ bool Launcher::SettingsPage::loadSettings()
shadowResolutionComboBox->setCurrentIndex(shadowResIndex);
connect(shadowDistanceCheckBox, &QCheckBox::toggled, this, &SettingsPage::slotShadowDistLimitToggled);
lightsMaxLightsSpinBox->setValue(Settings::shaders().mMaxLights);
lightsMaximumDistanceSpinBox->setValue(Settings::shaders().mMaximumLightDistance);
lightFadeMultiplierSpinBox->setValue(Settings::shaders().mLightFadeStart);
lightsBoundingSphereMultiplierSpinBox->setValue(Settings::shaders().mLightBoundsMultiplier);
lightsMinimumInteriorBrightnessSpinBox->setValue(Settings::shaders().mMinimumInteriorBrightness);
connect(lightingMethodComboBox, qOverload<int>(&QComboBox::currentIndexChanged), this,
&SettingsPage::slotLightTypeCurrentIndexChanged);
int lightingMethod = 1;
switch (Settings::shaders().mLightingMethod)
{
case SceneUtil::LightingMethod::FFP:
lightingMethod = 0;
break;
case SceneUtil::LightingMethod::PerObjectUniform:
lightingMethod = 1;
break;
case SceneUtil::LightingMethod::SingleUBO:
lightingMethod = 2;
break;
}
lightingMethodComboBox->setCurrentIndex(lightingMethod);
slotLightTypeCurrentIndexChanged(lightingMethod);
}
// Audio
@ -454,6 +464,12 @@ void Launcher::SettingsPage::saveSettings()
Settings::shadows().mComputeSceneBounds.set("primitives");
else
Settings::shadows().mComputeSceneBounds.set("none");
Settings::shaders().mMaxLights.set(lightsMaxLightsSpinBox->value());
Settings::shaders().mMaximumLightDistance.set(lightsMaximumDistanceSpinBox->value());
Settings::shaders().mLightFadeStart.set(lightFadeMultiplierSpinBox->value());
Settings::shaders().mLightBoundsMultiplier.set(lightsBoundingSphereMultiplierSpinBox->value());
Settings::shaders().mMinimumInteriorBrightness.set(lightsMinimumInteriorBrightnessSpinBox->value());
}
// Audio
@ -562,3 +578,11 @@ void Launcher::SettingsPage::slotShadowDistLimitToggled(bool checked)
shadowDistanceSpinBox->setEnabled(checked);
fadeStartSpinBox->setEnabled(checked);
}
void Launcher::SettingsPage::slotLightTypeCurrentIndexChanged(int index)
{
lightsMaximumDistanceSpinBox->setEnabled(index != 0);
lightsMaxLightsSpinBox->setEnabled(index != 0);
lightsBoundingSphereMultiplierSpinBox->setEnabled(index != 0);
lightsMinimumInteriorBrightnessSpinBox->setEnabled(index != 0);
}

@ -33,6 +33,7 @@ namespace Launcher
void slotPostProcessToggled(bool checked);
void slotSkyBlendingToggled(bool checked);
void slotShadowDistLimitToggled(bool checked);
void slotLightTypeCurrentIndexChanged(int index);
private:
Config::GameSettings& mGameSettings;

@ -1018,7 +1018,17 @@
<layout class="QHBoxLayout" name="horizontalLightingLayout">
<item>
<layout class="QGridLayout" name="lightingLayout" columnstretch="0,0">
<item row="4" column="1">
<item row="4" column="0">
<widget class="QLabel" name="lightsMaximumDistanceLabel">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Maximum distance at which lights will appear (measured in units).&lt;/p&gt;&lt;p&gt;Set this to 0 to use an unlimited distance.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Lights maximum distance</string>
</property>
</widget>
</item>
<item row="8" column="1">
<spacer name="verticalSpacer_10">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -1031,29 +1041,143 @@
</property>
</spacer>
</item>
<item row="3" column="0">
<widget class="QLabel" name="lightsMaxLightsLabel">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Maximum number of lights per object.&lt;/p&gt;&lt;p&gt;A low number near default will cause light popping similar to what you would see with legacy lighting.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Max light sources</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="lightFadeMultiplierLabel">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Fraction of maximum distance at which lights will start to fade.&lt;/p&gt;&lt;p&gt;Set this to a low value for slower transitions or a high value for quicker transitions.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Lights fade multiplier</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="lightingMethodLabel">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Set the internal handling of light sources.&lt;/p&gt;
&lt;p&gt; &quot;Legacy&quot; always uses 8 lights per object and provides a lighting closest to an original game.&lt;/p&gt;
&lt;p&gt;&quot;Shaders (compatibility)&quot; removes the 8 light limit. This mode also enables lighting on groundcover and a configurable light fade. It is recommended to use this with older hardware and a light limit closer to 8.&lt;/p&gt;
&lt;p&gt; &quot;Shaders&quot; carries all of the benefits that &quot;Shaders (compatibility)&quot; does, but uses a modern approach that allows for a higher max lights count with little to no performance penalties on modern hardware.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Lighting method</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="lightingMethodComboBox">
<item>
<property name="text">
<string>legacy</string>
<string>Legacy</string>
</property>
</item>
<item>
<property name="text">
<string>shaders compatibility</string>
<string>Shaders (compatibility)</string>
</property>
</item>
<item>
<property name="text">
<string>shaders</string>
<string>Shaders</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="skyBlendingStartLabel_2">
<item row="6" column="0">
<widget class="QLabel" name="lightsBoundingSphereMultiplierLabel">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Multipler for bounding sphere of lights.&lt;/p&gt;&lt;p&gt;Higher numbers allows for smooth falloff but require an increase in number of max lights.&lt;/p&gt;&lt;p&gt;Does not effect the illumination or strength of lights.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Lighting method</string>
<string>Lights bounding sphere multiplier</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="lightsMinimumInteriorBrightnessLabel">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Minimum ambient interior brightness.&lt;/p&gt;&lt;p&gt;Increase this if you feel interiors are too dark.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Lights minimum interior brightness</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QDoubleSpinBox" name="lightsBoundingSphereMultiplierSpinBox">
<property name="maximum">
<double>5.000000000000000</double>
</property>
<property name="singleStep">
<double>0.050000000000000</double>
</property>
<property name="value">
<double>1.650000000000000</double>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QDoubleSpinBox" name="lightFadeMultiplierSpinBox">
<property name="maximum">
<double>1.000000000000000</double>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
</property>
<property name="value">
<double>0.850000000000000</double>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QDoubleSpinBox" name="lightsMinimumInteriorBrightnessSpinBox">
<property name="maximum">
<double>1.000000000000000</double>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
</property>
<property name="value">
<double>0.080000000000000</double>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QSpinBox" name="lightsMaximumDistanceSpinBox">
<property name="suffix">
<string> unit(s)</string>
</property>
<property name="maximum">
<number>8192</number>
</property>
<property name="singleStep">
<number>128</number>
</property>
<property name="value">
<number>8192</number>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QSpinBox" name="lightsMaxLightsSpinBox">
<property name="minimum">
<number>2</number>
</property>
<property name="maximum">
<number>64</number>
</property>
<property name="singleStep">
<number>2</number>
</property>
</widget>
</item>

@ -131,7 +131,7 @@ namespace
void updateMaxLightsComboBox(MyGUI::ComboBox* box)
{
constexpr int min = 8;
constexpr int max = 32;
constexpr int max = 64;
constexpr int increment = 8;
const int maxLights = Settings::shaders().mMaxLights;
// show increments of 8 in dropdown

@ -87,6 +87,10 @@ LightsBoundingSphereMultiplier: "Bounding-Sphere-Multiplikator"
LightsBoundingSphereMultiplierTooltip: "Standard: 1.65\nMultiplikator für Begrenzungskugel.\nHöhere Zahlen ermöglichen einen sanften Abfall, erfordern jedoch eine Erhöhung der Anzahl der maximalen Lichter.\n\nBeeinflusst nicht die Beleuchtung oder Lichtstärke."
LightsFadeStartMultiplier: "Licht Verblassungs-Start-Multiplikator"
LightsFadeStartMultiplierTooltip: "Standard: 0.85\nBruchteil der maximalen Entfernung, bei der die Lichter zu verblassen beginnen.\n\nStellen Sie hier einen niedrigen Wert für langsamere Übergänge oder einen hohen Wert für schnellere Übergänge ein."
#LightsLightingMethodTooltip: "Set the internal handling of light sources.\n\n
# \"Legacy\" always uses 8 lights per object and provides a lighting closest to an original game.\n\n
# \"Shaders (compatibility)\" removes the 8 light limit. This mode also enables lighting on groundcover and a configurable light fade. It is recommended to use this with older hardware and a light limit closer to 8.\n\n
# \"Shaders\" carries all of the benefits that \"Shaders (compatibility)\" does, but uses a modern approach that allows for a higher max lights count with little to no performance penalties on modern hardware."
LightsMaximumDistance: "Maximale Lichtreichweite"
LightsMaximumDistanceTooltip: "Standard: 8192\nMaximale Entfernung, bei der Lichter erscheinen (gemessen in Einheiten).\n\nSetzen Sie dies auf 0, um eine unbegrenzte Entfernung zu verwenden."
LightsMinimumInteriorBrightness: "Minimale Innenhelligkeit"

@ -107,6 +107,10 @@ LightsBoundingSphereMultiplier: "Bounding Sphere Multiplier"
LightsBoundingSphereMultiplierTooltip: "Default: 1.65\nMultipler for bounding sphere of lights.\nHigher numbers allows for smooth falloff but require an increase in number of max lights.\n\nDoes not effect the illumination or strength of lights."
LightsFadeStartMultiplier: "Fade Start Multiplier"
LightsFadeStartMultiplierTooltip: "Default: 0.85\nFraction of maximum distance at which lights will start to fade.\n\nSet this to a low value for slower transitions or a high value for quicker transitions."
LightsLightingMethodTooltip: "Set the internal handling of light sources.\n\n
\"Legacy\" always uses 8 lights per object and provides a lighting closest to an original game.\n\n
\"Shaders (compatibility)\" removes the 8 light limit. This mode also enables lighting on groundcover and a configurable light fade. It is recommended to use this with older hardware and a light limit closer to 8.\n\n
\"Shaders\" carries all of the benefits that \"Shaders (compatibility)\" does, but uses a modern approach that allows for a higher max lights count with little to no performance penalties on modern hardware."
LightsMaximumDistance: "Maximum Light Distance"
LightsMaximumDistanceTooltip: "Default: 8192\nMaximum distance at which lights will appear (measured in units).\n\nSet this to 0 to use an unlimited distance."
LightsMinimumInteriorBrightness: "Minimum Interior Brightness"

@ -107,6 +107,10 @@ LightsBoundingSphereMultiplier: "Multiplicateur de sphère englobante"
LightsBoundingSphereMultiplierTooltip: "valeur par défaut: 1.65\nMultiplicateur pour le rayon de la sphère incluant les sources lumineuses.\nUn multiplicateur plus élevé permet une extinction plus douce, mais applique un plus grand nombre de sources lumineuses sur chaque objet.\n\nCe paramètre ne modifie ni l'intensité ni la luminance des lumières."
LightsFadeStartMultiplier: "Seuil de perte d'éclat lumineux"
LightsFadeStartMultiplierTooltip: "valeur par défaut: 0.85\nFraction de la distance maximale d'une source à partir de laquelle l'intensité lumineuse commence à décroître.\n\nSélectionnez une valeur basse pour une transition douce ou une valeur plus élevée pour une transition plus abrupte."
#LightsLightingMethodTooltip: "Set the internal handling of light sources.\n\n
# \"Legacy\" always uses 8 lights per object and provides a lighting closest to an original game.\n\n
# \"Shaders (compatibility)\" removes the 8 light limit. This mode also enables lighting on groundcover and a configurable light fade. It is recommended to use this with older hardware and a light limit closer to 8.\n\n
# \"Shaders\" carries all of the benefits that \"Shaders (compatibility)\" does, but uses a modern approach that allows for a higher max lights count with little to no performance penalties on modern hardware."
LightsMaximumDistance: "Distance maximale des sources lumineuses"
LightsMaximumDistanceTooltip: "valeur par défaut: 8192\nDistance maximale d'affichage des sources lumineuses (en unité de distance).\n\nMettez cette valeur à 0 pour une distance d'affichage infinie."
LightsMinimumInteriorBrightness: "Luminosité intérieure minimale"

@ -107,6 +107,10 @@ LightsBoundingSphereMultiplier: "Множитель размера ограни
LightsBoundingSphereMultiplierTooltip: "Значение по умолчанию: 1.65\nМножитель размера ограничивающей сферы источников света.\nВысокие значения делают затухание света плавнее, но требуют более высокого максимального количества источников света.\n\nНастройка не влияет на уровень освещения или мощность источников света."
LightsFadeStartMultiplier: "Множитель начала затухания"
LightsFadeStartMultiplierTooltip: "Значение по умолчанию: 0.85\nДоля расстояния (относительно дальности отображения источников света), на которой свет начинает затухать.\n\nНизкие значения ведут к плавному затуханию, высокие - к резкому."
LightsLightingMethodTooltip: "Задает способ обработки источников света.\n\n
\"Устаревший\" всегда использует 8 источников света на объект и выдает освещение, наиболее близкое к таковому в оригинальной игре.\n\n
\"Шейдеры (режим совместимости)\" убирает ограничение в 8 источников света. Этот режим также позволяет освещению влиять на анимированную траву и позволяет настроить угасание света на расстоянии. Рекомендуется использовать этот режим на устаревшем аппаратном обеспечении и с количеством источников света на объект около 8.\n\n
\"Шейдеры\" работает аналогично режиму \"Шейдеры (режим совместимости)\", но использует более современный подход, позволяющий использовать большее количество источников света с минимальным влиянием на производительность на современном аппаратном обеспечении."
LightsMaximumDistance: "Дальность отображения источников света"
LightsMaximumDistanceTooltip: "Значение по умолчанию: 8192\nМаксимальное расстояние, на котором будут отображаться источники света (во внутриигровых единицах измерения).\n\nЕсли 0, то расстояние не ограничено."
LightsMinimumInteriorBrightness: "Минимальный уровень освещения в помещениях"

@ -107,6 +107,10 @@ LightsBoundingSphereMultiplier: "Gränssfärsmultiplikator"
LightsBoundingSphereMultiplierTooltip: "Förvalt: 1.65\nMultiplikator för ljusens gränssfär.\nHögre värden ger mjukare minskning av gränssfären, men kräver högre värde i Max antal ljuskällor.\n\nPåverkar inte ljusstyrkan."
LightsFadeStartMultiplier: "Blekningsstartmultiplikator"
LightsFadeStartMultiplierTooltip: "Förvalt: 0.85\nFraktion av det maximala avståndet från vilket ljuskällor börjar blekna.\n\nVälj lågt värde för långsammare övergång eller högre värde för snabbare övergång."
#LightsLightingMethodTooltip: "Set the internal handling of light sources.\n\n
# \"Legacy\" always uses 8 lights per object and provides a lighting closest to an original game.\n\n
# \"Shaders (compatibility)\" removes the 8 light limit. This mode also enables lighting on groundcover and a configurable light fade. It is recommended to use this with older hardware and a light limit closer to 8.\n\n
# \"Shaders\" carries all of the benefits that \"Shaders (compatibility)\" does, but uses a modern approach that allows for a higher max lights count with little to no performance penalties on modern hardware."
LightsMaximumDistance: "Maximalt ljusavstånd"
LightsMaximumDistanceTooltip: "Förvalt: 8192\nMaximala avståndet där ljuskällor syns (mätt i enheter).\n\nVärdet 0 ger oändligt avstånd."
LightsMinimumInteriorBrightness: "Minsta ljusstyrka i interiörer"

@ -536,6 +536,9 @@
<!-- Lighting Method -->
<Widget type="TextBox" skin="NormalText" position="0 4 250 18" align="Left Top">
<Property key="Caption" value="#{OMWEngine:LightingMethod}"/>
<UserString key="ToolTipType" value="Layout"/>
<UserString key="ToolTipLayout" value="TextToolTip"/>
<UserString key="Caption_Text" value="#{OMWEngine:LightsLightingMethodTooltip}"/>
</Widget>
<Widget type="ComboBox" skin="MW_ComboBox" position="0 28 250 24" align="Left Top" name="LightingMethodButton">
<Property key="AddItem" value="legacy"/>
@ -561,6 +564,10 @@
<Property key="AddItem" value="16"/>
<Property key="AddItem" value="24"/>
<Property key="AddItem" value="32"/>
<Property key="AddItem" value="40"/>
<Property key="AddItem" value="48"/>
<Property key="AddItem" value="56"/>
<Property key="AddItem" value="64"/>
</Widget>
<Widget type="ImageBox" skin="MW_HLine" position="0 54 360 18" align="Top HStretch"/>
<!-- Light Fade Start -->
@ -570,7 +577,7 @@
<UserString key="Caption_Text" value="#{OMWEngine:LightsMaximumDistanceTooltip}"/>
</Widget>
<Widget type="ScrollBar" skin="MW_HScroll" position="0 104 352 18" align="HStretch Top">
<Property key="Range" value="8192"/>
<Property key="Range" value="8193"/>
<Property key="Page" value="128"/>
<UserString key="SettingType" value="Slider"/>
<UserString key="SettingMin" value="0"/>

Loading…
Cancel
Save