summaryrefslogtreecommitdiff
path: root/indra/newview/llsettingsvo.cpp
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-05-17 14:21:52 -0700
committerGraham Linden <graham@lindenlab.com>2019-05-17 14:21:52 -0700
commitc8ae0c0c3f1747faf36d27a63c66755a1bfeeb3c (patch)
treed710ca558ccaea9bd72faea4f6963d8cc7aa4fe7 /indra/newview/llsettingsvo.cpp
parentb3c0218a31b9d7dd699cf3944bbcfc35e9adbd49 (diff)
SL-11112
Fix blend between reflected/refracted water maps (make less transparent) and fix setting of water fog color alpha on low end to better match prev behavior of setting the internal control value in that case.
Diffstat (limited to 'indra/newview/llsettingsvo.cpp')
-rw-r--r--indra/newview/llsettingsvo.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp
index 7e0ec23a06..387644fa57 100644
--- a/indra/newview/llsettingsvo.cpp
+++ b/indra/newview/llsettingsvo.cpp
@@ -936,10 +936,14 @@ void LLSettingsVOWater::applySpecial(void *ptarget)
shader->uniform1f(LLShaderMgr::WATER_FOGKS, waterFogKS);
F32 eyedepth = LLViewerCamera::getInstance()->getOrigin().mV[2] - water_height;
+ bool underwater = LLPipeline::sUnderWaterRender || (eyedepth <= 0.0f);
- F32 waterFogDensity = env.getCurrentWater()->getModifiedWaterFogDensity(LLPipeline::sUnderWaterRender || (eyedepth <= 0.0f));
+ F32 waterFogDensity = env.getCurrentWater()->getModifiedWaterFogDensity(underwater);
shader->uniform1f(LLShaderMgr::WATER_FOGDENSITY, waterFogDensity);
+ LLColor4 fog_color(env.getCurrentWater()->getWaterFogColor(), 0.0f);
+ shader->uniform4fv(LLShaderMgr::WATER_FOGCOLOR, 1, fog_color.mV);
+
F32 blend_factor = env.getCurrentWater()->getBlendFactor();
shader->uniform1f(LLShaderMgr::BLEND_FACTOR, blend_factor);
@@ -970,9 +974,8 @@ LLSettingsWater::parammapping_t LLSettingsVOWater::getParameterMap() const
if (param_map.empty())
{
- LLSD water_defaults = LLSettingsWater::defaults();
- param_map[SETTING_FOG_COLOR] = DefaultParam(LLShaderMgr::WATER_FOGCOLOR, water_defaults[SETTING_FOG_COLOR]);
-
+ //LLSD water_defaults = LLSettingsWater::defaults();
+ //param_map[SETTING_FOG_COLOR] = DefaultParam(LLShaderMgr::WATER_FOGCOLOR, water_defaults[SETTING_FOG_COLOR]);
// let this get set by LLSettingsVOWater::applySpecial so that it can properly reflect the underwater modifier
//param_map[SETTING_FOG_DENSITY] = DefaultParam(LLShaderMgr::WATER_FOGDENSITY, water_defaults[SETTING_FOG_DENSITY]);
}