summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2013-07-15 17:38:38 -0700
committerGraham Linden <graham@lindenlab.com>2013-07-15 17:38:38 -0700
commit749eef31fa7b33438e1e110faf584512d75338a4 (patch)
treeb46760b359b6c2d3bd4ac634d988b4079bf350c6 /indra/newview
parenta540ae81c42f1c7be87bda73d060b7ba8eaa0654 (diff)
NORSPEC-265 WIP imposters work in non-deferred and ALM but are forward-only render
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/lldrawpoolavatar.cpp8
-rwxr-xr-xindra/newview/pipeline.cpp20
2 files changed, 20 insertions, 8 deletions
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index 59c9cf5a83..87e9071c4d 100755
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -681,12 +681,16 @@ void LLDrawPoolAvatar::beginDeferredImpostor()
LLVOAvatar::sNumVisibleAvatars = 0;
}
+#if DEFERRED_IMPOSTORS
sVertexProgram = &gDeferredImpostorProgram;
specular_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::SPECULAR_MAP);
normal_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::DEFERRED_NORMAL);
sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
-
+#else
+ sVertexProgram = &gImpostorProgram;
+ sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
+#endif
sVertexProgram->bind();
sVertexProgram->setMinimumAlpha(0.01f);
}
@@ -1248,6 +1252,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
if (impostor)
{
+#if DEFERRED_IMPOSTORS
if (LLPipeline::sRenderDeferred && !LLPipeline::sReflectionRender && avatarp->mImpostor.isComplete())
{
if (normal_channel > -1)
@@ -1259,6 +1264,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
avatarp->mImpostor.bindTexture(1, specular_channel);
}
}
+#endif
avatarp->renderImpostor(LLColor4U(255,255,255,255), sDiffuseChannel);
}
return;
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index ad082b5c74..fc79f1c31f 100755
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -11254,7 +11254,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
S32 occlusion = sUseOcclusion;
sUseOcclusion = 0;
- sReflectionRender = sRenderDeferred ? FALSE : TRUE;
+ //sReflectionRender = sRenderDeferred ? FALSE : TRUE;
sShadowRender = TRUE;
sImpostorRender = TRUE;
@@ -11351,25 +11351,27 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
LLFastTimer t(FTM_IMPOSTOR_ALLOCATE);
avatar->mImpostor.allocate(resX,resY,GL_RGBA,TRUE,FALSE);
+#if DEFERRED_IMPOSTORS
if (LLPipeline::sRenderDeferred)
{
addDeferredAttachments(avatar->mImpostor);
}
-
+#endif
+
gGL.getTexUnit(0)->bind(&avatar->mImpostor);
gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT);
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
}
- else if(resX != avatar->mImpostor.getWidth() ||
- resY != avatar->mImpostor.getHeight())
+ else if(resX != avatar->mImpostor.getWidth() || resY != avatar->mImpostor.getHeight())
{
LLFastTimer t(FTM_IMPOSTOR_RESIZE);
avatar->mImpostor.resize(resX,resY,GL_RGBA);
}
- avatar->mImpostor.bindTarget();
+ avatar->mImpostor.bindTarget();
}
+#if DEFERRED_IMPOSTORS
if (LLPipeline::sRenderDeferred)
{
avatar->mImpostor.clear();
@@ -11377,20 +11379,24 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
renderGeomPostDeferred(camera);
}
else
- {
+#endif
+ {
LLGLEnable scissor(GL_SCISSOR_TEST);
- glScissor(0, 0, resX, resY);
+ glScissor(0, 0, resX, resY);
avatar->mImpostor.clear();
renderGeom(camera);
}
{ //create alpha mask based on depth buffer (grey out if muted)
LLFastTimer t(FTM_IMPOSTOR_BACKGROUND);
+
+#if DEFERRED_IMPOSTORS
if (LLPipeline::sRenderDeferred)
{
GLuint buff = GL_COLOR_ATTACHMENT0;
glDrawBuffersARB(1, &buff);
}
+#endif
LLGLDisable blend(GL_BLEND);