summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpoolavatar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lldrawpoolavatar.cpp')
-rw-r--r--indra/newview/lldrawpoolavatar.cpp31
1 files changed, 16 insertions, 15 deletions
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index 60844ae8ca..2d0859650a 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -123,7 +123,7 @@ void LLDrawPoolAvatar::prerender()
if (sShaderLevel > 0)
{
- sBufferUsage = GL_DYNAMIC_DRAW_ARB;
+ sBufferUsage = GL_STATIC_DRAW_ARB;
}
else
{
@@ -157,8 +157,6 @@ void LLDrawPoolAvatar::beginDeferredPass(S32 pass)
{
LLFastTimer t(FTM_RENDER_CHARACTERS);
- sSkipTransparent = TRUE;
-
if (LLPipeline::sImpostorRender)
{
beginDeferredSkinned();
@@ -183,8 +181,6 @@ void LLDrawPoolAvatar::endDeferredPass(S32 pass)
{
LLFastTimer t(FTM_RENDER_CHARACTERS);
- sSkipTransparent = FALSE;
-
if (LLPipeline::sImpostorRender)
{
endDeferredSkinned();
@@ -254,6 +250,7 @@ S32 LLDrawPoolAvatar::getNumShadowPasses()
void LLDrawPoolAvatar::beginShadowPass(S32 pass)
{
LLFastTimer t(FTM_SHADOW_AVATAR);
+
sVertexProgram = &gDeferredAvatarShadowProgram;
if (sShaderLevel > 0)
{
@@ -275,6 +272,7 @@ void LLDrawPoolAvatar::beginShadowPass(S32 pass)
void LLDrawPoolAvatar::endShadowPass(S32 pass)
{
LLFastTimer t(FTM_SHADOW_AVATAR);
+
if (sShaderLevel > 0)
{
sRenderingSkinned = FALSE;
@@ -312,11 +310,6 @@ void LLDrawPoolAvatar::renderShadow(S32 pass)
return;
}
- if (sShaderLevel > 0)
- {
- gAvatarMatrixParam = sVertexProgram->mUniform[LLViewerShaderMgr::AVATAR_MATRIX];
- }
-
avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE);
}
@@ -353,7 +346,7 @@ void LLDrawPoolAvatar::beginRenderPass(S32 pass)
switch (pass)
{
case 0:
- beginImpostor();
+ beginFootShadow();
break;
case 1:
beginRigid();
@@ -377,7 +370,7 @@ void LLDrawPoolAvatar::endRenderPass(S32 pass)
switch (pass)
{
case 0:
- endImpostor();
+ endFootShadow();
break;
case 1:
endRigid();
@@ -387,7 +380,7 @@ void LLDrawPoolAvatar::endRenderPass(S32 pass)
}
}
-void LLDrawPoolAvatar::beginImpostor()
+void LLDrawPoolAvatar::beginFootShadow()
{
if (!LLPipeline::sReflectionRender)
{
@@ -399,7 +392,7 @@ void LLDrawPoolAvatar::beginImpostor()
diffuse_channel = 0;
}
-void LLDrawPoolAvatar::endImpostor()
+void LLDrawPoolAvatar::endFootShadow()
{
gPipeline.enableLightsDynamic();
}
@@ -571,6 +564,7 @@ void LLDrawPoolAvatar::endSkinned()
void LLDrawPoolAvatar::beginDeferredSkinned()
{
+ sSkipTransparent = TRUE;
sShaderLevel = mVertexShaderLevel;
sVertexProgram = &gDeferredAvatarProgram;
@@ -585,6 +579,7 @@ void LLDrawPoolAvatar::beginDeferredSkinned()
void LLDrawPoolAvatar::endDeferredSkinned()
{
+ sSkipTransparent = FALSE;
// if we're in software-blending, remember to set the fence _after_ we draw so we wait till this rendering is done
sRenderingSkinned = FALSE;
disable_vertex_weighting(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT]);
@@ -698,6 +693,10 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
}
avatarp->renderImpostor(LLColor4U(255,255,255,255), diffuse_channel);
}
+ else if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_FOOT_SHADOWS) && !LLPipeline::sRenderDeferred)
+ {
+ avatarp->renderFootShadows();
+ }
return;
}
@@ -851,7 +850,9 @@ LLColor3 LLDrawPoolAvatar::getDebugColor() const
LLVertexBufferAvatar::LLVertexBufferAvatar()
: LLVertexBuffer(sDataMask,
- GL_STREAM_DRAW_ARB) //avatars are always stream draw due to morph targets
+ LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_AVATAR) > 0 ?
+ GL_DYNAMIC_DRAW_ARB :
+ GL_STREAM_DRAW_ARB)
{
}