From c8ae0c0c3f1747faf36d27a63c66755a1bfeeb3c Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 17 May 2019 14:21:52 -0700 Subject: 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. --- indra/newview/llsettingsvo.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'indra/newview/llsettingsvo.cpp') 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]); } -- cgit v1.2.3