diff options
Diffstat (limited to 'indra/newview/lldrawpoolavatar.cpp')
-rw-r--r-- | indra/newview/lldrawpoolavatar.cpp | 77 |
1 files changed, 63 insertions, 14 deletions
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index d1f4be71f5..63ca17d62d 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -103,6 +103,7 @@ S32 normal_channel = -1; S32 specular_channel = -1; S32 cube_channel = -1; +#if LL_MESH_ENABLED static const U32 rigged_data_mask[] = { LLDrawPoolAvatar::RIGGED_SIMPLE_MASK, LLDrawPoolAvatar::RIGGED_FULLBRIGHT_MASK, @@ -114,6 +115,7 @@ static const U32 rigged_data_mask[] = { LLDrawPoolAvatar::RIGGED_DEFERRED_BUMP_MASK, LLDrawPoolAvatar::RIGGED_DEFERRED_SIMPLE_MASK, }; +#endif static LLFastTimer::DeclareTimer FTM_SHADOW_AVATAR("Avatar Shadow"); @@ -194,12 +196,14 @@ void LLDrawPoolAvatar::beginDeferredPass(S32 pass) case 2: beginDeferredSkinned(); break; +#if LL_MESH_ENABLED case 3: beginDeferredRiggedSimple(); break; case 4: beginDeferredRiggedBump(); break; +#endif } } @@ -226,12 +230,14 @@ void LLDrawPoolAvatar::endDeferredPass(S32 pass) case 2: endDeferredSkinned(); break; +#if LL_MESH_ENABLED case 3: endDeferredRiggedSimple(); break; case 4: endDeferredRiggedBump(); break; +#endif } } @@ -242,7 +248,11 @@ void LLDrawPoolAvatar::renderDeferred(S32 pass) S32 LLDrawPoolAvatar::getNumPostDeferredPasses() { +#if LL_MESH_ENABLED return 6; +#else + return 1; +#endif } void LLDrawPoolAvatar::beginPostDeferredPass(S32 pass) @@ -252,6 +262,7 @@ void LLDrawPoolAvatar::beginPostDeferredPass(S32 pass) case 0: beginPostDeferredAlpha(); break; +#if LL_MESH_ENABLED case 1: beginRiggedFullbright(); break; @@ -267,6 +278,7 @@ void LLDrawPoolAvatar::beginPostDeferredPass(S32 pass) case 5: beginRiggedGlow(); break; +#endif } } @@ -284,6 +296,7 @@ void LLDrawPoolAvatar::beginPostDeferredAlpha() enable_vertex_weighting(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT]); } +#if LL_MESH_ENABLED void LLDrawPoolAvatar::beginDeferredRiggedAlpha() { sVertexProgram = &gDeferredSkinnedAlphaProgram; @@ -301,6 +314,7 @@ void LLDrawPoolAvatar::endDeferredRiggedAlpha() LLVertexBuffer::sWeight4Loc = -1; sVertexProgram = NULL; } +#endif void LLDrawPoolAvatar::endPostDeferredPass(S32 pass) { @@ -309,6 +323,7 @@ void LLDrawPoolAvatar::endPostDeferredPass(S32 pass) case 0: endPostDeferredAlpha(); break; +#if LL_MESH_ENABLED case 1: endRiggedFullbright(); break; @@ -324,6 +339,7 @@ void LLDrawPoolAvatar::endPostDeferredPass(S32 pass) case 5: endRiggedGlow(); break; +#endif } } @@ -357,7 +373,11 @@ void LLDrawPoolAvatar::renderPostDeferred(S32 pass) S32 LLDrawPoolAvatar::getNumShadowPasses() { +#if LL_MESH_ENABLED return 2; +#else + return 1; +#endif } void LLDrawPoolAvatar::beginShadowPass(S32 pass) @@ -448,6 +468,7 @@ void LLDrawPoolAvatar::renderShadow(S32 pass) avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE); } +#if LL_MESH_ENABLED else { renderRigged(avatarp, RIGGED_SIMPLE); @@ -457,10 +478,12 @@ void LLDrawPoolAvatar::renderShadow(S32 pass) renderRigged(avatarp, RIGGED_SHINY); renderRigged(avatarp, RIGGED_FULLBRIGHT_ALPHA); } +#endif } S32 LLDrawPoolAvatar::getNumPasses() { +#if LL_MESH_ENABLED if (LLPipeline::sImpostorRender) { return 8; @@ -473,8 +496,19 @@ S32 LLDrawPoolAvatar::getNumPasses() { return 3; } +#else + if (LLPipeline::sImpostorRender) + { + return 1; + } + else + { + return 3; + } +#endif } + S32 LLDrawPoolAvatar::getNumDeferredPasses() { if (LLPipeline::sImpostorRender) @@ -522,6 +556,7 @@ void LLDrawPoolAvatar::beginRenderPass(S32 pass) case 2: beginSkinned(); break; +#if LL_MESH_ENABLED case 3: beginRiggedSimple(); break; @@ -543,6 +578,7 @@ void LLDrawPoolAvatar::beginRenderPass(S32 pass) case 9: beginRiggedGlow(); break; +#endif } } @@ -566,6 +602,7 @@ void LLDrawPoolAvatar::endRenderPass(S32 pass) case 2: endSkinned(); break; +#if LL_MESH_ENABLED case 3: endRiggedSimple(); break; @@ -587,6 +624,7 @@ void LLDrawPoolAvatar::endRenderPass(S32 pass) case 9: endRiggedGlow(); break; +#endif } } @@ -772,6 +810,7 @@ void LLDrawPoolAvatar::endSkinned() gGL.getTexUnit(0)->activate(); } +#if LL_MESH_ENABLED void LLDrawPoolAvatar::beginRiggedSimple() { sVertexProgram = &gSkinnedObjectSimpleProgram; @@ -924,6 +963,7 @@ void LLDrawPoolAvatar::endDeferredRiggedBump() sDiffuseChannel = 0; sVertexProgram = NULL; } +#endif void LLDrawPoolAvatar::beginDeferredSkinned() { @@ -995,7 +1035,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) if (!single_avatar && !avatarp->isFullyLoaded() ) { - if (pass==1 && (!gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_PARTICLES) || LLViewerPartSim::getMaxPartCount() <= 0)) + if (pass==0 && (!gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_PARTICLES) || LLViewerPartSim::getMaxPartCount() <= 0)) { // debug code to draw a sphere in place of avatar gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sWhiteImagep); @@ -1007,8 +1047,10 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) gGL.translatef((F32)(pos.mV[VX]), (F32)(pos.mV[VY]), (F32)(pos.mV[VZ])); - gGL.scalef(0.15f, 0.15f, 0.3f); - gSphere.render(); + gGL.scalef(0.15f, 0.15f, 0.3f); + + gSphere.renderGGL(); + gGL.popMatrix(); gGL.setColorMask(true, false); } @@ -1067,6 +1109,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) return; } +#if LL_MESH_ENABLED if (pass == 3) { if (is_deferred_render) @@ -1148,7 +1191,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) gGL.setSceneBlendType(LLRender::BT_ALPHA); return; } - +#endif if (sShaderLevel > 0) { @@ -1186,6 +1229,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) } } +#if LL_MESH_ENABLED void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLFace* face, const LLMeshSkinInfo* skin, LLVolume* volume, const LLVolumeFace& vol_face) { U32 data_mask = 0; @@ -1201,14 +1245,14 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLFace* face, const LLMeshSk if (!buff || buff->getTypeMask() != data_mask || - buff->getRequestedVerts() != vol_face.mVertices.size()) + buff->getRequestedVerts() != vol_face.mNumVertices) { face->setGeomIndex(0); face->setIndicesIndex(0); - face->setSize(vol_face.mVertices.size(), vol_face.mIndices.size()); + face->setSize(vol_face.mNumVertices, vol_face.mNumIndices); face->mVertexBuffer = new LLVertexBuffer(data_mask, 0); - face->mVertexBuffer->allocateBuffer(vol_face.mVertices.size(), vol_face.mIndices.size(), true); + face->mVertexBuffer->allocateBuffer(vol_face.mNumVertices, vol_face.mNumIndices, true); U16 offset = 0; @@ -1375,7 +1419,7 @@ void LLDrawPoolAvatar::renderRiggedGlow(LLVOAvatar* avatar) { renderRigged(avatar, RIGGED_GLOW, true); } - +#endif @@ -1477,6 +1521,7 @@ LLColor3 LLDrawPoolAvatar::getDebugColor() const return LLColor3(0.f, 1.f, 0.f); } +#if LL_MESH_ENABLED void LLDrawPoolAvatar::addRiggedFace(LLFace* facep, U32 type) { if (facep->mRiggedIndex.empty()) @@ -1531,6 +1576,7 @@ void LLDrawPoolAvatar::removeRiggedFace(LLFace* facep) } } } +#endif LLVertexBufferAvatar::LLVertexBufferAvatar() : LLVertexBuffer(sDataMask, @@ -1546,20 +1592,23 @@ void LLVertexBufferAvatar::setupVertexBuffer(U32 data_mask) const { U8* base = useVBOs() ? NULL : mMappedData; - glVertexPointer(3,GL_FLOAT, mStride, (void*)(base + 0)); - glNormalPointer(GL_FLOAT, mStride, (void*)(base + mOffsets[TYPE_NORMAL])); - glTexCoordPointer(2,GL_FLOAT, mStride, (void*)(base + mOffsets[TYPE_TEXCOORD0])); + glVertexPointer(3,GL_FLOAT, LLVertexBuffer::sTypeOffsets[LLVertexBuffer::TYPE_VERTEX], (void*)(base + 0)); + glNormalPointer(GL_FLOAT, LLVertexBuffer::sTypeOffsets[LLVertexBuffer::TYPE_NORMAL], (void*)(base + mOffsets[TYPE_NORMAL])); + glTexCoordPointer(2,GL_FLOAT, LLVertexBuffer::sTypeOffsets[LLVertexBuffer::TYPE_TEXCOORD0], (void*)(base + mOffsets[TYPE_TEXCOORD0])); - set_vertex_weights(LLDrawPoolAvatar::sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT], mStride, (F32*)(base + mOffsets[TYPE_WEIGHT])); + set_vertex_weights(LLDrawPoolAvatar::sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT], + LLVertexBuffer::sTypeOffsets[LLVertexBuffer::TYPE_WEIGHT], (F32*)(base + mOffsets[TYPE_WEIGHT])); if (sShaderLevel >= LLDrawPoolAvatar::SHADER_LEVEL_BUMP) { - set_binormals(LLDrawPoolAvatar::sVertexProgram->mAttribute[LLViewerShaderMgr::BINORMAL], mStride, (LLVector3*)(base + mOffsets[TYPE_BINORMAL])); + set_binormals(LLDrawPoolAvatar::sVertexProgram->mAttribute[LLViewerShaderMgr::BINORMAL], + LLVertexBuffer::sTypeOffsets[LLVertexBuffer::TYPE_BINORMAL], (LLVector3*)(base + mOffsets[TYPE_BINORMAL])); } if (sShaderLevel >= LLDrawPoolAvatar::SHADER_LEVEL_CLOTH) { - set_vertex_clothing_weights(LLDrawPoolAvatar::sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_CLOTHING], mStride, (LLVector4*)(base + mOffsets[TYPE_CLOTHWEIGHT])); + set_vertex_clothing_weights(LLDrawPoolAvatar::sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_CLOTHING], + LLVertexBuffer::sTypeOffsets[LLVertexBuffer::TYPE_CLOTHWEIGHT], (LLVector4*)(base + mOffsets[TYPE_CLOTHWEIGHT])); } } else |