diff options
author | Dave Parks <davep@lindenlab.com> | 2011-11-08 15:28:13 -0600 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2011-11-08 15:28:13 -0600 |
commit | 0d568ce9f0522eaa21a12fa5fae31f80c59bd947 (patch) | |
tree | 6b849a3b48a35feaeff0278ca8e562359df852e2 /indra/newview/lldrawpoolsimple.cpp | |
parent | 28c26cb491305525fb3f24ec2ef3bcb9b1ab8c5f (diff) | |
parent | ef8bdb5d95ebd869279ee4bb0510d54e51ab747f (diff) |
merge
Diffstat (limited to 'indra/newview/lldrawpoolsimple.cpp')
-rw-r--r-- | indra/newview/lldrawpoolsimple.cpp | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp index eec4ee6bac..6e0ea78af2 100644 --- a/indra/newview/lldrawpoolsimple.cpp +++ b/indra/newview/lldrawpoolsimple.cpp @@ -46,7 +46,7 @@ static LLFastTimer::DeclareTimer FTM_RENDER_GRASS_DEFERRED("Deferred Grass"); void LLDrawPoolGlow::beginPostDeferredPass(S32 pass) { - gDeferredFullbrightProgram.bind(); + gDeferredEmissiveProgram.bind(); } static LLFastTimer::DeclareTimer FTM_RENDER_GLOW_PUSH("Glow Push"); @@ -76,10 +76,22 @@ void LLDrawPoolGlow::renderPostDeferred(S32 pass) void LLDrawPoolGlow::endPostDeferredPass(S32 pass) { - gDeferredFullbrightProgram.unbind(); + gDeferredEmissiveProgram.unbind(); LLRenderPass::endRenderPass(pass); } +S32 LLDrawPoolGlow::getNumPasses() +{ + if (LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_OBJECT) > 0) + { + return 1; + } + else + { + return 0; + } +} + void LLDrawPoolGlow::render(S32 pass) { LLFastTimer t(FTM_RENDER_GLOW); @@ -93,39 +105,29 @@ void LLDrawPoolGlow::render(S32 pass) U32 shader_level = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_OBJECT); - if (shader_level > 0 && fullbright_shader) - { - fullbright_shader->bind(); - } - else - { - gPipeline.enableLightsFullbright(LLColor4(1,1,1,1)); - } + //should never get here without basic shaders enabled + llassert(shader_level > 0); + + LLGLSLShader* shader = LLPipeline::sUnderWaterRender ? &gObjectEmissiveWaterProgram : &gObjectEmissiveProgram; + shader->bind(); LLGLDepthTest depth(GL_TRUE, GL_FALSE); gGL.setColorMask(false, true); - if (shader_level > 1) - { - pushBatches(LLRenderPass::PASS_GLOW, getVertexDataMask() | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, TRUE); - } - else - { - renderTexture(LLRenderPass::PASS_GLOW, getVertexDataMask()); - } + pushBatches(LLRenderPass::PASS_GLOW, getVertexDataMask() | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, TRUE); gGL.setColorMask(true, false); gGL.setSceneBlendType(LLRender::BT_ALPHA); if (shader_level > 0 && fullbright_shader) { - fullbright_shader->unbind(); + shader->unbind(); } } void LLDrawPoolGlow::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL batch_textures) { - glColor4ubv(params.mGlowColor.mV); + //gGL.diffuseColor4ubv(params.mGlowColor.mV); LLRenderPass::pushBatch(params, mask, texture, batch_textures); } @@ -253,6 +255,7 @@ void LLDrawPoolGrass::prerender() void LLDrawPoolGrass::beginRenderPass(S32 pass) { LLFastTimer t(FTM_RENDER_GRASS); + stop_glerror(); if (LLPipeline::sUnderWaterRender) { @@ -266,7 +269,7 @@ void LLDrawPoolGrass::beginRenderPass(S32 pass) if (mVertexShaderLevel > 0) { simple_shader->bind(); - simple_shader->setAlphaRange(0.5f, 1.f); + simple_shader->setMinimumAlpha(0.5f); } else { @@ -322,7 +325,7 @@ void LLDrawPoolGrass::renderDeferred(S32 pass) { LLFastTimer t(FTM_RENDER_GRASS_DEFERRED); gDeferredNonIndexedDiffuseAlphaMaskProgram.bind(); - gDeferredNonIndexedDiffuseAlphaMaskProgram.setAlphaRange(0.5f, 1.f); + gDeferredNonIndexedDiffuseAlphaMaskProgram.setMinimumAlpha(0.5f); //render grass LLRenderPass::renderTexture(LLRenderPass::PASS_GRASS, getVertexDataMask()); } |