diff options
author | Leslie Linden <leslie@lindenlab.com> | 2011-09-07 13:58:19 -0700 |
---|---|---|
committer | Leslie Linden <leslie@lindenlab.com> | 2011-09-07 13:58:19 -0700 |
commit | 78821c51a1f7d5fcc6e4a2678bfd3446ccfaee36 (patch) | |
tree | 51da53114f257ca57c2aa36da655019b75cf0269 /indra/newview/lldrawpooltree.cpp | |
parent | c64bd7d5cb28fc221716e866ff9c9a28c22e69ce (diff) | |
parent | fef401a1768bae9bfb23a13549fa3a5005f2c7ae (diff) |
Merge from viewer-experience
Diffstat (limited to 'indra/newview/lldrawpooltree.cpp')
-rw-r--r-- | indra/newview/lldrawpooltree.cpp | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp index 429e06b227..a6e0151114 100644 --- a/indra/newview/lldrawpooltree.cpp +++ b/indra/newview/lldrawpooltree.cpp @@ -62,24 +62,25 @@ void LLDrawPoolTree::prerender() void LLDrawPoolTree::beginRenderPass(S32 pass) { LLFastTimer t(FTM_RENDER_TREES); - gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f); - + if (LLPipeline::sUnderWaterRender) { - shader = &gObjectSimpleNonIndexedWaterProgram; + shader = &gObjectAlphaMaskNonIndexedWaterProgram; } else { - shader = &gObjectSimpleNonIndexedProgram; + shader = &gObjectAlphaMaskNonIndexedProgram; } if (gPipeline.canUseVertexShaders()) { shader->bind(); + shader->setAlphaRange(0.5f, 1.f); } else { gPipeline.enableLightsDynamic(); + gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f); } } @@ -92,7 +93,7 @@ void LLDrawPoolTree::render(S32 pass) return; } - LLGLEnable test(GL_ALPHA_TEST); + LLGLState test(GL_ALPHA_TEST, LLGLSLShader::sNoFixedFunction ? 0 : 1); LLOverrideFaceColor color(this, 1.f, 1.f, 1.f, 1.f); if (gSavedSettings.getBOOL("RenderAnimateTrees")) @@ -121,12 +122,16 @@ void LLDrawPoolTree::render(S32 pass) void LLDrawPoolTree::endRenderPass(S32 pass) { LLFastTimer t(FTM_RENDER_TREES); - gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); - + if (gPipeline.canUseWindLightShadersOnObjects()) { shader->unbind(); } + + if (mVertexShaderLevel <= 0) + { + gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); + } } //============================================ @@ -135,10 +140,10 @@ void LLDrawPoolTree::endRenderPass(S32 pass) void LLDrawPoolTree::beginDeferredPass(S32 pass) { LLFastTimer t(FTM_RENDER_TREES); - gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.f); - shader = &gDeferredTreeProgram; + shader = &gDeferredNonIndexedDiffuseAlphaMaskProgram; shader->bind(); + shader->setAlphaRange(0.5f, 1.f); } void LLDrawPoolTree::renderDeferred(S32 pass) @@ -149,8 +154,7 @@ void LLDrawPoolTree::renderDeferred(S32 pass) void LLDrawPoolTree::endDeferredPass(S32 pass) { LLFastTimer t(FTM_RENDER_TREES); - gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); - + shader->unbind(); } @@ -160,11 +164,12 @@ void LLDrawPoolTree::endDeferredPass(S32 pass) void LLDrawPoolTree::beginShadowPass(S32 pass) { LLFastTimer t(FTM_SHADOW_TREE); - gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f); + glPolygonOffset(gSavedSettings.getF32("RenderDeferredTreeShadowOffset"), gSavedSettings.getF32("RenderDeferredTreeShadowBias")); - gDeferredShadowProgram.bind(); + gDeferredShadowAlphaMaskProgram.bind(); + gDeferredShadowAlphaMaskProgram.setAlphaRange(0.5f, 1.f); } void LLDrawPoolTree::renderShadow(S32 pass) @@ -175,12 +180,9 @@ void LLDrawPoolTree::renderShadow(S32 pass) void LLDrawPoolTree::endShadowPass(S32 pass) { LLFastTimer t(FTM_SHADOW_TREE); - gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); - + glPolygonOffset(gSavedSettings.getF32("RenderDeferredSpotShadowOffset"), gSavedSettings.getF32("RenderDeferredSpotShadowBias")); - - //gDeferredShadowProgram.unbind(); } |