mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-01-18 22:51:39 +00:00
Revert "- add gl_dither for toggling dithered output on and off"
This reverts commit 770c676ac9
.
# Conflicts:
# wadsrc/static/menudef.txt
This commit is contained in:
parent
8b7c5242cb
commit
7fdf558ad6
7 changed files with 3 additions and 15 deletions
|
@ -155,8 +155,6 @@ 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)
|
||||
|
||||
void FGLRenderer::RenderScreenQuad()
|
||||
{
|
||||
mVBO->BindVBO();
|
||||
|
@ -887,7 +885,6 @@ void FGLRenderer::DrawPresentTexture(const GL_IRECT &box, bool applyGamma)
|
|||
mPresentShader->Saturation.Set(clamp<float>(vid_saturation, -15.0f, 15.f));
|
||||
mPresentShader->GrayFormula.Set(static_cast<int>(gl_satformula));
|
||||
}
|
||||
mPresentShader->ColorScale.Set(static_cast<float>(gl_dither ? 255.0f : 0.0f));
|
||||
mPresentShader->Scale.Set(mScreenViewport.width / (float)mBuffers->GetWidth(), mScreenViewport.height / (float)mBuffers->GetHeight());
|
||||
RenderScreenQuad();
|
||||
}
|
||||
|
|
|
@ -49,7 +49,6 @@ void FPresentShaderBase::Init(const char * vtx_shader_name, const char * program
|
|||
Saturation.Init(mShader, "Saturation");
|
||||
GrayFormula.Init(mShader, "GrayFormula");
|
||||
Scale.Init(mShader, "UVScale");
|
||||
ColorScale.Init(mShader, "ColorScale");
|
||||
}
|
||||
|
||||
void FPresentShader::Bind()
|
||||
|
|
|
@ -15,7 +15,6 @@ public:
|
|||
FBufferedUniform1f Saturation;
|
||||
FBufferedUniform1i GrayFormula;
|
||||
FBufferedUniform2f Scale;
|
||||
FBufferedUniform1f ColorScale;
|
||||
|
||||
protected:
|
||||
virtual void Init(const char * vtx_shader_name, const char * program_name);
|
||||
|
|
|
@ -45,7 +45,6 @@ EXTERN_CVAR(Float, vid_saturation)
|
|||
EXTERN_CVAR(Float, vid_brightness)
|
||||
EXTERN_CVAR(Float, vid_contrast)
|
||||
EXTERN_CVAR(Int, gl_satformula)
|
||||
EXTERN_CVAR(Bool, gl_dither)
|
||||
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
|
||||
|
@ -113,7 +112,6 @@ 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.Scale.Set(
|
||||
GLRenderer->mScreenViewport.width / (float)GLRenderer->mBuffers->GetWidth(),
|
||||
GLRenderer->mScreenViewport.height / (float)GLRenderer->mBuffers->GetHeight());
|
||||
|
|
|
@ -2769,7 +2769,6 @@ GLPREFMNU_LENS = "Lens distortion effect";
|
|||
GLPREFMNU_SSAO = "Ambient occlusion quality";
|
||||
GLPREFMNU_SSAO_PORTALS = "Portals with AO";
|
||||
GLPREFMNU_FXAA = "FXAA Quality";
|
||||
GLPREFMNU_DITHER = "Dither output";
|
||||
GLPREFMNU_PALTONEMAPORDER = "Tonemap Palette Order";
|
||||
GLPREFMNU_PALTONEMAPPOWER = "Tonemap Palette Exponent";
|
||||
GLPREFMNU_SWLMBANDED = "Banded SW Lightmode";
|
||||
|
|
|
@ -2548,7 +2548,6 @@ 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_TONEMAP", gl_tonemap, "TonemapModes"
|
||||
StaticText " "
|
||||
Slider "$GLPREFMNU_PALTONEMAPPOWER", gl_paltonemap_powtable, 0.2, 3.0, 0.1, 1
|
||||
|
|
|
@ -8,7 +8,6 @@ uniform float Contrast;
|
|||
uniform float Brightness;
|
||||
uniform float Saturation;
|
||||
uniform int GrayFormula;
|
||||
uniform float ColorScale;
|
||||
|
||||
vec4 ApplyGamma(vec4 c)
|
||||
{
|
||||
|
@ -43,16 +42,14 @@ float DitherMatrix[64] = float[](
|
|||
15.0 / 16.0 + HALFSTEP * 2, 7.0 / 16.0 + HALFSTEP * 2, 13.0 / 16.0 + HALFSTEP * 2, 5.0 / 16.0 + HALFSTEP * 2
|
||||
);
|
||||
|
||||
vec4 Dither(vec4 c)
|
||||
vec4 Dither(vec4 c, float colorscale)
|
||||
{
|
||||
if (ColorScale == 0.0)
|
||||
return c;
|
||||
ivec2 pos = ivec2(gl_FragCoord.xy) & 7;
|
||||
float threshold = DitherMatrix[pos.x + (pos.y << 3)];
|
||||
return vec4(floor(c.rgb * ColorScale + threshold) / ColorScale, c.a);
|
||||
return vec4(floor(c.rgb * colorscale + threshold) / colorscale, c.a);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
FragColor = Dither(ApplyGamma(texture(InputTexture, TexCoord)));
|
||||
FragColor = Dither(ApplyGamma(texture(InputTexture, TexCoord)), 255.0);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue