summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpoolwater.cpp
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2018-06-01 00:18:36 +0100
committerGraham Linden <graham@lindenlab.com>2018-06-01 00:18:36 +0100
commit64302d3000b69b31e72eb6a3bd8a981c80cb88de (patch)
treed942aa56bc50bd44542ff5f7757d46a6189e8036 /indra/newview/lldrawpoolwater.cpp
parent439273c9c11ec5f3c186fd7d97a28d11419153cd (diff)
Modify use of sky settings, reduce complexity, and name funcs to indicate coord systems in use.
Fix class2 softenLightF shader.
Diffstat (limited to 'indra/newview/lldrawpoolwater.cpp')
-rw-r--r--indra/newview/lldrawpoolwater.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp
index bcc0023089..9cd59c61ec 100644
--- a/indra/newview/lldrawpoolwater.cpp
+++ b/indra/newview/lldrawpoolwater.cpp
@@ -488,26 +488,29 @@ void LLDrawPoolWater::shade()
LLVector3 light_dir;
LLColor3 light_color;
- LLSettingsWater::ptr_t pwater = LLEnvironment::instance().getCurrentWater();
+ LLEnvironment& environment = LLEnvironment::instance();
+ LLSettingsWater::ptr_t pwater = environment.getCurrentWater();
+ LLSettingsSky::ptr_t psky = environment.getCurrentSky();
- light_dir = voskyp->getLightDirection();
+ light_dir = environment.getLightDirection();
light_dir.normalize();
- bool sun_up = LLEnvironment::instance().getIsSunUp();
- bool moon_up = LLEnvironment::instance().getIsSunUp();
+ bool sun_up = environment.getIsSunUp();
+ bool moon_up = environment.getIsMoonUp();
if (sun_up)
{
- light_color = light_color + voskyp->getSunAmbientColor();
- light_diffuse += voskyp->getSunDiffuseColor();
+ light_color = light_color + psky->getSunAmbient();
+ light_diffuse += psky->getSunDiffuse();
}
light_exp = light_dir * LLVector3(light_dir.mV[0], light_dir.mV[1], 0.f);
if (moon_up)
{
- light_color += voskyp->getMoonDiffuseColor();
- light_diffuse += voskyp->getMoonDiffuseColor() * 0.5f;
+ LLColor3 moon_diffuse_color = psky->getMoonDiffuse();
+ light_color += moon_diffuse_color;
+ light_diffuse += moon_diffuse_color * 0.5f;
if (!sun_up)
{