diff options
Diffstat (limited to 'indra/newview/pipeline.cpp')
-rw-r--r-- | indra/newview/pipeline.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index bc0d89f4ad..e142a40f1d 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -361,10 +361,12 @@ static LLCullResult* sCull = NULL; void validate_framebuffer_object(); - -bool addDeferredAttachments(LLRenderTarget& target) +// Add color attachments for deferred rendering +// target -- RenderTarget to add attachments to +// for_impostor -- whether or not these render targets are for an impostor (if true, avoids implicit sRGB conversions) +bool addDeferredAttachments(LLRenderTarget& target, bool for_impostor = false) { - return target.addColorAttachment(GL_SRGB8_ALPHA8) && //specular + return target.addColorAttachment(for_impostor ? GL_RGBA : GL_SRGB8_ALPHA8) && //specular target.addColorAttachment(GL_RGB10_A2); //normal+z } @@ -10996,14 +10998,11 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar, bool preview_avatar) if (!avatar->mImpostor.isComplete()) { + avatar->mImpostor.allocate(resX, resY, GL_RGBA, TRUE, FALSE); + if (LLPipeline::sRenderDeferred) { - avatar->mImpostor.allocate(resX,resY,GL_SRGB8_ALPHA8,TRUE,FALSE); - addDeferredAttachments(avatar->mImpostor); - } - else - { - avatar->mImpostor.allocate(resX,resY,GL_RGBA,TRUE,FALSE); + addDeferredAttachments(avatar->mImpostor, true); } gGL.getTexUnit(0)->bind(&avatar->mImpostor); |