- Allow specifying monitor bits-per-channel for dithering output. Not all displays are created equal, so this option is actually important for specifying the exact amount for your display.

# Conflicts:
#	src/gl/renderer/gl_stereo3d.cpp
#	wadsrc/static/menudef.txt

# Conflicts:
#	src/gl/renderer/gl_postprocess.cpp
#	src/gl/stereo3d/gl_interleaved3d.cpp
This commit is contained in:
Rachael Alexanderson 2018-08-09 15:13:26 -04:00 committed by drfrag
parent 7021e612b0
commit 1a26946e5b
3 changed files with 15 additions and 6 deletions

View file

@ -157,7 +157,7 @@ EXTERN_CVAR(Float, vid_contrast)
EXTERN_CVAR(Float, vid_saturation)
EXTERN_CVAR(Int, gl_satformula)
CVAR(Bool, gl_dither, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
CVAR(Int, gl_dither_bpc, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
void FGLRenderer::RenderScreenQuad()
{
@ -902,11 +902,11 @@ void FGLRenderer::DrawPresentTexture(const GL_IRECT &box, bool applyGamma)
// It probably will eventually in desktop mode too, but the DWM doesn't seem to support that.
invgamma *= 2.2f;
mPresentShader->InvGamma.Set(invgamma);
mPresentShader->ColorScale.Set(static_cast<float>(gl_dither ? 1023.0f : 0.0f));
mPresentShader->ColorScale.Set(static_cast<float>((gl_dither_bpc == -1) ? 1023.0f : (float)((1 << gl_dither_bpc) - 1)));
}
else
{
mPresentShader->ColorScale.Set(static_cast<float>(gl_dither ? 255.0f : 0.0f));
mPresentShader->ColorScale.Set(static_cast<float>((gl_dither_bpc == -1) ? 255.0f : (float)((1 << gl_dither_bpc) - 1)));
}
mPresentShader->Scale.Set(mScreenViewport.width / (float)mBuffers->GetWidth(), mScreenViewport.height / (float)mBuffers->GetHeight());
RenderScreenQuad();

View file

@ -48,7 +48,7 @@ EXTERN_CVAR(Int, gl_satformula)
EXTERN_CVAR(Bool, fullscreen)
EXTERN_CVAR(Int, win_x) // screen pixel position of left of display window
EXTERN_CVAR(Int, win_y) // screen pixel position of top of display window
EXTERN_CVAR(Bool, gl_dither)
EXTERN_CVAR(Int, gl_dither_bpc)
namespace s3d {
@ -113,7 +113,7 @@ static void prepareInterleavedPresent(FPresentStereoShaderBase& shader)
shader.Saturation.Set(clamp<float>(vid_saturation, -15.0f, 15.0f));
shader.GrayFormula.Set(static_cast<int>(gl_satformula));
}
shader.ColorScale.Set(static_cast<float>(gl_dither ? 255.0f : 0.0f));
shader.ColorScale.Set(static_cast<float>((gl_dither_bpc == -1) ? 255.0f : (float)((1 << gl_dither_bpc) - 1)));
shader.Scale.Set(
GLRenderer->mScreenViewport.width / (float)GLRenderer->mBuffers->GetWidth(),
GLRenderer->mScreenViewport.height / (float)GLRenderer->mBuffers->GetHeight());

View file

@ -2349,6 +2349,15 @@ OptionValue "Precision"
1, "$OPTVAL_QUALITY"
}
OptionValue "DitherModes"
{
0, "$OPTVAL_OFF"
-1, "$OPTVAL_ON"
6, "6 BPC"
8, "8 BPC"
10, "10 BPC"
12, "12 BPC"
}
OptionValue "Hz"
{
@ -2548,7 +2557,7 @@ OptionMenu "PostProcessMenu" protected
Option "$GLPREFMNU_SSAO", gl_ssao, "SSAOModes"
Slider "$GLPREFMNU_SSAO_PORTALS", gl_ssao_portals, 0.0, 4.0, 1.0, 0
Option "$GLPREFMNU_FXAA", gl_fxaa, "FXAAQuality"
Option "$GLPREFMNU_DITHER", gl_dither, "OnOff"
Option "$GLPREFMNU_DITHER", gl_dither_bpc, "DitherModes"
Option "$GLPREFMNU_TONEMAP", gl_tonemap, "TonemapModes"
StaticText " "
Slider "$GLPREFMNU_PALTONEMAPPOWER", gl_paltonemap_powtable, 0.2, 3.0, 0.1, 1