diff options
author | Graham Linden <graham@lindenlab.com> | 2019-06-20 16:11:31 -0700 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2019-06-20 16:11:31 -0700 |
commit | 7c770e97be0a0862ec5fbb927805259b220b55f4 (patch) | |
tree | 5bbb9f75c478ba610e8d2676edd3fe50208418b1 /indra | |
parent | 05ee6b5d9837c31660a79dea55ec877155b49009 (diff) |
SL-11371
Remove the ugly band of fog color at the horizon in Low/Low+ entirely.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/lllegacyatmospherics.cpp | 53 |
1 files changed, 32 insertions, 21 deletions
diff --git a/indra/newview/lllegacyatmospherics.cpp b/indra/newview/lllegacyatmospherics.cpp index 017c21df39..a09f54c303 100644 --- a/indra/newview/lllegacyatmospherics.cpp +++ b/indra/newview/lllegacyatmospherics.cpp @@ -206,29 +206,27 @@ void LLAtmospherics::init() LLColor4 LLAtmospherics::calcSkyColorInDir(AtmosphericsVars& vars, const LLVector3 &dir, bool isShiny) { F32 saturation = 0.3f; - if (dir.mV[VZ] < -0.02f) + + if (isShiny && dir.mV[VZ] < -0.02f) { LLColor4 col = LLColor4(llmax(mFogColor[0],0.2f), llmax(mFogColor[1],0.2f), llmax(mFogColor[2],0.22f),0.f); - if (isShiny) + LLColor3 desat_fog = LLColor3(mFogColor); + F32 brightness = desat_fog.brightness(); + // So that shiny somewhat shows up at night. + if (brightness < 0.15f) { - LLColor3 desat_fog = LLColor3(mFogColor); - F32 brightness = desat_fog.brightness(); - // So that shiny somewhat shows up at night. - if (brightness < 0.15f) - { - brightness = 0.15f; - desat_fog = smear(0.15f); - } - LLColor3 greyscale = smear(brightness); - desat_fog = desat_fog * saturation + greyscale * (1.0f - saturation); - if (!gPipeline.canUseWindLightShaders()) - { - col = LLColor4(desat_fog, 0.f); - } - else - { - col = LLColor4(desat_fog * 0.5f, 0.f); - } + brightness = 0.15f; + desat_fog = smear(0.15f); + } + LLColor3 greyscale = smear(brightness); + desat_fog = desat_fog * saturation + greyscale * (1.0f - saturation); + if (!gPipeline.canUseWindLightShaders()) + { + col = LLColor4(desat_fog, 0.f); + } + else + { + col = LLColor4(desat_fog * 0.5f, 0.f); } float x = 1.0f-fabsf(-0.1f-dir.mV[VZ]); x *= x; @@ -242,7 +240,17 @@ LLColor4 LLAtmospherics::calcSkyColorInDir(AtmosphericsVars& vars, const LLVecto LLVector3 Pn = LLVector3(-dir[1] , -dir[2], -dir[0]); calcSkyColorWLVert(Pn, vars); - + +#if SL_11371 + if (dir.mV[VZ] < 0.4f) + { + LLColor4 col = LLColor4(llmax(mFogColor[0],0.2f), llmax(mFogColor[1],0.2f), llmax(mFogColor[2],0.22f),0.f); + col *= dir * LLVector3(0,1,0); + col += vars.hazeColor; + return col; + } +#endif + LLColor3 sky_color = calcSkyColorWLFrag(Pn, vars); if (isShiny) { @@ -378,6 +386,7 @@ void LLAtmospherics::calcSkyColorWLVert(LLVector3 & Pn, AtmosphericsVars& vars) // At horizon, blend high altitude sky color towards the darker color below the clouds vars.hazeColor += componentMult(vars.hazeColorBelowCloud - vars.hazeColor, LLColor3::white - componentSqrt(temp1)); +#if SL_11371 if (Pn[1] < 0.f) { // Eric's original: @@ -397,6 +406,8 @@ void LLAtmospherics::calcSkyColorWLVert(LLVector3 & Pn, AtmosphericsVars& vars) vars.hazeColor = colorMix(LLColor3::white * haze_brightness, vars.hazeColor, fabs((Pn[1] + 0.05f) * -20.f)); } } +#endif + } LLColor3 LLAtmospherics::calcSkyColorWLFrag(LLVector3 & Pn, AtmosphericsVars& vars) |