SL-15861: Fix inconsistent additive light spanning 180 degrees for water angles in Mid quality.

meow-7.2.2
Ptolemy 2022-03-07 09:32:17 -08:00
parent bdc611badb
commit d7bb4cdc8d
1 changed files with 4 additions and 1 deletions

View File

@ -602,7 +602,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();
// SL-15861 This was changed from getRotatedLightNorm() as it was causing
// lightnorm in shaders\class1\windlight\atmosphericsFuncs.glsl in have inconsistent additive lighting for 180 degrees of the FOV.
LLVector4 rotated_light_direction = LLEnvironment::instance().getClampedLightNorm();
shader->uniform4fv(LLViewerShaderMgr::LIGHTNORM, 1, rotated_light_direction.mV);
shader->uniform3fv(LLShaderMgr::WL_CAMPOSLOCAL, 1, LLViewerCamera::getInstance()->getOrigin().mV);