Merge viewer-cougar

master
Ansariel 2019-10-30 18:58:52 +01:00
commit 209f3700d1
34 changed files with 168 additions and 141 deletions

View File

@ -1201,11 +1201,32 @@ 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;
bool is_hud = mVObjp->isHUDAttachment();
bool is_attachment = mVObjp->isAttachment() && !is_hud;
if ((partition_type == LLViewerRegion::PARTITION_HUD) != is_hud)
{
// 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);
}
else if ((partition_type == LLViewerRegion::PARTITION_AVATAR) != is_attachment)
{
// Was/became part of avatar
// remove obsolete bridge
mSpatialBridge->markDead();
setSpatialBridge(NULL);
}
}
//must be an active volume
if (!mSpatialBridge)
@ -1214,6 +1235,15 @@ LLSpatialPartition* LLDrawable::getSpatialPartition()
{
setSpatialBridge(new LLHUDBridge(this, getRegion()));
}
else if (mVObjp->isAnimatedObject() && mVObjp->getControlAvatar())
{
setSpatialBridge(new LLControlAVBridge(this, getRegion()));
}
// check HUD first, because HUD is also attachment
else if (mVObjp->isAttachment())
{
setSpatialBridge(new LLAvatarBridge(this, getRegion()));
}
else
{
setSpatialBridge(new LLVolumeBridge(this, getRegion()));
@ -1733,12 +1763,26 @@ void LLDrawable::updateFaceSize(S32 idx)
LLBridgePartition::LLBridgePartition(LLViewerRegion* regionp)
: LLSpatialPartition(0, FALSE, 0, regionp)
{
mDrawableType = LLPipeline::RENDER_TYPE_AVATAR;
mDrawableType = LLPipeline::RENDER_TYPE_VOLUME;
mPartitionType = LLViewerRegion::PARTITION_BRIDGE;
mLODPeriod = 16;
mSlopRatio = 0.25f;
}
LLAvatarPartition::LLAvatarPartition(LLViewerRegion* regionp)
: LLBridgePartition(regionp)
{
mDrawableType = LLPipeline::RENDER_TYPE_AVATAR;
mPartitionType = LLViewerRegion::PARTITION_AVATAR;
}
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)
{

View File

@ -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];
@ -449,10 +440,10 @@ void LLRenderPass::applyModelMatrix(const LLDrawInfo& params)
if (params.mModelMatrix != gGLLastMatrix)
{
gGLLastMatrix = params.mModelMatrix;
gGL.matrixMode(LLRender::MM_MODELVIEW);
gGL.loadMatrix(gGLModelView);
if (params.mModelMatrix)
{
llassert(gGL.getMatrixMode() == LLRender::MM_MODELVIEW);
gGL.multMatrix((GLfloat*) params.mModelMatrix->mMatrix);
}
gPipeline.mMatrixOpCount++;

View File

@ -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; }

View File

@ -112,8 +112,8 @@ S32 cube_channel = -1;
static LLTrace::BlockTimerStatHandle FTM_SHADOW_AVATAR("Avatar Shadow");
LLDrawPoolAvatar::LLDrawPoolAvatar() :
LLFacePool(POOL_AVATAR)
LLDrawPoolAvatar::LLDrawPoolAvatar(U32 type) :
LLFacePool(type)
{
}
@ -142,15 +142,6 @@ BOOL LLDrawPoolAvatar::isDead()
}
return TRUE;
}
//-----------------------------------------------------------------------------
// instancePool()
//-----------------------------------------------------------------------------
LLDrawPool *LLDrawPoolAvatar::instancePool()
{
return new LLDrawPoolAvatar();
}
S32 LLDrawPoolAvatar::getVertexShaderLevel() const
{
@ -1814,6 +1805,10 @@ bool 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);
@ -2307,8 +2302,8 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow)
gGL.loadMatrix((F32*) face->mTextureMatrix->mMatrix);
buff->setBuffer(data_mask);
buff->drawRange(LLRender::TRIANGLES, start, end, count, offset);
gGL.matrixMode(LLRender::MM_TEXTURE);
gGL.loadIdentity();
gGL.matrixMode(LLRender::MM_MODELVIEW);
}
else
{
@ -2491,7 +2486,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;
@ -2513,7 +2508,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;

View File

@ -178,7 +178,7 @@ typedef enum
virtual S32 getVertexShaderLevel() const;
LLDrawPoolAvatar();
LLDrawPoolAvatar(U32 type);
static LLMatrix4& getModelView();
@ -187,8 +187,6 @@ typedef enum
LLVOAvatar* avatar);
//</FS:Beq>
/*virtual*/ LLDrawPool *instancePool();
/*virtual*/ S32 getNumPasses();
/*virtual*/ void beginRenderPass(S32 pass);
/*virtual*/ void endRenderPass(S32 pass);

View File

@ -46,11 +46,6 @@ LLDrawPoolGround::LLDrawPoolGround() :
{
}
LLDrawPool *LLDrawPoolGround::instancePool()
{
return new LLDrawPoolGround();
}
void LLDrawPoolGround::prerender()
{
mVertexShaderLevel = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_ENVIRONMENT);

View File

@ -43,8 +43,6 @@ public:
LLDrawPoolGround();
/*virtual*/ LLDrawPool *instancePool();
/*virtual*/ void prerender();
/*virtual*/ void render(S32 pass = 0);
};

View File

@ -48,11 +48,6 @@ LLDrawPoolSky::LLDrawPoolSky()
{
}
LLDrawPool *LLDrawPoolSky::instancePool()
{
return new LLDrawPoolSky();
}
void LLDrawPoolSky::prerender()
{
mVertexShaderLevel = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_ENVIRONMENT);

View File

@ -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); }

View File

@ -93,13 +93,6 @@ LLDrawPoolTerrain::~LLDrawPoolTerrain()
llassert( gPipeline.findPool( getType(), getTexture() ) == NULL );
}
LLDrawPool *LLDrawPoolTerrain::instancePool()
{
return new LLDrawPoolTerrain(mTexturep);
}
U32 LLDrawPoolTerrain::getVertexDataMask()
{
if (LLPipeline::sShadowRender)

View File

@ -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);

View File

@ -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);

View File

@ -44,8 +44,6 @@ public:
LLDrawPoolTree(LLViewerTexture *texturep);
/*virtual*/ LLDrawPool *instancePool();
/*virtual*/ void prerender();
/*virtual*/ S32 getNumDeferredPasses() { return 1; }

View File

@ -104,13 +104,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) ?

View File

@ -63,7 +63,6 @@ public:
LLDrawPoolWater();
/*virtual*/ ~LLDrawPoolWater();
/*virtual*/ LLDrawPool *instancePool();
static void restoreGL();
/*virtual*/ S32 getNumPostDeferredPasses() { return 0; } //getNumPasses(); }

View File

@ -399,11 +399,6 @@ void LLDrawPoolWLSky::prerender()
//LL_INFOS() << "wlsky prerendering pass." << LL_ENDL;
}
LLDrawPoolWLSky *LLDrawPoolWLSky::instancePool()
{
return new LLDrawPoolWLSky();
}
LLViewerTexture* LLDrawPoolWLSky::getTexture()
{
return NULL;

View File

@ -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();

View File

@ -201,7 +201,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);
}

View File

@ -1137,21 +1137,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
getChildView("maskcutoff")->setEnabled(editable && mIsAlpha);
getChildView("label maskcutoff")->setEnabled(editable && mIsAlpha);
bool allAttachments = true;
for (LLObjectSelection::iterator iter = LLSelectMgr::getInstance()->getSelection()->begin();
iter != LLSelectMgr::getInstance()->getSelection()->end();iter++)
{
LLSelectNode* node = *iter;
LLViewerObject* object = node->getObject();
if (!object->isAttachment())
{
allAttachments = false;
break;
}
}
mTextureCtrl->setBakeTextureEnabled(allAttachments);
mTextureCtrl->setBakeTextureEnabled(TRUE);
}
else if (id.isNull())
{
@ -1176,21 +1162,8 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
getChildView("label alphamode")->setEnabled(editable && mIsAlpha);
getChildView("maskcutoff")->setEnabled(editable && mIsAlpha);
getChildView("label maskcutoff")->setEnabled(editable && mIsAlpha);
bool allAttachments = true;
for (LLObjectSelection::iterator iter = LLSelectMgr::getInstance()->getSelection()->begin();
iter != LLSelectMgr::getInstance()->getSelection()->end();iter++)
{
LLSelectNode* node = *iter;
LLViewerObject* object = node->getObject();
if (!object->isAttachment())
{
allAttachments = false;
break;
}
}
mTextureCtrl->setBakeTextureEnabled(allAttachments);
mTextureCtrl->setBakeTextureEnabled(TRUE);
}
}

View File

@ -560,7 +560,9 @@ 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_AVATAR &&
getSpatialPartition()->mPartitionType != LLViewerRegion::PARTITION_CONTROL_AV)
{
setState(GEOM_DIRTY);
gPipeline.markRebuild(this, TRUE);

View File

@ -696,6 +696,18 @@ public:
virtual void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count) { LLVolumeGeometryManager::addGeometryCount(group, vertex_count, index_count); }
};
class LLAvatarBridge : public LLVolumeBridge
{
public:
LLAvatarBridge(LLDrawable* drawablep, LLViewerRegion* regionp);
};
class LLControlAVBridge : public LLVolumeBridge
{
public:
LLControlAVBridge(LLDrawable* drawablep, LLViewerRegion* regionp);
};
class LLHUDBridge : public LLVolumeBridge
{
public:
@ -713,6 +725,18 @@ public:
virtual void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count) { }
};
class LLAvatarPartition : public LLBridgePartition
{
public:
LLAvatarPartition(LLViewerRegion* regionp);
};
class LLControlAVPartition : public LLBridgePartition
{
public:
LLControlAVPartition(LLViewerRegion* regionp);
};
class LLHUDPartition : public LLBridgePartition
{
public:

View File

@ -491,7 +491,7 @@ BOOL LLFloaterTexturePicker::postBuild()
getChild<LLComboBox>("l_bake_use_texture_combo_box")->setCommitCallback(onBakeTextureSelect, this);
getChild<LLCheckBoxCtrl>("hide_base_mesh_region")->setCommitCallback(onHideBaseMeshRegionCheck, this);
setBakeTextureEnabled(FALSE);
setBakeTextureEnabled(TRUE);
return TRUE;
}
@ -1370,7 +1370,6 @@ LLTextureCtrl::LLTextureCtrl(const LLTextureCtrl::Params& p)
mDefaultImageAssetID(p.default_image_id),
mDefaultImageName(p.default_image_name),
mFallbackImage(p.fallback_image),
mBakeTextureEnabled(FALSE),
// <FS:Ansariel> Mask texture if desired
mIsMasked(FALSE),
// </FS:Ansariel> Mask texture if desired
@ -1578,7 +1577,7 @@ void LLTextureCtrl::showPicker(BOOL take_focus)
}
if (texture_floaterp)
{
texture_floaterp->setBakeTextureEnabled(mBakeTextureEnabled);
texture_floaterp->setBakeTextureEnabled(TRUE);
}
LLFloater* root_floater = gFloaterView->getParentFloater(this);
@ -1776,7 +1775,6 @@ void LLTextureCtrl::setImageAssetID( const LLUUID& asset_id )
void LLTextureCtrl::setBakeTextureEnabled(BOOL enabled)
{
mBakeTextureEnabled = enabled;
LLFloaterTexturePicker* floaterp = (LLFloaterTexturePicker*)mFloaterHandle.get();
if (floaterp)
{

View File

@ -242,7 +242,6 @@ private:
BOOL mShowLoadingPlaceholder;
std::string mLoadingPlaceholderString;
S32 mLabelWidth;
BOOL mBakeTextureEnabled;
// <FS:Ansariel> Texture preview mode
BOOL mPreviewMode;

View File

@ -711,7 +711,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();

View File

@ -893,6 +893,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;

View File

@ -297,6 +297,7 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe
mOnActiveList(FALSE),
mOnMap(FALSE),
mStatic(FALSE),
mSeatCount(0),
mNumFaces(0),
mRotTime(0.f),
mAngularVelocityRot(),
@ -917,7 +918,12 @@ void LLViewerObject::addChild(LLViewerObject *childp)
if(childp->setParent(this))
{
mChildList.push_back(childp);
childp->afterReparent();
childp->afterReparent();
if (childp->isAvatar())
{
mSeatCount++;
}
}
}
@ -946,6 +952,11 @@ void LLViewerObject::removeChild(LLViewerObject *childp)
{
childp->setParent(NULL);
}
if (childp->isAvatar())
{
mSeatCount--;
}
break;
}
}
@ -1006,21 +1017,10 @@ BOOL LLViewerObject::isChild(const LLViewerObject *childp) const
return FALSE;
}
// returns TRUE if at least one avatar is sitting on this object
BOOL LLViewerObject::isSeat() const
{
for (child_list_t::const_iterator iter = mChildList.begin();
iter != mChildList.end(); iter++)
{
LLViewerObject* child = *iter;
if (child->isAvatar())
{
return TRUE;
}
}
return FALSE;
return mSeatCount > 0;
}
BOOL LLViewerObject::setDrawableParent(LLDrawable* parentp)

View File

@ -839,6 +839,7 @@ protected:
BOOL mOnActiveList;
BOOL mOnMap; // On the map.
BOOL mStatic; // Object doesn't move.
S32 mSeatCount;
S32 mNumFaces;
F32 mRotTime; // Amount (in seconds) that object has rotated according to angular velocity (llSetTargetOmega)

View File

@ -637,6 +637,8 @@ void LLViewerRegion::initPartitions()
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 LLAvatarPartition(this)); //PARTITION_AVATAR
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

View File

@ -89,6 +89,8 @@ public:
PARTITION_GRASS,
PARTITION_VOLUME,
PARTITION_BRIDGE,
PARTITION_AVATAR,
PARTITION_CONTROL_AV, // Animesh
PARTITION_HUD_PARTICLE,
PARTITION_VO_CACHE,
PARTITION_NONE,

View File

@ -2566,7 +2566,7 @@ void LLVOAvatar::idleUpdate(LLAgent &agent, const F64 &time)
// <FS:CR> Use LLCachedControl
static LLCachedControl<bool> disable_all_render_types(gSavedSettings, "DisableAllRenderTypes");
if (!(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_AVATAR))
if (!(gPipeline.hasRenderType(mIsControlAvatar ? LLPipeline::RENDER_TYPE_CONTROL_AV : LLPipeline::RENDER_TYPE_AVATAR))
//&& !(gSavedSettings.getBOOL("DisableAllRenderTypes")) && !isSelf())
&& !(disable_all_render_types) && !isSelf())
// </FS:CR>
@ -7573,13 +7573,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() ;
@ -7604,7 +7604,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;
}
@ -10960,7 +10960,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_AVATAR;
}
//static

View File

@ -5109,6 +5109,14 @@ U32 LLVOVolume::getPartitionType() const
{
return LLViewerRegion::PARTITION_HUD;
}
if (isAnimatedObject() && getControlAvatar())
{
return LLViewerRegion::PARTITION_CONTROL_AV;
}
if (isAttachment())
{
return LLViewerRegion::PARTITION_AVATAR;
}
return LLViewerRegion::PARTITION_VOLUME;
}
@ -5139,6 +5147,20 @@ LLVolumeGeometryManager()
mSlopRatio = 0.25f;
}
LLAvatarBridge::LLAvatarBridge(LLDrawable* drawablep, LLViewerRegion* regionp)
: LLVolumeBridge(drawablep, regionp)
{
mDrawableType = LLPipeline::RENDER_TYPE_AVATAR;
mPartitionType = LLViewerRegion::PARTITION_AVATAR;
}
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())
@ -5490,7 +5512,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;
}
@ -5810,7 +5833,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);
}

View File

@ -1733,6 +1733,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:
@ -3533,6 +3534,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,
@ -5940,6 +5942,7 @@ void LLPipeline::addToQuickLookup( LLDrawPool* new_poolp )
break;
case LLDrawPool::POOL_AVATAR:
case LLDrawPool::POOL_CONTROL_AV:
break; // Do nothing
case LLDrawPool::POOL_SKY:
@ -6088,6 +6091,7 @@ void LLPipeline::removeFromQuickLookup( LLDrawPool* poolp )
break;
case LLDrawPool::POOL_AVATAR:
case LLDrawPool::POOL_CONTROL_AV:
break; // Do nothing
case LLDrawPool::POOL_SKY:
@ -7283,7 +7287,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
@ -7345,7 +7350,7 @@ LLViewerObject* LLPipeline::lineSegmentIntersectInWorld(const LLVector4a& start,
{
LLViewerRegion* region = *iter;
LLSpatialPartition* part = region->getSpatialPartition(LLViewerRegion::PARTITION_BRIDGE);
LLSpatialPartition* part = region->getSpatialPartition(LLViewerRegion::PARTITION_AVATAR);
if (part && hasRenderType(part->mDrawableType))
{
LLDrawable* hit = part->lineSegmentIntersect(start, local_end, pick_transparent, pick_rigged, face_hit, &position, tex_coord, normal, tangent);

View File

@ -452,6 +452,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,

View File

@ -2731,6 +2731,16 @@
function="Advanced.ToggleRenderType"
parameter="character" />
</menu_item_check>
<menu_item_check
label="Animeshes"
name="Rendering Type Control Avatar">
<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"