diff options
author | Graham Linden <graham@lindenlab.com> | 2019-07-11 08:33:41 -0700 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2019-07-11 08:33:41 -0700 |
commit | 695ec5229f6c8c80625e7d445232ae5fb0011327 (patch) | |
tree | fcbc66f59e4428cea638dcafbf3f3366b38b5561 | |
parent | 664722168d7016d8bf80a65626bbff542913dc24 (diff) |
Fix knock-on from touching the sky tex gen which also generated the shiny env map.
-rw-r--r-- | indra/newview/lllegacyatmospherics.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llvosky.cpp | 21 | ||||
-rw-r--r-- | indra/newview/llvosky.h | 4 |
3 files changed, 19 insertions, 8 deletions
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<FACE_COUNT; i++) { @@ -551,7 +560,7 @@ void LLVOSky::initCubeMap() if (!mCubeMap && gSavedSettings.getBOOL("RenderWater") && gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps) { - mCubeMap = new LLCubeMap(true); + mCubeMap = new LLCubeMap(false); } if (mCubeMap) diff --git a/indra/newview/llvosky.h b/indra/newview/llvosky.h index 3c7ce4004c..67a7059b5a 100644 --- a/indra/newview/llvosky.h +++ b/indra/newview/llvosky.h @@ -68,7 +68,7 @@ public: protected: LLSkyTex(); - void init(); + void init(bool isShiny); void cleanupGL(); void restoreGL(); @@ -121,6 +121,8 @@ protected: LLImageRaw* getImageRaw(BOOL curr=TRUE); void createGLImage(BOOL curr=TRUE); + + bool mIsShiny; }; /// TODO Move into the stars draw pool (and rename them appropriately). |