1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-29 04:20:29 +00:00

Post processing shaders localization

This commit is contained in:
Andrei Kortunov 2022-07-24 13:18:50 +00:00 committed by Petr Mikheev
parent ea9f2761c3
commit e0c05a15fb
9 changed files with 43 additions and 11 deletions
components/fx
docs/source/reference/postprocessing
files/data

@ -80,7 +80,10 @@ namespace fx
void UniformBase::init(const std::shared_ptr<fx::Types::UniformBase>& uniform)
{
mLabel->setCaption(uniform->mDisplayName.empty() ? uniform->mName : uniform->mDisplayName);
if (uniform->mDisplayName.empty())
mLabel->setCaption(uniform->mName);
else
mLabel->setCaptionWithReplacing(uniform->mDisplayName);
if (uniform->mDescription.empty())
{
@ -163,4 +166,4 @@ namespace fx
assignWidget(mClient, "Client");
}
}
}
}

@ -34,12 +34,19 @@ of two ways:
key by default. This is the recommended method as manual editing can be error
prone.
Localization
============
Output text (e.g. shader description) can use the ``#{ContextName:Key}`` tags.
In this case OpenMW replaces it for value of ``Key`` key from the
``Data Files\L10n\ContextName\used_language.yaml`` file.
Hot Reloading
==============
=============
It is possible to modify a shader without restarting OpenMW, :ref:`live reload`
must be enabled in ``settings.cfg``. Whenever a file is modified and saved, the
shader will automatically reload in game. This allows shaders to be written in a
text editor you are comfortable with. The only restriction is that new shaders
cannot be added, as the VFS will not be rebuilt and OpenMW will not be aware of
the new file.
text editor you are comfortable with. The only restriction is that the VFS is not
aware of new files or changes in non-shader files, so new shaders and localization
strings can not be used.

@ -20,6 +20,8 @@ set(BUILTIN_DATA_FILES
fonts/Pelagiad.omwfont
fonts/PelagiadFontLicense.txt
l10n/BuiltInShaders/en.yaml
l10n/BuiltInShaders/ru.yaml
l10n/Calendar/en.yaml
l10n/Calendar/ru.yaml
l10n/Calendar/sv.yaml

@ -0,0 +1,3 @@
DisplayDepthDescription: "Visualizes the depth buffer."
DisplayDepthFactorDescription: "Determines correlation between pixel depth value and its output color. High values lead to brighter image."
DisplayDepthFactorName: "Color factor"

@ -0,0 +1,3 @@
DisplayDepthDescription: "Визуализирует буфер глубины."
DisplayDepthFactorDescription: "Определяет соотношение между значением глубины пикселя и его цветом. Чем выше значение, тем ярче будет изображение."
DisplayDepthFactorName: "Соотношение цвета"

@ -1,7 +1,11 @@
Abovewater: "Abovewater"
Author: "Author"
Configuration: "Configuration"
ContrastLevelDescription: "Constrast level"
ContrastLevelName: "Constrast"
Description: "Description"
GammaLevelDescription: "Gamma level"
GammaLevelName: "Gamma"
InExteriors: "Exteriors"
InInteriors: "Interiors"
KeyboardControls: |
@ -11,6 +15,7 @@ KeyboardControls: |
Shift+Left-Arrow > Deactive shader
Shift+Up-Arrow > Move shader up
Shift+Down-Arrow > Move shader down
MainPassDescription: "Passes scene data to post processing shaders. Can not be toggled or moved."
PostProcessHUD: "Postprocess HUD"
ResetShader: "Reset shader to default state"
ShaderLocked: "Locked"

@ -1,7 +1,11 @@
Abovewater: "Над водой"
Author: "Автор"
Configuration: "Настройки"
ContrastLevelDescription: "Контрастность изображения"
ContrastLevelName: "Контрастность"
Description: "Описание"
GammaLevelDescription: "Яркость изображения"
GammaLevelName: "Яркость"
InExteriors: "Вне помещений"
InInteriors: "В помещениях"
KeyboardControls: |
@ -11,10 +15,11 @@ KeyboardControls: |
Shift+Left-Arrow > Выключить шейдер
Shift+Up-Arrow > Передвинуть шейдер выше
Shift+Down-Arrow > Передвинуть шейдер ниже
MainPassDescription: "Передает данные сцены в шейдеры постобработки. Не может быть выключен или передвинут."
PostProcessHUD: "Настройки постобработки"
ResetShader: "Обнулить настройки этого шейдера"
ShaderLocked: "Заблокирован"
ShaderLockedDescription: "Не может быть выключен или перемещен, управляется внешним Lua-скриптом"
ShaderLockedDescription: "Не может быть выключен или передвинут, управляется внешним Lua-скриптом"
ShaderResetUniform: "x"
Underwater: "Под водой"
Version: "Версия"

@ -3,6 +3,8 @@ uniform_float uFactor {
min = 0.01;
max = 20.0;
default = 1.0;
display_name = "#{BuiltInShaders:DisplayDepthFactorName}";
description = "#{BuiltInShaders:DisplayDepthFactorDescription}";
}
fragment main {
@ -20,7 +22,7 @@ fragment main {
technique {
passes = main;
description = "Visualizes the depth buffer.";
description = "#{BuiltInShaders:DisplayDepthDescription}";
author = "OpenMW";
version = "1.0";
}

@ -11,7 +11,8 @@ uniform_float uGamma {
step = 0.01;
min = 0.0;
max = 5.0;
description = "gamma level";
display_name = "#{PostProcessing:GammaLevelName}";
description = "#{PostProcessing:GammaLevelDescription}";
}
uniform_float uContrast {
@ -19,7 +20,8 @@ uniform_float uContrast {
step = 0.01;
min = 0.0;
max = 5.0;
description = "constrast level";
display_name = "#{PostProcessing:ContrastLevelName}";
description = "#{PostProcessing:ContrastLevelDescription}";
}
fragment main {
@ -37,7 +39,7 @@ fragment main {
}
technique {
description = "Main pass.";
description = "#{PostProcessing:MainPassDescription}";
version = "1.0";
author = "OpenMW";
passes = main;