diff options
Diffstat (limited to 'indra/newview/lldrawpoolavatar.cpp')
-rwxr-xr-x | indra/newview/lldrawpoolavatar.cpp | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index f622d5a63a..e77ed27fa2 100755 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -1708,9 +1708,9 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) { if (sShaderLevel > 0) { //upload matrix palette to shader - LLMatrix4 mat[32]; + LLMatrix4 mat[64]; - U32 count = llmin((U32) skin->mJointNames.size(), (U32) 32); + U32 count = llmin((U32) skin->mJointNames.size(), (U32) 64); for (U32 i = 0; i < count; ++i) { @@ -1724,10 +1724,42 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) stop_glerror(); - LLDrawPoolAvatar::sVertexProgram->uniformMatrix4fv(LLViewerShaderMgr::AVATAR_MATRIX, + F32 mp[64*9]; + + F32 transp[64*3]; + + for (U32 i = 0; i < count; ++i) + { + F32* m = (F32*) mat[i].mMatrix; + + U32 idx = i*9; + + mp[idx+0] = m[0]; + mp[idx+1] = m[1]; + mp[idx+2] = m[2]; + + mp[idx+3] = m[4]; + mp[idx+4] = m[5]; + mp[idx+5] = m[6]; + + mp[idx+6] = m[8]; + mp[idx+7] = m[9]; + mp[idx+8] = m[10]; + + idx = i*3; + + transp[idx+0] = m[12]; + transp[idx+1] = m[13]; + transp[idx+2] = m[14]; + } + + LLDrawPoolAvatar::sVertexProgram->uniformMatrix3fv(LLViewerShaderMgr::AVATAR_MATRIX, count, FALSE, - (GLfloat*) mat[0].mMatrix); + (GLfloat*) mp); + + LLDrawPoolAvatar::sVertexProgram->uniform3fv(LLShaderMgr::AVATAR_TRANSLATION, count, transp); + stop_glerror(); } |