diff options
Diffstat (limited to 'indra/newview/pipeline.cpp')
-rw-r--r-- | indra/newview/pipeline.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index b2ec9a6a66..625f811789 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -6034,7 +6034,7 @@ void LLPipeline::setupAvatarLights(bool for_edit) } } F32 backlight_mag; - if (gSky.getSunDirection().mV[2] >= NIGHTTIME_ELEVATION_SIN) + if (LLEnvironment::instance().getIsSunUp()) { backlight_mag = BACKLIGHT_DAY_MAGNITUDE_OBJECT; } @@ -6253,14 +6253,16 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) // Light 0 = Sun or Moon (All objects) { - if (gSky.getSunDirection().mV[2] >= NIGHTTIME_ELEVATION_SIN) + LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky(); + + if (LLEnvironment::instance().getIsSunUp()) { - mSunDir.setVec(gSky.getSunDirection()); + mSunDir.setVec(psky->getSunDirection()); mSunDiffuse.setVec(gSky.getSunDiffuseColor()); } else { - mSunDir.setVec(gSky.getMoonDirection()); + mSunDir.setVec(psky->getMoonDirection()); mSunDiffuse.setVec(gSky.getMoonDiffuseColor()); } |