diff options
author | Graham Linden <graham@lindenlab.com> | 2019-05-07 15:36:43 -0700 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2019-05-07 15:36:43 -0700 |
commit | a1e8042c1f2f1ab0ed5b6040535348974e659556 (patch) | |
tree | 6dc73e850b3f3be2d202ede8fee351302bd582ee /indra/newview/pipeline.cpp | |
parent | 570bbdb779f5e4be0c1804862bdffc9c5a1beb1b (diff) |
SL-11055, SL-10966, SL-11087
Make haze look more like WL.
Make lack of sun and moon mean black and fixed dir to prevent spooky underlighting.
Diffstat (limited to 'indra/newview/pipeline.cpp')
-rw-r--r-- | indra/newview/pipeline.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index c57b267c92..211993fb46 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -6203,7 +6203,8 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) gGL.setAmbientLightColor(ambient); } - bool sun_up = environment.getIsSunUp(); + bool sun_up = environment.getIsSunUp(); + bool moon_up = environment.getIsMoonUp(); // Light 0 = Sun or Moon (All objects) { @@ -6212,7 +6213,9 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) mSunDir.setVec(sun_dir); mMoonDir.setVec(moon_dir); - mSunDiffuse.setVec(psky->getSunDiffuse()); + + // calculates diffuse sunlight per-pixel downstream, just provide setting sunlight_color + mSunDiffuse.setVec(psky->getSunlightColor()); mMoonDiffuse.setVec(psky->getMoonDiffuse()); F32 max_color = llmax(mSunDiffuse.mV[0], mSunDiffuse.mV[1], mSunDiffuse.mV[2]); @@ -6229,6 +6232,15 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) } mMoonDiffuse.clamp(); + // prevent underlighting from having neither lightsource facing us + if (!sun_up && !moon_up) + { + mSunDiffuse.setVec(LLColor4(0.0, 0.0, 0.0, 1.0)); + mMoonDiffuse.setVec(LLColor4(0.0, 0.0, 0.0, 1.0)); + mSunDir.setVec(LLVector4(0.0, 1.0, 0.0, 0.0)); + mMoonDir.setVec(LLVector4(0.0, 1.0, 0.0, 0.0)); + } + LLVector4 light_dir = sun_up ? mSunDir : mMoonDir; mHWLightColors[0] = mSunDiffuse; |