summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llspatialpartition.h17
-rw-r--r--indra/newview/llvoavatar.cpp8
-rw-r--r--indra/newview/pipeline.cpp4
3 files changed, 29 insertions, 0 deletions
diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h
index acfcd63686..6d3ef33801 100644
--- a/indra/newview/llspatialpartition.h
+++ b/indra/newview/llspatialpartition.h
@@ -255,6 +255,19 @@ public:
}
};
+ struct CompareRenderOrder
+ {
+ bool operator()(const LLSpatialGroup* const& lhs, const LLSpatialGroup* const& rhs)
+ {
+ if (lhs->mAvatarp != rhs->mAvatarp)
+ {
+ return lhs->mAvatarp < rhs->mAvatarp;
+ }
+
+ return lhs->mRenderOrder > rhs->mRenderOrder;
+ }
+ };
+
typedef enum
{
GEOM_DIRTY = LLViewerOctreeGroup::INVALID_STATE,
@@ -338,6 +351,10 @@ public:
F32 mPixelArea;
F32 mRadius;
+
+ //used by LLVOAVatar to set render order in alpha draw pool to preserve legacy render order behavior
+ LLVOAvatar* mAvatarp = nullptr;
+ U32 mRenderOrder = 0;
} LL_ALIGN_POSTFIX(64);
class LLGeometryManager
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 701a0b5b13..314c22eb6c 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -2809,6 +2809,7 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update)
// update attachments positions
if (detailed_update)
{
+ U32 draw_order = 0;
for (attachment_map_t::iterator iter = mAttachmentPoints.begin();
iter != mAttachmentPoints.end();
++iter)
@@ -2875,6 +2876,13 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update)
bridge->setState(LLDrawable::MOVE_UNDAMPED);
bridge->updateMove();
bridge->setState(LLDrawable::EARLY_MOVE);
+
+ LLSpatialGroup* group = attached_object->mDrawable->getSpatialGroup();
+ if (group)
+ { //set draw order of group
+ group->mAvatarp = this;
+ group->mRenderOrder = draw_order++;
+ }
}
}
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 20d6fe39e3..da16c8209f 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -3877,7 +3877,11 @@ void LLPipeline::postSort(LLCamera& camera)
if (!sShadowRender)
{
+ // order alpha groups by distance
std::sort(sCull->beginAlphaGroups(), sCull->endAlphaGroups(), LLSpatialGroup::CompareDepthGreater());
+
+ // order rigged alpha groups by avatar attachment order
+ std::sort(sCull->beginRiggedAlphaGroups(), sCull->endRiggedAlphaGroups(), LLSpatialGroup::CompareRenderOrder());
}
LL_PUSH_CALLSTACKS();