summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2015-08-26 10:49:02 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2015-08-26 10:49:02 -0400
commit2ea8df0593d520b86bcf958263622218f76ac113 (patch)
treee122d46164a5df229c7b52f9290b584b4e35b983 /indra
parent0f9700af5b18b2ddd1eed10b34c4ad5d9a09ee7e (diff)
SL-205 WIP - support for 152-joint rigged meshes with both hardware and software skinning.
Diffstat (limited to 'indra')
-rwxr-xr-xindra/llcharacter/lljoint.h1
-rwxr-xr-xindra/llprimitive/llmodel.cpp1
-rwxr-xr-xindra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl13
-rwxr-xr-xindra/newview/lldrawpoolavatar.cpp3
-rwxr-xr-xindra/newview/llvovolume.cpp1
5 files changed, 13 insertions, 6 deletions
diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h
index 28109f682a..d9101c04ca 100755
--- a/indra/llcharacter/lljoint.h
+++ b/indra/llcharacter/lljoint.h
@@ -40,6 +40,7 @@
#include "xform.h"
const S32 LL_CHARACTER_MAX_JOINTS_PER_MESH = 15;
+// BENTO JOINT COUNT LIMIT
const U32 LL_CHARACTER_MAX_JOINTS = 152; // must be divisible by 4!
// FIXME BENTO - these should be higher than the joint_num of any
// other joint, to avoid conflicts in updateMotionsByType()
diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp
index ed903146ef..7290fa5f83 100755
--- a/indra/llprimitive/llmodel.cpp
+++ b/indra/llprimitive/llmodel.cpp
@@ -1762,6 +1762,7 @@ LLSD LLModel::writeModel(
S32 count = 0;
for (weight_list::iterator iter = weights.begin(); iter != weights.end(); ++iter)
{
+ // BENTO JOINT COUNT LIMIT 255?
if (iter->mJointIdx < 255 && iter->mJointIdx >= 0)
{
U8 idx = (U8) iter->mJointIdx;
diff --git a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl
index 6cd38d8ef5..d3eed775bf 100755
--- a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl
@@ -24,8 +24,11 @@
ATTRIBUTE vec4 weight4;
-uniform mat3 matrixPalette[52];
-uniform vec3 translationPalette[52];
+/* BENTO JOINT COUNT LIMITS
+ * Note that the value in these two lines also needs to be updated to value-1 several places below.
+ */
+uniform mat3 matrixPalette[152];
+uniform vec3 translationPalette[152];
mat4 getObjectSkinnedTransform()
{
@@ -34,7 +37,7 @@ mat4 getObjectSkinnedTransform()
vec4 w = fract(weight4);
vec4 index = floor(weight4);
- index = min(index, vec4(51.0));
+ index = min(index, vec4(151.0));
index = max(index, vec4( 0.0));
float scale = 1.0/(w.x+w.y+w.z+w.w);
@@ -68,8 +71,8 @@ mat4 getObjectSkinnedTransform()
// If it's AMD make sure the GLSL compiler sees the arrays referenced once by static index. Otherwise it seems to optimise the storage awawy which leads to unfun crashes and artifacts.
mat3 dummy1 = matrixPalette[0];
vec3 dummy2 = translationPalette[0];
- mat3 dummy3 = matrixPalette[51];
- vec3 dummy4 = translationPalette[51];
+ mat3 dummy3 = matrixPalette[151];
+ vec3 dummy4 = translationPalette[151];
#endif
}
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index f828b56f7f..6c9107cb76 100755
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -55,7 +55,8 @@ static U32 sDataMask = LLDrawPoolAvatar::VERTEX_DATA_MASK;
static U32 sBufferUsage = GL_STREAM_DRAW_ARB;
static U32 sShaderLevel = 0;
-#define JOINT_COUNT 52
+// BENTO JOINT COUNT LIMIT
+#define JOINT_COUNT 152
LLGLSLShader* LLDrawPoolAvatar::sVertexProgram = NULL;
BOOL LLDrawPoolAvatar::sSkipOpaque = FALSE;
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];