summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpoolwlsky.cpp
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2018-06-11 11:45:11 -0700
committerRider Linden <rider@lindenlab.com>2018-06-11 11:45:11 -0700
commit0f608cb764856ae8586a9d9631842a782cb70a23 (patch)
tree97a12c3bfcc14ae73df00c68141e9519493a0619 /indra/newview/lldrawpoolwlsky.cpp
parent97da85de0b1e0f8c2fc60c156c31b237b869230a (diff)
parent4fbdfe637049e0a2e93c6fed030e61b32a43ae07 (diff)
Merge
Diffstat (limited to 'indra/newview/lldrawpoolwlsky.cpp')
-rw-r--r--indra/newview/lldrawpoolwlsky.cpp27
1 files changed, 19 insertions, 8 deletions
diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp
index c6abba95bc..3e74b06a7f 100644
--- a/indra/newview/lldrawpoolwlsky.cpp
+++ b/indra/newview/lldrawpoolwlsky.cpp
@@ -52,7 +52,7 @@ LLPointer<LLImageRaw> LLDrawPoolWLSky::sCloudNoiseRawImage = NULL;
static LLGLSLShader* cloud_shader = NULL;
static LLGLSLShader* sky_shader = NULL;
-
+static LLGLSLShader* moon_shader = NULL;
LLDrawPoolWLSky::LLDrawPoolWLSky(void) :
LLDrawPool(POOL_WL_SKY)
@@ -109,6 +109,11 @@ void LLDrawPoolWLSky::beginRenderPass( S32 pass )
LLPipeline::sUnderWaterRender ?
&gObjectFullbrightNoColorWaterProgram :
&gWLCloudProgram;
+
+ moon_shader =
+ LLPipeline::sUnderWaterRender ?
+ &gObjectFullbrightNoColorWaterProgram :
+ &gWLMoonProgram;
}
void LLDrawPoolWLSky::endRenderPass( S32 pass )
@@ -275,6 +280,7 @@ void LLDrawPoolWLSky::renderStars(void) const
void LLDrawPoolWLSky::renderSkyClouds(const LLVector3& camPosLocal, F32 camHeightLocal) const
{
+#if REMOVE_BEFORE_FLIGHT
if (gPipeline.canUseWindLightShaders() && gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS) && sCloudNoiseTexture.notNull())
{
LLGLEnable blend(GL_BLEND);
@@ -289,6 +295,7 @@ void LLDrawPoolWLSky::renderSkyClouds(const LLVector3& camPosLocal, F32 camHeigh
cloud_shader->unbind();
}
+#endif
}
void LLDrawPoolWLSky::renderHeavenlyBodies()
@@ -311,7 +318,7 @@ void LLDrawPoolWLSky::renderHeavenlyBodies()
LLFace * face = gSky.mVOSkyp->mFace[LLVOSky::FACE_MOON];
- if (gSky.mVOSkyp->getMoon().getDraw() && face->getGeomCount())
+ if (gSky.mVOSkyp->getMoon().getDraw() && face->getGeomCount() && moon_shader)
{
// *NOTE: even though we already bound this texture above for the
// stars register combiners, we bind again here for defensive reasons,
@@ -328,8 +335,11 @@ void LLDrawPoolWLSky::renderHeavenlyBodies()
if (gPipeline.canUseVertexShaders())
{
- gHighlightProgram.bind();
- gHighlightProgram.uniform4fv(LLShaderMgr::DIFFUSE_COLOR, 1, color.mV);
+ moon_shader->bind();
+ moon_shader->uniform4fv(LLShaderMgr::DIFFUSE_COLOR, 1, color.mV);
+ moon_shader->uniform3fv(LLShaderMgr::GLOW_LUM_WEIGHTS, 1, LLPipeline::RenderGlowLumWeights.mV);
+ F32 blend_factor = LLEnvironment::instance().getCurrentSky()->getBlendFactor();
+ moon_shader->uniform1f(LLShaderMgr::BLEND_FACTOR, blend_factor);
}
LLFacePool::LLOverrideFaceColor color_override(this, color);
@@ -338,7 +348,7 @@ void LLDrawPoolWLSky::renderHeavenlyBodies()
if (gPipeline.canUseVertexShaders())
{
- gHighlightProgram.unbind();
+ moon_shader->unbind();
}
}
}
@@ -380,10 +390,11 @@ void LLDrawPoolWLSky::renderDeferred(S32 pass)
gGL.translatef(origin.mV[0], origin.mV[1], origin.mV[2]);
gDeferredStarProgram.bind();
- // *NOTE: have to bind a texture here since register combiners blending in
+ // *NOTE: have to bind moon textures here since register combiners blending in
// renderStars() requires something to be bound and we might as well only
- // bind the moon's texture once.
- gGL.getTexUnit(0)->bind(gSky.mVOSkyp->mFace[LLVOSky::FACE_MOON]->getTexture());
+ // bind the moon textures once.
+ gGL.getTexUnit(0)->bind(gSky.mVOSkyp->mFace[LLVOSky::FACE_MOON]->getTexture(LLRender::DIFFUSE_MAP));
+ gGL.getTexUnit(1)->bind(gSky.mVOSkyp->mFace[LLVOSky::FACE_MOON]->getTexture(LLRender::ALTERNATE_DIFFUSE_MAP));
renderHeavenlyBodies();