Add slider for refraction size in settings window

0.6.3
Miloslav Číž 7 years ago
parent d13fc06baf
commit ee40b41285

@ -272,7 +272,7 @@ public:
void setWaterLevel(float waterLevel) void setWaterLevel(float waterLevel)
{ {
const float refractionScale = std::min(1.0f,std::max(0.0f, const float refractionScale = std::min(1.0f,std::max(0.01f, // 0.0 crashes the game
Settings::Manager::getFloat("refraction scale", "Water"))); Settings::Manager::getFloat("refraction scale", "Water")));
setViewMatrix(osg::Matrix::scale(1,1,refractionScale) * setViewMatrix(osg::Matrix::scale(1,1,refractionScale) *

@ -104,4 +104,4 @@ This setting only applies if water shader is on and refractions are enabled. Not
setting if off, there will still be small refractions caused by the water waves, which however do not cause such significant setting if off, there will still be small refractions caused by the water waves, which however do not cause such significant
distortion. distortion.
TODO: setting via GUI? Interation with rttsize? This setting can be edited with the 'Refraction scale' slider in the Water tab of the Video panel of the Options menu.

@ -394,8 +394,30 @@
<Property key="Caption" value="Reflect actors"/> <Property key="Caption" value="Reflect actors"/>
</Widget> </Widget>
</Widget> </Widget>
<Widget type="TextBox" skin="NormalText" position="4 84 350 18" align="Left Top">
<Property key="Caption" value="Refraction scale"/>
</Widget>
<Widget type="HBox" skin="" position="4 112 350 24">
<Widget type="MWScrollBar" skin="MW_HScroll" position="4 154 200 18" align="Left Top">
<Property key="Range" value="10000"/>
<Property key="Page" value="100"/>
<UserString key="SettingType" value="Slider"/>
<UserString key="SettingCategory" value="Water"/>
<UserString key="SettingName" value="refraction scale"/>
<UserString key="SettingValueType" value="Float"/>
<UserString key="SettingMin" value="0.01"/>
<UserString key="SettingMax" value="1.0"/>
</Widget>
</Widget>
<Widget type="TextBox" skin="SandText" position="4 140 200 18" align="Left Top">
<Property key="Caption" value="0"/>
<Property key="TextAlign" value="Left"/>
</Widget>
<Widget type="TextBox" skin="SandText" position="4 140 200 18" align="Left Top">
<Property key="Caption" value="1"/>
<Property key="TextAlign" value="Right"/>
</Widget>
</Widget> </Widget>
</Widget> </Widget>
<!-- <!--
<Widget type="TabItem" skin="" position="0 28 352 268"> <Widget type="TabItem" skin="" position="0 28 352 268">

Loading…
Cancel
Save