From 5bba58536292b13d7367e1d0375fca39a4984dee Mon Sep 17 00:00:00 2001 From: Ansariel Date: Wed, 22 Aug 2018 09:57:33 +0200 Subject: [PATCH] Remove simple avatar shadows for the time being since they are incompatible with upcoming rendering changes --- .../app_settings/graphic_preset_controls.xml | 1 - indra/newview/app_settings/settings.xml | 11 -- indra/newview/lldrawpoolavatar.cpp | 166 ------------------ indra/newview/lldrawpoolavatar.h | 3 - indra/newview/llvoavatar.cpp | 11 -- indra/newview/llvoavatarself.cpp | 11 -- .../xui/en/panel_preferences_graphics1.xml | 39 ---- 7 files changed, 242 deletions(-) diff --git a/indra/newview/app_settings/graphic_preset_controls.xml b/indra/newview/app_settings/graphic_preset_controls.xml index 706561c911..a259e269e7 100644 --- a/indra/newview/app_settings/graphic_preset_controls.xml +++ b/indra/newview/app_settings/graphic_preset_controls.xml @@ -10,7 +10,6 @@ FSLimitFramerate FSRenderDoFUnderwater FSRenderVignette - FSSimpleAvatarShadows FullScreen RenderAnisotropic RenderAttachedLights diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index dcebe152d7..d04d5b0d06 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -24045,17 +24045,6 @@ Change of this parameter will affect the layout of buttons in notification toast Value 13 - FSSimpleAvatarShadows - - Comment - How to render deferred avatar shadows. 0=none, 1=simplified (no rigged mesh shadows), 2=optimized (slower but still faster than legacy when several avatars are around), 3=legacy (like the SL viewer, slow with complex rigged attachments). - Persist - 1 - Type - U32 - Value - 3 - FSConfirmPayments Comment diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index c789e48c35..b73b80977b 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -488,14 +488,6 @@ void LLDrawPoolAvatar::renderShadow(S32 pass) { LL_RECORD_BLOCK_TIME(FTM_SHADOW_AVATAR); - // Chalice Yao's simple avatar shadows via Marine Kelley - static LLCachedControl fsSimpleAvatarShadows(gSavedSettings, "FSSimpleAvatarShadows", 3); - if (fsSimpleAvatarShadows == 0) - { - return; - } - // - if (mDrawFace.empty()) { return; @@ -528,18 +520,6 @@ void LLDrawPoolAvatar::renderShadow(S32 pass) { avatarp->renderSkinned(); } - // Chalice Yao's simple avatar shadows via Marine Kelley - else if (fsSimpleAvatarShadows == 1) - { - // Don't render the shadow of anything that is rigged. Instead, force the shadow of the avatar shape to render instead. - // See LLVOAvatar::isTextureVisible() and LLVOAvatarSelf::isTextureVisible() - return; - } - else if (fsSimpleAvatarShadows == 2) - { - renderRiggedShadows(avatarp); - } - // else { for (U32 i = 0; i < NUM_RIGGED_PASSES; ++i) @@ -2107,152 +2087,6 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) } } -// Chalice Yao's simple avatar shadows via Marine Kelley -void LLDrawPoolAvatar::renderRiggedShadows(LLVOAvatar* avatar) -{ - if (avatar->isSelf() && !gAgent.needsRenderAvatar()) - { - return; - } - - stop_glerror(); - - U32 rigTypes[18] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,21 }; - for (U32 j = 0; j < 18; ++j) - for (U32 i = 0; i < mRiggedFace[rigTypes[j]].size(); ++i) - { - LLFace* face = mRiggedFace[rigTypes[j]][i]; - LLDrawable* drawable = face->getDrawable(); - if (!drawable) - { - continue; - } - - LLVOVolume* vobj = drawable->getVOVolume(); - - if (!vobj) - { - continue; - } - - LLVolume* volume = vobj->getVolume(); - S32 te = face->getTEOffset(); - - if (!volume || volume->getNumVolumeFaces() <= te || !volume->isMeshAssetLoaded()) - { - continue; - } - - LLUUID mesh_id = volume->getParams().getSculptID(); - if (mesh_id.isNull()) - { - continue; - } - - const LLMeshSkinInfo* skin = gMeshRepo.getSkinInfo(mesh_id, vobj); - if (!skin) - { - continue; - } - - U32 data_mask = LLFace::getRiggedDataMask(24); - - LLVertexBuffer* buff = face->getVertexBuffer(); - - if (buff) - { - if (sShaderLevel > 0) - { - // upload matrix palette to shader - LLMatrix4a mat[LL_MAX_JOINTS_PER_MESH_OBJECT]; - U32 count = LLSkinningUtil::getMeshJointCount(skin); - LLSkinningUtil::initSkinningMatrixPalette((LLMatrix4*)mat, count, skin, avatar); - - stop_glerror(); - - F32 mp[LL_MAX_JOINTS_PER_MESH_OBJECT*12]; - - for (U32 i = 0; i < count; ++i) - { - F32* m = (F32*)mat[i].mMatrix[0].getF32ptr(); - - U32 idx = i * 12; - - mp[idx + 0] = m[0]; - mp[idx + 1] = m[1]; - mp[idx + 2] = m[2]; - mp[idx + 3] = m[12]; - - mp[idx + 4] = m[4]; - mp[idx + 5] = m[5]; - mp[idx + 6] = m[6]; - mp[idx + 7] = m[13]; - - mp[idx + 8] = m[8]; - mp[idx + 9] = m[9]; - mp[idx + 10] = m[10]; - mp[idx + 11] = m[14]; - } - - LLDrawPoolAvatar::sVertexProgram->uniformMatrix3x4fv(LLViewerShaderMgr::AVATAR_MATRIX, - count, - FALSE, - (GLfloat*)mp); - - stop_glerror(); - } - else - { - data_mask &= ~LLVertexBuffer::MAP_WEIGHT4; - } - - U16 start = face->getGeomStart(); - U16 end = start + face->getGeomCount() - 1; - S32 offset = face->getIndicesStart(); - U32 count = face->getIndicesCount(); - - if ((rigTypes[j] < 4) || (rigTypes[j] == 5) || (rigTypes[j] == 6) || (rigTypes[j] == 9) || (rigTypes[j] == 10) || (rigTypes[j] == 13) || (rigTypes[j] == 14) || (rigTypes[j] == 21)) - { - gGL.getTexUnit(sDiffuseChannel)->bind(face->getTexture()); - sVertexProgram->setMinimumAlpha(0.f); - - if ((rigTypes[j] == 2) || (rigTypes[j] == 6) || (rigTypes[j] == 10) || (rigTypes[j] == 14)) - { - const LLTextureEntry* te = face->getTextureEntry(); - LLMaterial* mat = te->getMaterialParams().get(); - - if (mat) - if (mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK) - sVertexProgram->setMinimumAlpha(mat->getAlphaMaskCutoff() / 255.f); - } - - if (face->mTextureMatrix && vobj->mTexAnimMode) - { - gGL.matrixMode(LLRender::MM_TEXTURE); - gGL.loadMatrix((F32*)face->mTextureMatrix->mMatrix); - buff->setBuffer(data_mask); - buff->drawRange(LLRender::TRIANGLES, start, end, count, offset); - gGL.loadIdentity(); - gGL.matrixMode(LLRender::MM_MODELVIEW); - } - else - { - buff->setBuffer(data_mask); - buff->drawRange(LLRender::TRIANGLES, start, end, count, offset); - } - } - else - { - buff->setBuffer(data_mask); - buff->drawRange(LLRender::TRIANGLES, start, end, count, offset); - } - - gPipeline.addTrianglesDrawn(count, LLRender::TRIANGLES); - } - } -} -// - void LLDrawPoolAvatar::renderDeferredRiggedSimple(LLVOAvatar* avatar) { renderRigged(avatar, RIGGED_DEFERRED_SIMPLE); diff --git a/indra/newview/lldrawpoolavatar.h b/indra/newview/lldrawpoolavatar.h index 5959631b85..9cbdb84e2c 100644 --- a/indra/newview/lldrawpoolavatar.h +++ b/indra/newview/lldrawpoolavatar.h @@ -147,9 +147,6 @@ public: void updateRiggedVertexBuffers(LLVOAvatar* avatar); void renderRigged(LLVOAvatar* avatar, U32 type, bool glow = false); - // Chalice Yao's simple avatar shadows via Marine Kelley - void renderRiggedShadows(LLVOAvatar* avatar); - // void renderRiggedSimple(LLVOAvatar* avatar); void renderRiggedAlpha(LLVOAvatar* avatar); void renderRiggedFullbrightAlpha(LLVOAvatar* avatar); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index e6b847c348..1947e348c9 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -10502,17 +10502,6 @@ BOOL LLVOAvatar::isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex type, } else { - // Chalice Yao's simple avatar shadows via Marine Kelley - if (LLPipeline::sShadowRender) - { - static LLCachedControl fsSimpleAvatarShadows(gSavedSettings, "FSSimpleAvatarShadows", 3); - if (fsSimpleAvatarShadows == 1) - { - return TRUE; - } - } - // - // baked textures can use TE images directly return ((isTextureDefined(type) || isSelf()) && (getTEImage(type)->getID() != IMG_INVISIBLE diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index e51c5936bd..15bd8bdf9f 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2041,17 +2041,6 @@ BOOL LLVOAvatarSelf::isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex t return LLVOAvatar::isTextureVisible(type, (U32)0); } - // Chalice Yao's simple avatar shadows via Marine Kelley - if (LLPipeline::sShadowRender) - { - static LLCachedControl fsSimpleAvatarShadows(gSavedSettings, "FSSimpleAvatarShadows", 3); - if (fsSimpleAvatarShadows == 1) - { - return TRUE; - } - } - // - LLUUID tex_id = getLocalTextureID(type,index); return (tex_id != IMG_INVISIBLE) || (LLDrawPoolAlpha::sShowDebugAlpha); diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index d1ac416ae6..ffd1dd6151 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -369,45 +369,6 @@ value="2"/> - - Avatar Shadows: - - - - - - - -