diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp
index ae7352b528..43865d3ff0 100644
--- a/indra/llcharacter/llmotioncontroller.cpp
+++ b/indra/llcharacter/llmotioncontroller.cpp
@@ -442,7 +442,8 @@ BOOL LLMotionController::stopMotionLocally(const LLUUID &id, BOOL stop_immediate
{
// if already inactive, return false
LLMotion *motion = findMotion(id);
- return stopMotionInstance(motion, stop_immediate);
+ // SL-1290: always stop immediate if paused
+ return stopMotionInstance(motion, stop_immediate||mPaused);
}
BOOL LLMotionController::stopMotionInstance(LLMotion* motion, BOOL stop_immediate)
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 8415f3e356..ac5edd22fd 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -4688,14 +4688,6 @@ void LLAppViewer::requestQuit()
gAgentAvatarp->updateAvatarRezMetrics(true); // force a last packet to be sent.
}
- // Try to send last batch of avatar rez metrics.
- // LL merge error
- //if (!gDisconnected && isAgentAvatarValid())
- //{
- // gAgentAvatarp->updateAvatarRezMetrics(true); // force a last packet to be sent.
- //}
- //
-
LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE);
effectp->setPositionGlobal(gAgent.getPositionGlobal());
effectp->setColor(LLColor4U(gAgent.getEffectColor()));
diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp
index bb665cc31d..d3fd5813a0 100644
--- a/indra/newview/llcontrolavatar.cpp
+++ b/indra/newview/llcontrolavatar.cpp
@@ -35,16 +35,22 @@
#include "llviewerregion.h"
#include "llskinningutil.h"
+//#pragma optimize("", off)
+
const F32 LLControlAvatar::MAX_LEGAL_OFFSET = 3.0f;
const F32 LLControlAvatar::MAX_LEGAL_SIZE = 64.0f;
+//static
+boost::signals2::connection LLControlAvatar::sRegionChangedSlot;
+
LLControlAvatar::LLControlAvatar(const LLUUID& id, const LLPCode pcode, LLViewerRegion* regionp) :
LLVOAvatar(id, pcode, regionp),
mPlaying(false),
mGlobalScale(1.0f),
mMarkedForDeath(false),
mRootVolp(NULL),
- mScaleConstraintFixup(1.0)
+ mScaleConstraintFixup(1.0),
+ mRegionChanged(false)
{
mIsDummy = TRUE;
mIsControlAvatar = true;
@@ -80,15 +86,18 @@ void LLControlAvatar::getNewConstraintFixups(LLVector3& new_pos_fixup, F32& new_
{
max_legal_offset = gSavedSettings.getF32("AnimatedObjectsMaxLegalOffset");
}
+ max_legal_offset = llmax(max_legal_offset,0.f);
+
F32 max_legal_size = MAX_LEGAL_SIZE;
if (gSavedSettings.getControl("AnimatedObjectsMaxLegalSize"))
{
max_legal_size = gSavedSettings.getF32("AnimatedObjectsMaxLegalSize");
}
+ max_legal_size = llmax(max_legal_size, 1.f);
new_pos_fixup = LLVector3();
new_scale_fixup = 1.0f;
- LLVector3 vol_pos = mRootVolp->getRenderPosition();
+ LLVector3 vol_pos = mRootVolp->getRenderPosition();
// Fix up position if needed to prevent visual encroachment
if (box_valid_and_non_zero(getLastAnimExtents())) // wait for state to settle down
@@ -100,32 +109,37 @@ void LLControlAvatar::getNewConstraintFixups(LLVector3& new_pos_fixup, F32& new_
// correction to the control avatar position if
// needed.
const LLVector3 *extents = getLastAnimExtents();
+ LLVector3 unshift_extents[2];
+ unshift_extents[0] = extents[0] - mPositionConstraintFixup;
+ unshift_extents[1] = extents[1] - mPositionConstraintFixup;
LLVector3 box_dims = extents[1]-extents[0];
- F32 max_size = llmax(box_dims[0],box_dims[1],box_dims[2]);
- LLVector3 pos_box_offset = point_to_box_offset(vol_pos, extents);
- F32 offset_dist = pos_box_offset.length();
- if (offset_dist > max_legal_offset)
+ F32 box_size = llmax(box_dims[0],box_dims[1],box_dims[2]);
+
+ if (!mRootVolp->isAttachment())
+ {
+ LLVector3 pos_box_offset = point_to_box_offset(vol_pos, unshift_extents);
+ F32 offset_dist = pos_box_offset.length();
+ if (offset_dist > max_legal_offset && offset_dist > 0.f)
+ {
+ F32 target_dist = (offset_dist - max_legal_offset);
+ new_pos_fixup = (target_dist/offset_dist)*pos_box_offset;
+ }
+ if (new_pos_fixup != mPositionConstraintFixup)
+ {
+ LL_DEBUGS("ConstraintFix") << getFullname() << " pos fix, offset_dist " << offset_dist << " pos fixup "
+ << new_pos_fixup << " was " << mPositionConstraintFixup << LL_ENDL;
+ LL_DEBUGS("ConstraintFix") << "vol_pos " << vol_pos << LL_ENDL;
+ LL_DEBUGS("ConstraintFix") << "extents " << extents[0] << " " << extents[1] << LL_ENDL;
+ LL_DEBUGS("ConstraintFix") << "unshift_extents " << unshift_extents[0] << " " << unshift_extents[1] << LL_ENDL;
+
+ }
+ }
+ if (box_size/mScaleConstraintFixup > max_legal_size)
{
- F32 target_dist = (offset_dist - max_legal_offset);
- new_pos_fixup = mPositionConstraintFixup + (target_dist/offset_dist)*pos_box_offset;
- LL_DEBUGS("ConstraintFix") << getFullname() << " pos fix, offset_dist " << offset_dist << " pos fixup "
- << new_pos_fixup << " was " << mPositionConstraintFixup << LL_ENDL;
- }
- else if (offset_dist < max_legal_offset-1 && mPositionConstraintFixup.length()>0.01f)
- {
- new_pos_fixup = mPositionConstraintFixup * 0.9f;
- LL_DEBUGS("ConstraintFix") << getFullname() << " pos fixup reduced "
- << new_pos_fixup << " was " << mPositionConstraintFixup << LL_ENDL;
- }
- else
- {
- new_pos_fixup = mPositionConstraintFixup;
- }
- if (max_size/mScaleConstraintFixup > max_legal_size)
- {
- new_scale_fixup = mScaleConstraintFixup*max_legal_size/max_size;
- LL_DEBUGS("ConstraintFix") << getFullname() << " scale fix, max_size " << max_size << " fixup "
- << mScaleConstraintFixup << " -> " << new_scale_fixup << LL_ENDL;
+ new_scale_fixup = mScaleConstraintFixup*max_legal_size/box_size;
+ LL_DEBUGS("ConstraintFix") << getFullname() << " scale fix, box_size " << box_size << " fixup "
+ << mScaleConstraintFixup << " max legal " << max_legal_size
+ << " -> new scale " << new_scale_fixup << LL_ENDL;
}
}
}
@@ -134,6 +148,21 @@ void LLControlAvatar::matchVolumeTransform()
{
if (mRootVolp)
{
+ LLVector3 new_pos_fixup;
+ F32 new_scale_fixup;
+ if (mRegionChanged)
+ {
+ new_scale_fixup = mScaleConstraintFixup;
+ new_pos_fixup = mPositionConstraintFixup;
+ mRegionChanged = false;
+ }
+ else
+ {
+ getNewConstraintFixups(new_pos_fixup, new_scale_fixup);
+ }
+ mPositionConstraintFixup = new_pos_fixup;
+ mScaleConstraintFixup = new_scale_fixup;
+
if (mRootVolp->isAttachment())
{
LLVOAvatar *attached_av = mRootVolp->getAvatarAncestor();
@@ -150,6 +179,9 @@ void LLControlAvatar::matchVolumeTransform()
mRoot->setWorldPosition(obj_pos + joint_pos);
mRoot->setWorldRotation(obj_rot * joint_rot);
setRotation(mRoot->getRotation());
+
+ F32 global_scale = gSavedSettings.getF32("AnimatedObjectsGlobalScale");
+ setGlobalScale(global_scale * mScaleConstraintFixup);
}
else
{
@@ -160,13 +192,6 @@ void LLControlAvatar::matchVolumeTransform()
{
LLVector3 vol_pos = mRootVolp->getRenderPosition();
- LLVector3 new_pos_fixup;
- F32 new_scale_fixup;
- getNewConstraintFixups(new_pos_fixup, new_scale_fixup);
-
- mPositionConstraintFixup = new_pos_fixup;
- mScaleConstraintFixup = new_scale_fixup;
-
// FIXME: Currently if you're doing something like playing an
// animation that moves the pelvis (on an avatar or
// animated object), the name tag and debug text will be
@@ -416,9 +441,9 @@ void LLControlAvatar::updateDebugText()
type_string += "-";
}
}
- addDebugText(llformat("CAV obj %d anim %d active %s impost %d strcst %f",
+ addDebugText(llformat("CAV obj %d anim %d active %s impost %d upprd %d strcst %f",
total_linkset_count, animated_volume_count,
- active_string.c_str(), (S32) isImpostor(), streaming_cost));
+ active_string.c_str(), (S32) isImpostor(), getUpdatePeriod(), streaming_cost));
addDebugText(llformat("types %s lods %s", type_string.c_str(), lod_string.c_str()));
addDebugText(llformat("flags %s", animated_object_flag_string.c_str()));
addDebugText(llformat("tris %d (est %.1f, streaming %.1f), verts %d", total_tris, est_tris, est_streaming_tris, total_verts));
@@ -574,3 +599,44 @@ std::string LLControlAvatar::getFullname() const
return "AO_no_root_vol";
}
}
+
+// virtual
+bool LLControlAvatar::shouldRenderRigged() const
+{
+ if (mRootVolp && mRootVolp->isAttachment())
+ {
+ LLVOAvatar *attached_av = mRootVolp->getAvatarAncestor();
+ if (attached_av)
+ {
+ return attached_av->shouldRenderRigged();
+ }
+ }
+ return true;
+}
+
+// virtual
+BOOL LLControlAvatar::isImpostor()
+{
+ if (mRootVolp && mRootVolp->isAttachment())
+ {
+ // Attached animated objects should match state of their attached av.
+ LLVOAvatar *attached_av = mRootVolp->getAvatarAncestor();
+ if (attached_av)
+ {
+ return attached_av->isImpostor();
+ }
+ }
+ return LLVOAvatar::isImpostor();
+}
+
+//static
+void LLControlAvatar::onRegionChanged()
+{
+ std::vector::iterator it = LLCharacter::sInstances.begin();
+ for ( ; it != LLCharacter::sInstances.end(); ++it)
+ {
+ LLControlAvatar* cav = dynamic_cast(*it);
+ if (!cav) continue;
+ cav->mRegionChanged = true;
+ }
+}
diff --git a/indra/newview/llcontrolavatar.h b/indra/newview/llcontrolavatar.h
index 9924697938..288d07cd48 100644
--- a/indra/newview/llcontrolavatar.h
+++ b/indra/newview/llcontrolavatar.h
@@ -73,6 +73,10 @@ public:
virtual std::string getFullname() const;
+ virtual bool shouldRenderRigged() const;
+
+ virtual BOOL isImpostor();
+
bool mPlaying;
F32 mGlobalScale;
@@ -86,7 +90,10 @@ public:
static const F32 MAX_LEGAL_OFFSET;
static const F32 MAX_LEGAL_SIZE;
-
+
+ static void onRegionChanged();
+ bool mRegionChanged;
+ static boost::signals2::connection sRegionChangedSlot;
};
typedef std::map signaled_animation_map_t;
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index 73983cd0c2..f7f86dbf26 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -1904,7 +1904,7 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(
void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow)
{
- if (avatar->isSelf() && !gAgent.needsRenderAvatar())
+ if (!avatar->shouldRenderRigged())
{
return;
}
diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h
index 126281b3da..5a0fa15bd5 100644
--- a/indra/newview/llmeshrepository.h
+++ b/indra/newview/llmeshrepository.h
@@ -552,13 +552,6 @@ private:
// Estimated triangle counts derived from the LOD sizes. LOD 0=lowest, 3=highest.
std::vector mEstTrisByLOD;
-
- // Estimated triangle counts for the largest LOD. Typically this
- // is also the "high" LOD, but not necessarily.
- F32 mEstTrisMax;
-
- // Sum of all LOD sizes.
- S32 mSizeTotal;
};
class LLMeshRepository
diff --git a/indra/newview/llpipelinelistener.cpp b/indra/newview/llpipelinelistener.cpp
index dfbe689f56..f11cdcf876 100644
--- a/indra/newview/llpipelinelistener.cpp
+++ b/indra/newview/llpipelinelistener.cpp
@@ -87,7 +87,7 @@ namespace {
U32 render_feature = feature_from_string( iter->asString() );
if ( render_feature != 0 )
{
- LLPipeline::toggleRenderDebugControl( render_feature );
+ LLPipeline::toggleRenderDebugFeatureControl( render_feature );
}
}
}
@@ -123,7 +123,7 @@ namespace {
iter != request["displays"].endArray();
++iter)
{
- U32 info_display = info_display_from_string( iter->asString() );
+ U64 info_display = info_display_from_string( iter->asString() );
if ( info_display != 0 )
{
LLPipeline::toggleRenderDebug( info_display );
@@ -134,7 +134,7 @@ namespace {
void has_info_display_wrapper(LLSD const& request)
{
LLEventAPI::Response response(LLSD(), request);
- U32 info_display = info_display_from_string( request["display"].asString() );
+ U64 info_display = info_display_from_string( request["display"].asString() );
if ( info_display != 0 )
{
response["value"] = gPipeline.hasRenderDebugMask(info_display);
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index 4a192d2658..7ae9ac1a40 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -53,6 +53,9 @@
#include "llvolumemgr.h"
#include "lltextureatlas.h"
#include "llviewershadermgr.h"
+#include "llcontrolavatar.h"
+
+//#pragma optimize("", off)
#include "llvotree.h"
@@ -2183,7 +2186,24 @@ void renderBoundingBox(LLDrawable* drawable, BOOL set_color = TRUE)
gGL.diffuseColor4f(0,0.5f,0,1); // dark green
break;
default:
- gGL.diffuseColor4f(1,0,1,1); // magenta
+ LLControlAvatar *cav = dynamic_cast(drawable->getVObj()->asAvatar());
+ if (cav)
+ {
+ bool has_pos_constraint = (cav->mPositionConstraintFixup != LLVector3());
+ bool has_scale_constraint = (cav->mScaleConstraintFixup != 1.0f);
+ if (has_pos_constraint || has_scale_constraint)
+ {
+ gGL.diffuseColor4f(1,0,0,1);
+ }
+ else
+ {
+ gGL.diffuseColor4f(0,1,0.5,1);
+ }
+ }
+ else
+ {
+ gGL.diffuseColor4f(1,0,1,1); // magenta
+ }
break;
}
}
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index eb234d8f06..5b80768446 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -1116,10 +1116,7 @@ class LLAdvancedSetDisplayTextureDensity : public view_listener_t
//////////////////
// INFO DISPLAY //
//////////////////
-// Need an unsigned long here
-//U32 info_display_from_string(std::string info_display)
U64 info_display_from_string(std::string info_display)
-//
{
if ("verify" == info_display)
{
@@ -1237,6 +1234,10 @@ U64 info_display_from_string(std::string info_display)
{
return LLPipeline::RENDER_DEBUG_TRIANGLE_COUNT;
}
+ else if ("impostors" == info_display)
+ {
+ return LLPipeline::RENDER_DEBUG_IMPOSTORS;
+ }
else if ("texture size" == info_display)
{
return LLPipeline::RENDER_DEBUG_TEXTURE_SIZE;
@@ -1252,10 +1253,7 @@ class LLAdvancedToggleInfoDisplay : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- // Need an unsigned long here
- //U32 info_display = info_display_from_string( userdata.asString() );
U64 info_display = info_display_from_string( userdata.asString() );
- //
LL_INFOS("ViewerMenu") << "toggle " << userdata.asString() << LL_ENDL;
@@ -1273,10 +1271,7 @@ class LLAdvancedCheckInfoDisplay : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- // Need an unsigned long here
- //U32 info_display = info_display_from_string( userdata.asString() );
U64 info_display = info_display_from_string( userdata.asString() );
- //
bool new_value = false;
if ( info_display != 0 )
diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h
index da684beadd..d40dcdfce4 100644
--- a/indra/newview/llviewermenu.h
+++ b/indra/newview/llviewermenu.h
@@ -164,10 +164,7 @@ void handle_export_selected( void * );
// Convert strings to internal types
U32 render_type_from_string(std::string render_type);
U32 feature_from_string(std::string feature);
-// Need an unsigned long here
-//U32 info_display_from_string(std::string info_display);
U64 info_display_from_string(std::string info_display);
-//
// export
bool enable_object_export();
//
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 1dd1e04915..4f0d223d4b 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -647,6 +647,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
mTyping(FALSE),
mMeshValid(FALSE),
mVisible(FALSE),
+ mLastImpostorUpdateFrameTime(0.f),
mWindFreq(0.f),
mRipplePhase( 0.f ),
mBelowWater(FALSE),
@@ -1148,6 +1149,8 @@ void LLVOAvatar::initClass()
// Where should this be set initially?
LLJoint::setDebugJointNames(gSavedSettings.getString("DebugAvatarJoints"));
+ LLControlAvatar::sRegionChangedSlot = gAgent.addRegionChangedCallback(&LLControlAvatar::onRegionChanged);
+
initCloud();
}
@@ -1348,8 +1351,18 @@ void LLVOAvatar::updateSpatialExtents(LLVector4a& newMin, LLVector4a &newMax)
calculateSpatialExtents(newMin,newMax);
mLastAnimExtents[0].set(newMin.getF32ptr());
mLastAnimExtents[1].set(newMax.getF32ptr());
+ mLastAnimBasePos = mPelvisp->getWorldPosition();
mNeedsExtentUpdate = false;
}
+ else
+ {
+ LLVector3 new_base_pos = mPelvisp->getWorldPosition();
+ LLVector3 shift = new_base_pos-mLastAnimBasePos;
+ mLastAnimExtents[0] += shift;
+ mLastAnimExtents[1] += shift;
+ mLastAnimBasePos = new_base_pos;
+
+ }
if (isImpostor() && !needsImpostorUpdate())
{
@@ -1372,7 +1385,7 @@ void LLVOAvatar::updateSpatialExtents(LLVector4a& newMin, LLVector4a &newMax)
}
-static LLTrace::BlockTimerStatHandle FTM_AVATAR_EXTENT_UPDATE("Avatar Update Extent");
+static LLTrace::BlockTimerStatHandle FTM_AVATAR_EXTENT_UPDATE("Av Upd Extent");
void LLVOAvatar::calculateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax)
{
@@ -1501,14 +1514,7 @@ void LLVOAvatar::calculateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax)
// Stretch bounding box by rigged mesh joint boxes
if (box_detail>=3)
{
- // FIXME could try to cache unless something has changed about attached rigged meshes,
- // but needs more logic based on volume states.
-
- //if (mRiggingInfoTab.needsUpdate())
- {
- updateRiggingInfo();
- //mJointRiggingInfoTab.setNeedsUpdate(false);
- }
+ updateRiggingInfo();
for (S32 joint_num = 0; joint_num < LL_CHARACTER_MAX_ANIMATED_JOINTS; joint_num++)
{
LLJoint *joint = getJoint(joint_num);
@@ -2563,7 +2569,16 @@ void LLVOAvatar::idleUpdate(LLAgent &agent, const F64 &time)
}
// Update should be happening max once per frame.
- mNeedsExtentUpdate = true;
+ const S32 upd_freq = 4; // force update every upd_freq frames.
+ if ((mLastAnimExtents[0]==LLVector3())||
+ (mLastAnimExtents[1])==LLVector3())
+ {
+ mNeedsExtentUpdate = true;
+ }
+ else
+ {
+ mNeedsExtentUpdate = ((LLDrawable::getCurrentFrame()+mID.mData[0])%upd_freq==0);
+ }
LLScopedContextString str("avatar_idle_update " + getFullname());
@@ -4757,7 +4772,7 @@ void LLVOAvatar::updateRootPositionAndRotation(LLAgent& agent, F32 speed, bool w
if (cav)
{
// SL-1350: Moved to LLDrawable::updateXform()
- //cav->matchVolumeTransform();
+ cav->matchVolumeTransform();
}
else
{
@@ -5558,41 +5573,72 @@ U32 LLVOAvatar::renderImpostor(LLColor4U color, S32 diffuse_channel)
left *= mImpostorDim.mV[0];
up *= mImpostorDim.mV[1];
- LLGLEnable test(GL_ALPHA_TEST);
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.f);
-
- gGL.color4ubv(color.mV);
- gGL.getTexUnit(diffuse_channel)->bind(&mImpostor);
- // Remove QUADS rendering mode
- //gGL.begin(LLRender::QUADS);
- //gGL.texCoord2f(0,0);
- //gGL.vertex3fv((pos+left-up).mV);
- //gGL.texCoord2f(1,0);
- //gGL.vertex3fv((pos-left-up).mV);
- //gGL.texCoord2f(1,1);
- //gGL.vertex3fv((pos-left+up).mV);
- //gGL.texCoord2f(0,1);
- //gGL.vertex3fv((pos+left+up).mV);
- //gGL.end();
- gGL.begin(LLRender::TRIANGLES);
+ if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_IMPOSTORS))
{
- gGL.texCoord2f(0.f, 0.f);
- gGL.vertex3fv((pos + left - up).mV);
- gGL.texCoord2f(1.f, 0.f);
- gGL.vertex3fv((pos - left - up).mV);
- gGL.texCoord2f(1.f, 1.f);
- gGL.vertex3fv((pos - left + up).mV);
+ LLGLEnable blend(GL_BLEND);
+ gGL.setSceneBlendType(LLRender::BT_ADD);
+ gGL.getTexUnit(diffuse_channel)->unbind(LLTexUnit::TT_TEXTURE);
- gGL.texCoord2f(0.f, 0.f);
- gGL.vertex3fv((pos + left - up).mV);
- gGL.texCoord2f(1.f, 1.f);
- gGL.vertex3fv((pos - left + up).mV);
- gGL.texCoord2f(0.f, 1.f);
- gGL.vertex3fv((pos + left + up).mV);
+ // gGL.begin(LLRender::QUADS);
+ // gGL.vertex3fv((pos+left-up).mV);
+ // gGL.vertex3fv((pos-left-up).mV);
+ // gGL.vertex3fv((pos-left+up).mV);
+ // gGL.vertex3fv((pos+left+up).mV);
+ // gGL.end();
+
+
+ gGL.begin(LLRender::LINES);
+ gGL.color4f(1.f,1.f,1.f,1.f);
+ F32 thickness = llmax(F32(5.0f-5.0f*(gFrameTimeSeconds-mLastImpostorUpdateFrameTime)),1.0f);
+ glLineWidth(thickness);
+ gGL.vertex3fv((pos+left-up).mV);
+ gGL.vertex3fv((pos-left-up).mV);
+ gGL.vertex3fv((pos-left-up).mV);
+ gGL.vertex3fv((pos-left+up).mV);
+ gGL.vertex3fv((pos-left+up).mV);
+ gGL.vertex3fv((pos+left+up).mV);
+ gGL.vertex3fv((pos+left+up).mV);
+ gGL.vertex3fv((pos+left-up).mV);
+ gGL.end();
+ gGL.flush();
+ }
+ {
+ LLGLEnable test(GL_ALPHA_TEST);
+ gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.f);
+
+ gGL.color4ubv(color.mV);
+ gGL.getTexUnit(diffuse_channel)->bind(&mImpostor);
+ // Remove QUADS rendering mode
+ //gGL.begin(LLRender::QUADS);
+ //gGL.texCoord2f(0,0);
+ //gGL.vertex3fv((pos+left-up).mV);
+ //gGL.texCoord2f(1,0);
+ //gGL.vertex3fv((pos-left-up).mV);
+ //gGL.texCoord2f(1,1);
+ //gGL.vertex3fv((pos-left+up).mV);
+ //gGL.texCoord2f(0,1);
+ //gGL.vertex3fv((pos+left+up).mV);
+ //gGL.end();
+ gGL.begin(LLRender::TRIANGLES);
+ {
+ gGL.texCoord2f(0.f, 0.f);
+ gGL.vertex3fv((pos + left - up).mV);
+ gGL.texCoord2f(1.f, 0.f);
+ gGL.vertex3fv((pos - left - up).mV);
+ gGL.texCoord2f(1.f, 1.f);
+ gGL.vertex3fv((pos - left + up).mV);
+
+ gGL.texCoord2f(0.f, 0.f);
+ gGL.vertex3fv((pos + left - up).mV);
+ gGL.texCoord2f(1.f, 1.f);
+ gGL.vertex3fv((pos - left + up).mV);
+ gGL.texCoord2f(0.f, 1.f);
+ gGL.vertex3fv((pos + left + up).mV);
+ }
+ gGL.end();
+ //
+ gGL.flush();
}
- gGL.end();
- //
- gGL.flush();
return 6;
}
@@ -8298,6 +8344,12 @@ void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL
updateMeshTextures();
}
+// virtual
+bool LLVOAvatar::shouldRenderRigged() const
+{
+ return true;
+}
+
// FIXME: We have an mVisible member, set in updateVisibility(), but this
// function doesn't return it! isVisible() and mVisible are used
// different places for different purposes. mVisible seems to be more
@@ -10546,13 +10598,49 @@ void LLVOAvatar::getAssociatedVolumes(std::vector& volumes)
}
}
+static LLTrace::BlockTimerStatHandle FTM_AVATAR_RIGGING_INFO_UPDATE("Av Upd Rig Info");
+static LLTrace::BlockTimerStatHandle FTM_AVATAR_RIGGING_KEY_UPDATE("Av Upd Rig Key");
+static LLTrace::BlockTimerStatHandle FTM_AVATAR_RIGGING_AVOL_UPDATE("Av Upd Avol");
+
// virtual
void LLVOAvatar::updateRiggingInfo()
{
+ LL_RECORD_BLOCK_TIME(FTM_AVATAR_RIGGING_INFO_UPDATE);
+
LL_DEBUGS("RigSpammish") << getFullname() << " updating rig tab" << LL_ENDL;
- mJointRiggingInfoTab.clear();
+
std::vector volumes;
- getAssociatedVolumes(volumes);
+
+ {
+ LL_RECORD_BLOCK_TIME(FTM_AVATAR_RIGGING_AVOL_UPDATE);
+ getAssociatedVolumes(volumes);
+ }
+
+ std::map curr_rigging_info_key;
+ {
+ LL_RECORD_BLOCK_TIME(FTM_AVATAR_RIGGING_KEY_UPDATE);
+ // Get current rigging info key
+ for (std::vector::iterator it = volumes.begin(); it != volumes.end(); ++it)
+ {
+ LLVOVolume *vol = *it;
+ if (vol->isMesh() && vol->getVolume())
+ {
+ const LLUUID& mesh_id = vol->getVolume()->getParams().getSculptID();
+ S32 max_lod = llmax(vol->getLOD(), vol->mLastRiggingInfoLOD);
+ curr_rigging_info_key[mesh_id] = max_lod;
+ }
+ }
+
+ // Check for key change, which indicates some change in volume composition or LOD.
+ if (curr_rigging_info_key == mLastRiggingInfoKey)
+ {
+ return;
+ }
+ }
+
+ // Something changed. Update.
+ mLastRiggingInfoKey = curr_rigging_info_key;
+ mJointRiggingInfoTab.clear();
for (std::vector::iterator it = volumes.begin(); it != volumes.end(); ++it)
{
LLVOVolume *vol = *it;
@@ -10605,6 +10693,7 @@ void LLVOAvatar::updateImpostors()
LLCharacter::sAllowInstancesChange = TRUE;
}
+// virtual
BOOL LLVOAvatar::isImpostor()
{
// Fix LL impostor hacking
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index 1b3d007dfe..85f22c6c86 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -225,7 +225,9 @@ public:
// virtual
void updateRiggingInfo();
-
+ // This encodes mesh id and LOD, so we can see whether display is up-to-date.
+ std::map mLastRiggingInfoKey;
+
std::set mActiveOverrideMeshes;
virtual void onActiveOverrideMeshesChanged();
@@ -542,7 +544,7 @@ private:
// Impostors
//--------------------------------------------------------------------
public:
- BOOL isImpostor();
+ virtual BOOL isImpostor();
BOOL shouldImpostor(const U32 rank_factor = 1) const;
BOOL needsImpostorUpdate() const;
const LLVector3& getImpostorOffset() const;
@@ -554,7 +556,10 @@ public:
static void updateImpostors();
LLRenderTarget mImpostor;
BOOL mNeedsImpostorUpdate;
+ F32SecondsImplicit mLastImpostorUpdateFrameTime;
const LLVector3* getLastAnimExtents() const { return mLastAnimExtents; }
+ void setNeedsExtentUpdate(bool val) { mNeedsExtentUpdate = val; }
+
private:
LLVector3 mImpostorOffset;
LLVector2 mImpostorDim;
@@ -566,6 +571,7 @@ private:
F32 mImpostorDistance;
F32 mImpostorPixelArea;
LLVector3 mLastAnimExtents[2];
+ LLVector3 mLastAnimBasePos;
LLCachedControl mRenderUnloadedAvatar;
@@ -800,6 +806,7 @@ private:
//--------------------------------------------------------------------
public:
BOOL isVisible() const;
+ virtual bool shouldRenderRigged() const;
void setVisibilityRank(U32 rank);
U32 getVisibilityRank() const { return mVisibilityRank; }
static S32 sNumVisibleAvatars; // Number of instances of this class
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index 033548779a..fc1980bbd6 100644
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -3260,6 +3260,12 @@ void LLVOAvatarSelf::onCustomizeEnd(bool disable_camera_switch)
}
}
+// virtual
+bool LLVOAvatarSelf::shouldRenderRigged() const
+{
+ return gAgent.needsRenderAvatar();
+}
+
// HACK: this will null out the avatar's local texture IDs before the TE message is sent
// to ensure local texture IDs are not sent to other clients in the area.
// this is a short-term solution. The long term solution will be to not set the texture
diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h
index 66033d0479..dc359e65fc 100644
--- a/indra/newview/llvoavatarself.h
+++ b/indra/newview/llvoavatarself.h
@@ -367,6 +367,9 @@ public:
//--------------------------------------------------------------------
// Visibility
//--------------------------------------------------------------------
+
+ /* virtual */ bool shouldRenderRigged() const;
+
public:
bool sendAppearanceMessage(LLMessageSystem *mesgsys) const;
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 866d9f0f9e..8c2d4ebbe9 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -4965,7 +4965,6 @@ void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, cons
}
else
{
-#if 1
bool is_paused = avatar && avatar->areAnimationsPaused();
if (is_paused)
{
@@ -4975,7 +4974,6 @@ void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, cons
return;
}
}
-#endif
}
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index cfecb86683..24074386e7 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -6992,10 +6992,7 @@ bool LLPipeline::toggleRenderTypeControlNegated(S32 type)
}
//static
-// Need an unsigned long here
-//void LLPipeline::toggleRenderDebug(U32 bit)
void LLPipeline::toggleRenderDebug(U64 bit)
-//
{
if (gPipeline.hasRenderDebugMask(bit))
{
@@ -7010,10 +7007,7 @@ void LLPipeline::toggleRenderDebug(U64 bit)
//static
-// Need an unsigned long here
-//bool LLPipeline::toggleRenderDebugControl(U32 bit)
bool LLPipeline::toggleRenderDebugControl(U64 bit)
-//
{
return gPipeline.hasRenderDebugMask(bit);
}
@@ -11871,6 +11865,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
avatar->mNeedsImpostorUpdate = FALSE;
avatar->cacheImpostorValues();
+ avatar->mLastImpostorUpdateFrameTime = gFrameTimeSeconds;
LLVertexBuffer::unbind();
LLGLState::checkStates();
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index 6eca64263d..53640dfa95 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -330,16 +330,10 @@ public:
void addTrianglesDrawn(S32 index_count, U32 render_type = LLRender::TRIANGLES);
bool hasRenderDebugFeatureMask(const U32 mask) const { return bool(mRenderDebugFeatureMask & mask); }
- // Need an unsigned long here
- //bool hasRenderDebugMask(const U32 mask) const { return bool(mRenderDebugMask & mask); }
bool hasRenderDebugMask(const U64 mask) const { return bool(mRenderDebugMask & mask); }
- //
void setAllRenderDebugFeatures() { mRenderDebugFeatureMask = 0xffffffff; }
void clearAllRenderDebugFeatures() { mRenderDebugFeatureMask = 0x0; }
- // Need an unsigned long here
- //void setAllRenderDebugDisplays() { mRenderDebugMask = 0xffffffff; }
void setAllRenderDebugDisplays() { mRenderDebugMask = 0xffffffffffffffff; }
- //
void clearAllRenderDebugDisplays() { mRenderDebugMask = 0x0; }
bool hasRenderType(const U32 type) const;
@@ -363,17 +357,11 @@ public:
// For UI control of render features
static bool hasRenderTypeControl(U32 data);
- // Need an unsigned long here
- //static void toggleRenderDebug(U32 data);
static void toggleRenderDebug(U64 data);
- //
static void toggleRenderDebugFeature(U32 data);
static void toggleRenderTypeControl(U32 data);
static bool toggleRenderTypeControlNegated(S32 data);
- // Need an unsigned long here
- //static bool toggleRenderDebugControl(U32 data);
static bool toggleRenderDebugControl(U64 data);
- //
static bool toggleRenderDebugFeatureControl(U32 data);
static void setRenderDebugFeatureControl(U32 bit, bool value);
@@ -522,41 +510,42 @@ public:
RENDER_DEBUG_FEATURE_FOOT_SHADOWS = 0x0100,
};
- enum LLRenderDebugMask : U64 // Need an unsigned long here - needs C++11 support!
+ enum LLRenderDebugMask: U64
{
- RENDER_DEBUG_COMPOSITION = 0x00000001,
- RENDER_DEBUG_VERIFY = 0x00000002,
- RENDER_DEBUG_BBOXES = 0x00000004,
- RENDER_DEBUG_OCTREE = 0x00000008,
- RENDER_DEBUG_WIND_VECTORS = 0x00000010,
- RENDER_DEBUG_OCCLUSION = 0x00000020,
- RENDER_DEBUG_POINTS = 0x00000040,
- RENDER_DEBUG_TEXTURE_PRIORITY = 0x00000080,
- RENDER_DEBUG_TEXTURE_AREA = 0x00000100,
- RENDER_DEBUG_FACE_AREA = 0x00000200,
- RENDER_DEBUG_PARTICLES = 0x00000400,
- RENDER_DEBUG_GLOW = 0x00000800, // not used
- RENDER_DEBUG_TEXTURE_ANIM = 0x00001000,
- RENDER_DEBUG_LIGHTS = 0x00002000,
- RENDER_DEBUG_BATCH_SIZE = 0x00004000,
- RENDER_DEBUG_ALPHA_BINS = 0x00008000, // not used
- RENDER_DEBUG_RAYCAST = 0x00010000,
- RENDER_DEBUG_AVATAR_DRAW_INFO = 0x00020000,
- RENDER_DEBUG_SHADOW_FRUSTA = 0x00040000,
- RENDER_DEBUG_SCULPTED = 0x00080000,
- RENDER_DEBUG_AVATAR_VOLUME = 0x00100000,
- RENDER_DEBUG_AVATAR_JOINTS = 0x00200000,
- RENDER_DEBUG_BUILD_QUEUE = 0x00400000,
- RENDER_DEBUG_AGENT_TARGET = 0x00800000,
- RENDER_DEBUG_UPDATE_TYPE = 0x01000000,
- RENDER_DEBUG_PHYSICS_SHAPES = 0x02000000,
- RENDER_DEBUG_NORMALS = 0x04000000,
- RENDER_DEBUG_LOD_INFO = 0x08000000,
- RENDER_DEBUG_RENDER_COMPLEXITY = 0x10000000,
- RENDER_DEBUG_ATTACHMENT_BYTES = 0x20000000, // not used
- RENDER_DEBUG_TEXEL_DENSITY = 0x40000000,
- RENDER_DEBUG_TRIANGLE_COUNT = 0x80000000,
- RENDER_DEBUG_TEXTURE_SIZE = 0x100000000
+ RENDER_DEBUG_COMPOSITION = 0x00000001,
+ RENDER_DEBUG_VERIFY = 0x00000002,
+ RENDER_DEBUG_BBOXES = 0x00000004,
+ RENDER_DEBUG_OCTREE = 0x00000008,
+ RENDER_DEBUG_WIND_VECTORS = 0x00000010,
+ RENDER_DEBUG_OCCLUSION = 0x00000020,
+ RENDER_DEBUG_POINTS = 0x00000040,
+ RENDER_DEBUG_TEXTURE_PRIORITY = 0x00000080,
+ RENDER_DEBUG_TEXTURE_AREA = 0x00000100,
+ RENDER_DEBUG_FACE_AREA = 0x00000200,
+ RENDER_DEBUG_PARTICLES = 0x00000400,
+ RENDER_DEBUG_GLOW = 0x00000800, // not used
+ RENDER_DEBUG_TEXTURE_ANIM = 0x00001000,
+ RENDER_DEBUG_LIGHTS = 0x00002000,
+ RENDER_DEBUG_BATCH_SIZE = 0x00004000,
+ RENDER_DEBUG_ALPHA_BINS = 0x00008000, // not used
+ RENDER_DEBUG_RAYCAST = 0x00010000,
+ RENDER_DEBUG_AVATAR_DRAW_INFO = 0x00020000,
+ RENDER_DEBUG_SHADOW_FRUSTA = 0x00040000,
+ RENDER_DEBUG_SCULPTED = 0x00080000,
+ RENDER_DEBUG_AVATAR_VOLUME = 0x00100000,
+ RENDER_DEBUG_AVATAR_JOINTS = 0x00200000,
+ RENDER_DEBUG_BUILD_QUEUE = 0x00400000,
+ RENDER_DEBUG_AGENT_TARGET = 0x00800000,
+ RENDER_DEBUG_UPDATE_TYPE = 0x01000000,
+ RENDER_DEBUG_PHYSICS_SHAPES = 0x02000000,
+ RENDER_DEBUG_NORMALS = 0x04000000,
+ RENDER_DEBUG_LOD_INFO = 0x08000000,
+ RENDER_DEBUG_RENDER_COMPLEXITY = 0x10000000,
+ RENDER_DEBUG_ATTACHMENT_BYTES = 0x20000000, // not used
+ RENDER_DEBUG_TEXEL_DENSITY = 0x40000000,
+ RENDER_DEBUG_TRIANGLE_COUNT = 0x80000000,
+ RENDER_DEBUG_IMPOSTORS = 0x100000000,
+ RENDER_DEBUG_TEXTURE_SIZE = 0x200000000
};
public:
@@ -702,14 +691,10 @@ protected:
std::stack mRenderTypeEnableStack;
U32 mRenderDebugFeatureMask;
- // Need an unsigned long here
- //U32 mRenderDebugMask;
U64 mRenderDebugMask;
+ U64 mOldRenderDebugMask;
std::stack mRenderDebugFeatureStack;
- // Need an unsigned long here
- //U32 mOldRenderDebugMask;
- U64 mOldRenderDebugMask;
/////////////////////////////////////////////
//
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 91b8231113..2a57515c52 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -4747,6 +4747,16 @@
function="Advanced.ToggleInfoDisplay"
parameter="agent target" />
+
+
+
+