diff options
author | Geenz <geenz@geenzo.com> | 2013-02-15 11:49:59 -0500 |
---|---|---|
committer | Geenz <geenz@geenzo.com> | 2013-02-15 11:49:59 -0500 |
commit | c2785a740eb98d28ba705c981f4b6b289501d2e5 (patch) | |
tree | 833c36a8c62ebbe94b050ea5e6433b9c475a169a | |
parent | 170ecf5e8a771c8dd629cae0715ab243edea1171 (diff) |
Fixed: alpha mode shaders not being bound appropriately.
-rw-r--r-- | indra/newview/lldrawpoolmaterials.cpp | 7 | ||||
-rw-r--r-- | indra/newview/pipeline.cpp | 15 |
2 files changed, 19 insertions, 3 deletions
diff --git a/indra/newview/lldrawpoolmaterials.cpp b/indra/newview/lldrawpoolmaterials.cpp index e775346563..52f476f589 100644 --- a/indra/newview/lldrawpoolmaterials.cpp +++ b/indra/newview/lldrawpoolmaterials.cpp @@ -68,20 +68,23 @@ void LLDrawPoolMaterials::renderDeferred(S32 pass) switch (params.mDiffuseAlphaMode) { case 0: - LL_INFOS("Asdf") << "Renderererererrerererrrr!!!~!!!~!~" << LL_ENDL; mShader = &gDeferredMaterialShinyNormal; + mShader->bind(); break; case 1: // Alpha blending not supported in the opaque draw pool. return; case 2: mShader = &gDeferredMaterialShinyNormalAlphaTest; + mShader->bind(); + mShader->setMinimumAlpha(params.mAlphaMaskCutoff); break; case 3: mShader = &gDeferredMaterialShinyNormalEmissive; + mShader->bind(); break; }; - mShader->bind(); + mShader->uniform4f(LLShaderMgr::SPECULAR_COLOR, params.mSpecColor.mV[0], params.mSpecColor.mV[1], params.mSpecColor.mV[2], params.mSpecColor.mV[3]); mShader->uniform1f(LLShaderMgr::ENVIRONMENT_INTENSITY, params.mEnvIntensity); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 8ee4cd7713..53632e3608 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1598,7 +1598,20 @@ U32 LLPipeline::getPoolTypeFromTE(const LLTextureEntry* te, LLViewerTexture* ima { alpha = alpha || (imagep->getComponents() == 4 && imagep->getType() != LLViewerTexture::MEDIA_TEXTURE) || (imagep->getComponents() == 2); } - + + if (alpha && te->getMaterialParams()) + { + switch (te->getMaterialParams()->getDiffuseAlphaMode()) + { + case 1: + alpha = true; // Material's alpha mode is set to blend. Toss it into the alpha draw pool. + break; + default: + alpha = false; // Material's alpha mode is set to none, mask, or emissive. Toss it into the opaque material draw pool. + break; + } + } + if (alpha) { return LLDrawPool::POOL_ALPHA; |