diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/lldrawpoolalpha.cpp | 36 | ||||
-rw-r--r-- | indra/newview/pipeline.cpp | 15 |
2 files changed, 21 insertions, 30 deletions
diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 71eee0188c..537f6216c2 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -125,6 +125,9 @@ void LLDrawPoolAlpha::beginPostDeferredPass(S32 pass) { simple_shader = &gDeferredAlphaProgram; fullbright_shader = &gObjectFullbrightProgram; + + //prime simple shader (loads shadow relevant uniforms) + gPipeline.bindDeferredShader(*simple_shader); } else { @@ -290,11 +293,6 @@ void LLDrawPoolAlpha::render(S32 pass) gGL.setSceneBlendType(LLRender::BT_ALPHA); } - if (deferred_render && current_shader != NULL) - { - gPipeline.unbindDeferredShader(*current_shader); - } - if (sShowDebugAlpha) { if(gPipeline.canUseWindLightShaders()) @@ -411,29 +409,11 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) if(use_shaders && (current_shader != target_shader)) { llassert(target_shader != NULL); - if (deferred_render && current_shader != NULL) - { - gPipeline.unbindDeferredShader(*current_shader); - diffuse_channel = 0; - } current_shader = target_shader; - if (deferred_render) - { - gPipeline.bindDeferredShader(*current_shader); - diffuse_channel = current_shader->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); - } - else - { - current_shader->bind(); - } + current_shader->bind(); } else if (!use_shaders && current_shader != NULL) { - if (deferred_render) - { - gPipeline.unbindDeferredShader(*current_shader); - diffuse_channel = 0; - } LLGLSLShader::bindNoShader(); current_shader = NULL; } @@ -510,12 +490,8 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) } } - if (deferred_render && current_shader != NULL) - { - gPipeline.unbindDeferredShader(*current_shader); - LLVertexBuffer::unbind(); - } - + LLVertexBuffer::unbind(); + if (!light_enabled) { gPipeline.enableLightsDynamic(); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 1489c033e2..4d678117a5 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -773,14 +773,29 @@ void LLPipeline::updateRenderDeferred() //static void LLPipeline::refreshRenderDeferred() { + static BOOL physics_shapes_is_on = FALSE ; + static BOOL render_glow_copy = FALSE ; + if(gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_PHYSICS_SHAPES)) { + if(!physics_shapes_is_on) + { + physics_shapes_is_on = TRUE ; + render_glow_copy = sRenderGlow ; + } + //turn the deferred rendering and glow off when draw physics shapes. sRenderDeferred = FALSE ; sRenderGlow = FALSE ; } else { + if(physics_shapes_is_on) + { + physics_shapes_is_on = FALSE ; + sRenderGlow = render_glow_copy ; + } + updateRenderDeferred() ; } } |