diff options
Diffstat (limited to 'indra/newview/lldrawpoolwlsky.cpp')
-rw-r--r-- | indra/newview/lldrawpoolwlsky.cpp | 27 |
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(); |