From 2ea8df0593d520b86bcf958263622218f76ac113 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 26 Aug 2015 10:49:02 -0400 Subject: SL-205 WIP - support for 152-joint rigged meshes with both hardware and software skinning. --- indra/newview/llvovolume.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 267061b83d..7bbaf981ae 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4163,6 +4163,7 @@ void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, cons } //build matrix palette + // BENTO JOINT COUNT LIMIT static const size_t kMaxJoints = 64; LLMatrix4a mp[kMaxJoints]; -- cgit v1.2.3 From 5cacd71c07cd4202784ebf2f826239b4529787ba Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 2 Sep 2015 15:42:22 -0400 Subject: SL-205 WIP - bumped up max joint count in software-skinning pass. --- indra/newview/llvovolume.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index f70280d8c1..25e61c259f 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4164,7 +4164,7 @@ void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, cons //build matrix palette // BENTO JOINT COUNT LIMIT - static const size_t kMaxJoints = 64; + static const size_t kMaxJoints = 152; LLMatrix4a mp[kMaxJoints]; LLMatrix4* mat = (LLMatrix4*) mp; -- cgit v1.2.3 From 2da22ad9fc92b255f9ec63dee11cf56342c2ac33 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 24 Sep 2015 11:35:19 -0400 Subject: SL-227 WIP - initial pass at consolidating skinning code. Less duplication of functionality, still needs more cleanup. --- indra/newview/llvovolume.cpp | 54 ++++---------------------------------------- 1 file changed, 4 insertions(+), 50 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index eefe452c14..5e010a4712 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4164,27 +4164,11 @@ void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, cons //build matrix palette // BENTO JOINT COUNT LIMIT - static const size_t kMaxJoints = 152; + static const size_t kMaxJoints = LL_MAX_JOINTS_PER_MESH_OBJECT; - LLMatrix4a mp[kMaxJoints]; - LLMatrix4* mat = (LLMatrix4*) mp; - + LLMatrix4a mat[kMaxJoints]; U32 maxJoints = llmin(skin->mJointNames.size(), kMaxJoints); - for (U32 j = 0; j < maxJoints; ++j) - { - LLJoint* joint = avatar->getJoint(skin->mJointNames[j]); - if (!joint) - { - // Fall back to a point inside the avatar if mesh is - // rigged to an unknown joint. - joint = avatar->getJoint("mPelvis"); - } - if (joint) - { - mat[j] = skin->mInvBindMatrix[j]; - mat[j] *= joint->getWorldMatrix(); - } - } + LLDrawPoolAvatar::initSkinningMatrixPalette((LLMatrix4*)mat, maxJoints, skin, avatar); for (S32 i = 0; i < volume->getNumVolumeFaces(); ++i) { @@ -4208,37 +4192,7 @@ void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, cons for (U32 j = 0; j < dst_face.mNumVertices; ++j) { LLMatrix4a final_mat; - final_mat.clear(); - - S32 idx[4]; - - LLVector4 wght; - - F32 scale = 0.f; - for (U32 k = 0; k < 4; k++) - { - F32 w = weight[j][k]; - - idx[k] = (S32) floorf(w); - wght[k] = w - floorf(w); - scale += wght[k]; - } - // This is enforced in unpackVolumeFaces() - llassert(scale>0.f); - wght *= 1.f / scale; - - for (U32 k = 0; k < 4; k++) - { - F32 w = wght[k]; - - LLMatrix4a src; - // Insure ref'd bone is in our clamped array of mats - // clamp idx to maxJoints to avoid reading garbage off stack in release - S32 index = llclamp((S32)idx[k],(S32)0,(S32)kMaxJoints-1); - src.setMul(mp[index], w); - final_mat.add(src); - } - + LLDrawPoolAvatar::getPerVertexSkinMatrix(weight[j].getF32ptr(), mat, false, final_mat); LLVector4a& v = vol_face.mPositions[j]; LLVector4a t; -- cgit v1.2.3 From 74b8a487646cccb3260d02910ab5b16e274ec9ab Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 7 Oct 2015 15:38:40 -0400 Subject: SL-234 WIP - adjust max mesh object joints at run-time, including rebuilding shaders --- indra/newview/llvovolume.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 5e010a4712..dde0e2caa1 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4167,7 +4167,7 @@ void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, cons static const size_t kMaxJoints = LL_MAX_JOINTS_PER_MESH_OBJECT; LLMatrix4a mat[kMaxJoints]; - U32 maxJoints = llmin(skin->mJointNames.size(), kMaxJoints); + U32 maxJoints = LLDrawPoolAvatar::getMeshJointCount(skin); LLDrawPoolAvatar::initSkinningMatrixPalette((LLMatrix4*)mat, maxJoints, skin, avatar); for (S32 i = 0; i < volume->getNumVolumeFaces(); ++i) @@ -4189,10 +4189,11 @@ void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, cons { LL_RECORD_BLOCK_TIME(FTM_SKIN_RIGGED); + U32 max_joints = LLDrawPoolAvatar::getMaxJointCount(); for (U32 j = 0; j < dst_face.mNumVertices; ++j) { LLMatrix4a final_mat; - LLDrawPoolAvatar::getPerVertexSkinMatrix(weight[j].getF32ptr(), mat, false, final_mat); + LLDrawPoolAvatar::getPerVertexSkinMatrix(weight[j].getF32ptr(), mat, false, final_mat, max_joints); LLVector4a& v = vol_face.mPositions[j]; LLVector4a t; -- cgit v1.2.3 From 6c6a95478ecd657c271354d93a6f98c90093bac5 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 19 Oct 2015 16:32:49 -0400 Subject: SL-234 WIP - remap skin weights to match included-joint logic --- indra/newview/llvovolume.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index c09786b7c7..5d8558cb46 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4192,6 +4192,7 @@ void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, cons if ( weight ) { + LLDrawPoolAvatar::checkSkinWeights(weight, dst_face.mNumVertices, skin); LLMatrix4a bind_shape_matrix; bind_shape_matrix.loadu(skin->mBindShapeMatrix); -- cgit v1.2.3 From d365aa10f16c022970cefbfac8651fe01b5a9de8 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 21 Oct 2015 16:47:03 -0400 Subject: SL-234 WIP - moved LLSkinningUtil funcs to separate class/files. Remap weights where needed. Warn that related debug settings require restart to take effect. --- indra/newview/llvovolume.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 5d8558cb46..9b2e9db59a 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -54,6 +54,7 @@ #include "llspatialpartition.h" #include "llhudmanager.h" #include "llflexibleobject.h" +#include "llskinningutil.h" #include "llsky.h" #include "lltexturefetch.h" #include "llvector4a.h" @@ -4179,8 +4180,8 @@ void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, cons static const size_t kMaxJoints = LL_MAX_JOINTS_PER_MESH_OBJECT; LLMatrix4a mat[kMaxJoints]; - U32 maxJoints = LLDrawPoolAvatar::getMeshJointCount(skin); - LLDrawPoolAvatar::initSkinningMatrixPalette((LLMatrix4*)mat, maxJoints, skin, avatar); + U32 maxJoints = LLSkinningUtil::getMeshJointCount(skin); + LLSkinningUtil::initSkinningMatrixPalette((LLMatrix4*)mat, maxJoints, skin, avatar); for (S32 i = 0; i < volume->getNumVolumeFaces(); ++i) { @@ -4192,7 +4193,7 @@ void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, cons if ( weight ) { - LLDrawPoolAvatar::checkSkinWeights(weight, dst_face.mNumVertices, skin); + LLSkinningUtil::checkSkinWeights(weight, dst_face.mNumVertices, skin); LLMatrix4a bind_shape_matrix; bind_shape_matrix.loadu(skin->mBindShapeMatrix); @@ -4202,11 +4203,11 @@ void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, cons { LL_RECORD_BLOCK_TIME(FTM_SKIN_RIGGED); - U32 max_joints = LLDrawPoolAvatar::getMaxJointCount(); + U32 max_joints = LLSkinningUtil::getMaxJointCount(); for (U32 j = 0; j < dst_face.mNumVertices; ++j) { LLMatrix4a final_mat; - LLDrawPoolAvatar::getPerVertexSkinMatrix(weight[j].getF32ptr(), mat, false, final_mat, max_joints); + LLSkinningUtil::getPerVertexSkinMatrix(weight[j].getF32ptr(), mat, false, final_mat, max_joints); LLVector4a& v = vol_face.mPositions[j]; LLVector4a t; -- cgit v1.2.3 From 7b410df303d37a800ddd0024932729a574a00860 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 25 Nov 2015 15:07:26 -0500 Subject: SL-124 WIP - cleanup of comments and test code before going to project viewer. --- indra/newview/llvovolume.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 9b2e9db59a..af87bb904d 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4176,7 +4176,6 @@ void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, cons } //build matrix palette - // BENTO JOINT COUNT LIMIT static const size_t kMaxJoints = LL_MAX_JOINTS_PER_MESH_OBJECT; LLMatrix4a mat[kMaxJoints]; -- cgit v1.2.3 From 0f65a04eff96c9b3a0644e9bcbb7cd74a806c866 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 2 Mar 2016 08:51:02 -0500 Subject: SL-343 - attachment can include any number of joint overrides. --- indra/newview/llvovolume.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 7389eade06..680487ea78 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -81,7 +81,7 @@ const F32 FORCE_SIMPLE_RENDER_AREA = 512.f; const F32 FORCE_CULL_AREA = 8.f; -U32 JOINT_COUNT_REQUIRED_FOR_FULLRIG = 20; +U32 JOINT_COUNT_REQUIRED_FOR_FULLRIG = 1; BOOL gAnimateTextures = TRUE; //extern BOOL gHideSelectedObjects; -- cgit v1.2.3 From 2f346d6b328bd8367ed1c1e689c0db582be13f35 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 21 Apr 2016 17:00:58 -0400 Subject: SL-314 - show bones now colorizes rigged-to joints a different color. Also removed what I think is some redundancy in calculating attachment pos overrides. If it breaks I'll change it back. --- indra/newview/llvovolume.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 4e427289e7..c2550afcac 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4767,13 +4767,18 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) drawablep->clearState(LLDrawable::HAS_ALPHA); bool rigged = vobj->isAttachment() && - vobj->isMesh() && - gMeshRepo.getSkinInfo(vobj->getVolume()->getParams().getSculptID(), vobj); + vobj->isMesh() && + gMeshRepo.getSkinInfo(vobj->getVolume()->getParams().getSculptID(), vobj); bool bake_sunlight = LLPipeline::sBakeSunlight && drawablep->isStatic(); bool is_rigged = false; + if (rigged && pAvatarVO) + { + pAvatarVO->addAttachmentPosOverridesForObject(vobj); + } + //for each face for (S32 i = 0; i < drawablep->getNumFaces(); i++) { @@ -4790,8 +4795,6 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) //sum up face verts and indices drawablep->updateFaceSize(i); - - if (rigged) { if (!facep->isState(LLFace::RIGGED)) @@ -4805,13 +4808,6 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) //get drawpool of avatar with rigged face LLDrawPoolAvatar* pool = get_avatar_drawpool(vobj); - // FIXME should this be inside the face loop? - // doesn't seem to depend on any per-face state. - if ( pAvatarVO ) - { - pAvatarVO->addAttachmentPosOverridesForObject(vobj); - } - if (pool) { const LLTextureEntry* te = facep->getTextureEntry(); -- cgit v1.2.3 From ec471497f5dba41e74afc6864ab0f7100659e1d9 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 29 Apr 2016 11:25:17 -0400 Subject: SL-375, SL-378 - rudimentary logging info to list joint offsets during mesh import. dae_tool.py work to enable joint offset tweaking. --- indra/newview/llvovolume.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index c2550afcac..9d8ef05cbc 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4777,6 +4777,10 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (rigged && pAvatarVO) { pAvatarVO->addAttachmentPosOverridesForObject(vobj); + if (pAvatarVO->isSelf()) + { + //pAvatarVO->showAttachmentPosOverrides(); + } } //for each face -- cgit v1.2.3 From 3a53109152b961c9d0e7d6dd4f66b02d7531fb2a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 7 Jun 2016 10:39:32 -0400 Subject: SL-395 - support scale overrides (currently no way to get these into a dae, so the actual scale values are fabricated at run-time based on the joint name) --- indra/newview/llvovolume.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 465f8fe0d6..8e6a15b67f 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4780,10 +4780,10 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (rigged && pAvatarVO) { - pAvatarVO->addAttachmentPosOverridesForObject(vobj); + pAvatarVO->addAttachmentOverridesForObject(vobj); if (pAvatarVO->isSelf()) { - //pAvatarVO->showAttachmentPosOverrides(); + //pAvatarVO->showAttachmentOverrides(); } } -- cgit v1.2.3 From b7a0d441a35193cdeb604a491b266d2f54babb7f Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 9 Aug 2016 09:17:37 -0400 Subject: SL-126 - attachment logging under avatar at DEBUG level. Also fixed a typo in avatar_lad.xml --- indra/newview/llvovolume.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 465f8fe0d6..c8e98683aa 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4783,7 +4783,8 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) pAvatarVO->addAttachmentPosOverridesForObject(vobj); if (pAvatarVO->isSelf()) { - //pAvatarVO->showAttachmentPosOverrides(); + bool verbose = true; + pAvatarVO->showAttachmentPosOverrides(verbose); } } -- cgit v1.2.3 From e6297ab3d6262014d3b501703154437bea523be1 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 27 Sep 2016 17:29:22 -0400 Subject: SL-451 - support for getJoint() by number, use in initSkinningMatrixPalette() --- indra/newview/llvovolume.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 6d3e2e4a39..fd77bc2985 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4779,11 +4779,13 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (rigged && pAvatarVO) { pAvatarVO->addAttachmentOverridesForObject(vobj); +#if 0 if (pAvatarVO->isSelf()) { bool verbose = true; pAvatarVO->showAttachmentOverrides(verbose); } +#endif } //for each face -- cgit v1.2.3 From 8d6bb9ee4e9def306454e9ecda1980793dcf7ad5 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 28 Sep 2016 15:43:07 -0400 Subject: SL-451 - SSE-optimized matrix multiply, used in initSkinningMatrixPalette() --- indra/newview/llvovolume.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index fd77bc2985..f476a3641e 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4779,13 +4779,11 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (rigged && pAvatarVO) { pAvatarVO->addAttachmentOverridesForObject(vobj); -#if 0 - if (pAvatarVO->isSelf()) - { + if (debugLoggingEnabled("Avatar") && pAvatarVO->isSelf()) + { bool verbose = true; pAvatarVO->showAttachmentOverrides(verbose); } -#endif } //for each face -- cgit v1.2.3 From fd226196319909af8f99f6fbed04bb7713975f02 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 24 Oct 2016 09:48:03 -0400 Subject: SL-109 - made overly verbose showAttachmentOverrides harder to get when not desired. --- indra/newview/llvovolume.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index f476a3641e..d9877d6def 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4779,7 +4779,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (rigged && pAvatarVO) { pAvatarVO->addAttachmentOverridesForObject(vobj); - if (debugLoggingEnabled("Avatar") && pAvatarVO->isSelf()) + if (debugLoggingEnabled("AvatarAttachments") && pAvatarVO->isSelf()) { bool verbose = true; pAvatarVO->showAttachmentOverrides(verbose); -- cgit v1.2.3 From 7447da6943842a5af31787b2bbee3255b45ba88e Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 27 Oct 2016 09:39:39 -0400 Subject: SL-503 - more info in archetype dump files --- indra/newview/llvovolume.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index d9877d6def..5b3354a472 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4779,7 +4779,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (rigged && pAvatarVO) { pAvatarVO->addAttachmentOverridesForObject(vobj); - if (debugLoggingEnabled("AvatarAttachments") && pAvatarVO->isSelf()) + if (!LLApp::isExiting() && pAvatarVO->isSelf() && debugLoggingEnabled("AvatarAttachments")) { bool verbose = true; pAvatarVO->showAttachmentOverrides(verbose); -- cgit v1.2.3