diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/lldrawpoolwater.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llsettingsvo.cpp | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp index 2c9418ca19..1b5c154378 100644 --- a/indra/newview/lldrawpoolwater.cpp +++ b/indra/newview/lldrawpoolwater.cpp @@ -606,6 +606,10 @@ void LLDrawPoolWater::shade2(bool edge, LLGLSLShader* shader, const LLColor3& li shader->uniform1f(LLShaderMgr::WATER_SUN_ANGLE2, 0.1f + 0.2f*sunAngle); shader->uniform1i(LLShaderMgr::WATER_EDGE_FACTOR, edge ? 1 : 0); + LLVector4 rotated_light_direction = LLEnvironment::instance().getRotatedLightNorm(); + shader->uniform4fv(LLViewerShaderMgr::LIGHTNORM, 1, rotated_light_direction.mV); + shader->uniform3fv(LLShaderMgr::WL_CAMPOSLOCAL, 1, LLViewerCamera::getInstance()->getOrigin().mV); + if (LLViewerCamera::getInstance()->cameraUnderWater()) { shader->uniform1f(LLShaderMgr::WATER_REFSCALE, pwater->getScaleBelow()); diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index f4cd0eef6e..cc70f651cf 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -947,10 +947,8 @@ void LLSettingsVOWater::applySpecial(void *ptarget) F32 blend_factor = env.getCurrentWater()->getBlendFactor(); shader->uniform1f(LLShaderMgr::BLEND_FACTOR, blend_factor); - LLVector4 rotated_light_direction = LLEnvironment::instance().getRotatedLightNorm(); - shader->uniform4fv(LLViewerShaderMgr::LIGHTNORM, 1, rotated_light_direction.mV); - shader->uniform3fv(LLShaderMgr::WL_CAMPOSLOCAL, 1, LLViewerCamera::getInstance()->getOrigin().mV); - shader->uniform1f(LLViewerShaderMgr::DISTANCE_MULTIPLIER, 0); + // update to normal lightnorm, water shader itself will use rotated lightnorm as necessary + shader->uniform4fv(LLShaderMgr::LIGHTNORM, 1, light_direction.mV); } } |