mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-27 16:09:42 +00:00
Shaders: Hot reload, togglable by lua debug command See merge request OpenMW/openmw!2238 (cherry picked from commit4078f19c74
)8d194a16
Shaders: rudimentary hot reloader on shaders4e7c1c5b
Added break when the operation failed6b38d622
Added lua bindings to toggle hot reload (disabled by default) or to trigger a reload31d41252
forgot memory includef78fa989
fixed include, cleaned comments and indentationfc8838c7
Renamed lua binding, and use action to avoid concurrency issueaa51d6de
Missing chrono include ?68d06989
Fixed cyclical included checkb6d7293a
Removed weird lines that I thought were necessary to please the compiler9a475b0c
fixed blank lines and missing breakscdd95f78
replaced empty function body by defaulta1c8dc9d
C++17 compat ?7b78bf4b
Fix files with different defines weren't added to the hot reload managercc9d4364
includes now work when the same shader has different defines15751c57
Lua debug api doc3ab0a991
Hot reload done only once every 200 ms, no point in beeing fasterdf69fc76
Post processing shaders now use the same lua commands, no more launcher option...c71f3508
changed overview.rst of post processing603b30e1
Added some variable names to make it clearer what their function wasbaadc06e
Merge branch 'master' into 'SHADER_HOT_RELOAD'decfbc53
Fix threading issuesb14cc673
adds missing decleration16a4b571
adds missing include166717d6
Makes sure threads are only stopped once ,and that they will be re-started25c1f0ca
Renamed variable to fix case issue
53 lines
2 KiB
ReStructuredText
53 lines
2 KiB
ReStructuredText
#####################################
|
|
Overview of Post Processing Framework
|
|
#####################################
|
|
|
|
Overview
|
|
========
|
|
|
|
OpenMW supports a moddable post process framework for creating and
|
|
controlling screenspace effects. This is integrated into OpenMW's Lua API, see
|
|
`reference <../lua-scripting/openmw_postprocessing.html>`_ for details.
|
|
|
|
Basic concepts
|
|
==============
|
|
|
|
Pass
|
|
Describes a single shader invocation pass. Currently only pixel (also known
|
|
as fragment) shaders are supported.
|
|
|
|
Technique/Shader
|
|
An ordered list of passes, techniques will encompass a single effect like
|
|
bloom or SSAO. Technique is interchangable with shader.
|
|
|
|
Installing and Activating
|
|
=========================
|
|
|
|
Shaders are managed through the virtual file system, simply install the associated
|
|
archive or folder as described in :ref:`mod-install<install>`. Shaders must be
|
|
in the `Shaders` directory to be discoverable. A shader can be activated in one
|
|
of two ways:
|
|
|
|
1. Adding the shaders filename (without its extension) to the end of the
|
|
:ref:`chain` list in ``settings.cfg``.
|
|
2. Using the in game post processor HUD, which can be activated with the ``F2``
|
|
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 by using the lua command `debug.setShaderHotReloadEnabled(true)`.
|
|
Whenever a file is modified and saved, the shader will automatically reload in game.
|
|
You can also trigger a single reload using `debug.triggerShaderReload()`
|
|
This allows shaders to be written in a 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.
|