diff --git a/components/sceneutil/lightmanager.cpp b/components/sceneutil/lightmanager.cpp index 66fe231e11..178ea087c0 100644 --- a/components/sceneutil/lightmanager.cpp +++ b/components/sceneutil/lightmanager.cpp @@ -830,32 +830,33 @@ namespace SceneUtil if (settings.mLightingMethod == LightingMethod::FFP) { initFFP(ffpMaxLights); - return; } - - static bool hasLoggedWarnings = false; - - if (settings.mLightingMethod == LightingMethod::SingleUBO && !hasLoggedWarnings) + else { - if (!supportsUBO) - Log(Debug::Warning) - << "GL_ARB_uniform_buffer_object not supported: switching to shader compatibility lighting mode"; - if (!supportsGPU4) - Log(Debug::Warning) - << "GL_EXT_gpu_shader4 not supported: switching to shader compatibility lighting mode"; - hasLoggedWarnings = true; - } + static bool hasLoggedWarnings = false; - if (!supportsUBO || !supportsGPU4 || settings.mLightingMethod == LightingMethod::PerObjectUniform) - initPerObjectUniform(settings.mMaxLights); - else - initSingleUBO(settings.mMaxLights); + if (settings.mLightingMethod == LightingMethod::SingleUBO && !hasLoggedWarnings) + { + if (!supportsUBO) + Log(Debug::Warning) << "GL_ARB_uniform_buffer_object not supported: switching to shader " + "compatibility lighting mode"; + if (!supportsGPU4) + Log(Debug::Warning) + << "GL_EXT_gpu_shader4 not supported: switching to shader compatibility lighting mode"; + hasLoggedWarnings = true; + } - updateSettings(settings.mLightBoundsMultiplier, settings.mMaximumLightDistance, settings.mLightFadeStart); + if (!supportsUBO || !supportsGPU4 || settings.mLightingMethod == LightingMethod::PerObjectUniform) + initPerObjectUniform(settings.mMaxLights); + else + initSingleUBO(settings.mMaxLights); - getOrCreateStateSet()->addUniform(new osg::Uniform("PointLightCount", 0)); + getOrCreateStateSet()->addUniform(new osg::Uniform("PointLightCount", 0)); + + addCullCallback(new LightManagerCullCallback(this)); + } - addCullCallback(new LightManagerCullCallback(this)); + updateSettings(settings.mLightBoundsMultiplier, settings.mMaximumLightDistance, settings.mLightFadeStart); } LightManager::LightManager(const LightManager& copy, const osg::CopyOp& copyop) @@ -942,9 +943,6 @@ namespace SceneUtil void LightManager::updateSettings(float lightBoundsMultiplier, float maximumLightDistance, float lightFadeStart) { - if (getLightingMethod() == LightingMethod::FFP) - return; - mPointLightRadiusMultiplier = lightBoundsMultiplier; mPointLightFadeEnd = maximumLightDistance; if (mPointLightFadeEnd > 0) diff --git a/docs/source/reference/modding/settings/shaders.rst b/docs/source/reference/modding/settings/shaders.rst index 22ceb34f44..808fb2932a 100644 --- a/docs/source/reference/modding/settings/shaders.rst +++ b/docs/source/reference/modding/settings/shaders.rst @@ -148,13 +148,13 @@ lighting method Sets the internal handling of light sources. -'legacy' is restricted to 8 lights per object and emulates fixed function -pipeline compatible lighting. +'legacy' is restricted to 8 lights per object and it is the method closest to +fixed function pipeline lighting. 'shaders compatibility' removes the light limit controllable through :ref:`max lights` and follows a modified attenuation formula which can drastically reduce -light popping and seams. This mode also enables lighting on groundcover and a -configurable light fade. It is recommended to use this with older hardware and a +light popping and seams. This mode also enables lighting on groundcover. +It is recommended to use this with older hardware and a light limit closer to 8. Because of its wide range of compatibility it is set as the default. @@ -189,7 +189,7 @@ increase in :ref:`max lights` and thus carries a performance penalty. This especially helps with abrupt light popping with handheld light sources such as torches and lanterns. -This setting has no effect if :ref:`lighting method` is 'legacy'. +In Morrowind, this multiplier is non-existent, i.e. it is always 1.0. maximum light distance ---------------------- @@ -202,7 +202,7 @@ The maximum distance from the camera that lights will be illuminated, applies to both interiors and exteriors. A lower distance will improve performance. Set this to a non-positive value to disable fading. -This setting has no effect if :ref:`lighting method` is 'legacy'. +In Morrowind, there is no distance-based light fading. light fade start ---------------- @@ -214,8 +214,7 @@ light fade start The fraction of the maximum distance at which lights will begin to fade away. Tweaking it will make the transition proportionally more or less smooth. -This setting has no effect if the :ref:`maximum light distance` is non-positive -or :ref:`lighting method` is 'legacy'. +This setting has no effect if the :ref:`maximum light distance` is non-positive. max lights ---------- diff --git a/files/data/l10n/OMWEngine/de.yaml b/files/data/l10n/OMWEngine/de.yaml index 151905f6b9..94398c00b2 100644 --- a/files/data/l10n/OMWEngine/de.yaml +++ b/files/data/l10n/OMWEngine/de.yaml @@ -125,7 +125,7 @@ LightsFadeStartMultiplier: "Multiplikator für Startwert der Lichtabblendung" LightsFadeStartMultiplierTooltip: "Standard: 0,85\nBruchteil der maximalen Lichtreichweite, bei der Lichtquellen langsam zu verblassen beginnen.\n\nKleinere Werte führen zu einem sanfteren Übergang, der allerdings bereits bei geringerer Entfernung startet; größere Werte machen den Übergang abrupter, betreffen aber nur weiter entfernte Lichtquellen." LightsLightingMethodTooltip: "Legt die interne Behandlung von Lichtquellen fest.\n\n „Veraltet“ verwendet immer bis zu 8 Lichtquellen pro Objekt und führt zu Ergebnissen, die denen der Original-Engine am ähnlichsten sind.\n\n - „Shader (Kompatibilitätsmodus)“ entfernt das Maximum von 8 Lichtquellen pro Objekt; Bodenvegetation wird von Lichtquellen beleuchtet und das sanfte Abblenden von Lichtquellen wird aktiviert. Es wird empfohlen, diese Option für ältere Hardware und Maximalwerte für Lichtquellen nahe 8 zu verwenden.\n\n + „Shader (Kompatibilitätsmodus)“ entfernt das Maximum von 8 Lichtquellen pro Objekt; Bodenvegetation wird von Lichtquellen beleuchtet. Es wird empfohlen, diese Option für ältere Hardware und Maximalwerte für Lichtquellen nahe 8 zu verwenden.\n\n „Shader“ bietet alle Vorteile von „Shader (Kompatibilitätsmodus)“, nutzt aber einen moderneren Ansatz, der größere Maximalwerte für Lichtquellen bei geringen bis keinen Leistungseinbußen ermöglicht. Funktioniert möglicherweise nicht auf älterer Hardware." 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." diff --git a/files/data/l10n/OMWEngine/en.yaml b/files/data/l10n/OMWEngine/en.yaml index 3379f946a3..80718b67c7 100644 --- a/files/data/l10n/OMWEngine/en.yaml +++ b/files/data/l10n/OMWEngine/en.yaml @@ -120,12 +120,12 @@ LightingMethodShadersCompatibility: "Shaders (compatibility)" LightingResetToDefaults: "Resets to default values, would you like to continue? Changes to lighting method will require a restart." Lights: "Lights" 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." +LightsBoundingSphereMultiplierTooltip: "Default: 1.65\nMultiplier 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 + \"Legacy\" always uses 8 lights per object. It provides results most similar to Morrowind's lighting.\n\n + \"Shaders (compatibility)\" removes the 8 light limit. This mode also enables lighting on groundcover. 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." diff --git a/files/data/l10n/OMWEngine/fr.yaml b/files/data/l10n/OMWEngine/fr.yaml index 0829f042d0..ed18410274 100644 --- a/files/data/l10n/OMWEngine/fr.yaml +++ b/files/data/l10n/OMWEngine/fr.yaml @@ -125,7 +125,7 @@ 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: "Définit la gestion des sources lumineuses :\n\n \"Traditionnelle\" Chaque objet est éclairé par 8 sources lumineuses. Cet méthode est la plus proche du jeu original.\n\n - \"Shaders (mode de compatibilité)\" supprime la limite des 8 sources lumineuses. Cette méthode permet d'éclairer la végétation au sol, mais aussi de configurer à quel distance une source lumineuse s'estompe. Ce choix est recommandé pour les ordinateurs plus anciens avec un nombre de sources lumineuses proche de 8.\n\n + \"Shaders (mode de compatibilité)\" supprime la limite des 8 sources lumineuses. Cette méthode permet d'éclairer la végétation au sol. Ce choix est recommandé pour les ordinateurs plus anciens avec un nombre de sources lumineuses proche de 8.\n\n \"Shaders\" offre tous les bénéfices apportés par \"Shaders (mode de compatibilité)\", mais utilise une approche moderne. Celle-ci permet, sur du matériel moderne, d'augmenter le nombre de sources lumineuses par objet sans perte de performance." 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." diff --git a/files/data/l10n/OMWEngine/ru.yaml b/files/data/l10n/OMWEngine/ru.yaml index 76f4076862..ffaba85859 100644 --- a/files/data/l10n/OMWEngine/ru.yaml +++ b/files/data/l10n/OMWEngine/ru.yaml @@ -125,7 +125,7 @@ LightsFadeStartMultiplier: "Множитель начала затухания" LightsFadeStartMultiplierTooltip: "Значение по умолчанию: 0.85\nДоля расстояния (относительно дальности отображения источников света), на которой свет начинает затухать.\n\nНизкие значения ведут к плавному затуханию, высокие - к резкому." LightsLightingMethodTooltip: "Задает способ обработки источников света.\n\n \"Устаревший\" всегда использует 8 источников света на объект и выдает освещение, наиболее близкое к таковому в оригинальной игре.\n\n - \"Шейдеры (режим совместимости)\" убирает ограничение в 8 источников света. Этот режим также позволяет освещению влиять на анимированную траву и позволяет настроить угасание света на расстоянии. Рекомендуется использовать этот режим на устаревшем аппаратном обеспечении и с количеством источников света на объект около 8.\n\n + \"Шейдеры (режим совместимости)\" убирает ограничение в 8 источников света. Этот режим также позволяет освещению влиять на анимированную траву. Рекомендуется использовать этот режим на устаревшем аппаратном обеспечении и с количеством источников света на объект около 8.\n\n \"Шейдеры\" работает аналогично режиму \"Шейдеры (режим совместимости)\", но использует более современный подход, позволяющий использовать большее количество источников света с минимальным влиянием на производительность на современном аппаратном обеспечении." LightsMaximumDistance: "Дальность отображения источников света" LightsMaximumDistanceTooltip: "Значение по умолчанию: 8192\nМаксимальное расстояние, на котором будут отображаться источники света (во внутриигровых единицах измерения).\n\nЕсли 0, то расстояние не ограничено." diff --git a/files/data/l10n/OMWEngine/sv.yaml b/files/data/l10n/OMWEngine/sv.yaml index dcd5a9033c..5103db9ed3 100644 --- a/files/data/l10n/OMWEngine/sv.yaml +++ b/files/data/l10n/OMWEngine/sv.yaml @@ -126,7 +126,7 @@ 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: "Välj intern hantering av ljuskällor.\n\n \"Gammaldags\" använder alltid max 8 ljuskällor per objekt och ger ljussättning likt ett gammaldags spel.\n\n - \"Shader (kompatibilitet)\" tar bort begränsningen med max 8 ljuskällor per objekt. Detta läge aktiverar också ljus på marktäckning och ett konfigurerbart ljusbleknande. Rekommenderas för äldre hårdvara tillsammans med en ljusbegränsning nära 8.\n\n + \"Shader (kompatibilitet)\" tar bort begränsningen med max 8 ljuskällor per objekt. Detta läge aktiverar också ljus på marktäckning. Rekommenderas för äldre hårdvara tillsammans med en ljusbegränsning nära 8.\n\n \"Shader\" har alla fördelar som \"Shader (kompatibilitet)\" har, med med ett modernt förhållningssätt som möjliggör fler maximalt antal ljuskällor med liten eller ingen prestandaförlust på modern hårdvara." 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."