summaryrefslogtreecommitdiff
path: root/indra/newview/pipeline.cpp
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2019-04-02 18:06:37 +0000
committerRider Linden <rider@lindenlab.com>2019-04-02 18:06:37 +0000
commitd7b47bf71f84e4d7311a532b4bfa4a3795f19ab9 (patch)
tree7bbe7116f4a6e53127286d8cb8dcf090f64915b2 /indra/newview/pipeline.cpp
parent1199d139810f49de6052ceb90b4359042eb9a639 (diff)
parent3a42d2b94a0f2d27b4baef63abaf49e64139ff01 (diff)
Merged in Geenz/viewer-eep (pull request #321)
[WIP] Use EXT_texture_sRGB_decode in order to selectively sample textures consumed by the deferred renderer as sRGB Approved-by: Graham Madarasz <graham@lindenlab.com>
Diffstat (limited to 'indra/newview/pipeline.cpp')
-rw-r--r--indra/newview/pipeline.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index f84cd594c9..313edca345 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -8145,6 +8145,7 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* light_
{
deferred_target->bindTexture(0,channel);
gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_POINT);
+ gGL.getTexUnit(channel)->setTextureColorSpace(LLTexUnit::TCS_SRGB);
}
channel = shader.enableTexture(LLShaderMgr::DEFERRED_SPECULAR, deferred_target->getUsage());
@@ -8152,6 +8153,7 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* light_
{
deferred_target->bindTexture(1, channel);
gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_POINT);
+ gGL.getTexUnit(channel)->setTextureColorSpace(LLTexUnit::TCS_SRGB);
}
channel = shader.enableTexture(LLShaderMgr::DEFERRED_NORMAL, deferred_target->getUsage());
@@ -8159,6 +8161,7 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* light_
{
deferred_target->bindTexture(2, channel);
gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_POINT);
+ gGL.getTexUnit(channel)->setTextureColorSpace(LLTexUnit::TCS_LINEAR);
}
channel = shader.enableTexture(LLShaderMgr::DEFERRED_DEPTH, deferred_depth_target->getUsage());
@@ -8281,7 +8284,7 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* light_
stop_glerror();
- channel = shader.enableTexture(LLShaderMgr::ENVIRONMENT_MAP, LLTexUnit::TT_CUBE_MAP);
+ channel = shader.enableTexture(LLShaderMgr::ENVIRONMENT_MAP, LLTexUnit::TT_CUBE_MAP, LLTexUnit::TCS_SRGB);
if (channel > -1)
{
LLCubeMap* cube_map = gSky.mVOSkyp ? gSky.mVOSkyp->getCubeMap() : NULL;
@@ -8779,7 +8782,7 @@ void LLPipeline::renderDeferredLighting(LLRenderTarget* screen_target)
mCubeVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
- gDeferredSpotLightProgram.enableTexture(LLShaderMgr::DEFERRED_PROJECTION);
+ gDeferredSpotLightProgram.enableTexture(LLShaderMgr::DEFERRED_PROJECTION, LLTexUnit::TT_TEXTURE, LLTexUnit::TCS_SRGB);
for (LLDrawable::drawable_list_t::iterator iter = spot_lights.begin(); iter != spot_lights.end(); ++iter)
{
@@ -8807,7 +8810,7 @@ void LLPipeline::renderDeferredLighting(LLRenderTarget* screen_target)
mCubeVB->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, get_box_fan_indices(camera, center));
}
- gDeferredSpotLightProgram.disableTexture(LLShaderMgr::DEFERRED_PROJECTION);
+ gDeferredSpotLightProgram.disableTexture(LLShaderMgr::DEFERRED_PROJECTION, LLTexUnit::TT_TEXTURE, LLTexUnit::TCS_SRGB);
unbindDeferredShader(gDeferredSpotLightProgram);
}
@@ -8863,7 +8866,7 @@ void LLPipeline::renderDeferredLighting(LLRenderTarget* screen_target)
bindDeferredShader(gDeferredMultiSpotLightProgram);
- gDeferredMultiSpotLightProgram.enableTexture(LLShaderMgr::DEFERRED_PROJECTION);
+ gDeferredMultiSpotLightProgram.enableTexture(LLShaderMgr::DEFERRED_PROJECTION, LLTexUnit::TT_TEXTURE, LLTexUnit::TCS_SRGB);
mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
@@ -8894,7 +8897,7 @@ void LLPipeline::renderDeferredLighting(LLRenderTarget* screen_target)
mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3);
}
- gDeferredMultiSpotLightProgram.disableTexture(LLShaderMgr::DEFERRED_PROJECTION);
+ gDeferredMultiSpotLightProgram.disableTexture(LLShaderMgr::DEFERRED_PROJECTION, LLTexUnit::TT_TEXTURE, LLTexUnit::TCS_SRGB);
unbindDeferredShader(gDeferredMultiSpotLightProgram);
gGL.popMatrix();
@@ -9139,7 +9142,7 @@ void LLPipeline::setupSpotLight(LLGLSLShader& shader, LLDrawable* drawablep)
img = LLViewerFetchedTexture::sWhiteImagep;
}
- S32 channel = shader.enableTexture(LLShaderMgr::DEFERRED_PROJECTION);
+ S32 channel = shader.enableTexture(LLShaderMgr::DEFERRED_PROJECTION, LLTexUnit::TT_TEXTURE, LLTexUnit::TCS_SRGB);
if (channel > -1)
{
@@ -9191,7 +9194,7 @@ void LLPipeline::unbindDeferredShader(LLGLSLShader &shader)
shader.disableTexture(LLShaderMgr::DEFERRED_NOISE);
shader.disableTexture(LLShaderMgr::DEFERRED_LIGHTFUNC);
- S32 channel = shader.disableTexture(LLShaderMgr::ENVIRONMENT_MAP, LLTexUnit::TT_CUBE_MAP);
+ S32 channel = shader.disableTexture(LLShaderMgr::ENVIRONMENT_MAP, LLTexUnit::TT_CUBE_MAP, LLTexUnit::TCS_SRGB);
if (channel > -1)
{
LLCubeMap* cube_map = gSky.mVOSkyp ? gSky.mVOSkyp->getCubeMap() : NULL;