1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-03-26 22:10:25 +00:00

Allow to do not reflect terrain

This commit is contained in:
Andrei Kortunov 2019-02-24 20:54:01 +04:00
parent 00ab552184
commit 9398117ea7
5 changed files with 20 additions and 17 deletions

View file

@ -260,7 +260,7 @@ namespace MWGui
mWaterTextureSize->setIndexSelected(2); mWaterTextureSize->setIndexSelected(2);
int waterReflectionDetail = Settings::Manager::getInt("reflection detail", "Water"); 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); mWaterReflectionDetail->setIndexSelected(waterReflectionDetail);
mWindowBorderButton->setEnabled(!Settings::Manager::getBool("fullscreen", "Video")); mWindowBorderButton->setEnabled(!Settings::Manager::getBool("fullscreen", "Video"));
@ -344,7 +344,7 @@ namespace MWGui
void SettingsWindow::onWaterReflectionDetailChanged(MyGUI::ComboBox* _sender, size_t pos) 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); Settings::Manager::setInt("reflection detail", "Water", level);
apply(); apply();
} }

View file

@ -316,13 +316,14 @@ public:
setSmallFeatureCullingPixelSize(Settings::Manager::getInt("small feature culling pixel size", "Water")); setSmallFeatureCullingPixelSize(Settings::Manager::getInt("small feature culling pixel size", "Water"));
setName("ReflectionCamera"); setName("ReflectionCamera");
unsigned int reflectionDetail = Settings::Manager::getInt("reflection detail", "Water"); int reflectionDetail = Settings::Manager::getInt("reflection detail", "Water");
reflectionDetail = std::max((unsigned int)isInterior, reflectionDetail); reflectionDetail = std::min(4, std::max(isInterior ? 2 : 0, reflectionDetail));
unsigned int extraMask = 0; unsigned int extraMask = 0;
if(reflectionDetail >= 1) extraMask |= Mask_Static; if(reflectionDetail >= 1) extraMask |= Mask_Terrain;
if(reflectionDetail >= 2) extraMask |= Mask_Effect|Mask_ParticleSystem|Mask_Object; if(reflectionDetail >= 2) extraMask |= Mask_Static;
if(reflectionDetail >= 3) extraMask |= Mask_Actor; if(reflectionDetail >= 3) extraMask |= Mask_Effect|Mask_ParticleSystem|Mask_Object;
setCullMask(Mask_Scene|Mask_Terrain|Mask_Sky|Mask_Player|Mask_Lighting|extraMask); if(reflectionDetail >= 4) extraMask |= Mask_Player|Mask_Actor;
setCullMask(Mask_Scene|Mask_Sky|Mask_Lighting|extraMask);
setNodeMask(Mask_RenderToTexture); setNodeMask(Mask_RenderToTexture);
unsigned int rttSize = Settings::Manager::getInt("rtt size", "Water"); unsigned int rttSize = Settings::Manager::getInt("rtt size", "Water");

View file

@ -62,17 +62,18 @@ reflection detail
-------------- --------------
:Type: integer :Type: integer
:Range: 0, 1, 2, 3 :Range: 0, 1, 2, 3, 4
:Default: 1 :Default: 2
Controls what kinds of things are rendered in water reflections. Controls what kinds of things are rendered in water reflections.
0: only terrain and the sky are reflected (acts like level 1 in interiors) 0: only sky is reflected
1: statics, activators, and doors are also reflected 1: terrain is also reflected
2: items, containers, and particles are also reflected 2: statics, activators, and doors are also reflected
3: actors 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. 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 small feature culling pixel size

View file

@ -429,10 +429,11 @@
</Widget> </Widget>
<Widget type="HBox" skin="" position="4 56 350 24"> <Widget type="HBox" skin="" position="4 56 350 24">
<Widget type="ComboBox" skin="MW_ComboBox" position="0 0 115 24" align="Left Top" name="WaterReflectionDetail"> <Widget type="ComboBox" skin="MW_ComboBox" position="0 0 115 24" align="Left Top" name="WaterReflectionDetail">
<Property key="AddItem" value="Off"/>
<Property key="AddItem" value="Terrain"/> <Property key="AddItem" value="Terrain"/>
<Property key="AddItem" value="World"/> <Property key="AddItem" value="World"/>
<Property key="AddItem" value="Objects"/> <Property key="AddItem" value="Objects"/>
<Property key="AddItem" value="Everything"/> <Property key="AddItem" value="Actors"/>
</Widget> </Widget>
<Widget type="AutoSizedTextBox" skin="SandText" position="64 4 90 16" align="Left Top"> <Widget type="AutoSizedTextBox" skin="SandText" position="64 4 90 16" align="Left Top">
<Property key="Caption" value="Reflection shader detail"/> <Property key="Caption" value="Reflection shader detail"/>

View file

@ -463,7 +463,7 @@ rtt size = 512
refraction = false refraction = false
# Draw objects on water reflections. # 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. # Overrides the value in '[Camera] small feature culling pixel size' specifically for water reflection/refraction textures.
small feature culling pixel size = 20.0 small feature culling pixel size = 20.0