diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index 6f7ec25b98..8c39c13941 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -1005,6 +1005,8 @@ namespace MWRender { mWater->setEnabled(enabled); mSky->setWaterEnabled(enabled); + + mPostProcessor->getStateUpdater()->setIsWaterEnabled(enabled); } void RenderingManager::setWaterHeight(float height) diff --git a/components/fx/stateupdater.hpp b/components/fx/stateupdater.hpp index b2beb8d576..0ea217c8ec 100644 --- a/components/fx/stateupdater.hpp +++ b/components/fx/stateupdater.hpp @@ -81,6 +81,8 @@ namespace fx void setWaterHeight(float height) { mData.get() = height; } + void setIsWaterEnabled(bool enabled) { mData.get() = enabled; } + void setSimulationTime(float time) { mData.get() = time; } void setDeltaSimulationTime(float time) { mData.get() = time; } @@ -145,6 +147,8 @@ namespace fx struct WaterHeight : std140::Float { static constexpr std::string_view sName = "waterHeight"; }; + struct IsWaterEnabled : std140::Bool { static constexpr std::string_view sName = "isWaterEnabled"; }; + struct SimulationTime : std140::Float { static constexpr std::string_view sName = "simulationTime"; }; struct DeltaSimulationTime : std140::Float { static constexpr std::string_view sName = "deltaSimulationTime"; }; @@ -182,6 +186,7 @@ namespace fx GameHour, SunVis, WaterHeight, + IsWaterEnabled, SimulationTime, DeltaSimulationTime, WindSpeed, diff --git a/docs/source/reference/postprocessing/omwfx.rst b/docs/source/reference/postprocessing/omwfx.rst index 4168399daa..6b43af2cd2 100644 --- a/docs/source/reference/postprocessing/omwfx.rst +++ b/docs/source/reference/postprocessing/omwfx.rst @@ -97,6 +97,8 @@ Builtin Uniforms | | | | | | | Exterior water level is always zero | +-------------+------------------------------+--------------------------------------------------+ +| bool | ``omw.isWaterEnabled`` | True if water is enabled for current cell | ++-------------+------------------------------+--------------------------------------------------+ | float | ``omw.simulationTime`` | The time in milliseconds since simulation began | +-------------+------------------------------+--------------------------------------------------+ | float | ``omw.deltaSimulationTime`` | The change in `omw.simulationTime` |