diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2012-10-22 11:10:37 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2012-10-22 11:10:37 -0400 |
commit | 7f025073771b808b65f85e5f2e67e0944e903c33 (patch) | |
tree | 83483cc2fe53334f83885cc41de0a6e22cdf9060 /indra | |
parent | c961b5f6571cc6147410f9e7620e5aa44c009f3f (diff) | |
parent | 3ac3f76fc36332e02551ed68c361c9808a8459e1 (diff) |
merge
Diffstat (limited to 'indra')
-rw-r--r-- | indra/cmake/Variables.cmake | 7 | ||||
-rw-r--r-- | indra/llappearance/lltexlayer.cpp | 97 |
2 files changed, 97 insertions, 7 deletions
diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 6efe738197..895b3003db 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -51,9 +51,6 @@ if (EXISTS ${CMAKE_SOURCE_DIR}/Server.cmake) # We use this as a marker that you can try to use the proprietary libraries. set(INSTALL_PROPRIETARY ON CACHE BOOL "Install proprietary binaries") endif (EXISTS ${CMAKE_SOURCE_DIR}/Server.cmake) -if (LINUX AND INSTALL_PROPRIETARY) - set(BUILD_HEADLESS ON CACHE BOOL "Build headless libraries.") -endif (LINUX AND INSTALL_PROPRIETARY) set(TEMPLATE_VERIFIER_OPTIONS "" CACHE STRING "Options for scripts/template_verifier.py") set(TEMPLATE_VERIFIER_MASTER_URL "http://bitbucket.org/lindenlab/master-message-template/raw/tip/message_template.msg" CACHE STRING "Location of the master message template") @@ -73,6 +70,10 @@ endif (${CMAKE_SYSTEM_NAME} MATCHES "Windows") if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") set(LINUX ON BOOl FORCE) + if (INSTALL_PROPRIETARY) + set(BUILD_HEADLESS ON CACHE BOOL "Build headless libraries.") + endif (INSTALL_PROPRIETARY) + # If someone has specified a word size, use that to determine the # architecture. Otherwise, let the architecture specify the word size. if (WORD_SIZE EQUAL 32) diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp index 6e2623b860..c44799f40d 100644 --- a/indra/llappearance/lltexlayer.cpp +++ b/indra/llappearance/lltexlayer.cpp @@ -148,11 +148,17 @@ 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(); @@ -391,6 +397,7 @@ 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 { @@ -400,6 +407,11 @@ 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 ); @@ -410,6 +422,10 @@ 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) @@ -440,6 +456,10 @@ 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 ); @@ -452,6 +472,11 @@ 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; @@ -542,6 +567,7 @@ 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()) @@ -568,6 +594,11 @@ 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 ); @@ -578,6 +609,11 @@ 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 @@ -1085,6 +1121,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height) //gPipeline.disableLights(); stop_glerror(); glDisable(GL_LIGHTING); + glEnable(GL_ALPHA_TEST); stop_glerror(); bool use_shaders = LLGLSLShader::sNoFixedFunction; @@ -1171,9 +1208,16 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height) { bool no_alpha_test = getInfo()->mWriteAllChannels; LLGLDisable alpha_test(no_alpha_test ? GL_ALPHA_TEST : 0); - if (use_shaders && no_alpha_test) + if (no_alpha_test) { - gAlphaMaskProgram.setMinimumAlpha(0.f); + if (use_shaders) + { + gAlphaMaskProgram.setMinimumAlpha(0.f); + } + else + { + gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.0f); + } } LLTexUnit::eTextureAddressMode old_mode = tex->getAddressMode(); @@ -1185,9 +1229,16 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height) gGL.getTexUnit(0)->setTextureAddressMode(old_mode); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - if (use_shaders && no_alpha_test) + if (no_alpha_test) { - gAlphaMaskProgram.setMinimumAlpha(0.004f); + if (use_shaders) + { + gAlphaMaskProgram.setMinimumAlpha(0.004f); + } + else + { + gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.004f); + } } } @@ -1226,6 +1277,11 @@ BOOL LLTexLayer::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.color4fv( net_color.mV ); gl_rect_2d_simple( width, height ); @@ -1233,6 +1289,10 @@ 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 ) @@ -1321,6 +1381,7 @@ 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() ) { @@ -1332,6 +1393,11 @@ 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); @@ -1339,6 +1405,10 @@ BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height) { gAlphaMaskProgram.setMinimumAlpha(0.004f); } + else + { + gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.004f); + } } else { @@ -1357,6 +1427,11 @@ 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); @@ -1365,6 +1440,10 @@ BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height) { gAlphaMaskProgram.setMinimumAlpha(0.004f); } + else + { + gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.0f); + } } } } @@ -1386,11 +1465,17 @@ 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); @@ -1471,6 +1556,10 @@ 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; |