Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
None
-
5.9.4, 5.10.1, 5.11
-
None
-
e813fb36e782c5e0ab7c25b9c069cee709692506
Description
RenderCapture relies on GraphicsContext::copyGLFramebufferDataToImage to copy data from the framebuffer into the image. In copyGLFramebufferDataToImage, every pixel value is divided by 1 + the value. This results in values in the range 0 to 0.5 (or 0 to 127), which makes the image darker than expected.
The current implementation of copyGLFramebufferDataToImage appears to attempt to map from some non-linear range of values to a linear range. However, it appears the only way to obtain numbers that are equal both when set in a shader and when read from the QImage, is to remove the division and use the value directly. That is, to map from a linear range to another linear range.