diff options
author | Graham Linden <graham@lindenlab.com> | 2013-08-06 14:16:46 -0700 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2013-08-06 14:16:46 -0700 |
commit | 5b400d50e1f25667e2c865d85fd93546ffe7f96f (patch) | |
tree | f495ec82be8072b47885e0b90d42bcd3a226bd7c /indra/newview/pipeline.cpp | |
parent | 629bda7cf371f2eb2e7fc9adbfd123d5a079093e (diff) |
NORSPEC-322 NORSPEC-342 fix issues with black impostors and missing alpha attachments on impostors
Diffstat (limited to 'indra/newview/pipeline.cpp')
-rwxr-xr-x | indra/newview/pipeline.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 9aa375767b..29b7e30655 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -11358,15 +11358,18 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) if (!avatar->mImpostor.isComplete()) { LLFastTimer t(FTM_IMPOSTOR_ALLOCATE); - avatar->mImpostor.allocate(resX,resY,GL_RGBA,TRUE,FALSE); + -#if DEFERRED_IMPOSTORS if (LLPipeline::sRenderDeferred) { + avatar->mImpostor.allocate(resX,resY,GL_SRGB8_ALPHA8,TRUE,FALSE); addDeferredAttachments(avatar->mImpostor); } -#endif - + else + { + avatar->mImpostor.allocate(resX,resY,GL_RGBA,TRUE,FALSE); + } + gGL.getTexUnit(0)->bind(&avatar->mImpostor); gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); @@ -11374,38 +11377,34 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) else if(resX != avatar->mImpostor.getWidth() || resY != avatar->mImpostor.getHeight()) { LLFastTimer t(FTM_IMPOSTOR_RESIZE); - avatar->mImpostor.resize(resX,resY,GL_RGBA); + avatar->mImpostor.resize(resX,resY,LLPipeline::sRenderDeferred ? GL_SRGB8_ALPHA8 : GL_RGBA); } avatar->mImpostor.bindTarget(); } -#if DEFERRED_IMPOSTORS if (LLPipeline::sRenderDeferred) { - avatar->mImpostor.clear(); + avatar->mImpostor.clear(); renderGeomDeferred(camera); renderGeomPostDeferred(camera); } else -#endif { LLGLEnable scissor(GL_SCISSOR_TEST); 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); |