diff --git a/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp b/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp index 83380b18d0..ebbf888e83 100644 --- a/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp +++ b/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp @@ -588,10 +588,9 @@ std::function OpenGLDisplayPlugin hudEyeViewports[eye] = eyeViewport(eye); }); return [=](gpu::Batch& batch, const gpu::TexturePointer& hudTexture) { - auto pipeline = hudPipeline; - if (pipeline && hudTexture) { + if (hudPipeline && hudTexture) { batch.enableStereo(false); - batch.setPipeline(pipeline); + batch.setPipeline(hudPipeline); batch.setResourceTexture(0, hudTexture); if (hudStereo) { for_each_eye([&](Eye eye) { diff --git a/libraries/render-utils/src/toneMapping.slf b/libraries/render-utils/src/toneMapping.slf index 211b2a50f4..4f7ed6374d 100644 --- a/libraries/render-utils/src/toneMapping.slf +++ b/libraries/render-utils/src/toneMapping.slf @@ -51,19 +51,16 @@ void main(void) { int toneCurve = getToneCurve(); vec3 tonedColor = srcColor; if (toneCurve == ToneCurveFilmic) { - vec3 rgbColor = pow(srcColor, vec3(GAMMA_22)); - vec3 x = max(vec3(0.0), rgbColor-0.004); - tonedColor = (x * (6.2 * x + 0.5)) / (x * (6.2 * x + 1.7) + 0.06); + 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) { + } 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 { + } 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 diff --git a/libraries/render/src/render/ResampleTask.cpp b/libraries/render/src/render/ResampleTask.cpp index 1a7a075af6..b3d4b38d02 100644 --- a/libraries/render/src/render/ResampleTask.cpp +++ b/libraries/render/src/render/ResampleTask.cpp @@ -159,8 +159,6 @@ void UpsampleToBlitFramebuffer::run(const RenderContextPointer& renderContext, c const auto bufferSize = resampledFrameBuffer->getSize(); glm::ivec4 viewport{ 0, 0, bufferSize.x, bufferSize.y }; - gpu::PipelinePointer pipeline = args->_renderMode == RenderArgs::MIRROR_RENDER_MODE ? _mirrorPipeline : _pipeline; - gpu::doInBatch("Upsample::run", args->_context, [&](gpu::Batch& batch) { batch.enableStereo(false); @@ -169,7 +167,7 @@ void UpsampleToBlitFramebuffer::run(const RenderContextPointer& renderContext, c batch.setViewportTransform(viewport); batch.setProjectionTransform(glm::mat4()); batch.resetViewTransform(); - batch.setPipeline(pipeline); + batch.setPipeline(args->_renderMode == RenderArgs::MIRROR_RENDER_MODE ? _mirrorPipeline : _pipeline); batch.setModelTransform(gpu::Framebuffer::evalSubregionTexcoordTransform(bufferSize, viewport)); batch.setResourceTexture(0, sourceFramebuffer->getRenderBuffer(0));