summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2018-10-02 16:32:06 +0000
committerRider Linden <rider@lindenlab.com>2018-10-02 16:32:06 +0000
commitac184e1ca77fc5085487925f74aaa6826f39870e (patch)
treed953f8b7bb6f5b991a287dedd9c21e32125c24ee /indra
parent06e83caa26db3a0d9682af394f4e55eeaacf1e09 (diff)
parent17ce10ccd98d4795784466bb217e877ca2d8bad2 (diff)
Merged in graham_linden/viewer-eep-graham (pull request #125)
SL-9687
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llvosky.cpp45
-rw-r--r--indra/newview/llvosky.h2
2 files changed, 34 insertions, 13 deletions
diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp
index a42239ec87..705e382a99 100644
--- a/indra/newview/llvosky.cpp
+++ b/indra/newview/llvosky.cpp
@@ -477,7 +477,7 @@ void LLVOSky::init()
for (S32 tile = 0; tile < NUM_TILES; ++tile)
{
initSkyTextureDirs(side, tile);
- createSkyTexture(vars, side, tile);
+ createSkyTexture(vars, side, tile, false);
}
}
@@ -603,7 +603,7 @@ void LLVOSky::initSkyTextureDirs(const S32 side, const S32 tile)
}
}
-void LLVOSky::createSkyTexture(AtmosphericsVars& vars, const S32 side, const S32 tile)
+void LLVOSky::createSkyTexture(AtmosphericsVars& vars, const S32 side, const S32 tile, bool skip_sky_tex)
{
S32 tile_x = tile % NUM_TILES_X;
S32 tile_y = tile / NUM_TILES_X;
@@ -612,11 +612,21 @@ void LLVOSky::createSkyTexture(AtmosphericsVars& vars, const S32 side, const S32
S32 tile_y_pos = tile_y * sTileResY;
S32 x, y;
+ if (!skip_sky_tex)
+ {
+ for (y = tile_y_pos; y < (tile_y_pos + sTileResY); ++y)
+ {
+ for (x = tile_x_pos; x < (tile_x_pos + sTileResX); ++x)
+ {
+ mSkyTex[side].setPixel(m_legacyAtmospherics.calcSkyColorInDir(vars, mSkyTex[side].getDir(x, y)), x, y);
+ }
+ }
+ }
+
for (y = tile_y_pos; y < (tile_y_pos + sTileResY); ++y)
{
for (x = tile_x_pos; x < (tile_x_pos + sTileResX); ++x)
{
- mSkyTex[side].setPixel(m_legacyAtmospherics.calcSkyColorInDir(vars, mSkyTex[side].getDir(x, y)), x, y);
mShinyTex[side].setPixel(m_legacyAtmospherics.calcSkyColorInDir(vars, mSkyTex[side].getDir(x, y), true), x, y);
}
}
@@ -684,8 +694,6 @@ bool LLVOSky::updateSky()
direction.normalize();
const F32 dot_lighting = direction * mLastLightingDirection;
- //_WARNS("LAPRAS") << " <" << direction.getValue() << "> dot <" << mLastLightingDirection << "> = " << dot_lighting << " (threshold is " << LIGHT_DIRECTION_THRESHOLD << ")" << LL_ENDL;
-
LLColor3 delta_color;
delta_color.setVec(mLastTotalAmbient.mV[0] - total_ambient.mV[0],
mLastTotalAmbient.mV[1] - total_ambient.mV[1],
@@ -698,6 +706,8 @@ bool LLVOSky::updateSky()
mForceUpdate = mForceUpdate || color_changed;
mForceUpdate = mForceUpdate || !mInitialized;
+ bool is_alm_wl_sky = gPipeline.canUseWindLightShaders();
+
if (mForceUpdate && mForceUpdateThrottle.hasExpired())
{
LL_RECORD_BLOCK_TIME(FTM_VOSKY_UPDATEFORCED);
@@ -741,7 +751,7 @@ bool LLVOSky::updateSky()
{
for (int tile = 0; tile < NUM_TILES; tile++)
{
- createSkyTexture(vars, side, tile);
+ createSkyTexture(vars, side, tile, is_alm_wl_sky);
}
}
@@ -751,10 +761,14 @@ bool LLVOSky::updateSky()
{
LLImageRaw* raw1 = nullptr;
LLImageRaw* raw2 = nullptr;
- raw1 = mSkyTex[side].getImageRaw(TRUE);
- raw2 = mSkyTex[side].getImageRaw(FALSE);
- raw2->copy(raw1);
- mSkyTex[side].createGLImage(tex);
+
+ if (!is_alm_wl_sky)
+ {
+ raw1 = mSkyTex[side].getImageRaw(TRUE);
+ raw2 = mSkyTex[side].getImageRaw(FALSE);
+ raw2->copy(raw1);
+ mSkyTex[side].createGLImage(tex);
+ }
raw1 = mShinyTex[side].getImageRaw(TRUE);
raw2 = mShinyTex[side].getImageRaw(FALSE);
@@ -764,9 +778,16 @@ bool LLVOSky::updateSky()
next_frame = 0;
// update the sky texture
- for (S32 i = 0; i < 6; ++i)
+ if (!is_alm_wl_sky)
+ {
+ for (S32 i = 0; i < 6; ++i)
+ {
+ mSkyTex[i].create(1.0f);
+ }
+ }
+
+ for (S32 i = 0; i < 6; ++i)
{
- mSkyTex[i].create(1.0f);
mShinyTex[i].create(1.0f);
}
diff --git a/indra/newview/llvosky.h b/indra/newview/llvosky.h
index ed190892fe..e465dcbe27 100644
--- a/indra/newview/llvosky.h
+++ b/indra/newview/llvosky.h
@@ -293,7 +293,7 @@ protected:
void updateDirections(void);
void initSkyTextureDirs(const S32 side, const S32 tile);
- void createSkyTexture(AtmosphericsVars& vars, const S32 side, const S32 tile);
+ void createSkyTexture(AtmosphericsVars& vars, const S32 side, const S32 tile, bool skip_sky_tex);
LLPointer<LLViewerFetchedTexture> mSunTexturep[2];
LLPointer<LLViewerFetchedTexture> mMoonTexturep[2];