plugins/screencast, screenshot: switch color transforms to relative colorimetric

This is to disable tone mapping, which makes screenshots of SDR things while HDR is enabled on a
display look a lot worse.
As the tradeoff, this will make HDR content look worse, but that can be fixed later by taking the
actual HDR metadata into account.

BUG: 496185
wilder/Plasma/6.3
Xaver Hugl 1 year ago
parent ae04e36cb7
commit d62eb36757
  1. 2
      src/plugins/screencast/outputscreencastsource.cpp
  2. 2
      src/plugins/screencast/regionscreencastsource.cpp
  3. 2
      src/plugins/screenshot/screenshot.cpp

@ -72,7 +72,7 @@ void OutputScreenCastSource::render(GLFramebuffer *target)
projectionMatrix.scale(1, -1); projectionMatrix.scale(1, -1);
projectionMatrix.ortho(QRect(QPoint(), textureSize())); projectionMatrix.ortho(QRect(QPoint(), textureSize()));
shaderBinder.shader()->setUniform(GLShader::Mat4Uniform::ModelViewProjectionMatrix, projectionMatrix); shaderBinder.shader()->setUniform(GLShader::Mat4Uniform::ModelViewProjectionMatrix, projectionMatrix);
shaderBinder.shader()->setColorspaceUniforms(colorDescription, ColorDescription::sRGB, RenderingIntent::Perceptual); shaderBinder.shader()->setColorspaceUniforms(colorDescription, ColorDescription::sRGB, RenderingIntent::RelativeColorimetricWithBPC);
GLFramebuffer::pushFramebuffer(target); GLFramebuffer::pushFramebuffer(target);
outputTexture->render(textureSize()); outputTexture->render(textureSize());

@ -107,7 +107,7 @@ void RegionScreenCastSource::blit(Output *output)
projectionMatrix.translate(outputGeometry.left(), outputGeometry.top()); projectionMatrix.translate(outputGeometry.left(), outputGeometry.top());
shaderBinder.shader()->setUniform(GLShader::Mat4Uniform::ModelViewProjectionMatrix, projectionMatrix); shaderBinder.shader()->setUniform(GLShader::Mat4Uniform::ModelViewProjectionMatrix, projectionMatrix);
shaderBinder.shader()->setColorspaceUniforms(colorDescription, ColorDescription::sRGB, RenderingIntent::Perceptual); shaderBinder.shader()->setColorspaceUniforms(colorDescription, ColorDescription::sRGB, RenderingIntent::RelativeColorimetricWithBPC);
outputTexture->render(outputGeometry.size()); outputTexture->render(outputGeometry.size());
GLFramebuffer::popFramebuffer(); GLFramebuffer::popFramebuffer();

@ -385,7 +385,7 @@ QImage ScreenShotEffect::blitScreenshot(const RenderTarget &renderTarget, const
if (renderTarget.texture()) { if (renderTarget.texture()) {
GLFramebuffer::pushFramebuffer(&target); GLFramebuffer::pushFramebuffer(&target);
ShaderBinder binder(ShaderTrait::MapTexture | ShaderTrait::TransformColorspace); ShaderBinder binder(ShaderTrait::MapTexture | ShaderTrait::TransformColorspace);
binder.shader()->setColorspaceUniforms(renderTarget.colorDescription(), ColorDescription::sRGB, RenderingIntent::Perceptual); binder.shader()->setColorspaceUniforms(renderTarget.colorDescription(), ColorDescription::sRGB, RenderingIntent::RelativeColorimetricWithBPC);
QMatrix4x4 projectionMatrix; QMatrix4x4 projectionMatrix;
projectionMatrix.scale(1, -1); projectionMatrix.scale(1, -1);
projectionMatrix *= renderTarget.transform().toMatrix(); projectionMatrix *= renderTarget.transform().toMatrix();

Loading…
Cancel
Save