diff options
author | bea@american.lindenlab.com <bea@american.lindenlab.com> | 2009-12-01 18:50:53 -0800 |
---|---|---|
committer | bea@american.lindenlab.com <bea@american.lindenlab.com> | 2009-12-01 18:50:53 -0800 |
commit | 916720dd110d089a295e2c28f1702da7e6725e83 (patch) | |
tree | 090eec84797cfa6014a9b42cb0659e6e8d2a8cd9 /indra/newview/llvoavatar.cpp | |
parent | 9026ac3264b00636a72a0c196b02cdac96b2c156 (diff) | |
parent | 1db0d32133f97b03a632f03fa78e198b7f00866b (diff) |
merge
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rw-r--r-- | indra/newview/llvoavatar.cpp | 45 |
1 files changed, 37 insertions, 8 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 9882dcd6af..a9194c0c3b 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3621,6 +3621,16 @@ void LLVOAvatar::updateVisibility() mVisible = visible; } +// private +bool LLVOAvatar::shouldAlphaMask() +{ + const bool should_alpha_mask = mSupportsAlphaLayers && !LLDrawPoolAlpha::sShowDebugAlpha // Don't alpha mask if "Highlight Transparent" checked + && !LLDrawPoolAvatar::sSkipTransparent; + + return should_alpha_mask; + +} + //----------------------------------------------------------------------------- // renderSkinned() //----------------------------------------------------------------------------- @@ -3754,9 +3764,8 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass) if (pass == AVATAR_RENDER_PASS_SINGLE) { - const bool should_alpha_mask = mSupportsAlphaLayers && !LLDrawPoolAlpha::sShowDebugAlpha // Don't alpha mask if "Highlight Transparent" checked - && !LLDrawPoolAvatar::sSkipTransparent; + bool should_alpha_mask = shouldAlphaMask(); LLGLState test(GL_ALPHA_TEST, should_alpha_mask); if (should_alpha_mask) @@ -3825,6 +3834,15 @@ U32 LLVOAvatar::renderTransparent(BOOL first_pass) gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f); } + bool should_alpha_mask = shouldAlphaMask(); + + LLGLState test(GL_ALPHA_TEST, should_alpha_mask); + + if (should_alpha_mask) + { + gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f); + } + if (isTextureVisible(TEX_HEAD_BAKED)) { num_indices += mMeshLOD[MESH_ID_EYELASH]->render(mAdjustedPixelArea, first_pass, mIsDummy); @@ -3868,11 +3886,21 @@ U32 LLVOAvatar::renderRigid() return 0; } + bool should_alpha_mask = shouldAlphaMask(); + LLGLState test(GL_ALPHA_TEST, should_alpha_mask); + + if (should_alpha_mask) + { + gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f); + } + if (isTextureVisible(TEX_EYES_BAKED) || mIsDummy) { num_indices += mMeshLOD[MESH_ID_EYEBALL_LEFT]->render(mAdjustedPixelArea, TRUE, mIsDummy); num_indices += mMeshLOD[MESH_ID_EYEBALL_RIGHT]->render(mAdjustedPixelArea, TRUE, mIsDummy); } + + gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); return num_indices; } @@ -5943,6 +5971,9 @@ void LLVOAvatar::updateMeshTextures() } + // Turn on alpha masking correctly for yourself and other avatars on 1.23+ + mSupportsAlphaLayers = isSelf() || is_layer_baked[BAKED_HAIR]; + // Baked textures should be requested from the sim this avatar is on. JC const LLHost target_host = getObjectHost(); if (!target_host.isOk()) @@ -5981,7 +6012,7 @@ void LLVOAvatar::updateMeshTextures() } else if (mBakedTextureDatas[i].mTexLayerSet && !other_culled - && (i != BAKED_HAIR || is_layer_baked[i] || isSelf())) // ! BACKWARDS COMPATIBILITY ! workaround for old viewers. + && (i != BAKED_HAIR || mSupportsAlphaLayers)) // ! BACKWARDS COMPATIBILITY ! workaround for old viewers. { mBakedTextureDatas[i].mTexLayerSet->createComposite(); mBakedTextureDatas[i].mTexLayerSet->setUpdatesEnabled( TRUE ); @@ -5992,10 +6023,10 @@ void LLVOAvatar::updateMeshTextures() } } } - + // ! BACKWARDS COMPATIBILITY ! // Workaround for viewing avatars from old viewers that haven't baked hair textures. - if (!is_layer_baked[BAKED_HAIR] || self_customizing) + if (!mSupportsAlphaLayers) { const LLColor4 color = mTexHairColor ? mTexHairColor->getColor() : LLColor4(1,1,1,1); LLViewerTexture* hair_img = getImage( TEX_HAIR, 0 ); @@ -6006,8 +6037,6 @@ void LLVOAvatar::updateMeshTextures() } } - // Turn on alpha masking correctly for yourself and other avatars on 1.23+ - mSupportsAlphaLayers = isSelf() || is_layer_baked[BAKED_HAIR]; for (LLVOAvatarDictionary::BakedTextures::const_iterator baked_iter = LLVOAvatarDictionary::getInstance()->getBakedTextures().begin(); baked_iter != LLVOAvatarDictionary::getInstance()->getBakedTextures().end(); @@ -6510,7 +6539,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) } - if( !mFirstTEMessageReceived ) + if( !is_first_appearance_message ) { onFirstTEMessageReceived(); } |