From: uis Date: Mon, 5 Feb 2024 19:53:01 +0000 (+0300) Subject: Revert to gl_dither cvar X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuis%2Fmultisample;p=xonotic%2Fdarkplaces.git Revert to gl_dither cvar --- diff --git a/cl_screen.c b/cl_screen.c index a19c76f7..01fb7a27 100644 --- a/cl_screen.c +++ b/cl_screen.c @@ -2323,6 +2323,11 @@ void CL_UpdateScreen(void) qglFlush(); // ensure that the commands are submitted to the GPU before we do other things VID_Finish(); + if (gl_dither.integer) { + qglEnable(GL_DITHER);CHECKGLERROR + } else { + qglDisable(GL_DITHER);CHECKGLERROR + } } void CL_Screen_NewMap(void) diff --git a/gl_backend.c b/gl_backend.c index 32a6ee7d..d7d7350e 100644 --- a/gl_backend.c +++ b/gl_backend.c @@ -12,6 +12,7 @@ cvar_t r_render = {CF_CLIENT, "r_render", "1", "enables rendering 3D views (you cvar_t r_renderview = {CF_CLIENT, "r_renderview", "1", "enables rendering 3D views (you want this on!)"}; cvar_t r_waterwarp = {CF_CLIENT | CF_ARCHIVE, "r_waterwarp", "1", "warp view while underwater"}; cvar_t gl_polyblend = {CF_CLIENT | CF_ARCHIVE, "gl_polyblend", "1", "tints view while underwater, hurt, etc"}; +cvar_t gl_dither = {CF_CLIENT | CF_ARCHIVE, "gl_dither", "0", "enables OpenGL dithering (16bit looks bad with this off)"}; cvar_t v_flipped = {CF_CLIENT, "v_flipped", "0", "mirror the screen (poor man's left handed mode)"}; qbool v_flipped_state = false; @@ -368,6 +369,7 @@ void gl_backend_init(void) Cvar_RegisterVariable(&r_waterwarp); Cvar_RegisterVariable(&gl_polyblend); Cvar_RegisterVariable(&v_flipped); + Cvar_RegisterVariable(&gl_dither); Cvar_RegisterVariable(&gl_debug); Cvar_RegisterVariable(&gl_paranoid); Cvar_RegisterVariable(&gl_printcheckerror); diff --git a/render.h b/render.h index c0ff8cf9..4464c167 100644 --- a/render.h +++ b/render.h @@ -562,6 +562,7 @@ extern cvar_t r_glsl_offsetmapping_lod_distance; extern cvar_t r_glsl_deluxemapping; extern cvar_t gl_polyblend; +extern cvar_t gl_dither; extern cvar_t cl_deathfade; diff --git a/vid_shared.c b/vid_shared.c index 2e880cac..d8861d72 100644 --- a/vid_shared.c +++ b/vid_shared.c @@ -843,8 +843,6 @@ void GL_Setup(void) vid.allowalphatocoverage = false; } } - if (vid_bitsperpixel.integer >= 24) - qglDisable(GL_DITHER); // currently MSAA antialiasing is not implemented for fbo viewports, so we actually have to force this off anyway. vid.allowalphatocoverage = false; #endif