diff options
| author | Geenz <geenz@geenzo.com> | 2013-04-17 16:40:10 -0400 |
|---|---|---|
| committer | Geenz <geenz@geenzo.com> | 2013-04-17 16:40:10 -0400 |
| commit | 35cc62f24c8a3f1fe3d6c879a4435dfebcb6fc8e (patch) | |
| tree | 3071192a59259f0301e987239c7ec36c56453f87 /indra/newview/lldrawpoolalpha.cpp | |
| parent | bb5bf632c6c3dea22865a86dc8c13f5de9ce06f0 (diff) | |
| parent | 67af268b785e8a47d7db10aa3a566c269b0f16e3 (diff) | |
Merge + propagated class 2 alphaF changes to class 1 alphaF.
Diffstat (limited to 'indra/newview/lldrawpoolalpha.cpp')
| -rw-r--r-- | indra/newview/lldrawpoolalpha.cpp | 47 |
1 files changed, 41 insertions, 6 deletions
diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 31b84bb258..3ce2d4fb1c 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -441,6 +441,13 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) LLRenderPass::applyModelMatrix(params); + LLMaterial* mat = NULL; + + if (deferred_render && !LLPipeline::sUnderWaterRender) + { + mat = params.mMaterial; + } + if (params.mFullbright) { // Turn off lighting if it hasn't already been so. @@ -473,10 +480,30 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) light_enabled = TRUE; } - // If we need shaders, and we're not ALREADY using the proper shader, then bind it - // (this way we won't rebind shaders unnecessarily). - if(use_shaders && (current_shader != target_shader)) + if (!params.mFullbright && deferred_render && mat) + { + U32 mask = mat->getShaderMask(); + + llassert(mask < LLMaterial::SHADER_COUNT); + target_shader = &(gDeferredMaterialProgram[mask]); + + if (current_shader != target_shader) + { + gPipeline.bindDeferredShader(*target_shader); + } + } + else if (!params.mFullbright) + { + target_shader = simple_shader; + } + else { + target_shader = fullbright_shader; + } + + if(use_shaders && (current_shader != target_shader)) + {// If we need shaders, and we're not ALREADY using the proper shader, then bind it + // (this way we won't rebind shaders unnecessarily). llassert(target_shader != NULL); current_shader = target_shader; current_shader->bind(); @@ -487,7 +514,7 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) current_shader = NULL; } - if (params.mMaterial.notNull() && current_shader == simple_shader) + if (mat && !params.mFullbright) { // I apologize in advance for not giving this its own shader. // We have a material. Supply the appropriate data here. @@ -549,12 +576,20 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) } } } - else + else { //not batching textures or batch has only 1 texture -- might need a texture matrix if (params.mTexture.notNull()) { params.mTexture->addTextureStats(params.mVSize); - gGL.getTexUnit(0)->bind(params.mTexture, TRUE) ; + if (use_shaders && mat) + { + current_shader->bindTexture(LLShaderMgr::DIFFUSE_MAP, params.mTexture); + } + else + { + gGL.getTexUnit(0)->bind(params.mTexture, TRUE); + } + if (params.mTextureMatrix) { tex_setup = true; |
