From 8e54ae95d1417f51edd6c68c389fd6cd7322ca52 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 20 Mar 2013 15:25:14 -0700 Subject: Prototype code for "simple imposter" mode rendering of avatars. Reviewed by Kelly --- indra/newview/lldrawpoolavatar.cpp | 135 ++++++++++++++++++------------------- 1 file changed, 66 insertions(+), 69 deletions(-) (limited to 'indra/newview/lldrawpoolavatar.cpp') 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& buffer, U32 data_mask, const LLMeshSkinInfo* skin, LLVolume* volume, const LLVolumeFace& vol_face) { -- cgit v1.2.3