- Add missing screenshot sRGB gamma when vid_hdr is active

This commit is contained in:
Magnus Norddahl 2019-01-03 03:48:47 +01:00 committed by Rachael Alexanderson
parent a61559078c
commit ed0dccdc1f

View file

@ -58,6 +58,7 @@ void gl_LoadExtensions();
void gl_PrintStartupLog();
void Draw2D(F2DDrawer *drawer, FRenderState &state);
extern bool vid_hdr_active;
CUSTOM_CVAR(Int, vid_hwgamma, 2, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
{
@ -466,6 +467,8 @@ TArray<uint8_t> OpenGLFrameBuffer::GetScreenshotBuffer(int &pitch, ESSType &colo
// Screenshot should not use gamma correction if it was already applied to rendered image
gamma = 1 == vid_hwgamma || (2 == vid_hwgamma && !fullscreen) ? 1.0f : Gamma;
if (vid_hdr_active && fullscreen)
gamma *= 2.2f;
return ScreenshotBuffer;
}