diff options
-rwxr-xr-x | indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl | 2 | ||||
-rwxr-xr-x | indra/newview/lldrawpoolavatar.cpp | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl index 2745d5fd95..43ed41a205 100755 --- a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl @@ -26,7 +26,7 @@ ATTRIBUTE vec4 weight4; -uniform mat4 matrixPalette[64]; +uniform mat4 matrixPalette[32]; mat4 getObjectSkinnedTransform() { diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 69f10cd4df..c7ffef18db 100755 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -1587,9 +1587,11 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) { if (sShaderLevel > 0) { //upload matrix palette to shader - LLMatrix4 mat[64]; + LLMatrix4 mat[32]; - for (U32 i = 0; i < skin->mJointNames.size(); ++i) + U32 count = llmin(skin->mJointNames.size(), (U32) 32); + + for (U32 i = 0; i < count; ++i) { LLJoint* joint = avatar->getJoint(skin->mJointNames[i]); if (joint) @@ -1602,7 +1604,7 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) stop_glerror(); LLDrawPoolAvatar::sVertexProgram->uniformMatrix4fv("matrixPalette", - skin->mJointNames.size(), + count, FALSE, (GLfloat*) mat[0].mMatrix); |