diff options
author | andreykproductengine <andreykproductengine@lindenlab.com> | 2019-10-25 17:32:19 +0300 |
---|---|---|
committer | andreykproductengine <andreykproductengine@lindenlab.com> | 2019-10-25 17:32:19 +0300 |
commit | 4f5d78522632920586e7e4bf7acbc908f9492edb (patch) | |
tree | 1b93b5f285fb54815c9823cdd3e89d778409d113 /indra | |
parent | 62ce96a77b4305ead8fdde7644805b1cbf069597 (diff) |
SL-12014 Animesh is now a separate rendering type
Diffstat (limited to 'indra')
29 files changed, 99 insertions, 89 deletions
diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 8c6cbc020b..61524bcc6e 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -1178,11 +1178,23 @@ LLSpatialPartition* LLDrawable::getSpatialPartition() } else if (isRoot()) { - if (mSpatialBridge && (mSpatialBridge->asPartition()->mPartitionType == LLViewerRegion::PARTITION_HUD) != mVObjp->isHUDAttachment()) + if (mSpatialBridge) { - // remove obsolete bridge - mSpatialBridge->markDead(); - setSpatialBridge(NULL); + U32 partition_type = mSpatialBridge->asPartition()->mPartitionType; + if ((partition_type == LLViewerRegion::PARTITION_HUD) != mVObjp->isHUDAttachment()) + { + // Was/became HUD + // remove obsolete bridge + mSpatialBridge->markDead(); + setSpatialBridge(NULL); + } + else if ((partition_type == LLViewerRegion::PARTITION_CONTROL_AV) != (mVObjp->isAnimatedObject() && mVObjp->getControlAvatar() != NULL)) + { + // Was/became part of animesh + // remove obsolete bridge + mSpatialBridge->markDead(); + setSpatialBridge(NULL); + } } //must be an active volume if (!mSpatialBridge) @@ -1191,6 +1203,10 @@ LLSpatialPartition* LLDrawable::getSpatialPartition() { setSpatialBridge(new LLHUDBridge(this, getRegion())); } + else if (mVObjp->isAnimatedObject() && mVObjp->getControlAvatar()) + { + setSpatialBridge(new LLControlAVBridge(this, getRegion())); + } else { setSpatialBridge(new LLVolumeBridge(this, getRegion())); @@ -1704,6 +1720,13 @@ LLBridgePartition::LLBridgePartition(LLViewerRegion* regionp) mSlopRatio = 0.25f; } +LLControlAVPartition::LLControlAVPartition(LLViewerRegion* regionp) + : LLBridgePartition(regionp) +{ + mDrawableType = LLPipeline::RENDER_TYPE_CONTROL_AV; + mPartitionType = LLViewerRegion::PARTITION_CONTROL_AV; +} + LLHUDBridge::LLHUDBridge(LLDrawable* drawablep, LLViewerRegion* regionp) : LLVolumeBridge(drawablep, regionp) { diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp index 71b0f32a4f..f6f6d4fb40 100644 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -86,7 +86,8 @@ LLDrawPool *LLDrawPool::createPool(const U32 type, LLViewerTexture *tex0) poolp = new LLDrawPoolAlpha(); break; case POOL_AVATAR: - poolp = new LLDrawPoolAvatar(); + case POOL_CONTROL_AV: + poolp = new LLDrawPoolAvatar(type); break; case POOL_TREE: poolp = new LLDrawPoolTree(tex0); @@ -383,16 +384,6 @@ LLRenderPass::~LLRenderPass() } -LLDrawPool* LLRenderPass::instancePool() -{ -#if LL_RELEASE_FOR_DOWNLOAD - LL_WARNS() << "Attempting to instance a render pass. Invalid operation." << LL_ENDL; -#else - LL_ERRS() << "Attempting to instance a render pass. Invalid operation." << LL_ENDL; -#endif - return NULL; -} - void LLRenderPass::renderGroup(LLSpatialGroup* group, U32 type, U32 mask, BOOL texture) { LLSpatialGroup::drawmap_elem_t& draw_info = group->mDrawMap[type]; diff --git a/indra/newview/lldrawpool.h b/indra/newview/lldrawpool.h index bc299cc89f..e526930ec1 100644 --- a/indra/newview/lldrawpool.h +++ b/indra/newview/lldrawpool.h @@ -60,6 +60,7 @@ public: POOL_GRASS, POOL_INVISIBLE, // see below * POOL_AVATAR, + POOL_CONTROL_AV, // Animesh POOL_VOIDWATER, POOL_WATER, POOL_GLOW, @@ -110,7 +111,6 @@ public: virtual S32 getVertexShaderLevel() const { return mVertexShaderLevel; } static LLDrawPool* createPool(const U32 type, LLViewerTexture *tex0 = NULL); - virtual LLDrawPool *instancePool() = 0; // Create an empty new instance of the pool. virtual LLViewerTexture* getTexture() = 0; virtual BOOL isFacePool() { return FALSE; } virtual void resetDrawOrders() = 0; @@ -162,7 +162,6 @@ public: LLRenderPass(const U32 type); virtual ~LLRenderPass(); - /*virtual*/ LLDrawPool* instancePool(); /*virtual*/ LLViewerTexture* getDebugTexture() { return NULL; } LLViewerTexture* getTexture() { return NULL; } BOOL isDead() { return FALSE; } diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 9bb5d4a6bf..a858c81395 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -105,8 +105,8 @@ S32 cube_channel = -1; static LLTrace::BlockTimerStatHandle FTM_SHADOW_AVATAR("Avatar Shadow"); -LLDrawPoolAvatar::LLDrawPoolAvatar() : - LLFacePool(POOL_AVATAR) +LLDrawPoolAvatar::LLDrawPoolAvatar(U32 type) : + LLFacePool(type) { } @@ -135,15 +135,6 @@ BOOL LLDrawPoolAvatar::isDead() } return TRUE; } - -//----------------------------------------------------------------------------- -// instancePool() -//----------------------------------------------------------------------------- -LLDrawPool *LLDrawPoolAvatar::instancePool() -{ - return new LLDrawPoolAvatar(); -} - S32 LLDrawPoolAvatar::getVertexShaderLevel() const { @@ -1671,6 +1662,10 @@ void LLDrawPoolAvatar::getRiggedGeometry( { face->setPoolType(LLDrawPool::POOL_ALPHA); } + else if (type == LLDrawPool::POOL_CONTROL_AV) + { + face->setPoolType(LLDrawPool::POOL_CONTROL_AV); + } else { face->setPoolType(LLDrawPool::POOL_AVATAR); @@ -2267,7 +2262,7 @@ LLColor3 LLDrawPoolAvatar::getDebugColor() const void LLDrawPoolAvatar::addRiggedFace(LLFace* facep, U32 type) { llassert (facep->isState(LLFace::RIGGED)); - llassert(getType() == LLDrawPool::POOL_AVATAR); + llassert(getType() == LLDrawPool::POOL_AVATAR || getType() == LLDrawPool::POOL_CONTROL_AV); if (facep->getPool() && facep->getPool() != this) { LL_ERRS() << "adding rigged face that's already in another pool" << LL_ENDL; @@ -2289,7 +2284,7 @@ void LLDrawPoolAvatar::addRiggedFace(LLFace* facep, U32 type) void LLDrawPoolAvatar::removeRiggedFace(LLFace* facep) { llassert (facep->isState(LLFace::RIGGED)); - llassert(getType() == LLDrawPool::POOL_AVATAR); + llassert(getType() == LLDrawPool::POOL_AVATAR || getType() == LLDrawPool::POOL_CONTROL_AV); if (facep->getPool() != this) { LL_ERRS() << "Tried to remove a rigged face from the wrong pool" << LL_ENDL; diff --git a/indra/newview/lldrawpoolavatar.h b/indra/newview/lldrawpoolavatar.h index 8c1bc70c8e..6732a93b0f 100644 --- a/indra/newview/lldrawpoolavatar.h +++ b/indra/newview/lldrawpoolavatar.h @@ -177,12 +177,10 @@ typedef enum virtual S32 getVertexShaderLevel() const; - LLDrawPoolAvatar(); + LLDrawPoolAvatar(U32 type); static LLMatrix4& getModelView(); - /*virtual*/ LLDrawPool *instancePool(); - /*virtual*/ S32 getNumPasses(); /*virtual*/ void beginRenderPass(S32 pass); /*virtual*/ void endRenderPass(S32 pass); diff --git a/indra/newview/lldrawpoolground.cpp b/indra/newview/lldrawpoolground.cpp index 59c3fbf7a1..5f8d492d08 100644 --- a/indra/newview/lldrawpoolground.cpp +++ b/indra/newview/lldrawpoolground.cpp @@ -46,11 +46,6 @@ LLDrawPoolGround::LLDrawPoolGround() : { } -LLDrawPool *LLDrawPoolGround::instancePool() -{ - return new LLDrawPoolGround(); -} - void LLDrawPoolGround::prerender() { mVertexShaderLevel = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_ENVIRONMENT); diff --git a/indra/newview/lldrawpoolground.h b/indra/newview/lldrawpoolground.h index a4f8a3fcf5..15b1dc60a2 100644 --- a/indra/newview/lldrawpoolground.h +++ b/indra/newview/lldrawpoolground.h @@ -43,8 +43,6 @@ public: LLDrawPoolGround(); - /*virtual*/ LLDrawPool *instancePool(); - /*virtual*/ void prerender(); /*virtual*/ void render(S32 pass = 0); }; diff --git a/indra/newview/lldrawpoolsky.cpp b/indra/newview/lldrawpoolsky.cpp index bdb16abc78..ebb30c955f 100644 --- a/indra/newview/lldrawpoolsky.cpp +++ b/indra/newview/lldrawpoolsky.cpp @@ -48,11 +48,6 @@ LLDrawPoolSky::LLDrawPoolSky() { } -LLDrawPool *LLDrawPoolSky::instancePool() -{ - return new LLDrawPoolSky(); -} - void LLDrawPoolSky::prerender() { mVertexShaderLevel = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_ENVIRONMENT); diff --git a/indra/newview/lldrawpoolsky.h b/indra/newview/lldrawpoolsky.h index 098bd2134a..6817cd023e 100644 --- a/indra/newview/lldrawpoolsky.h +++ b/indra/newview/lldrawpoolsky.h @@ -49,8 +49,6 @@ public: LLDrawPoolSky(); - /*virtual*/ LLDrawPool *instancePool(); - /*virtual*/ S32 getNumPostDeferredPasses() { return getNumPasses(); } /*virtual*/ void beginPostDeferredPass(S32 pass) { beginRenderPass(pass); } /*virtual*/ void endPostDeferredPass(S32 pass) { endRenderPass(pass); } diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp index 3eefcef7aa..38b01a7561 100644 --- a/indra/newview/lldrawpoolterrain.cpp +++ b/indra/newview/lldrawpoolterrain.cpp @@ -85,13 +85,6 @@ LLDrawPoolTerrain::~LLDrawPoolTerrain() llassert( gPipeline.findPool( getType(), getTexture() ) == NULL ); } - -LLDrawPool *LLDrawPoolTerrain::instancePool() -{ - return new LLDrawPoolTerrain(mTexturep); -} - - U32 LLDrawPoolTerrain::getVertexDataMask() { if (LLPipeline::sShadowRender) diff --git a/indra/newview/lldrawpoolterrain.h b/indra/newview/lldrawpoolterrain.h index 484820491a..17409e961a 100644 --- a/indra/newview/lldrawpoolterrain.h +++ b/indra/newview/lldrawpoolterrain.h @@ -49,8 +49,6 @@ public: LLDrawPoolTerrain(LLViewerTexture *texturep); virtual ~LLDrawPoolTerrain(); - /*virtual*/ LLDrawPool *instancePool(); - /*virtual*/ S32 getNumDeferredPasses() { return 1; } /*virtual*/ void beginDeferredPass(S32 pass); /*virtual*/ void endDeferredPass(S32 pass); diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp index b1f40781f7..8a5073397e 100644 --- a/indra/newview/lldrawpooltree.cpp +++ b/indra/newview/lldrawpooltree.cpp @@ -50,11 +50,6 @@ LLDrawPoolTree::LLDrawPoolTree(LLViewerTexture *texturep) : mTexturep->setAddressMode(LLTexUnit::TAM_WRAP); } -LLDrawPool *LLDrawPoolTree::instancePool() -{ - return new LLDrawPoolTree(mTexturep); -} - void LLDrawPoolTree::prerender() { mVertexShaderLevel = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_OBJECT); diff --git a/indra/newview/lldrawpooltree.h b/indra/newview/lldrawpooltree.h index e7e25453cf..1b11469d9f 100644 --- a/indra/newview/lldrawpooltree.h +++ b/indra/newview/lldrawpooltree.h @@ -44,8 +44,6 @@ public: LLDrawPoolTree(LLViewerTexture *texturep); - /*virtual*/ LLDrawPool *instancePool(); - /*virtual*/ void prerender(); /*virtual*/ S32 getNumDeferredPasses() { return 1; } diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp index df06ad31e6..49954e7f24 100644 --- a/indra/newview/lldrawpoolwater.cpp +++ b/indra/newview/lldrawpoolwater.cpp @@ -96,13 +96,6 @@ void LLDrawPoolWater::restoreGL() } -LLDrawPool *LLDrawPoolWater::instancePool() -{ - LL_ERRS() << "Should never be calling instancePool on a water pool!" << LL_ENDL; - return NULL; -} - - void LLDrawPoolWater::prerender() { mVertexShaderLevel = (gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps) ? diff --git a/indra/newview/lldrawpoolwater.h b/indra/newview/lldrawpoolwater.h index aeeba179d6..10e0849016 100644 --- a/indra/newview/lldrawpoolwater.h +++ b/indra/newview/lldrawpoolwater.h @@ -63,7 +63,6 @@ public: LLDrawPoolWater(); /*virtual*/ ~LLDrawPoolWater(); - /*virtual*/ LLDrawPool *instancePool(); static void restoreGL(); /*virtual*/ S32 getNumPostDeferredPasses() { return 0; } //getNumPasses(); } diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp index 309f535c39..d79d04b271 100644 --- a/indra/newview/lldrawpoolwlsky.cpp +++ b/indra/newview/lldrawpoolwlsky.cpp @@ -394,11 +394,6 @@ void LLDrawPoolWLSky::prerender() //LL_INFOS() << "wlsky prerendering pass." << LL_ENDL; } -LLDrawPoolWLSky *LLDrawPoolWLSky::instancePool() -{ - return new LLDrawPoolWLSky(); -} - LLViewerTexture* LLDrawPoolWLSky::getTexture() { return NULL; diff --git a/indra/newview/lldrawpoolwlsky.h b/indra/newview/lldrawpoolwlsky.h index cd15c991ee..50d29b7558 100644 --- a/indra/newview/lldrawpoolwlsky.h +++ b/indra/newview/lldrawpoolwlsky.h @@ -61,8 +61,6 @@ public: //static LLDrawPool* createPool(const U32 type, LLViewerTexture *tex0 = NULL); - // Create an empty new instance of the pool. - /*virtual*/ LLDrawPoolWLSky *instancePool(); ///< covariant override /*virtual*/ LLViewerTexture* getTexture(); /*virtual*/ BOOL isFacePool() { return FALSE; } /*virtual*/ void resetDrawOrders(); diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 912bde9986..ebdd0c61d5 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -194,7 +194,7 @@ void LLFace::destroy() if (mDrawPoolp) { - if (this->isState(LLFace::RIGGED) && mDrawPoolp->getType() == LLDrawPool::POOL_AVATAR) + if (this->isState(LLFace::RIGGED) && (mDrawPoolp->getType() == LLDrawPool::POOL_CONTROL_AV || mDrawPoolp->getType() == LLDrawPool::POOL_AVATAR)) { ((LLDrawPoolAvatar*) mDrawPoolp)->removeRiggedFace(this); } diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 1dc1e65fe5..8fcfe9d386 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -558,7 +558,8 @@ void LLSpatialGroup::shift(const LLVector4a &offset) if (!getSpatialPartition()->mRenderByGroup && getSpatialPartition()->mPartitionType != LLViewerRegion::PARTITION_TREE && getSpatialPartition()->mPartitionType != LLViewerRegion::PARTITION_TERRAIN && - getSpatialPartition()->mPartitionType != LLViewerRegion::PARTITION_BRIDGE) + getSpatialPartition()->mPartitionType != LLViewerRegion::PARTITION_BRIDGE && + getSpatialPartition()->mPartitionType != LLViewerRegion::PARTITION_CONTROL_AV) { setState(GEOM_DIRTY); gPipeline.markRebuild(this, TRUE); diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index 7e65da42f7..7947b2c908 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -685,6 +685,12 @@ public: virtual void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count) { LLVolumeGeometryManager::addGeometryCount(group, vertex_count, index_count); } }; +class LLControlAVBridge : public LLVolumeBridge +{ +public: + LLControlAVBridge(LLDrawable* drawablep, LLViewerRegion* regionp); +}; + class LLHUDBridge : public LLVolumeBridge { public: @@ -702,6 +708,12 @@ public: virtual void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count) { } }; +class LLControlAVPartition : public LLBridgePartition +{ +public: + LLControlAVPartition(LLViewerRegion* regionp); +}; + class LLHUDPartition : public LLBridgePartition { public: diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 2a87bce134..4a9cc36ac5 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -649,7 +649,7 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) else { // perform a separate pick that detects transparent objects since they respond to 1-click actions - LLPickInfo click_action_pick = gViewerWindow->pickImmediate(x, y, TRUE, pick_rigged); + LLPickInfo click_action_pick = gViewerWindow->pickImmediate(x, y, FALSE, pick_rigged); LLViewerObject* click_action_object = click_action_pick.getObject(); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 52b2c631fa..aec8ba1656 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -745,6 +745,10 @@ U32 render_type_from_string(std::string render_type) { return LLPipeline::RENDER_TYPE_AVATAR; } + else if ("controlAV" == render_type) // Animesh + { + return LLPipeline::RENDER_TYPE_CONTROL_AV; + } else if ("surfacePatch" == render_type) { return LLPipeline::RENDER_TYPE_TERRAIN; diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 5b227c641b..a5a4c877b9 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -607,6 +607,7 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mImpl->mObjectPartition.push_back(new LLGrassPartition(this)); //PARTITION_GRASS mImpl->mObjectPartition.push_back(new LLVolumePartition(this)); //PARTITION_VOLUME mImpl->mObjectPartition.push_back(new LLBridgePartition(this)); //PARTITION_BRIDGE + mImpl->mObjectPartition.push_back(new LLControlAVPartition(this)); //PARTITION_CONTROL_AV mImpl->mObjectPartition.push_back(new LLHUDParticlePartition(this));//PARTITION_HUD_PARTICLE mImpl->mObjectPartition.push_back(new LLVOCachePartition(this)); //PARTITION_VO_CACHE mImpl->mObjectPartition.push_back(NULL); //PARTITION_NONE diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 2548ff1423..d9b08d4548 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -86,6 +86,7 @@ public: PARTITION_GRASS, PARTITION_VOLUME, PARTITION_BRIDGE, + PARTITION_CONTROL_AV, // Animesh PARTITION_HUD_PARTICLE, PARTITION_VO_CACHE, PARTITION_NONE, diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index b5db5d4a48..6644654a1c 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2448,7 +2448,7 @@ void LLVOAvatar::idleUpdate(LLAgent &agent, const F64 &time) return; } - if (!(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_AVATAR)) + if (!(gPipeline.hasRenderType(mIsControlAvatar ? LLPipeline::RENDER_TYPE_CONTROL_AV : LLPipeline::RENDER_TYPE_AVATAR)) && !(gSavedSettings.getBOOL("DisableAllRenderTypes")) && !isSelf()) { return; @@ -6793,13 +6793,13 @@ LLDrawable *LLVOAvatar::createDrawable(LLPipeline *pipeline) pipeline->allocDrawable(this); mDrawable->setLit(FALSE); - LLDrawPoolAvatar *poolp = (LLDrawPoolAvatar*) gPipeline.getPool(LLDrawPool::POOL_AVATAR); + LLDrawPoolAvatar *poolp = (LLDrawPoolAvatar*)gPipeline.getPool(mIsControlAvatar ? LLDrawPool::POOL_CONTROL_AV : LLDrawPool::POOL_AVATAR); // Only a single face (one per avatar) //this face will be splitted into several if its vertex buffer is too long. mDrawable->setState(LLDrawable::ACTIVE); mDrawable->addFace(poolp, NULL); - mDrawable->setRenderType(LLPipeline::RENDER_TYPE_AVATAR); + mDrawable->setRenderType(mIsControlAvatar ? LLPipeline::RENDER_TYPE_CONTROL_AV : LLPipeline::RENDER_TYPE_AVATAR); mNumInitFaces = mDrawable->getNumFaces() ; @@ -6824,7 +6824,7 @@ static LLTrace::BlockTimerStatHandle FTM_UPDATE_AVATAR("Update Avatar"); BOOL LLVOAvatar::updateGeometry(LLDrawable *drawable) { LL_RECORD_BLOCK_TIME(FTM_UPDATE_AVATAR); - if (!(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_AVATAR))) + if (!(gPipeline.hasRenderType(mIsControlAvatar ? LLPipeline::RENDER_TYPE_CONTROL_AV : LLPipeline::RENDER_TYPE_AVATAR))) { return TRUE; } @@ -9963,7 +9963,7 @@ void LLVOAvatar::onActiveOverrideMeshesChanged() U32 LLVOAvatar::getPartitionType() const { // Avatars merely exist as drawables in the bridge partition - return LLViewerRegion::PARTITION_BRIDGE; + return mIsControlAvatar ? LLViewerRegion::PARTITION_CONTROL_AV : LLViewerRegion::PARTITION_BRIDGE; } //static diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 33a9c771ea..83f7f6a5e9 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4850,6 +4850,10 @@ U32 LLVOVolume::getPartitionType() const { return LLViewerRegion::PARTITION_HUD; } + if (isAnimatedObject() && getControlAvatar()) + { + return LLViewerRegion::PARTITION_CONTROL_AV; + } return LLViewerRegion::PARTITION_VOLUME; } @@ -4880,6 +4884,13 @@ LLVolumeGeometryManager() mSlopRatio = 0.25f; } +LLControlAVBridge::LLControlAVBridge(LLDrawable* drawablep, LLViewerRegion* regionp) + : LLVolumeBridge(drawablep, regionp) +{ + mDrawableType = LLPipeline::RENDER_TYPE_CONTROL_AV; + mPartitionType = LLViewerRegion::PARTITION_CONTROL_AV; +} + bool can_batch_texture(LLFace* facep) { if (facep->getTextureEntry()->getBumpmap()) @@ -5224,7 +5235,8 @@ static LLDrawPoolAvatar* get_avatar_drawpool(LLViewerObject* vobj) LLDrawPool* drawpool = face->getPool(); if (drawpool) { - if (drawpool->getType() == LLDrawPool::POOL_AVATAR) + if (drawpool->getType() == LLDrawPool::POOL_AVATAR + || drawpool->getType() == LLDrawPool::POOL_CONTROL_AV) { return (LLDrawPoolAvatar*) drawpool; } @@ -5503,7 +5515,8 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) //remove face from old pool if it exists LLDrawPool* old_pool = facep->getPool(); - if (old_pool && old_pool->getType() == LLDrawPool::POOL_AVATAR) + if (old_pool + && (old_pool->getType() == LLDrawPool::POOL_AVATAR || old_pool->getType() == LLDrawPool::POOL_CONTROL_AV)) { ((LLDrawPoolAvatar*) old_pool)->removeRiggedFace(facep); } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 4647e7e84e..927ed5528f 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1624,6 +1624,7 @@ LLDrawPool *LLPipeline::findPool(const U32 type, LLViewerTexture *tex0) break; case LLDrawPool::POOL_AVATAR: + case LLDrawPool::POOL_CONTROL_AV: break; // Do nothing case LLDrawPool::POOL_SKY: @@ -3401,6 +3402,7 @@ static LLTrace::BlockTimerStatHandle FTM_RESET_DRAWORDER("Reset Draw Order"); void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result) { if (hasAnyRenderType(LLPipeline::RENDER_TYPE_AVATAR, + LLPipeline::RENDER_TYPE_CONTROL_AV, LLPipeline::RENDER_TYPE_GROUND, LLPipeline::RENDER_TYPE_TERRAIN, LLPipeline::RENDER_TYPE_TREE, @@ -5799,6 +5801,7 @@ void LLPipeline::addToQuickLookup( LLDrawPool* new_poolp ) break; case LLDrawPool::POOL_AVATAR: + case LLDrawPool::POOL_CONTROL_AV: break; // Do nothing case LLDrawPool::POOL_SKY: @@ -5947,6 +5950,7 @@ void LLPipeline::removeFromQuickLookup( LLDrawPool* poolp ) break; case LLDrawPool::POOL_AVATAR: + case LLDrawPool::POOL_CONTROL_AV: break; // Do nothing case LLDrawPool::POOL_SKY: @@ -7142,7 +7146,8 @@ LLViewerObject* LLPipeline::lineSegmentIntersectInWorld(const LLVector4a& start, for (U32 j = 0; j < LLViewerRegion::NUM_PARTITIONS; j++) { if ((j == LLViewerRegion::PARTITION_VOLUME) || - (j == LLViewerRegion::PARTITION_BRIDGE) || + (j == LLViewerRegion::PARTITION_BRIDGE) || + (j == LLViewerRegion::PARTITION_CONTROL_AV) || (j == LLViewerRegion::PARTITION_TERRAIN) || (j == LLViewerRegion::PARTITION_TREE) || (j == LLViewerRegion::PARTITION_GRASS)) // only check these partitions for now diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 29fe1cbd33..462d4836ac 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -442,6 +442,7 @@ public: RENDER_TYPE_BUMP = LLDrawPool::POOL_BUMP, RENDER_TYPE_MATERIALS = LLDrawPool::POOL_MATERIALS, RENDER_TYPE_AVATAR = LLDrawPool::POOL_AVATAR, + RENDER_TYPE_CONTROL_AV = LLDrawPool::POOL_CONTROL_AV, // Animesh RENDER_TYPE_TREE = LLDrawPool::POOL_TREE, RENDER_TYPE_INVISIBLE = LLDrawPool::POOL_INVISIBLE, RENDER_TYPE_VOIDWATER = LLDrawPool::POOL_VOIDWATER, diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 7bb7b5d62c..96996156c0 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -1750,6 +1750,17 @@ parameter="character" /> </menu_item_check> <menu_item_check + label="Animeshes" + name="Rendering Type Control Avatar" + shortcut="control|alt|shift|5"> + <menu_item_check.on_check + function="Advanced.CheckRenderType" + parameter="controlAV" /> + <menu_item_check.on_click + function="Advanced.ToggleRenderType" + parameter="controlAV" /> + </menu_item_check> + <menu_item_check label="Surface Patch" name="Rendering Type Surface Patch" shortcut="control|alt|shift|5"> |