diff options
author | Graham Linden graham@lindenlab.com <Graham Linden graham@lindenlab.com> | 2018-05-18 23:14:56 +0100 |
---|---|---|
committer | Graham Linden graham@lindenlab.com <Graham Linden graham@lindenlab.com> | 2018-05-18 23:14:56 +0100 |
commit | 8082cb86682c008389cb8127f295e6566ec368e5 (patch) | |
tree | e8168fc436aa4aaf5274719c917a64fee0af0a54 /indra/newview/lldrawpoolwater.cpp | |
parent | 242fe0610996696a026dc2dc9b1b42c4db2f852c (diff) |
Make nighttime elev constant _SIN, since it uses a sin value.
Put that constant in sky settings and eliminate dups.
Fix up logic around when to use heavenly bodies (fix broken moon in basic sky).
Remove unnecessary clip to horizon.
Put in temp code to ena/dis sun/moon based on LLEnvironment::getIsDaytime().
Diffstat (limited to 'indra/newview/lldrawpoolwater.cpp')
-rw-r--r-- | indra/newview/lldrawpoolwater.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp index bdf04bd436..2804ad1f46 100644 --- a/indra/newview/lldrawpoolwater.cpp +++ b/indra/newview/lldrawpoolwater.cpp @@ -491,6 +491,8 @@ void LLDrawPoolWater::shade() LLSettingsWater::ptr_t pwater = LLEnvironment::instance().getCurrentWater(); light_dir = voskyp->getLightDirection(); + light_dir.normalize(); + if (LLEnvironment::instance().getIsDayTime()) { light_color = voskyp->getSunAmbientColor(); @@ -501,14 +503,14 @@ void LLDrawPoolWater::shade() } else { - light_color = voskyp->getMoonAmbientColor(); + light_color = voskyp->getMoonDiffuseColor(); light_diffuse = voskyp->getMoonDiffuseColor(); light_diffuse.normalize(); light_diffuse *= 0.5f; light_exp = light_dir * LLVector3(light_dir.mV[0], light_dir.mV[1], 0.f); } -// if (gSky.getSunDirection().mV[2] > LLSky::NIGHTTIME_ELEVATION_COS) +// if (gSky.getSunDirection().mV[2] > NIGHTTIME_ELEVATION_COS) // { // light_dir = gSky.getSunDirection(); // light_dir.normVec(); |