diff options
| author | Dave Parks <davep@lindenlab.com> | 2011-07-18 12:22:54 -0500 | 
|---|---|---|
| committer | Dave Parks <davep@lindenlab.com> | 2011-07-18 12:22:54 -0500 | 
| commit | 2eaadf902406fbdf6feb5e3e39a9f07f3369fc17 (patch) | |
| tree | d44b4a0a1c343e65079c2b845a495f02f2992547 /indra/newview | |
| parent | 190ff3c346ae8f86b4533fd03f7a0dcb0808dde3 (diff) | |
SH-2031 Fix for shadow render targets using inappropriate shader for occlusion culling resulting in objects popping in and out of the shadow map.
Diffstat (limited to 'indra/newview')
| -rw-r--r-- | indra/newview/pipeline.cpp | 24 | 
1 files changed, 20 insertions, 4 deletions
| diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 8372c2430b..bd801ae4c2 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -2147,9 +2147,18 @@ void LLPipeline::doOcclusion(LLCamera& camera)  		LLGLDisable cull(GL_CULL_FACE); -		if (canUseVertexShaders()) +		 +		bool bind_shader = LLGLSLShader::sNoFixedFunction && LLGLSLShader::sCurBoundShader == 0; +		if (bind_shader)  		{ -			gOcclusionProgram.bind(); +			if (LLPipeline::sShadowRender) +			{ +				gDeferredShadowProgram.bind(); +			} +			else +			{ +				gOcclusionProgram.bind(); +			}  		}  		for (LLCullResult::sg_list_t::iterator iter = sCull->beginOcclusionGroups(); iter != sCull->endOcclusionGroups(); ++iter) @@ -2159,9 +2168,16 @@ void LLPipeline::doOcclusion(LLCamera& camera)  			group->clearOcclusionState(LLSpatialGroup::ACTIVE_OCCLUSION);  		} -		if (canUseVertexShaders()) +		if (bind_shader)  		{ -			gOcclusionProgram.unbind(); +			if (LLPipeline::sShadowRender) +			{ +				gDeferredShadowProgram.unbind(); +			} +			else +			{ +				gOcclusionProgram.unbind(); +			}  		}  		gGL.setColorMask(true, false); | 
