summaryrefslogtreecommitdiff
path: root/indra/newview/pipeline.cpp
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-05-21 16:00:45 -0700
committerGraham Linden <graham@lindenlab.com>2019-05-21 16:00:45 -0700
commite9dbee00262a437e4b3f971b37ea636e92032133 (patch)
tree57f79641ee532f3f80b0fbd89d3a1f42de398829 /indra/newview/pipeline.cpp
parent78e62fe0f16d95a2afb6c4205b121db189c297b9 (diff)
SL-11238
Fix ambient light inputs to the renderer. Fix 3rd sky shader w/ mistaken density mod conversion. Make ambient clamp apply to all modes. Tune ALM ambient clamp to match non-ALM.
Diffstat (limited to 'indra/newview/pipeline.cpp')
-rw-r--r--indra/newview/pipeline.cpp20
1 files changed, 5 insertions, 15 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index cd0a50113b..8463730552 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -6219,18 +6219,8 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
mSunDir.setVec(sun_dir);
mMoonDir.setVec(moon_dir);
- // calculates diffuse sunlight per-pixel downstream, just provide setting sunlight_color
- if (canUseWindLightShaders())
- {
- mSunDiffuse.setVec(psky->getSunlightColor());
- }
- else
- {
- // not using atmo shaders, use CPU-generated attenuated sunlight diffuse...
- mSunDiffuse.setVec(psky->getSunDiffuse());
- }
-
- mMoonDiffuse.setVec(psky->getMoonDiffuse());
+ mSunDiffuse.setVec(psky->getSunlightColor());
+ mMoonDiffuse.setVec(psky->getMoonlightColor());
F32 max_color = llmax(mSunDiffuse.mV[0], mSunDiffuse.mV[1], mSunDiffuse.mV[2]);
if (max_color > 1.f)
@@ -6257,15 +6247,15 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
LLVector4 light_dir = sun_up ? mSunDir : mMoonDir;
- mHWLightColors[0] = mSunDiffuse;
+ mHWLightColors[0] = sun_up ? mSunDiffuse : mMoonDiffuse;
LLLightState* light = gGL.getLight(0);
light->setPosition(light_dir);
light->setSunPrimary(sun_up);
- light->setDiffuse(mSunDiffuse);
+ light->setDiffuse(mHWLightColors[0]);
light->setDiffuseB(mMoonDiffuse);
- light->setAmbient(LLColor4::black);
+ light->setAmbient(psky->getTotalAmbient());
light->setSpecular(LLColor4::black);
light->setConstantAttenuation(1.f);
light->setLinearAttenuation(0.f);