summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpoolavatar.cpp
diff options
context:
space:
mode:
authorsimon <none@none>2013-03-20 15:25:14 -0700
committersimon <none@none>2013-03-20 15:25:14 -0700
commit8e54ae95d1417f51edd6c68c389fd6cd7322ca52 (patch)
treebb192b0d150eeff35099b07435c5f233c97adae2 /indra/newview/lldrawpoolavatar.cpp
parent5dbb0a31da9bb3fb5ff7c5ead5d90808f9e4b797 (diff)
Prototype code for "simple imposter" mode rendering of avatars.
Reviewed by Kelly
Diffstat (limited to 'indra/newview/lldrawpoolavatar.cpp')
-rw-r--r--indra/newview/lldrawpoolavatar.cpp135
1 files changed, 66 insertions, 69 deletions
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index d5afa25c9c..3d7407ab54 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -1163,88 +1163,85 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
}
else if (pass >= 3 && pass <= 9)
{ //render rigged attachments
- if (!avatarp->isVisuallyMuted())
+ if (!avatarp->isVisuallyMuted()) // These details are skipped for visually muted (plain imposter) avatars
{
- if (pass == 3)
- {
- if (is_deferred_render)
- {
- renderDeferredRiggedSimple(avatarp);
- }
- else
- {
- renderRiggedSimple(avatarp);
- }
- }
+ if (pass == 3) // To do - use switch statement
+ {
+ if (is_deferred_render)
+ {
+ renderDeferredRiggedSimple(avatarp);
+ }
+ else
+ {
+ renderRiggedSimple(avatarp);
+ }
+ }
else if (pass == 4)
- {
- if (is_deferred_render)
- {
- renderDeferredRiggedBump(avatarp);
- }
- else
- {
- renderRiggedFullbright(avatarp);
- }
- }
+ {
+ if (is_deferred_render)
+ {
+ renderDeferredRiggedBump(avatarp);
+ }
+ else
+ {
+ renderRiggedFullbright(avatarp);
+ }
+ }
else if (pass == 5)
- {
- renderRiggedShinySimple(avatarp);
- }
+ {
+ renderRiggedShinySimple(avatarp);
+ }
else if (pass == 6)
- {
- renderRiggedFullbrightShiny(avatarp);
- }
- else if (pass >= 7 && pass < 9)
- {
- if (pass == 7)
- {
- renderRiggedAlpha(avatarp);
- }
- else if (pass == 8)
- {
- renderRiggedFullbrightAlpha(avatarp);
- }
- }
+ {
+ renderRiggedFullbrightShiny(avatarp);
+ }
+ else if (pass == 7)
+ {
+ renderRiggedAlpha(avatarp);
+ }
+ else if (pass == 8)
+ {
+ renderRiggedFullbrightAlpha(avatarp);
+ }
else if (pass == 9)
- {
- renderRiggedGlow(avatarp);
- }
+ {
+ renderRiggedGlow(avatarp);
+ }
}
}
else
{
- if ((sShaderLevel >= SHADER_LEVEL_CLOTH))
- {
- LLMatrix4 rot_mat;
- LLViewerCamera::getInstance()->getMatrixToLocal(rot_mat);
- LLMatrix4 cfr(OGL_TO_CFR_ROTATION);
- rot_mat *= cfr;
+ if ((sShaderLevel >= SHADER_LEVEL_CLOTH))
+ {
+ LLMatrix4 rot_mat;
+ LLViewerCamera::getInstance()->getMatrixToLocal(rot_mat);
+ LLMatrix4 cfr(OGL_TO_CFR_ROTATION);
+ rot_mat *= cfr;
- LLVector4 wind;
- wind.setVec(avatarp->mWindVec);
- wind.mV[VW] = 0;
- wind = wind * rot_mat;
- wind.mV[VW] = avatarp->mWindVec.mV[VW];
-
- sVertexProgram->uniform4fv(LLViewerShaderMgr::AVATAR_WIND, 1, wind.mV);
- F32 phase = -1.f * (avatarp->mRipplePhase);
-
- F32 freq = 7.f + (noise1(avatarp->mRipplePhase) * 2.f);
- LLVector4 sin_params(freq, freq, freq, phase);
- sVertexProgram->uniform4fv(LLViewerShaderMgr::AVATAR_SINWAVE, 1, sin_params.mV);
-
- LLVector4 gravity(0.f, 0.f, -CLOTHING_GRAVITY_EFFECT, 0.f);
- gravity = gravity * rot_mat;
- sVertexProgram->uniform4fv(LLViewerShaderMgr::AVATAR_GRAVITY, 1, gravity.mV);
- }
+ LLVector4 wind;
+ wind.setVec(avatarp->mWindVec);
+ wind.mV[VW] = 0;
+ wind = wind * rot_mat;
+ wind.mV[VW] = avatarp->mWindVec.mV[VW];
+
+ sVertexProgram->uniform4fv(LLViewerShaderMgr::AVATAR_WIND, 1, wind.mV);
+ F32 phase = -1.f * (avatarp->mRipplePhase);
+
+ F32 freq = 7.f + (noise1(avatarp->mRipplePhase) * 2.f);
+ LLVector4 sin_params(freq, freq, freq, phase);
+ sVertexProgram->uniform4fv(LLViewerShaderMgr::AVATAR_SINWAVE, 1, sin_params.mV);
+
+ LLVector4 gravity(0.f, 0.f, -CLOTHING_GRAVITY_EFFECT, 0.f);
+ gravity = gravity * rot_mat;
+ sVertexProgram->uniform4fv(LLViewerShaderMgr::AVATAR_GRAVITY, 1, gravity.mV);
+ }
- if( !single_avatar || (avatarp == single_avatar) )
- {
- avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE);
+ if( !single_avatar || (avatarp == single_avatar) )
+ {
+ avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE);
+ }
}
}
-}
void LLDrawPoolAvatar::getRiggedGeometry(LLFace* face, LLPointer<LLVertexBuffer>& buffer, U32 data_mask, const LLMeshSkinInfo* skin, LLVolume* volume, const LLVolumeFace& vol_face)
{