by dpJudas » Mon May 20, 2019 4:02 am
Doom itself has always operated in sRGB space (approx 2.2 gamma). Before postprocess was added the Gamma CVAR would be applied by hardware and thus not applied to the screenshot. I'm not sure what the gamma multiplier was set to back then. It doesn't make much sense to me to try apply the Gamma CVAR as it still will not show exactly what the user is seeing as the brightness and contrast CVARs are not included. Maybe it did anyway, I can't remember.
Because early versions of postprocess also had to support OpenGL 2 where postprocess would be completely disabled, the OpenGL backend has always created the screenshot by reading directly from the back buffer. It does this by pretending it is a completely normal render to screen, including running the Present shader and creating black borders and scaling. If the game is running at 640x480 but the monitor is 1920x1080, then its reading a 1920x1080 image. That is why you see the OpenGL backend attempt to scale the image back down to 640x480. This also means the gamma, brightness and contrast CVARs will have been applied.
The Vulkan backend does it differently. It reads the image directly from postprocess - the original 640x480 image before present. Since this is before gamma, bright and contrast those will not have been applied.
So the answer to your question comes down to what people expect from a screenshot. Should it be the raw original image, or the gamma adjusted one? Vulkan does the first, OpenGL the second. In any case, simply applying the Gamma CVAR won't be enough since that doesn't include brightness, contrast and dithering.
Doom itself has always operated in sRGB space (approx 2.2 gamma). Before postprocess was added the Gamma CVAR would be applied by hardware and thus not applied to the screenshot. I'm not sure what the gamma multiplier was set to back then. It doesn't make much sense to me to try apply the Gamma CVAR as it still will not show exactly what the user is seeing as the brightness and contrast CVARs are not included. Maybe it did anyway, I can't remember.
Because early versions of postprocess also had to support OpenGL 2 where postprocess would be completely disabled, the OpenGL backend has always created the screenshot by reading directly from the back buffer. It does this by pretending it is a completely normal render to screen, including running the Present shader and creating black borders and scaling. If the game is running at 640x480 but the monitor is 1920x1080, then its reading a 1920x1080 image. That is why you see the OpenGL backend attempt to scale the image back down to 640x480. This also means the gamma, brightness and contrast CVARs will have been applied.
The Vulkan backend does it differently. It reads the image directly from postprocess - the original 640x480 image before present. Since this is before gamma, bright and contrast those will not have been applied.
So the answer to your question comes down to what people expect from a screenshot. Should it be the raw original image, or the gamma adjusted one? Vulkan does the first, OpenGL the second. In any case, simply applying the Gamma CVAR won't be enough since that doesn't include brightness, contrast and dithering.