summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2018-09-11 00:23:10 +0100
committerGraham Linden <graham@lindenlab.com>2018-09-11 00:23:10 +0100
commit24e0e64f2f226fb87df5d6b42d868e2a0e3daff7 (patch)
treef1c216eec853bb22528db0e5123edcbc70bb7ac4 /indra/newview
parent3262446f07616f42ad0e4c77930b6ba2f03e452c (diff)
Fix cloud shader tex binding to be more robust.
Make vert generation not skip dome verts used for clouds when doing advanced atmospherics.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/lldrawpoolwlsky.cpp7
-rw-r--r--indra/newview/llvowlsky.cpp76
2 files changed, 40 insertions, 43 deletions
diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp
index 205b6441e7..e7929e0bbf 100644
--- a/indra/newview/lldrawpoolwlsky.cpp
+++ b/indra/newview/lldrawpoolwlsky.cpp
@@ -350,10 +350,11 @@ void LLDrawPoolWLSky::renderSkyClouds(const LLVector3& camPosLocal, F32 camHeigh
LLGLEnable blend(GL_BLEND);
gGL.setSceneBlendType(LLRender::BT_ALPHA);
- gGL.getTexUnit(0)->bind(gSky.mVOSkyp->getCloudNoiseTex());
- gGL.getTexUnit(1)->bind(gSky.mVOSkyp->getCloudNoiseTexNext());
-
cloud_shader->bind();
+
+ cloud_shader->bindTexture(LLShaderMgr::CLOUD_NOISE_MAP, gSky.mVOSkyp->getCloudNoiseTex());
+ cloud_shader->bindTexture(LLShaderMgr::CLOUD_NOISE_MAP_NEXT, gSky.mVOSkyp->getCloudNoiseTexNext());
+
F32 blend_factor = LLEnvironment::instance().getCurrentSky()->getBlendFactor();
cloud_shader->uniform1f(LLShaderMgr::BLEND_FACTOR, blend_factor);
diff --git a/indra/newview/llvowlsky.cpp b/indra/newview/llvowlsky.cpp
index b5f019a7f8..933bf9bf12 100644
--- a/indra/newview/llvowlsky.cpp
+++ b/indra/newview/llvowlsky.cpp
@@ -160,49 +160,45 @@ BOOL LLVOWLSky::updateGeometry(LLDrawable * drawable)
LLStrider<LLVector2> texCoords;
LLStrider<U16> indices;
- if (gPipeline.useAdvancedAtmospherics())
+ if (mFsSkyVerts.isNull())
{
- if (mFsSkyVerts.isNull())
- {
- mFsSkyVerts = new LLVertexBuffer(LLDrawPoolWLSky::ADV_ATMO_SKY_VERTEX_DATA_MASK, GL_STATIC_DRAW_ARB);
-
- if (!mFsSkyVerts->allocateBuffer(4, 6, TRUE))
- {
- LL_WARNS() << "Failed to allocate Vertex Buffer on full screen sky update" << LL_ENDL;
- }
-
- BOOL success = mFsSkyVerts->getVertexStrider(vertices)
- && mFsSkyVerts->getTexCoord0Strider(texCoords)
- && mFsSkyVerts->getIndexStrider(indices);
-
- if(!success)
- {
- LL_ERRS() << "Failed updating WindLight fullscreen sky geometry." << LL_ENDL;
- }
-
- *vertices++ = LLVector3(-1.0f, -1.0f, 0.0f);
- *vertices++ = LLVector3( 1.0f, -1.0f, 0.0f);
- *vertices++ = LLVector3(-1.0f, 1.0f, 0.0f);
- *vertices++ = LLVector3( 1.0f, 1.0f, 0.0f);
-
- *texCoords++ = LLVector2(0.0f, 0.0f);
- *texCoords++ = LLVector2(1.0f, 0.0f);
- *texCoords++ = LLVector2(0.0f, 1.0f);
- *texCoords++ = LLVector2(1.0f, 1.0f);
-
- *indices++ = 0;
- *indices++ = 1;
- *indices++ = 2;
- *indices++ = 1;
- *indices++ = 3;
- *indices++ = 2;
-
- mFsSkyVerts->flush();
- }
-
- return TRUE;
+ mFsSkyVerts = new LLVertexBuffer(LLDrawPoolWLSky::ADV_ATMO_SKY_VERTEX_DATA_MASK, GL_STATIC_DRAW_ARB);
+
+ if (!mFsSkyVerts->allocateBuffer(4, 6, TRUE))
+ {
+ LL_WARNS() << "Failed to allocate Vertex Buffer on full screen sky update" << LL_ENDL;
+ }
+
+ BOOL success = mFsSkyVerts->getVertexStrider(vertices)
+ && mFsSkyVerts->getTexCoord0Strider(texCoords)
+ && mFsSkyVerts->getIndexStrider(indices);
+
+ if(!success)
+ {
+ LL_ERRS() << "Failed updating WindLight fullscreen sky geometry." << LL_ENDL;
+ }
+
+ *vertices++ = LLVector3(-1.0f, -1.0f, 0.0f);
+ *vertices++ = LLVector3( 1.0f, -1.0f, 0.0f);
+ *vertices++ = LLVector3(-1.0f, 1.0f, 0.0f);
+ *vertices++ = LLVector3( 1.0f, 1.0f, 0.0f);
+
+ *texCoords++ = LLVector2(0.0f, 0.0f);
+ *texCoords++ = LLVector2(1.0f, 0.0f);
+ *texCoords++ = LLVector2(0.0f, 1.0f);
+ *texCoords++ = LLVector2(1.0f, 1.0f);
+
+ *indices++ = 0;
+ *indices++ = 1;
+ *indices++ = 2;
+ *indices++ = 1;
+ *indices++ = 3;
+ *indices++ = 2;
+
+ mFsSkyVerts->flush();
}
+ if(mFanVerts.isNull())
{
mFanVerts = new LLVertexBuffer(LLDrawPoolWLSky::SKY_VERTEX_DATA_MASK, GL_STATIC_DRAW_ARB);
if (!mFanVerts->allocateBuffer(getFanNumVerts(), getFanNumIndices(), TRUE))