diff options
Diffstat (limited to 'indra/newview/lldrawpoolalpha.cpp')
-rw-r--r-- | indra/newview/lldrawpoolalpha.cpp | 80 |
1 files changed, 39 insertions, 41 deletions
diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 0873300cd2..b896ecde30 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -69,7 +69,7 @@ LLDrawPoolAlpha::~LLDrawPoolAlpha() void LLDrawPoolAlpha::prerender() { - mVertexShaderLevel = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_OBJECT); + mShaderLevel = LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_OBJECT); } S32 LLDrawPoolAlpha::getNumPostDeferredPasses() @@ -90,7 +90,7 @@ S32 LLDrawPoolAlpha::getNumPostDeferredPasses() void LLDrawPoolAlpha::beginPostDeferredPass(S32 pass) { - LL_RECORD_BLOCK_TIME(FTM_RENDER_ALPHA); + LL_RECORD_BLOCK_TIME(FTM_RENDER_ALPHA_DEFERRED); if (pass == 0) { @@ -115,12 +115,14 @@ void LLDrawPoolAlpha::beginPostDeferredPass(S32 pass) fullbright_shader->bind(); fullbright_shader->uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f); fullbright_shader->uniform1f(LLShaderMgr::DISPLAY_GAMMA, (gamma > 0.1f) ? 1.0f / gamma : (1.0f/2.2f)); - fullbright_shader->unbind(); + fullbright_shader->uniform1i(LLShaderMgr::NO_ATMO, LLPipeline::sRenderingHUDs ? 1 : 0); + fullbright_shader->setMinimumAlpha(LLPipeline::sImpostorRender ? 0.5f : 0.0f); + fullbright_shader->unbind(); //prime simple shader (loads shadow relevant uniforms) gPipeline.bindDeferredShader(*simple_shader); - - simple_shader->uniform1f(LLShaderMgr::DISPLAY_GAMMA, (gamma > 0.1f) ? 1.0f / gamma : (1.0f/2.2f)); + simple_shader->uniform1f(LLShaderMgr::DISPLAY_GAMMA, (gamma > 0.1f) ? 1.0f / gamma : (1.0f/2.2f)); + simple_shader->setMinimumAlpha(LLPipeline::sImpostorRender ? 0.5f : 0.0f); } else if (!LLPipeline::sImpostorRender) { @@ -152,7 +154,7 @@ void LLDrawPoolAlpha::beginPostDeferredPass(S32 pass) } deferred_render = TRUE; - if (mVertexShaderLevel > 0) + if (mShaderLevel > 0) { // Start out with no shaders. current_shader = target_shader = NULL; @@ -162,6 +164,8 @@ void LLDrawPoolAlpha::beginPostDeferredPass(S32 pass) void LLDrawPoolAlpha::endPostDeferredPass(S32 pass) { + LL_RECORD_BLOCK_TIME(FTM_RENDER_ALPHA_DEFERRED); + if (pass == 1 && !LLPipeline::sImpostorRender) { gPipeline.mDeferredDepth.flush(); @@ -175,6 +179,7 @@ void LLDrawPoolAlpha::endPostDeferredPass(S32 pass) void LLDrawPoolAlpha::renderPostDeferred(S32 pass) { + LL_RECORD_BLOCK_TIME(FTM_RENDER_ALPHA_DEFERRED); render(pass); } @@ -187,6 +192,18 @@ void LLDrawPoolAlpha::beginRenderPass(S32 pass) simple_shader = &gObjectSimpleImpostorProgram; fullbright_shader = &gObjectFullbrightProgram; emissive_shader = &gObjectEmissiveProgram; + + if (mShaderLevel > 0) + { + fullbright_shader->bind(); + fullbright_shader->setMinimumAlpha(0.5f); + simple_shader->bind(); + simple_shader->setMinimumAlpha(0.5f); + } + else + { + gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f); //OK + } } else if (LLPipeline::sUnderWaterRender) { @@ -201,12 +218,20 @@ void LLDrawPoolAlpha::beginRenderPass(S32 pass) emissive_shader = &gObjectEmissiveProgram; } - if (mVertexShaderLevel > 0) + if (!LLPipeline::sImpostorRender) { - // Start out with no shaders. - current_shader = target_shader = NULL; - LLGLSLShader::bindNoShader(); - } + if (mShaderLevel > 0) + { + fullbright_shader->bind(); + fullbright_shader->setMinimumAlpha(0.f); + simple_shader->bind(); + simple_shader->setMinimumAlpha(0.f); + } + else + { + gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); //OK + } + } gPipeline.enableLightsDynamic(); } @@ -256,37 +281,10 @@ void LLDrawPoolAlpha::render(S32 pass) mAlphaDFactor = LLRender::BF_ONE_MINUS_SOURCE_ALPHA; // } gGL.blendFunc(mColorSFactor, mColorDFactor, mAlphaSFactor, mAlphaDFactor); - if (mVertexShaderLevel > 0) - { - if (LLPipeline::sImpostorRender) - { - fullbright_shader->bind(); - fullbright_shader->setMinimumAlpha(0.5f); - simple_shader->bind(); - simple_shader->setMinimumAlpha(0.5f); - } - else - { - fullbright_shader->bind(); - fullbright_shader->setMinimumAlpha(0.f); - simple_shader->bind(); - simple_shader->setMinimumAlpha(0.f); - } - } - else - { - if (LLPipeline::sImpostorRender) - { - gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f); //OK - } - else - { - gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); //OK - } - } + } - if (mVertexShaderLevel > 0) + if (mShaderLevel > 0) { renderAlpha(getVertexDataMask() | LLVertexBuffer::MAP_TEXTURE_INDEX | LLVertexBuffer::MAP_TANGENT | LLVertexBuffer::MAP_TEXCOORD1 | LLVertexBuffer::MAP_TEXCOORD2, pass); } @@ -392,7 +390,7 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass) bool is_particle_or_hud_particle = group->getSpatialPartition()->mPartitionType == LLViewerRegion::PARTITION_PARTICLE || group->getSpatialPartition()->mPartitionType == LLViewerRegion::PARTITION_HUD_PARTICLE; - bool draw_glow_for_this_partition = mVertexShaderLevel > 0; // no shaders = no glow. + bool draw_glow_for_this_partition = mShaderLevel > 0; // no shaders = no glow. LL_RECORD_BLOCK_TIME(FTM_RENDER_ALPHA_GROUP_LOOP); |