summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2010-04-12 11:11:58 -0500
committerDave Parks <davep@lindenlab.com>2010-04-12 11:11:58 -0500
commit0660cf0c987385dc2923bff389c7fa1bc0feec81 (patch)
tree6b3c50d2563e3042fc7ac3a550938de8bfa5cbe5
parentf8f1e30ac385906230ef0532c0a68aff293de4cb (diff)
parentfb04904336b77b480f2ebd6bf9219f85c356d36f (diff)
merge
-rw-r--r--indra/newview/lldrawpoolavatar.cpp5
-rw-r--r--indra/newview/llvoavatar.cpp22
2 files changed, 21 insertions, 6 deletions
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index 23211d7090..de9b71a9b8 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -325,7 +325,7 @@ void LLDrawPoolAvatar::renderShadow(S32 pass)
S32 LLDrawPoolAvatar::getNumPasses()
{
- return LLPipeline::sImpostorRender ? 1 : 4;
+ return LLPipeline::sImpostorRender ? 1 : 3;
}
void LLDrawPoolAvatar::render(S32 pass)
@@ -362,6 +362,7 @@ void LLDrawPoolAvatar::beginRenderPass(S32 pass)
break;
case 2:
beginSkinned();
+ break;
case 3:
beginRigged();
break;
@@ -579,12 +580,14 @@ void LLDrawPoolAvatar::endSkinned()
void LLDrawPoolAvatar::beginRigged()
{
+ sVertexProgram = NULL;
gSkinnedObjectSimpleProgram.bind();
LLVertexBuffer::sWeight4Loc = gSkinnedObjectSimpleProgram.getAttribLocation(LLViewerShaderMgr::OBJECT_WEIGHT);
}
void LLDrawPoolAvatar::endRigged()
{
+ sVertexProgram = NULL;
gSkinnedObjectSimpleProgram.unbind();
LLVertexBuffer::sWeight4Loc = -1;
}
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 6c2eb37971..201c4ce1d5 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -3645,7 +3645,8 @@ U32 LLVOAvatar::renderSkinnedAttachments()
const U32 data_mask = LLVertexBuffer::MAP_VERTEX |
LLVertexBuffer::MAP_NORMAL |
- LLVertexBuffer::MAP_TEXCOORD0 |
+ LLVertexBuffer::MAP_TEXCOORD0 |
+ LLVertexBuffer::MAP_COLOR |
LLVertexBuffer::MAP_WEIGHT4;
for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin();
@@ -3669,10 +3670,16 @@ U32 LLVOAvatar::renderSkinnedAttachments()
if (face->isState(LLFace::RIGGED))
{
LLVolume* volume = attached_object->getVolume();
+ if (!volume || volume->getNumVolumeFaces() <= i)
+ {
+ continue;
+ }
+
const LLVolumeFace& vol_face = volume->getVolumeFace(i);
const LLMeshSkinInfo* skin = NULL;
LLVertexBuffer* buff = face->mVertexBuffer;
+ LLUUID mesh_id = volume->getParams().getSculptID();;
if (!buff ||
!buff->hasDataType(LLVertexBuffer::TYPE_WEIGHT4) ||
@@ -3682,7 +3689,6 @@ U32 LLVOAvatar::renderSkinnedAttachments()
face->mLastVertexBuffer = NULL;
buff = NULL;
- LLUUID mesh_id = volume->getParams().getSculptID();
if (mesh_id.notNull())
{
skin = gMeshRepo.getSkinInfo(mesh_id);
@@ -3693,7 +3699,8 @@ U32 LLVOAvatar::renderSkinnedAttachments()
face->setGeomIndex(0);
face->setIndicesIndex(0);
-
+ face->setSize(vol_face.mVertices.size(), vol_face.mIndices.size());
+
U16 offset = 0;
LLMatrix4 mat_vert = skin->mBindShapeMatrix;
@@ -3705,8 +3712,13 @@ U32 LLVOAvatar::renderSkinnedAttachments()
}
}
- if (buff)
+ if (buff && mesh_id.notNull())
{
+ if (!skin)
+ {
+ skin = gMeshRepo.getSkinInfo(mesh_id);
+ }
+
if (skin)
{
LLMatrix4 mat[64];
@@ -3729,7 +3741,7 @@ U32 LLVOAvatar::renderSkinnedAttachments()
buff->setBuffer(data_mask);
U16 start = face->getGeomStart();
- U16 end = start + face->getGeomCount();
+ U16 end = start + face->getGeomCount()-1;
S32 offset = face->getIndicesStart();
U32 count = face->getIndicesCount();