diff options
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rw-r--r-- | indra/newview/llvoavatar.cpp | 91 |
1 files changed, 61 insertions, 30 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 824e06284a..a9e9169891 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -86,6 +86,7 @@ #include "llsky.h" #include "llanimstatelabels.h" #include "lltrans.h" +#include "llappearancemgr.h" #include "llgesturemgr.h" //needed to trigger the voice gesticulations #include "llvoiceclient.h" @@ -691,6 +692,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, } mDirtyMesh = TRUE; // Dirty geometry, need to regenerate. + mMeshTexturesDirty = FALSE; mShadow0Facep = NULL; mShadow1Facep = NULL; mHeadp = NULL; @@ -729,8 +731,10 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mRippleTimeLast = 0.f; mShadowImagep = LLViewerTextureManager::getFetchedTextureFromFile("foot_shadow.j2c"); - gGL.getTexUnit(0)->bind(mShadowImagep); - mShadowImagep->setAddressMode(LLTexUnit::TAM_CLAMP); + + // GL NOT ACTIVE HERE + //gGL.getTexUnit(0)->bind(mShadowImagep.get()); + //mShadowImagep->setAddressMode(LLTexUnit::TAM_CLAMP); mInAir = FALSE; @@ -1411,7 +1415,7 @@ BOOL LLVOAvatar::lineSegmentIntersect(const LLVector3& start, const LLVector3& e LLVector3* normal, LLVector3* bi_normal) { - if (isSelf() && !gAgent.needsRenderAvatar() || !LLPipeline::sPickAvatar) + if ((isSelf() && !gAgent.needsRenderAvatar()) || !LLPipeline::sPickAvatar) { return FALSE; } @@ -1623,6 +1627,11 @@ BOOL LLVOAvatar::buildSkeleton(const LLVOAvatarSkeletonInfo *info) return TRUE; } +LLVOAvatar* LLVOAvatar::asAvatar() +{ + return this; +} + //----------------------------------------------------------------------------- // LLVOAvatar::startDefaultMotions() //----------------------------------------------------------------------------- @@ -2187,10 +2196,14 @@ BOOL LLVOAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) idleUpdateVoiceVisualizer( voice_enabled ); idleUpdateMisc( detailed_update ); idleUpdateAppearanceAnimation(); - idleUpdateLipSync( voice_enabled ); - idleUpdateLoadingEffect(); - idleUpdateBelowWater(); // wind effect uses this - idleUpdateWindEffect(); + if (detailed_update) + { + idleUpdateLipSync( voice_enabled ); + idleUpdateLoadingEffect(); + idleUpdateBelowWater(); // wind effect uses this + idleUpdateWindEffect(); + } + idleUpdateNameTag( root_pos_last ); idleUpdateRenderCost(); idleUpdateTractorBeam(); @@ -3043,7 +3056,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) if (!visible) { - updateMotions(LLCharacter::HIDDEN_UPDATE); + //updateMotions(LLCharacter::HIDDEN_UPDATE); return FALSE; } @@ -3713,7 +3726,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 + const bool should_alpha_mask = mSupportsAlphaLayers && !LLDrawPoolAlpha::sShowDebugAlpha // Don't alpha mask if "Highlight Transparent" checked + && !LLDrawPoolAvatar::sSkipTransparent; LLGLState test(GL_ALPHA_TEST, should_alpha_mask); @@ -3828,20 +3842,8 @@ U32 LLVOAvatar::renderRigid() if (isTextureVisible(TEX_EYES_BAKED) || mIsDummy) { - // If the meshes need to be drawn, enable alpha masking but not blending - bool should_alpha_mask = mSupportsAlphaLayers && !LLDrawPoolAlpha::sShowDebugAlpha; - - LLGLState test(GL_ALPHA_TEST, should_alpha_mask); - - if (should_alpha_mask) - { - gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f); - } - 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; @@ -3886,7 +3888,7 @@ U32 LLVOAvatar::renderFootShadows() LLGLDepthTest test(GL_TRUE, GL_FALSE); //render foot shadows LLGLEnable blend(GL_BLEND); - gGL.getTexUnit(0)->bind(mShadowImagep); + gGL.getTexUnit(0)->bind(mShadowImagep.get()); glColor4fv(mShadow0Facep->getRenderColor().mV); mShadow0Facep->renderIndexed(foot_mask); glColor4fv(mShadow1Facep->getRenderColor().mV); @@ -3895,7 +3897,7 @@ U32 LLVOAvatar::renderFootShadows() return num_indices; } -U32 LLVOAvatar::renderImpostor(LLColor4U color) +U32 LLVOAvatar::renderImpostor(LLColor4U color, S32 diffuse_channel) { if (!mImpostor.isComplete()) { @@ -3915,7 +3917,7 @@ U32 LLVOAvatar::renderImpostor(LLColor4U color) gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.f); gGL.color4ubv(color.mV); - gGL.getTexUnit(0)->bind(&mImpostor); + gGL.getTexUnit(diffuse_channel)->bind(&mImpostor); gGL.begin(LLRender::QUADS); gGL.texCoord2f(0,0); gGL.vertex3fv((pos+left-up).mV); @@ -3953,6 +3955,7 @@ void LLVOAvatar::updateTextures(LLAgent &agent) } std::vector<BOOL> layer_baked; + // GL NOT ACTIVE HERE - *TODO for (U32 i = 0; i < mBakedTextureDatas.size(); i++) { layer_baked.push_back(isTextureDefined(mBakedTextureDatas[i].mTextureIndex)); @@ -5182,6 +5185,15 @@ LLDrawable *LLVOAvatar::createDrawable(LLPipeline *pipeline) } +void LLVOAvatar::updateGL() +{ + if (mMeshTexturesDirty) + { + updateMeshTextures(); + mMeshTexturesDirty = FALSE; + } +} + //----------------------------------------------------------------------------- // updateGeometry() //----------------------------------------------------------------------------- @@ -5233,7 +5245,7 @@ void LLVOAvatar::updateShadowFaces() sprite.setSize(0.4f + cos_elev * 0.8f, 0.3f); LLVector3 sun_vec = gSky.mVOSkyp ? gSky.mVOSkyp->getToSun() : LLVector3(0.f, 0.f, 0.f); - if (mShadowImagep->hasValidGLTexture()) + if (mShadowImagep->hasGLTexture()) { LLVector3 normal; LLVector3d shadow_pos; @@ -5492,6 +5504,18 @@ BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object) if (isSelf()) { // Then make sure the inventory is in sync with the avatar. + + // Update COF contents, don't trigger appearance update. + if (gAgent.getAvatarObject() == NULL) + { + llinfos << "removeItemLinks skipped, avatar is under destruction" << llendl; + } + else + { + LLAppearanceManager::removeItemLinks(item_id, false); + } + + // BAP - needs to change for label to track link. gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id); gInventory.notifyObservers(); } @@ -6365,7 +6389,8 @@ void LLVOAvatar::onFirstTEMessageReceived() } } - updateMeshTextures(); + mMeshTexturesDirty = TRUE; + gPipeline.markGLRebuild(this); } } @@ -6428,6 +6453,8 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) } setCompositeUpdatesEnabled( FALSE ); + mMeshTexturesDirty = TRUE; + gPipeline.markGLRebuild(this); // ! BACKWARDS COMPATIBILITY ! // Non-self avatars will no longer have component textures @@ -6436,8 +6463,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) releaseComponentTextures(); } - updateMeshTextures(); // enables updates for laysets without baked textures. - + // parse visual params S32 num_blocks = mesgsys->getNumberOfBlocksFast(_PREHASH_VisualParam); if( num_blocks > 1 ) @@ -7447,13 +7473,18 @@ void LLVOAvatar::updateFreezeCounter(S32 counter) BOOL LLVOAvatar::updateLOD() { + if (isImpostor()) + { + return TRUE; + } + BOOL res = updateJointLODs(); LLFace* facep = mDrawable->getFace(0); if (facep->mVertexBuffer.isNull() || - LLVertexBuffer::sEnableVBOs && + (LLVertexBuffer::sEnableVBOs && ((facep->mVertexBuffer->getUsage() == GL_STATIC_DRAW ? TRUE : FALSE) != - (facep->getPool()->getVertexShaderLevel() > 0 ? TRUE : FALSE))) + (facep->getPool()->getVertexShaderLevel() > 0 ? TRUE : FALSE)))) { mDirtyMesh = TRUE; } |