From 695ec5229f6c8c80625e7d445232ae5fb0011327 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 11 Jul 2019 08:33:41 -0700 Subject: Fix knock-on from touching the sky tex gen which also generated the shiny env map. --- indra/newview/lllegacyatmospherics.cpp | 2 +- indra/newview/llvosky.cpp | 21 +++++++++++++++------ indra/newview/llvosky.h | 4 +++- 3 files changed, 19 insertions(+), 8 deletions(-) (limited to 'indra') diff --git a/indra/newview/lllegacyatmospherics.cpp b/indra/newview/lllegacyatmospherics.cpp index d56e6bd5d6..68613be19c 100644 --- a/indra/newview/lllegacyatmospherics.cpp +++ b/indra/newview/lllegacyatmospherics.cpp @@ -242,7 +242,7 @@ LLColor4 LLAtmospherics::calcSkyColorInDir(AtmosphericsVars& vars, const LLVecto calcSkyColorWLVert(Pn, vars); - LLColor3 sky_color = psky->gammaCorrect(vars.hazeColor * 2.0f); + LLColor3 sky_color = isShiny ? vars.hazeColor : psky->gammaCorrect(vars.hazeColor * 2.0f); if (isShiny) { diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index 3afc57d9ba..cf3132447d 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -96,12 +96,14 @@ S32 LLSkyTex::sCurrent = 0; LLSkyTex::LLSkyTex() : mSkyData(NULL), - mSkyDirs(NULL) + mSkyDirs(NULL), + mIsShiny(false) { } -void LLSkyTex::init() +void LLSkyTex::init(bool isShiny) { + mIsShiny = isShiny; mSkyData = new LLColor4[sResolution * sResolution]; mSkyDirs = new LLVector3[sResolution * sResolution]; @@ -207,7 +209,14 @@ void LLSkyTex::create(const F32 brightness) void LLSkyTex::createGLImage(S32 which) { - mTexture[which]->setExplicitFormat(GL_SRGB8_ALPHA8, GL_RGBA); + if (mIsShiny) + { + mTexture[which]->setExplicitFormat(GL_RGBA8, GL_RGBA); + } + else + { + mTexture[which]->setExplicitFormat(GL_SRGB8_ALPHA8, GL_RGBA); + } mTexture[which]->createGLTexture(0, mImageRaw[which], 0, TRUE, LLGLTexture::LOCAL); mTexture[which]->setAddressMode(LLTexUnit::TAM_CLAMP); } @@ -421,8 +430,8 @@ LLVOSky::LLVOSky(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) for (S32 i = 0; i < 6; i++) { - mSkyTex[i].init(); - mShinyTex[i].init(); + mSkyTex[i].init(false); + mShinyTex[i].init(true); } for (S32 i=0; i