summaryrefslogtreecommitdiff
path: root/indra/llappearance
diff options
context:
space:
mode:
authorDon Kjer <don@lindenlab.com>2012-12-18 23:40:31 +0000
committerDon Kjer <don@lindenlab.com>2012-12-18 23:40:31 +0000
commit802e738b77f09a67c893825dc8699f8273cebbee (patch)
treea860a9b03264fd8761bd560937a3693aef39ab6f /indra/llappearance
parent7d173dffa98c3c14d6d7db457ea813d3c85dcfa8 (diff)
Fix for alpha blending using gl fixed-functions not matching shader implementation
Diffstat (limited to 'indra/llappearance')
-rw-r--r--indra/llappearance/lltexlayer.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp
index d1edd4f095..6e184beac8 100644
--- a/indra/llappearance/lltexlayer.cpp
+++ b/indra/llappearance/lltexlayer.cpp
@@ -150,6 +150,10 @@ BOOL LLTexLayerSetBuffer::renderTexLayerSet()
gAlphaMaskProgram.bind();
gAlphaMaskProgram.setMinimumAlpha(0.004f);
}
+ else
+ {
+ gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.00f);
+ }
LLVertexBuffer::unbind();
@@ -1915,9 +1919,15 @@ LLGLTexture* LLTexLayerStaticImageList::getTexture(const std::string& file_name,
{
if( (image_raw->getComponents() == 1) && is_mask )
{
- // Note: these are static, unchanging images so it's ok to assume
- // that once an image is a mask it's always a mask.
- tex->setExplicitFormat( GL_ALPHA8, GL_ALPHA );
+ // Convert grayscale alpha masks from single channel into RGBA.
+ // Fill RGB with black to allow fixed function gl calls
+ // to match shader implementation.
+ LLPointer<LLImageRaw> alpha_image_raw = image_raw;
+ image_raw = new LLImageRaw(image_raw->getWidth(),
+ image_raw->getHeight(),
+ 4);
+
+ image_raw->copyUnscaledAlphaMask(alpha_image_raw, LLColor4U::black);
}
tex->createGLTexture(0, image_raw, 0, TRUE, LLGLTexture::LOCAL);