summaryrefslogtreecommitdiff
path: root/indra/newview/pipeline.cpp
diff options
context:
space:
mode:
authorJonathan "Geenz" Goodman <geenz@geenzo.com>2023-03-13 08:05:33 -0700
committerJonathan "Geenz" Goodman <geenz@geenzo.com>2023-03-13 08:05:33 -0700
commitf3ce17701e8dbbbc7a0e8e73c740b161bb2f36c0 (patch)
tree634ed8a7f1f6766be48e90c889d6714d1bb6c4b4 /indra/newview/pipeline.cpp
parent0982c44b46bfcbbf0d9a7a9a93605112fd1a4bd4 (diff)
Make sure the glow combine only happens in the gamma correct shader.
Diffstat (limited to 'indra/newview/pipeline.cpp')
-rw-r--r--indra/newview/pipeline.cpp25
1 files changed, 11 insertions, 14 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index b5b5d9ef7f..466a5d2995 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -7489,6 +7489,12 @@ void LLPipeline::renderFinalize()
screenTarget()->bindTexture(0, channel, LLTexUnit::TFO_POINT);
}
+ channel = gDeferredPostGammaCorrectProgram.enableTexture(LLShaderMgr::DEFERRED_EMISSIVE, screenTarget()->getUsage());
+ if (channel > -1)
+ {
+ mGlow[1].bindTexture(0, channel, LLTexUnit::TFO_BILINEAR);
+ }
+
gDeferredPostGammaCorrectProgram.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, screenTarget()->getWidth(), screenTarget()->getHeight());
static LLCachedControl<F32> exposure(gSavedSettings, "RenderExposure", 1.f);
@@ -7516,8 +7522,8 @@ void LLPipeline::renderFinalize()
bool multisample = RenderFSAASamples > 1 && mRT->fxaaBuffer.isComplete();
LLGLSLShader* shader = &gGlowCombineProgram;
- S32 width = mRT->screen.getWidth();
- S32 height = mRT->screen.getHeight();
+ S32 width = screenTarget()->getWidth();
+ S32 height = screenTarget()->getHeight();
S32 channel = -1;
@@ -7535,10 +7541,10 @@ void LLPipeline::renderFinalize()
shader->bind();
shader->uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, width, height);
- channel = shader->enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mRT->deferredLight.getUsage());
+ channel = shader->enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, screenTarget()->getUsage());
if (channel > -1)
{
- mRT->deferredLight.bindTexture(0, channel);
+ screenTarget()->bindTexture(0, channel);
}
{
@@ -7549,7 +7555,7 @@ void LLPipeline::renderFinalize()
gGL.flush();
- shader->disableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mRT->deferredLight.getUsage());
+ shader->disableTexture(LLShaderMgr::DEFERRED_DIFFUSE, screenTarget()->getUsage());
shader->unbind();
mRT->fxaaBuffer.flush();
@@ -7601,11 +7607,9 @@ void LLPipeline::renderFinalize()
shader->bind();
- S32 glow_channel = shader->getTextureChannel(LLShaderMgr::DEFERRED_EMISSIVE);
S32 screen_channel = shader->getTextureChannel(LLShaderMgr::DEFERRED_DIFFUSE);
S32 depth_channel = shader->getTextureChannel(LLShaderMgr::DEFERRED_DEPTH);
- gGL.getTexUnit(glow_channel)->bind(&mGlow[1]);
gGL.getTexUnit(screen_channel)->bind(screenTarget());
gGL.getTexUnit(depth_channel)->bind(&mRT->deferredScreen, true);
@@ -7622,7 +7626,6 @@ void LLPipeline::renderFinalize()
shader->unbind();
}
}
-
gGL.setSceneBlendType(LLRender::BT_ALPHA);
@@ -7779,12 +7782,6 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* light_
}
}
- channel = shader.enableTexture(LLShaderMgr::DEFERRED_BLOOM);
- if (channel > -1)
- {
- mGlow[1].bindTexture(0, channel);
- }
-
stop_glerror();
bindShadowMaps(shader);