From 176dec45a7af775e282c084edc78fcd6327cfaba Mon Sep 17 00:00:00 2001 From: Alexei Kotov Date: Mon, 22 Jul 2024 19:45:03 +0300 Subject: [PATCH] Make light attenuation fade optional This also makes Force Per Pixel Lighting caption shorter to provide more space for the new button --- apps/openmw/mwgui/settingswindow.cpp | 1 + apps/openmw/mwrender/renderingmanager.cpp | 10 ++++-- components/settings/categories/shaders.hpp | 1 + .../reference/modding/settings/shaders.rst | 31 ++++++++++++++++--- files/data/l10n/OMWEngine/de.yaml | 15 +++++++-- files/data/l10n/OMWEngine/en.yaml | 15 +++++++-- files/data/l10n/OMWEngine/fr.yaml | 15 +++++++-- files/data/l10n/OMWEngine/ru.yaml | 15 +++++++-- files/data/l10n/OMWEngine/sv.yaml | 15 +++++++-- .../data/mygui/openmw_settings_window.layout | 20 ++++++++++-- files/settings-default.cfg | 6 ++++ files/shaders/lib/light/lighting.glsl | 2 +- files/shaders/lib/light/lighting_util.glsl | 2 +- 13 files changed, 126 insertions(+), 22 deletions(-) diff --git a/apps/openmw/mwgui/settingswindow.cpp b/apps/openmw/mwgui/settingswindow.cpp index 1e320f11f4..f38f6dc0e1 100644 --- a/apps/openmw/mwgui/settingswindow.cpp +++ b/apps/openmw/mwgui/settingswindow.cpp @@ -649,6 +649,7 @@ namespace MWGui return; Settings::shaders().mForcePerPixelLighting.reset(); + Settings::shaders().mClassicFalloff.reset(); Settings::shaders().mLightBoundsMultiplier.reset(); Settings::shaders().mMaximumLightDistance.reset(); Settings::shaders().mLightFadeStart.reset(); diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index 7048f7c933..551b0218e4 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -437,6 +437,7 @@ namespace MWRender globalDefines["forcePPL"] = Settings::shaders().mForcePerPixelLighting ? "1" : "0"; globalDefines["clamp"] = Settings::shaders().mClampLighting ? "1" : "0"; globalDefines["preLightEnv"] = Settings::shaders().mApplyLightingToEnvironmentMaps ? "1" : "0"; + globalDefines["classicFalloff"] = Settings::shaders().mClassicFalloff ? "1" : "0"; const bool exponentialFog = Settings::fog().mExponentialFog; globalDefines["radialFog"] = (exponentialFog || Settings::fog().mRadialFog) ? "1" : "0"; globalDefines["exponentialFog"] = exponentialFog ? "1" : "0"; @@ -710,7 +711,7 @@ namespace MWRender bool isInterior = !cell.isExterior() && !cell.isQuasiExterior(); bool needsAdjusting = false; if (mResourceSystem->getSceneManager()->getLightingMethod() != SceneUtil::LightingMethod::FFP) - needsAdjusting = isInterior; + needsAdjusting = isInterior && !Settings::shaders().mClassicFalloff; osg::Vec4f ambient = SceneUtil::colourFromRGB(cell.getMood().mAmbiantColor); @@ -1547,14 +1548,19 @@ namespace MWRender if (MWMechanics::getPlayer().isInCell()) configureAmbient(*MWMechanics::getPlayer().getCell()->getCell()); } - else if (it->first == "Shaders" && it->second == "force per pixel lighting") + else if (it->first == "Shaders" + && (it->second == "force per pixel lighting" || it->second == "classic falloff")) { mViewer->stopThreading(); auto defines = mResourceSystem->getSceneManager()->getShaderManager().getGlobalDefines(); defines["forcePPL"] = Settings::shaders().mForcePerPixelLighting ? "1" : "0"; + defines["classicFalloff"] = Settings::shaders().mClassicFalloff ? "1" : "0"; mResourceSystem->getSceneManager()->getShaderManager().setGlobalDefines(defines); + if (MWMechanics::getPlayer().isInCell() && it->second == "classic falloff") + configureAmbient(*MWMechanics::getPlayer().getCell()->getCell()); + mViewer->startThreading(); } else if (it->first == "Shaders" diff --git a/components/settings/categories/shaders.hpp b/components/settings/categories/shaders.hpp index dce2531c1e..e6d9976e57 100644 --- a/components/settings/categories/shaders.hpp +++ b/components/settings/categories/shaders.hpp @@ -32,6 +32,7 @@ namespace Settings SettingValue mTerrainSpecularMapPattern{ mIndex, "Shaders", "terrain specular map pattern" }; SettingValue mApplyLightingToEnvironmentMaps{ mIndex, "Shaders", "apply lighting to environment maps" }; SettingValue mLightingMethod{ mIndex, "Shaders", "lighting method" }; + SettingValue mClassicFalloff{ mIndex, "Shaders", "classic falloff" }; SettingValue mLightBoundsMultiplier{ mIndex, "Shaders", "light bounds multiplier", makeClampSanitizerFloat(0, 5) }; SettingValue mMaximumLightDistance{ mIndex, "Shaders", "maximum light distance", diff --git a/docs/source/reference/modding/settings/shaders.rst b/docs/source/reference/modding/settings/shaders.rst index 808fb2932a..d0011df0b0 100644 --- a/docs/source/reference/modding/settings/shaders.rst +++ b/docs/source/reference/modding/settings/shaders.rst @@ -191,6 +191,25 @@ torches and lanterns. In Morrowind, this multiplier is non-existent, i.e. it is always 1.0. +classic falloff +--------------- + +:Type: boolean +:Range: True/False +:Default: False + +Use the traditional point light attenuation formula which lacks an early fade out. + +A flaw of the traditional formula is that light influence never quite reaches zero. +This is physically accurate, but because lights don't have infinite radius (see :ref:`light bounds multiplier`), +this can cause lighting seams between objects that got the relevant point light assigned and objects that didn't. +Early fade out helps diminish these seams at the cost of darkening the scene. + +Morrowind uses the traditional formula, so you may want to enable this if you dislike the brightness differences. +Alternatively, refer to :ref:`minimum interior brightness`. + +'legacy' :ref:`lighting method` behaves as if this setting were enabled. + maximum light distance ---------------------- @@ -237,17 +256,19 @@ minimum interior brightness :Range: 0.0-1.0 :Default: 0.08 -Sets the minimum interior ambient brightness for interior cells when -:ref:`lighting method` is not 'legacy'. A consequence of the new lighting system -is that interiors will sometimes be darker since light sources now have sensible -fall-offs. A couple solutions are to either add more lights or increase their +Sets the minimum interior ambient brightness for interior cells. + +A consequence of the new lighting system is that interiors will sometimes be darker +since light sources now have sensible fall-offs. +A couple solutions are to either add more lights or increase their radii to compensate, but these require content changes. For best results it is recommended to set this to 0.0 to retain the colors that level designers intended. If brighter interiors are wanted, however, this setting should be increased. Note, it is advised to keep this number small (< 0.1) to avoid the aforementioned changes in visuals. -This setting has no effect if :ref:`lighting method` is 'legacy'. +This setting has no effect if :ref:`lighting method` is 'legacy' +or if :ref:`classic falloff` is enabled. antialias alpha test -------------------- diff --git a/files/data/l10n/OMWEngine/de.yaml b/files/data/l10n/OMWEngine/de.yaml index 94398c00b2..8543436c44 100644 --- a/files/data/l10n/OMWEngine/de.yaml +++ b/files/data/l10n/OMWEngine/de.yaml @@ -78,6 +78,17 @@ CameraSensitivity: "Kameraempfindlichkeit" CameraZoomIn: "Kamera hineinzoomen" CameraZoomOut: "Kamera herauszoomen" ChangeRequiresRestart: "Diese Änderung erfordert einen Neustart, um wirksam zu werden." +ClassicFalloff: "Klassischer Lichtabfall" +ClassicFalloffTooltip: |- + Standard: aus + Verwendet die traditionelle Formel für die Abschwächung von Punktlichtquellen, die kein frühzeitiges Ausblenden aufweist. + + Ein Nachteil der traditionellen Formel ist, dass der Lichteinfluss nie ganz Null erreicht. + Dies ist physikalisch korrekt, kann aber zu Beleuchtungsnähten führen, da Lichter nicht die gesamte Szene beeinflussen. + Frühzeitiges Ausblenden hilft, diese Nähte zu verringern, allerdings auf Kosten einer dunkleren Szene. + + Morrowind verwendet die traditionelle Formel, daher möchten Sie dies möglicherweise aktivieren, wenn Ihnen die Helligkeitsunterschiede nicht gefallen. + Alternativ können Sie versuchen, die minimale Innenraumhelligkeit zu ändern. ConfirmResetBindings: "Alle Tastenbelegungen zurücksetzen?" ConfirmResolution: "Neue Auflösung wird sofort angewendet. Fortsetzen?" Controller: "Controller" @@ -95,7 +106,7 @@ EnableController: "Controller aktivieren" FieldOfView: "Sichtfeld" FieldOfViewLow: "Niedrig" FieldOfViewHigh: "Hoch" -ForcePerPixelLighting: "Beleuchtung pro Pixel erzwingen" +ForcePerPixelLighting: "Beleuchtung pro Pixel" ForcePerPixelLightingTooltip: |- Erzwingt die Verwendung der Beleuchtung pro Pixel. Standardmäßig verwenden nur Bump- und Normal-mapped-Objekte eine Beleuchtung pro Pixel. @@ -130,7 +141,7 @@ LightsLightingMethodTooltip: "Legt die interne Behandlung von Lichtquellen fest. LightsMaximumDistance: "Maximale Lichtreichweite" LightsMaximumDistanceTooltip: "Standard: 8192 (1 Zelle)\nMaximale Entfernung, bis zu der Lichtquellen noch dargestellt werden (gemessen in In-Game-Einheiten).\n\nEin Wert von 0 entspricht einer unbegrenzten Reichweite." LightsMinimumInteriorBrightness: "Minimale Helligkeit in Innenräumen" -LightsMinimumInteriorBrightnessTooltip: "Standard: 0,08\nMinimale Umgebungshelligkeit in Innenräumen.\n\nKann erhöht werden, falls Innenräume (v.a. bei Shader-Beleuchtungsmethoden) zu dunkel dargestellt werden." +LightsMinimumInteriorBrightnessTooltip: "Standard: 0,08\nMinimale Umgebungshelligkeit in Innenräumen.\n\nKann erhöht werden, falls Innenräume zu dunkel dargestellt werden.\n\nDies hat keine Auswirkung, wenn der klassische Lichtabfall verwendet wird." MaxLights: "Maximale Anzahl von Lichtquellen pro Objekt" MaxLightsTooltip: "Standard: 8\nMaximale Anzahl von Lichtquellen, die ein Objekt beleuchten können.\n\nKleine Werte können gerade an Orten mit vielen Lichtquellen zum Aufploppen und zum schnellen Wechsel von Lichtern führen, wie es aus der Original-Engine und anderen The-Elder-Scrolls-Titeln bekannt ist." MenuHelpDelay: "Verzögerung des Hilfe-Menüs" diff --git a/files/data/l10n/OMWEngine/en.yaml b/files/data/l10n/OMWEngine/en.yaml index 80718b67c7..c1e3e8b27a 100644 --- a/files/data/l10n/OMWEngine/en.yaml +++ b/files/data/l10n/OMWEngine/en.yaml @@ -78,6 +78,17 @@ CameraSensitivity: "Camera Sensitivity" CameraZoomIn: "Zoom Camera In" CameraZoomOut: "Zoom Camera Out" ChangeRequiresRestart: "This change requires a restart to take effect." +ClassicFalloff: "Classic Falloff" +ClassicFalloffTooltip: |- + Default: off + Use the traditional point light attenuation formula which lacks an early fade out. + + A flaw of the traditional formula is that light influence never quite reaches zero. + This is physically accurate, but can cause lighting seams because lights do not affect the entire scene. + Early fade out helps diminish these seams at the cost of darkening the scene. + + Morrowind uses the traditional formula, so you may want to enable this if you dislike the brightness differences. + Alternatively, try changing the minimum interior brightness. ConfirmResetBindings: "Reset all controls to the default?" ConfirmResolution: "New resolution will be applied immediately. Do you want to continue?" Controller: "Controller" @@ -95,7 +106,7 @@ EnableController: "Enable Controller" FieldOfView: "Field of View" FieldOfViewHigh: "High" FieldOfViewLow: "Low" -ForcePerPixelLighting: "Force Per-Pixel Lighting" +ForcePerPixelLighting: "Per-Pixel Lighting" ForcePerPixelLightingTooltip: |- Force the use of per-pixel lighting. By default, only bump- and normal-mapped objects use per-pixel lighting. @@ -130,7 +141,7 @@ LightsLightingMethodTooltip: "Set the internal handling of light sources.\n\n 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" -LightsMinimumInteriorBrightnessTooltip: "Default: 0.08\nMinimum ambient interior brightness.\n\nIncrease this if you feel interiors are too dark." +LightsMinimumInteriorBrightnessTooltip: "Default: 0.08\nMinimum ambient interior brightness.\n\nIncrease this if you feel interiors are too dark.\n\nThis has no effect if classic falloff is used." MaxLights: "Max Lights" MaxLightsTooltip: "Default: 8\nMaximum number of lights per object.\n\nA low number near default will cause light popping similar to what you would see with legacy lighting." MenuHelpDelay: "Menu Help Delay" diff --git a/files/data/l10n/OMWEngine/fr.yaml b/files/data/l10n/OMWEngine/fr.yaml index ed18410274..2ff7da5d2f 100644 --- a/files/data/l10n/OMWEngine/fr.yaml +++ b/files/data/l10n/OMWEngine/fr.yaml @@ -78,6 +78,17 @@ CameraSensitivity: "Sensibilité de la caméra" CameraZoomIn: "Zoom avant de la caméra" CameraZoomOut: "Zoom arrière de la caméra" ChangeRequiresRestart: "Ce changement requiert un redémarrage de l'application pour prendre effet." +ClassicFalloff: "Atténuation classique" +ClassicFalloffTooltip: |- + valeur par défaut: inactif + Utilise la formule traditionnelle d'atténuation de la lumière ponctuelle qui n'a pas de diminution précoce. + + Un défaut de la formule traditionnelle est que l'influence de la lumière n'atteint jamais tout à fait zéro. + C'est physiquement précis, mais peut causer des coutures d'éclairage car les lumières n'affectent pas toute la scène. + La diminution précoce aide à atténuer ces coutures au prix d'un assombrissement de la scène. + + Morrowind utilise la formule traditionnelle, vous pourriez donc vouloir activer ceci si vous n'aimez pas les différences de luminosité. + Alternativement, essayez de modifier la luminosité minimale intérieure. ConfirmResetBindings: "Réinitialiser tous les contrôles à leurs valeurs par défaut ?" ConfirmResolution: "La nouvelle résolution d'affichage sera appliquée instantanément. Voulez-vous continuer ?" Controller: "Manette" @@ -95,7 +106,7 @@ EnableController: "Activer la manette" FieldOfView: "Champ de vision" FieldOfViewHigh: "Étendu" FieldOfViewLow: "Restreint" -ForcePerPixelLighting: "Forcer l'éclairage par pixel" +ForcePerPixelLighting: "Éclairage par pixel" ForcePerPixelLightingTooltip: |- Force l'usage de l'éclairage par pixel. Par défaut, seuls les objets avec des "bump" et "normal" maps utilisent l'éclairage par pixel. @@ -130,7 +141,7 @@ LightsLightingMethodTooltip: "Définit la gestion des sources lumineuses :\n\n 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" -LightsMinimumInteriorBrightnessTooltip: "valeur par défaut: 0.08\nLuminosité ambiante minimum en intérieur.\n\nAugmentez cette valeur si les intérieurs vous semblent trop sombres." +LightsMinimumInteriorBrightnessTooltip: "valeur par défaut: 0.08\nLuminosité ambiante minimum en intérieur.\n\nAugmentez cette valeur si les intérieurs vous semblent trop sombres.\n\nCela n'a aucun effet si l'atténuation classique est utilisée." MaxLights: "Maximum de sources lumineuses" MaxLightsTooltip: "valeur par défaut: 8\nNombre maximum de sources lumineuses par objet.\n\nUne valeur faible mène à des apparitions tardives des sources lumineuses similaires à celles obtenues avec la méthode d'éclairage traditionnelle." MenuHelpDelay: "Délai d'affichage du menu d'aide" diff --git a/files/data/l10n/OMWEngine/ru.yaml b/files/data/l10n/OMWEngine/ru.yaml index ffaba85859..1dc5ccf5bf 100644 --- a/files/data/l10n/OMWEngine/ru.yaml +++ b/files/data/l10n/OMWEngine/ru.yaml @@ -78,6 +78,17 @@ CameraSensitivity: "Чувствительность камеры" CameraZoomIn: "Приблизить камеру" CameraZoomOut: "Отдалить камеру" ChangeRequiresRestart: "Чтобы это изменение вступило в силу, нужно перезапустить приложение." +ClassicFalloff: "Классическое угасание" +ClassicFalloffTooltip: |- + По умолчанию: выкл + Использовать традиционную формулу угасания точечных источников света, в которой полного угасания не происходит. + + Изъян традиционной формулы заключается в том, что влияние света на сцену никогда не достигает нуля. + Это корректно с физической точки зрения, но приводит к швам, потому что источник света не может влиять на всю сцену сразу. + Полное угасание позволяет сильно уменьшить количество таких швов ценой того, что сцена становится темнее. + + Morrowind использует традиционную формулу, поэтому вы можете решить включить эту настройку, если изменения освещенности вам не по душе. + Кроме того, вместо включения этой настройки вы также можете попробовать изменить минимальный уровень освещения в интерьерах. ConfirmResetBindings: "Сбросить все настройки управления?" ConfirmResolution: "Разрешение будет изменено немедленно. Продолжить?" Controller: "Геймпад" @@ -95,7 +106,7 @@ EnableController: "Геймпад" FieldOfView: "Поле зрения" FieldOfViewLow: "Маленькое" FieldOfViewHigh: "Большое" -ForcePerPixelLighting: "Принудительное попиксельное освещение" +ForcePerPixelLighting: "Попиксельное освещение" ForcePerPixelLightingTooltip: |- Использовать попиксельное освещение принудительно. По умолчанию его используют только объекты, использующие карты бампа и карты нормалей. @@ -130,7 +141,7 @@ LightsLightingMethodTooltip: "Задает способ обработки ис LightsMaximumDistance: "Дальность отображения источников света" LightsMaximumDistanceTooltip: "Значение по умолчанию: 8192\nМаксимальное расстояние, на котором будут отображаться источники света (во внутриигровых единицах измерения).\n\nЕсли 0, то расстояние не ограничено." LightsMinimumInteriorBrightness: "Минимальный уровень освещения в помещениях" -LightsMinimumInteriorBrightnessTooltip: "Значение по умолчанию: 0.08\nМинимальный уровень фонового освещения в помещениях.\n\nУвеличьте значение, если помещения в игре кажутся слишком темными." +LightsMinimumInteriorBrightnessTooltip: "Значение по умолчанию: 0.08\nМинимальный уровень фонового освещения в помещениях.\n\nУвеличьте значение, если помещения в игре кажутся слишком темными. Эта настройка не имеет эффекта, если используется классическое угасание." MaxLights: "Макс. кол-во источников света" MaxLightsTooltip: "Значение по умолчанию: 8\nМаксимальное количество источников света для каждого объекта.\n\nНизкие числа (близкие к значению по умолчанию) приводят к резким перепадам освещения, как при устаревшем методе освещения." MenuHelpDelay: "Задержка всплывающих подсказок" diff --git a/files/data/l10n/OMWEngine/sv.yaml b/files/data/l10n/OMWEngine/sv.yaml index 5103db9ed3..da5586a05d 100644 --- a/files/data/l10n/OMWEngine/sv.yaml +++ b/files/data/l10n/OMWEngine/sv.yaml @@ -78,6 +78,17 @@ CameraSensitivity: "Kamerakänslighet" CameraZoomIn: "Zooma in kamera" CameraZoomOut: "Zooma ut kamera" ChangeRequiresRestart: "Den här ändringen kräver omstart för att ge effekt." +ClassicFalloff: "Klassiskt ljusavtagande" +ClassicFalloffTooltip: |- + Förvalt: av + Använd den traditionella formeln för dämpning av punktljus som saknar en tidig uttoning. + + En nackdel med den traditionella formeln är att ljusets påverkan aldrig riktigt når noll. + Detta är fysiskt korrekt, men kan orsaka "sömmar" eftersom ljuset inte påverkar hela scenen. + Tidig uttoning minskar synligheten av dessa sömmar på bekostnad av att scenen blir mörkare. + + Morrowind använder den traditionella formeln, så du kanske vill aktivera detta om du ogillar skillnaderna i ljusstyrka. + Alternativt kan du prova att justera minsta ljusstyrkan i interiörer. ConfirmResetBindings: "Återställ alla kontroller till standard?" ConfirmResolution: "Ny upplösning kommer ställas in omedelbart. Vill du fortsätta?" Controller: "Handkontroll" @@ -95,7 +106,7 @@ EnableController: "Aktivera handkontroll" FieldOfView: "Synfält" FieldOfViewLow: "Låg" FieldOfViewHigh: "Hög" -ForcePerPixelLighting: "Tvinga per-pixelljussättning" +ForcePerPixelLighting: "Per-pixelljussättning" ForcePerPixelLightingTooltip: |- Tvingar användningen av per-pixelljussättning. Som standard är det annars bara objekt med normalkartor som använder per-pixelljussättning. @@ -131,7 +142,7 @@ LightsLightingMethodTooltip: "Välj intern hantering av ljuskällor.\n\n 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" -LightsMinimumInteriorBrightnessTooltip: "Förvalt: 0.08\nMinsta omgivande ljusstyrka i interiörer.\n\nÖka värdet om du anser att interiörer är för mörka." +LightsMinimumInteriorBrightnessTooltip: "Förvalt: 0.08\nMinsta omgivande ljusstyrka i interiörer.\n\nÖka värdet om du anser att interiörer är för mörka.\n\nDetta har ingen effekt om klassiskt ljusavtagande används." MaxLights: "Max antal ljuskällor" MaxLightsTooltip: "Förvalt: 8\nMaximalt antal ljuskällor per objekt.\n\nEtt lågt tal nära det förvalda kommer orsaka att ljuskällor poppar upp som vid ljussättningsmetoden Gammaldags." MenuHelpDelay: "Menyhjälp, fördröjning" #Unsure in what context this goes diff --git a/files/data/mygui/openmw_settings_window.layout b/files/data/mygui/openmw_settings_window.layout index 976f30e001..58f9ad3d75 100644 --- a/files/data/mygui/openmw_settings_window.layout +++ b/files/data/mygui/openmw_settings_window.layout @@ -597,19 +597,33 @@ - - + + + - + + + + + + + + + + + + + + diff --git a/files/settings-default.cfg b/files/settings-default.cfg index 70b0b133ab..1aab8554ae 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -476,6 +476,11 @@ apply lighting to environment maps = false # 'force per pixel lighting' is enabled. lighting method = shaders compatibility +# Use the traditional light attenuation formula. +# This disables OpenMW's adjustment to the formula that ensures point lights can properly fade out. +# When 'lighting method' is set to 'legacy', this setting is always true. +classic falloff = false + # Sets the bounding sphere multiplier of light sources. # The bounding sphere is used to determine if an object should receive lighting. # Higher values will allow for smoother transitions of light sources, @@ -496,6 +501,7 @@ max lights = 8 # Sets minimum ambient brightness of interior cells. Levels below this threshold will have their # ambient values adjusted to balance the darker interiors. # When 'lighting method' is set to 'legacy', this setting will have no effect. +# This setting will also have no effect if 'classic falloff' is true. minimum interior brightness = 0.08 # Convert the alpha test (cutout/punchthrough alpha) to alpha-to-coverage. diff --git a/files/shaders/lib/light/lighting.glsl b/files/shaders/lib/light/lighting.glsl index 8bb6ba148f..4a86233294 100644 --- a/files/shaders/lib/light/lighting.glsl +++ b/files/shaders/lib/light/lighting.glsl @@ -66,7 +66,7 @@ void doLighting(vec3 viewPos, vec3 viewNormal, float shininess, out vec3 diffuse float lightDistance = length(lightPos); // cull non-FFP point lighting by radius, light is guaranteed to not fall outside this bound with our cutoff -#if !@lightingMethodFFP +#if !@classicFalloff && !@lightingMethodFFP if (lightDistance > lcalcRadius(lightIndex) * 2.0) continue; #endif diff --git a/files/shaders/lib/light/lighting_util.glsl b/files/shaders/lib/light/lighting_util.glsl index 81db04a317..b56afe285b 100644 --- a/files/shaders/lib/light/lighting_util.glsl +++ b/files/shaders/lib/light/lighting_util.glsl @@ -106,7 +106,7 @@ float lcalcRadius(int lightIndex) float lcalcIllumination(int lightIndex, float dist) { float illumination = 1.0 / (lcalcConstantAttenuation(lightIndex) + lcalcLinearAttenuation(lightIndex) * dist + lcalcQuadraticAttenuation(lightIndex) * dist * dist); -#if @lightingMethodPerObjectUniform || @lightingMethodUBO +#if !@classicFalloff && !@lightingMethodFFP // Fade illumination between the radius and the radius doubled to diminish pop-in illumination *= 1.0 - quickstep((dist / lcalcRadius(lightIndex)) - 1.0); #endif