diff --git a/libraries/render-utils/src/ToneMapAndResampleTask.cpp b/libraries/render-utils/src/ToneMapAndResampleTask.cpp index 5f3e643a69..b6079ef0a7 100644 --- a/libraries/render-utils/src/ToneMapAndResampleTask.cpp +++ b/libraries/render-utils/src/ToneMapAndResampleTask.cpp @@ -33,7 +33,6 @@ void ToneMapAndResample::init(RenderArgs* args) { // shared_ptr to gpu::State gpu::StatePointer blitState = gpu::StatePointer(new gpu::State()); - // TODO why was this in the upsample task blitState->setDepthTest(gpu::State::DepthTest(false, false)); blitState->setColorWriteMask(true, true, true, true); diff --git a/libraries/render-utils/src/render-utils/toneMappingMirroredX.slp b/libraries/render-utils/src/render-utils/toneMappingMirroredX.slp deleted file mode 100644 index d4d8ec4b01..0000000000 --- a/libraries/render-utils/src/render-utils/toneMappingMirroredX.slp +++ /dev/null @@ -1 +0,0 @@ -VERTEX gpu::vertex::DrawViewportQuadTransformTexcoord diff --git a/libraries/render-utils/src/toneMappingMirroredX.slf b/libraries/render-utils/src/toneMappingMirroredX.slf deleted file mode 100644 index 7c510cdc1b..0000000000 --- a/libraries/render-utils/src/toneMappingMirroredX.slf +++ /dev/null @@ -1,71 +0,0 @@ -<@include gpu/Config.slh@> -<$VERSION_HEADER$> -// Generated on Sat Oct 24 09:34:37 2015 -// -// toneMapping.frag -// -// Draw texture 0 fetched at texcoord.xy -// -// Created by Sam Gateau on 6/22/2015 -// Copyright 2015 High Fidelity, Inc. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -<@include render-utils/ShaderConstants.h@> - -struct ToneMappingParams { - vec4 _exp_2powExp_s0_s1; - ivec4 _toneCurve_s0_s1_s2; -}; - -const float GAMMA_22 = 2.2; -const float INV_GAMMA_22 = 1.0 / 2.2; -const int ToneCurveNone = 0; -const int ToneCurveGamma22 = 1; -const int ToneCurveReinhard = 2; -const int ToneCurveFilmic = 3; - -LAYOUT(binding=RENDER_UTILS_BUFFER_TM_PARAMS) uniform toneMappingParamsBuffer { - ToneMappingParams params; -}; -float getTwoPowExposure() { - return params._exp_2powExp_s0_s1.y; -} -int getToneCurve() { - return params._toneCurve_s0_s1_s2.x; -} - -LAYOUT(binding=RENDER_UTILS_TEXTURE_TM_COLOR) uniform sampler2D colorMap; - -layout(location=0) in vec2 varTexCoord0; -layout(location=0) out vec4 outFragColor; - -void main(void) { - vec4 fragColorRaw = texture(colorMap, vec2(1 - varTexCoord0.x, varTexCoord0.y)); - vec3 fragColor = fragColorRaw.xyz; - - vec3 srcColor = fragColor * getTwoPowExposure(); - - int toneCurve = getToneCurve(); - vec3 tonedColor = srcColor; - if (toneCurve == ToneCurveFilmic) { - vec3 x = max(vec3(0.0), srcColor-0.004); - tonedColor = pow((x * (6.2 * x + 0.5)) / (x * (6.2 * x + 1.7) + 0.06), vec3(GAMMA_22)); - } else if (toneCurve == ToneCurveReinhard) { - tonedColor = srcColor/(1.0 + srcColor); - } else if (toneCurve == ToneCurveGamma22) { - // We use glEnable(GL_FRAMEBUFFER_SRGB), which automatically converts textures from RGB to SRGB - // when writing from an RGB framebuffer to an SRGB framebuffer (note that it doesn't do anything - // when writing from an SRGB framebuffer to an RGB framebuffer). - // Since the conversion happens automatically, we don't need to do anything in this shader - } else { - // toneCurve == ToneCurveNone - // For debugging purposes, we may want to see what the colors look like before the automatic OpenGL - // conversion mentioned above, so we undo it here - tonedColor = pow(srcColor, vec3(GAMMA_22)); - } - - outFragColor = vec4(tonedColor, 1.0); -}