Fix shadows on basic alpha faces.

This commit is contained in:
Shyotl
2018-08-07 01:53:06 -05:00
parent b1b415e862
commit 0fc962454d
2 changed files with 12 additions and 1 deletions

View File

@@ -457,7 +457,7 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass)
{
if(current_shader)
gPipeline.unbindDeferredShader(*current_shader);
target_shader->bind();
gPipeline.bindDeferredShader(*target_shader);
}
}
current_shader = target_shader;

View File

@@ -7408,6 +7408,11 @@ static LLTrace::BlockTimerStatHandle FTM_BIND_DEFERRED("Bind Deferred");
void LLPipeline::bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* diffuse_source, LLRenderTarget* light_source)
{
if (shader.mShaderClass != LLViewerShaderMgr::SHADER_DEFERRED && shader.mShaderClass != LLViewerShaderMgr::SHADER_INTERFACE)
{
shader.bind();
return;
}
LL_RECORD_BLOCK_TIME(FTM_BIND_DEFERRED);
static const LLCachedControl<F32> RenderDeferredSunWash("RenderDeferredSunWash",.5f);
@@ -8886,6 +8891,12 @@ void LLPipeline::setupSpotLight(LLGLSLShader& shader, LLDrawable* drawablep)
void LLPipeline::unbindDeferredShader(LLGLSLShader &shader, LLRenderTarget* diffuse_source, LLRenderTarget* light_source)
{
if (shader.mShaderClass != LLViewerShaderMgr::SHADER_DEFERRED && shader.mShaderClass != LLViewerShaderMgr::SHADER_INTERFACE)
{
shader.unbind();
return;
}
diffuse_source = diffuse_source ? diffuse_source : &mDeferredScreen;
light_source = light_source ? light_source : &mDeferredLight;