diff options
author | Graham Linden <graham@lindenlab.com> | 2018-08-30 18:15:26 +0100 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2018-08-30 18:15:26 +0100 |
commit | e61fb73f38cbbbbb4728ae822484f88a37094715 (patch) | |
tree | 2c09b2ea8488fa09891e7a70773a337ffa0bcccf /indra/newview/lldrawpoolwlsky.cpp | |
parent | 3b0ab35ac1325b164cc8ffa05d9ea4d3532ac40a (diff) | |
parent | 6dd9dd3ab63cb0daa7682a400ff0408fd894ba77 (diff) |
Merge
Diffstat (limited to 'indra/newview/lldrawpoolwlsky.cpp')
-rw-r--r-- | indra/newview/lldrawpoolwlsky.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp index 6b32c196dc..4bf47f4fd6 100644 --- a/indra/newview/lldrawpoolwlsky.cpp +++ b/indra/newview/lldrawpoolwlsky.cpp @@ -379,6 +379,9 @@ void LLDrawPoolWLSky::renderHeavenlyBodies() LLViewerTexture* tex_a = face->getTexture(LLRender::DIFFUSE_MAP); LLViewerTexture* tex_b = face->getTexture(LLRender::ALTERNATE_DIFFUSE_MAP); + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + gGL.getTexUnit(1)->unbind(LLTexUnit::TT_TEXTURE); + // if we even have sun disc textures to work with... if (tex_a || tex_b) { @@ -391,20 +394,18 @@ void LLDrawPoolWLSky::renderHeavenlyBodies() if (tex_a && (!tex_b || (tex_a == tex_b))) { // Bind current and next sun textures - gGL.getTexUnit(0)->bind(tex_a); - gGL.getTexUnit(1)->unbind(LLTexUnit::TT_TEXTURE); + sun_shader->bindTexture(LLShaderMgr::DIFFUSE_MAP, tex_a, LLTexUnit::TT_TEXTURE); blend_factor = 0; } else if (tex_b && !tex_a) { - gGL.getTexUnit(0)->bind(tex_b); - gGL.getTexUnit(1)->unbind(LLTexUnit::TT_TEXTURE); + sun_shader->bindTexture(LLShaderMgr::DIFFUSE_MAP, tex_b, LLTexUnit::TT_TEXTURE); blend_factor = 0; } else if (tex_b != tex_a) { - gGL.getTexUnit(0)->bind(tex_a); - gGL.getTexUnit(1)->bind(tex_b); + sun_shader->bindTexture(LLShaderMgr::DIFFUSE_MAP, tex_a, LLTexUnit::TT_TEXTURE); + sun_shader->bindTexture(LLShaderMgr::ALTERNATE_DIFFUSE_MAP, tex_b, LLTexUnit::TT_TEXTURE); } LLColor4 color(gSky.mVOSkyp->getSun().getInterpColor()); @@ -445,20 +446,18 @@ void LLDrawPoolWLSky::renderHeavenlyBodies() if (tex_a && (!tex_b || (tex_a == tex_b))) { // Bind current and next sun textures - gGL.getTexUnit(0)->bind(tex_a); - gGL.getTexUnit(1)->unbind(LLTexUnit::TT_TEXTURE); + moon_shader->bindTexture(LLShaderMgr::DIFFUSE_MAP, tex_a, LLTexUnit::TT_TEXTURE); blend_factor = 0; } else if (tex_b && !tex_a) { - gGL.getTexUnit(0)->bind(tex_b); - gGL.getTexUnit(1)->unbind(LLTexUnit::TT_TEXTURE); + moon_shader->bindTexture(LLShaderMgr::DIFFUSE_MAP, tex_b, LLTexUnit::TT_TEXTURE); blend_factor = 0; } else if (tex_b != tex_a) { - gGL.getTexUnit(0)->bind(tex_a); - gGL.getTexUnit(1)->bind(tex_b); + moon_shader->bindTexture(LLShaderMgr::DIFFUSE_MAP, tex_a, LLTexUnit::TT_TEXTURE); + moon_shader->bindTexture(LLShaderMgr::ALTERNATE_DIFFUSE_MAP, tex_b, LLTexUnit::TT_TEXTURE); } if (can_use_vertex_shaders) |