- remove vid_hwgamma, force always use shader gamma
*** note to drfrag: Please don't cherry-pick this commit. Systems that do not use renderbuffers will still need this feature!
This commit is contained in:
parent
477560e1ef
commit
dc27011370
10 changed files with 4 additions and 200 deletions
|
|
@ -60,12 +60,6 @@ void Draw2D(F2DDrawer *drawer, FRenderState &state);
|
|||
|
||||
extern bool vid_hdr_active;
|
||||
|
||||
CUSTOM_CVAR(Int, vid_hwgamma, 2, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
|
||||
{
|
||||
if (self < 0 || self > 2) self = 2;
|
||||
if (screen != nullptr) screen->SetGamma();
|
||||
}
|
||||
|
||||
namespace OpenGLRenderer
|
||||
{
|
||||
FGLRenderer *GLRenderer;
|
||||
|
|
@ -282,35 +276,6 @@ void OpenGLFrameBuffer::SetVSync(bool vsync)
|
|||
glBindFramebuffer(GL_READ_FRAMEBUFFER, oldReadFramebufferBinding);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// DoSetGamma
|
||||
//
|
||||
// (Unfortunately Windows has some safety precautions that block gamma ramps
|
||||
// that are considered too extreme. As a result this doesn't work flawlessly)
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
void OpenGLFrameBuffer::SetGamma()
|
||||
{
|
||||
bool useHWGamma = m_supportsGamma && ((vid_hwgamma == 0) || (vid_hwgamma == 2 && IsFullscreen()));
|
||||
if (useHWGamma)
|
||||
{
|
||||
uint16_t gammaTable[768];
|
||||
|
||||
// This formula is taken from Doomsday
|
||||
BuildGammaTable(gammaTable);
|
||||
SetGammaTable(gammaTable);
|
||||
|
||||
HWGammaActive = true;
|
||||
}
|
||||
else if (HWGammaActive)
|
||||
{
|
||||
ResetGammaTable();
|
||||
HWGammaActive = false;
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
//
|
||||
|
|
@ -466,7 +431,7 @@ TArray<uint8_t> OpenGLFrameBuffer::GetScreenshotBuffer(int &pitch, ESSType &colo
|
|||
color_type = SS_RGB;
|
||||
|
||||
// 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;
|
||||
gamma = 1;
|
||||
if (vid_hdr_active && fullscreen)
|
||||
gamma *= 2.2f;
|
||||
return ScreenshotBuffer;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue