diff options
Diffstat (limited to 'indra/newview/llsettingsvo.cpp')
-rw-r--r-- | indra/newview/llsettingsvo.cpp | 11 |
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]); } |