From c1deab5ba7595f5094313bb9002411c11bb00745 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 18 May 2022 15:55:24 -0500 Subject: SL-17417 Fix for incorrect reflection orientation on fullbright prims. --- indra/newview/lldrawpoolbump.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview') 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(); } -- cgit v1.2.3 From bf183ecff76809674f4fb0fa302138d554bc3628 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 18 May 2022 17:56:54 -0500 Subject: SL-17449 Fix for Alexa's hair --- indra/newview/llspatialpartition.h | 17 +++++++++++++++++ indra/newview/llvoavatar.cpp | 8 ++++++++ indra/newview/pipeline.cpp | 4 ++++ 3 files changed, 29 insertions(+) (limited to 'indra/newview') 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(); -- cgit v1.2.3 From 3365a39080744af0566adb7b6efd8e53fc6b3339 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 19 May 2022 14:02:48 -0500 Subject: SL-17451 Fix for erroneous attempt to apply vertex color alpha to texture before alpha masking (we don't actually support this and the vertex color alpha is sometimes zero when you think it ought not be). --- .../shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') 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)); -- cgit v1.2.3