summaryrefslogtreecommitdiff
path: root/indra/llappearance/lltexlayer.cpp
diff options
context:
space:
mode:
authorDon Kjer <don@lindenlab.com>2012-12-06 22:54:50 +0000
committerDon Kjer <don@lindenlab.com>2012-12-06 22:54:50 +0000
commit07d05c2967fb1013a3f21c1c055ad068b2be9995 (patch)
treedc06635670b65798d824595486f314a809d7dd88 /indra/llappearance/lltexlayer.cpp
parent96ef49df75c0248e4843f9a5b53f010b819d59f3 (diff)
Alpha rendering fixes for appearance utility.
Diffstat (limited to 'indra/llappearance/lltexlayer.cpp')
-rw-r--r--indra/llappearance/lltexlayer.cpp85
1 files changed, 1 insertions, 84 deletions
diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp
index a8bbbdbc06..d1edd4f095 100644
--- a/indra/llappearance/lltexlayer.cpp
+++ b/indra/llappearance/lltexlayer.cpp
@@ -145,17 +145,11 @@ BOOL LLTexLayerSetBuffer::renderTexLayerSet()
bool use_shaders = LLGLSLShader::sNoFixedFunction;
- LLGLEnable(GL_ALPHA_TEST);
-
if (use_shaders)
{
gAlphaMaskProgram.bind();
gAlphaMaskProgram.setMinimumAlpha(0.004f);
}
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.004f);
- }
LLVertexBuffer::unbind();
@@ -394,7 +388,6 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height )
LLGLSUIDefault gls_ui;
LLGLDepthTest gls_depth(GL_FALSE, GL_FALSE);
gGL.setColorMask(true, true);
- LLGLEnable(GL_ALPHA_TEST);
// clear buffer area to ensure we don't pick up UI elements
{
@@ -404,11 +397,6 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height )
{
gAlphaMaskProgram.setMinimumAlpha(0.0f);
}
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.0f);
- }
-
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
gGL.color4f( 0.f, 0.f, 0.f, 1.f );
@@ -419,10 +407,6 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height )
{
gAlphaMaskProgram.setMinimumAlpha(0.004f);
}
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.004f);
- }
}
if (mIsVisible)
@@ -453,10 +437,6 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height )
{
gAlphaMaskProgram.setMinimumAlpha(0.f);
}
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.0f);
- }
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
gGL.color4f( 0.f, 0.f, 0.f, 0.f );
@@ -469,11 +449,6 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height )
{
gAlphaMaskProgram.setMinimumAlpha(0.004f);
}
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.004f);
- }
-
}
return success;
@@ -564,7 +539,6 @@ void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height,
gGL.setColorMask(false, true);
gGL.setSceneBlendType(LLRender::BT_REPLACE);
- LLGLEnable(GL_ALPHA_TEST);
// (Optionally) replace alpha with a single component image from a tga file.
if (!info->mStaticAlphaFileName.empty())
@@ -591,11 +565,6 @@ void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height,
{
gAlphaMaskProgram.setMinimumAlpha(0.f);
}
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.0f);
- }
-
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
gGL.color4f( 0.f, 0.f, 0.f, 1.f );
@@ -606,11 +575,6 @@ void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height,
{
gAlphaMaskProgram.setMinimumAlpha(0.004f);
}
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.004f);
- }
-
}
// (Optional) Mask out part of the baked texture with alpha masks
@@ -1118,7 +1082,6 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height)
//gPipeline.disableLights();
stop_glerror();
glDisable(GL_LIGHTING);
- LLGLEnable(GL_ALPHA_TEST);
stop_glerror();
bool use_shaders = LLGLSLShader::sNoFixedFunction;
@@ -1211,10 +1174,6 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height)
{
gAlphaMaskProgram.setMinimumAlpha(0.f);
}
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.0f);
- }
}
LLTexUnit::eTextureAddressMode old_mode = tex->getAddressMode();
@@ -1232,12 +1191,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height)
{
gAlphaMaskProgram.setMinimumAlpha(0.004f);
}
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.004f);
- }
}
-
}
}
// else
@@ -1272,11 +1226,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height)
LLGLDisable no_alpha(GL_ALPHA_TEST);
if (use_shaders)
{
- gAlphaMaskProgram.setMinimumAlpha(0.f);
- }
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.0f);
+ gAlphaMaskProgram.setMinimumAlpha(0.000f);
}
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
@@ -1286,10 +1236,6 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height)
{
gAlphaMaskProgram.setMinimumAlpha(0.004f);
}
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.004f);
- }
}
if( alpha_mask_specified || getInfo()->mWriteAllChannels )
@@ -1378,7 +1324,6 @@ BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height)
gGL.flush();
bool use_shaders = LLGLSLShader::sNoFixedFunction;
- LLGLEnable(GL_ALPHA_TEST);
if( !getInfo()->mStaticImageFileName.empty() )
{
@@ -1390,11 +1335,6 @@ BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height)
{
gAlphaMaskProgram.setMinimumAlpha(0.f);
}
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.0f);
- }
-
gGL.getTexUnit(0)->bind(tex, TRUE);
gl_rect_2d_simple_tex( width, height );
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
@@ -1402,10 +1342,6 @@ BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height)
{
gAlphaMaskProgram.setMinimumAlpha(0.004f);
}
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.004f);
- }
}
else
{
@@ -1424,11 +1360,6 @@ BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height)
{
gAlphaMaskProgram.setMinimumAlpha(0.f);
}
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.0f);
- }
-
gGL.getTexUnit(0)->bind(tex);
gl_rect_2d_simple_tex( width, height );
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
@@ -1437,10 +1368,6 @@ BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height)
{
gAlphaMaskProgram.setMinimumAlpha(0.004f);
}
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.0f);
- }
}
}
}
@@ -1462,17 +1389,11 @@ BOOL LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
llassert( !mParamAlphaList.empty() );
bool use_shaders = LLGLSLShader::sNoFixedFunction;
- LLGLEnable(GL_ALPHA_TEST);
if (use_shaders)
{
gAlphaMaskProgram.setMinimumAlpha(0.f);
}
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.0f);
- }
-
gGL.setColorMask(false, true);
@@ -1553,10 +1474,6 @@ BOOL LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
{
gAlphaMaskProgram.setMinimumAlpha(0.004f);
}
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.004f);
- }
LLGLSUIDefault gls_ui;