From 9398117ea77c2313b84a82f49383c42af66ad06c Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sun, 24 Feb 2019 20:54:01 +0400 Subject: [PATCH] Allow to do not reflect terrain --- apps/openmw/mwgui/settingswindow.cpp | 4 ++-- apps/openmw/mwrender/water.cpp | 13 +++++++------ docs/source/reference/modding/settings/water.rst | 15 ++++++++------- files/mygui/openmw_settings_window.layout | 3 ++- files/settings-default.cfg | 2 +- 5 files changed, 20 insertions(+), 17 deletions(-) diff --git a/apps/openmw/mwgui/settingswindow.cpp b/apps/openmw/mwgui/settingswindow.cpp index 68e606ee74..aedde7bde8 100644 --- a/apps/openmw/mwgui/settingswindow.cpp +++ b/apps/openmw/mwgui/settingswindow.cpp @@ -260,7 +260,7 @@ namespace MWGui mWaterTextureSize->setIndexSelected(2); int waterReflectionDetail = Settings::Manager::getInt("reflection detail", "Water"); - waterReflectionDetail = std::min(3, std::max(0, waterReflectionDetail)); + waterReflectionDetail = std::min(4, std::max(0, waterReflectionDetail)); mWaterReflectionDetail->setIndexSelected(waterReflectionDetail); mWindowBorderButton->setEnabled(!Settings::Manager::getBool("fullscreen", "Video")); @@ -344,7 +344,7 @@ namespace MWGui void SettingsWindow::onWaterReflectionDetailChanged(MyGUI::ComboBox* _sender, size_t pos) { - unsigned int level = std::min((unsigned int)3, (unsigned int)pos); + unsigned int level = std::min((unsigned int)4, (unsigned int)pos); Settings::Manager::setInt("reflection detail", "Water", level); apply(); } diff --git a/apps/openmw/mwrender/water.cpp b/apps/openmw/mwrender/water.cpp index e5c2be95d9..d047130d4a 100644 --- a/apps/openmw/mwrender/water.cpp +++ b/apps/openmw/mwrender/water.cpp @@ -316,13 +316,14 @@ public: setSmallFeatureCullingPixelSize(Settings::Manager::getInt("small feature culling pixel size", "Water")); setName("ReflectionCamera"); - unsigned int reflectionDetail = Settings::Manager::getInt("reflection detail", "Water"); - reflectionDetail = std::max((unsigned int)isInterior, reflectionDetail); + int reflectionDetail = Settings::Manager::getInt("reflection detail", "Water"); + reflectionDetail = std::min(4, std::max(isInterior ? 2 : 0, reflectionDetail)); unsigned int extraMask = 0; - if(reflectionDetail >= 1) extraMask |= Mask_Static; - if(reflectionDetail >= 2) extraMask |= Mask_Effect|Mask_ParticleSystem|Mask_Object; - if(reflectionDetail >= 3) extraMask |= Mask_Actor; - setCullMask(Mask_Scene|Mask_Terrain|Mask_Sky|Mask_Player|Mask_Lighting|extraMask); + if(reflectionDetail >= 1) extraMask |= Mask_Terrain; + if(reflectionDetail >= 2) extraMask |= Mask_Static; + if(reflectionDetail >= 3) extraMask |= Mask_Effect|Mask_ParticleSystem|Mask_Object; + if(reflectionDetail >= 4) extraMask |= Mask_Player|Mask_Actor; + setCullMask(Mask_Scene|Mask_Sky|Mask_Lighting|extraMask); setNodeMask(Mask_RenderToTexture); unsigned int rttSize = Settings::Manager::getInt("rtt size", "Water"); diff --git a/docs/source/reference/modding/settings/water.rst b/docs/source/reference/modding/settings/water.rst index b00c3cb9b8..3581efb991 100644 --- a/docs/source/reference/modding/settings/water.rst +++ b/docs/source/reference/modding/settings/water.rst @@ -62,17 +62,18 @@ reflection detail -------------- :Type: integer -:Range: 0, 1, 2, 3 -:Default: 1 +:Range: 0, 1, 2, 3, 4 +:Default: 2 Controls what kinds of things are rendered in water reflections. -0: only terrain and the sky are reflected (acts like level 1 in interiors) -1: statics, activators, and doors are also reflected -2: items, containers, and particles are also reflected -3: actors are also reflected +0: only sky is reflected +1: terrain is also reflected +2: statics, activators, and doors are also reflected +3: items, containers, and particles are also reflected +4: actors are also reflected -The player is always reflected in third-person mode. +In interiors the lowest level is 2. This setting can be changed ingame with the "Reflection shader detail" dropdown under the Water tab of the Video panel in the Options menu. small feature culling pixel size diff --git a/files/mygui/openmw_settings_window.layout b/files/mygui/openmw_settings_window.layout index cc24adbe35..0e4f6e626e 100644 --- a/files/mygui/openmw_settings_window.layout +++ b/files/mygui/openmw_settings_window.layout @@ -429,10 +429,11 @@ + - + diff --git a/files/settings-default.cfg b/files/settings-default.cfg index cddf94af95..e3920a4bf9 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -463,7 +463,7 @@ rtt size = 512 refraction = false # Draw objects on water reflections. -reflection detail = 1 +reflection detail = 2 # Overrides the value in '[Camera] small feature culling pixel size' specifically for water reflection/refraction textures. small feature culling pixel size = 20.0