diff options
Diffstat (limited to 'indra/newview/llviewerjointmesh.cpp')
-rw-r--r-- | indra/newview/llviewerjointmesh.cpp | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp index 77c8bb0329..2d08a27923 100644 --- a/indra/newview/llviewerjointmesh.cpp +++ b/indra/newview/llviewerjointmesh.cpp @@ -459,7 +459,10 @@ void LLViewerJointMesh::uploadJointMatrices() } } stop_glerror(); - glUniform4fvARB(gAvatarMatrixParam, 45, mat); + if (LLGLSLShader::sCurBoundShaderPtr) + { + LLGLSLShader::sCurBoundShaderPtr->uniform4fv(LLViewerShaderMgr::AVATAR_MATRIX, 45, mat); + } stop_glerror(); } else @@ -512,7 +515,8 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy) { if (!mValid || !mMesh || !mFace || !mVisible || !mFace->getVertexBuffer() || - mMesh->getNumFaces() == 0) + mMesh->getNumFaces() == 0 || + (LLGLSLShader::sNoFixedFunction && LLGLSLShader::sCurBoundShaderPtr == NULL)) { return 0; } @@ -527,9 +531,9 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy) // setup current color //---------------------------------------------------------------- if (is_dummy) - glColor4fv(LLVOAvatar::getDummyColor().mV); + gGL.diffuseColor4fv(LLVOAvatar::getDummyColor().mV); else - glColor4fv(mColor.mV); + gGL.diffuseColor4fv(mColor.mV); stop_glerror(); @@ -547,11 +551,11 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy) if (mIsTransparent) { - glColor4f(1.f, 1.f, 1.f, 1.f); + gGL.diffuseColor4f(1.f, 1.f, 1.f, 1.f); } else { - glColor4f(0.7f, 0.6f, 0.3f, 1.f); + gGL.diffuseColor4f(0.7f, 0.6f, 0.3f, 1.f); gGL.getTexUnit(diffuse_channel)->setTextureColorBlend(LLTexUnit::TBO_LERP_TEX_ALPHA, LLTexUnit::TBS_TEX_COLOR, LLTexUnit::TBS_PREV_COLOR); } } @@ -582,13 +586,16 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy) gGL.getTexUnit(diffuse_channel)->bind(LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT)); } - mFace->getVertexBuffer()->setBuffer(sRenderMask); + + U32 mask = sRenderMask; U32 start = mMesh->mFaceVertexOffset; U32 end = start + mMesh->mFaceVertexCount - 1; U32 count = mMesh->mFaceIndexCount; U32 offset = mMesh->mFaceIndexOffset; + LLVertexBuffer* buff = mFace->getVertexBuffer(); + if (mMesh->hasWeights()) { if ((mFace->getPool()->getVertexShaderLevel() > 0)) @@ -597,16 +604,23 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy) { uploadJointMatrices(); } + mask = mask | LLVertexBuffer::MAP_WEIGHT; + if (mFace->getPool()->getVertexShaderLevel() > 1) + { + mask = mask | LLVertexBuffer::MAP_CLOTHWEIGHT; + } } - mFace->getVertexBuffer()->drawRange(LLRender::TRIANGLES, start, end, count, offset); + buff->setBuffer(mask); + buff->drawRange(LLRender::TRIANGLES, start, end, count, offset); } else { glPushMatrix(); LLMatrix4 jointToWorld = getWorldMatrix(); glMultMatrixf((GLfloat*)jointToWorld.mMatrix); - mFace->getVertexBuffer()->drawRange(LLRender::TRIANGLES, start, end, count, offset); + buff->setBuffer(mask); + buff->drawRange(LLRender::TRIANGLES, start, end, count, offset); glPopMatrix(); } gPipeline.addTrianglesDrawn(count); |