summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl4
-rw-r--r--indra/newview/lldrawpoolbump.cpp2
-rw-r--r--indra/newview/llspatialpartition.h17
-rw-r--r--indra/newview/llvoavatar.cpp8
-rw-r--r--indra/newview/pipeline.cpp4
5 files changed, 33 insertions, 2 deletions
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl
index 690821bb56..ad2170bbd3 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl
@@ -43,14 +43,14 @@ VARYING vec2 vary_texcoord0;
void fullbright_lighting()
{
- vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color;
+ vec4 color = diffuseLookup(vary_texcoord0.xy);
if (color.a < minimum_alpha)
{
discard;
}
- //color.rgb *= vertex_color.rgb;
+ color *= vertex_color;
color.rgb = pow(color.rgb, vec3(texture_gamma));
diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp
index ef38b77922..8db6a10e26 100644
--- a/indra/newview/lldrawpoolbump.cpp
+++ b/indra/newview/lldrawpoolbump.cpp
@@ -464,6 +464,7 @@ void LLDrawPoolBump::beginFullbrightShiny()
LLVector4 vec4(vec, gShinyOrigin.mV[3]);
shader->uniform4fv(LLViewerShaderMgr::SHINY_ORIGIN, 1, vec4.mV);
+ cube_map->setMatrix(1);
// Make sure that texture coord generation happens for tex unit 1, as that's the one we use for
// the cube map in the one pass shiny shaders
gGL.getTexUnit(1)->disable();
@@ -524,6 +525,7 @@ void LLDrawPoolBump::endFullbrightShiny()
if( cube_map )
{
cube_map->disable();
+ cube_map->restoreMatrix();
shader->unbind();
}
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 add2ade0a1..b8ebe92430 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 e142a40f1d..9ec3418132 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -3899,7 +3899,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();