diff options
author | Graham Linden <graham@lindenlab.com> | 2019-04-03 08:10:23 -0700 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2019-04-03 08:10:23 -0700 |
commit | 7d757e9cdac3e421c68376fc2373357b41a39787 (patch) | |
tree | d8d8257a2b584078c67c29168fafa03e281da7c5 /indra | |
parent | 4170f7b1601203e8953672c42bfb320d7c715a92 (diff) |
SL-10876
Fix edge cases in determining when we can skip doing shadow rendering work.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/pipeline.cpp | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 65c04b6eac..4606462db7 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -10113,10 +10113,29 @@ void LLPipeline::generateSunShadow(LLCamera& camera) bool sun_up = environment.getIsSunUp(); bool moon_up = environment.getIsMoonUp(); - bool ignore_shadows = (shadow_detail == 0) - || (sun_up && (mSunDiffuse == LLColor4::black)) - || (moon_up && (mMoonDiffuse == LLColor4::black)) - || !(sun_up || moon_up); + + bool ignore_shadows = (shadow_detail == 0); // explicitly disabled shadows + + // no sun or moon, no shadows + if (!sun_up && !moon_up) + { + ignore_shadows |= true; + } + // only moon and moon is black + else if (!sun_up && moon_up & (mMoonDiffuse == LLColor4::black)) + { + ignore_shadows |= true; + } + // only sun and sun is black + else if (!moon_up && sun_up && (mSunDiffuse == LLColor4::black)) + { + ignore_shadows |= true; + } + // both up, but both black + else if ((mSunDiffuse == LLColor4::black) && (mMoonDiffuse == LLColor4::black)) + { + ignore_shadows |= true; + } if (ignore_shadows) { //sun diffuse is totally black, shadows don't matter |