diff options
author | Graham Linden <graham@lindenlab.com> | 2019-08-12 13:44:59 -0700 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2019-08-12 13:44:59 -0700 |
commit | 41c7523e08aab7f2bf4a040ac1c1c8a1d24babed (patch) | |
tree | b8a36a5667815b87929c11917c3800ed90e1061a /indra/newview/lldrawpoolsky.cpp | |
parent | 71af0a2a9e9f90d1e336f8a30f642bb5e19ef658 (diff) |
SL-11676
Make sun/moon textures render on Low/Low-Mid again.
Fix solar additive being present when moon was only heavenly body in sky.
Diffstat (limited to 'indra/newview/lldrawpoolsky.cpp')
-rw-r--r-- | indra/newview/lldrawpoolsky.cpp | 55 |
1 files changed, 35 insertions, 20 deletions
diff --git a/indra/newview/lldrawpoolsky.cpp b/indra/newview/lldrawpoolsky.cpp index 12614b5e2d..dbe8724088 100644 --- a/indra/newview/lldrawpoolsky.cpp +++ b/indra/newview/lldrawpoolsky.cpp @@ -111,37 +111,52 @@ void LLDrawPoolSky::render(S32 pass) LLVertexBuffer::unbind(); gGL.diffuseColor4f(1,1,1,1); - for (S32 i = 0; i < llmin(6, face_count); ++i) + for (S32 i = 0; i < face_count; ++i) { - renderSkyCubeFace(i); + renderSkyFace(i); } gGL.popMatrix(); } -void LLDrawPoolSky::renderSkyCubeFace(U8 side) +void LLDrawPoolSky::renderSkyFace(U8 index) { - LLFace &face = *mDrawFace[LLVOSky::FACE_SIDE0 + side]; - if (!face.getGeomCount()) + LLFace* face = mDrawFace[index]; + + if (!face || !face->getGeomCount()) { return; } - llassert(mSkyTex); - mSkyTex[side].bindTexture(TRUE); - - gGL.getTexUnit(0)->setTextureColorSpace(LLTexUnit::TCS_SRGB); - - face.renderIndexed(); - - if (LLSkyTex::doInterpolate()) - { - - LLGLEnable blend(GL_BLEND); - mSkyTex[side].bindTexture(FALSE); - gGL.diffuseColor4f(1, 1, 1, LLSkyTex::getInterpVal()); // lighting is disabled - face.renderIndexed(); - } + F32 interp_val = gSky.mVOSkyp ? gSky.mVOSkyp->getInterpVal() : 0.0f; + + if (index < 6) // sky tex...interp + { + llassert(mSkyTex); + mSkyTex[index].bindTexture(true); // bind the current tex + + face->renderIndexed(); + + if (interp_val > 0.01f) // iff, we've got enough info to lerp (a to and a from) + { + LLGLEnable blend(GL_BLEND); + llassert(mSkyTex); + mSkyTex[index].bindTexture(false); // bind the "other" texture + gGL.diffuseColor4f(1, 1, 1, interp_val); // lighting is disabled + face->renderIndexed(); + } + } + else // heavenly body faces, no interp... + { + LLGLEnable blend(GL_BLEND); + + LLViewerTexture* tex = face->getTexture(LLRender::DIFFUSE_MAP); + if (tex) + { + gGL.getTexUnit(0)->bind(tex, true); + face->renderIndexed(); + } + } } void LLDrawPoolSky::endRenderPass( S32 pass ) |