cvar_t vid_height = {CVAR_SAVE, "vid_height", "480", "resolution"};
cvar_t vid_bitsperpixel = {CVAR_SAVE, "vid_bitsperpixel", "32", "how many bits per pixel to render at (32 or 16, 32 is recommended)"};
cvar_t vid_samples = {CVAR_SAVE, "vid_samples", "1", "how many anti-aliasing samples per pixel to request from the graphics driver (4 is recommended, 1 is faster)"};
-cvar_t vid_multisampling = {CVAR_SAVE, "vid_multisampling", "0", "Make use of GL_AGB_MULTISAMPLING for advaced anti-aliasing techniques such as Alpha-To-Coverage, not yet finished"};
cvar_t vid_refreshrate = {CVAR_SAVE, "vid_refreshrate", "60", "refresh rate to use, in hz (higher values flicker less, if supported by your monitor)"};
cvar_t vid_userefreshrate = {CVAR_SAVE, "vid_userefreshrate", "0", "set this to 1 to make vid_refreshrate used, or to 0 to let the engine choose a sane default"};
cvar_t vid_stereobuffer = {CVAR_SAVE, "vid_stereobuffer", "0", "enables 'quad-buffered' stereo rendering for stereo shutterglasses, HMD (head mounted display) devices, or polarized stereo LCDs, if supported by your drivers"};
vid.support.ext_texture_filter_anisotropic = GL_CheckExtension("GL_EXT_texture_filter_anisotropic", NULL, "-noanisotropy", false);
vid.support.ext_texture_srgb = GL_CheckExtension("GL_EXT_texture_sRGB", NULL, "-nosrgb", false);
vid.support.arb_multisample = GL_CheckExtension("GL_ARB_multisample", multisamplefuncs, "-nomultisample", false);
+ vid.allowalphatocoverage = false;
// COMMANDLINEOPTION: GL: -noshaders disables use of OpenGL 2.0 shaders (which allow pixel shader effects, can improve per pixel lighting performance and capabilities)
// COMMANDLINEOPTION: GL: -noanisotropy disables GL_EXT_texture_filter_anisotropic (allows higher quality texturing)
vid.sRGBcapable2D = false;
vid.sRGBcapable3D = true;
vid.useinterleavedarrays = false;
+ Con_Printf("vid.support.arb_multisample %i\n", vid.support.arb_multisample);
+ Con_Printf("vid.mode.samples %i\n", vid.mode.samples);
+ Con_Printf("vid.support.gl20shaders %i\n", vid.support.gl20shaders);
+ vid.allowalphatocoverage = true; // but see below, it may get turned to false again if GL_SAMPLES_ARB is <= 1
}
else if (vid.support.arb_texture_env_combine && vid.texunits >= 2 && vid_gl13.integer)
{
vid.useinterleavedarrays = false;
}
+ // enable multisample antialiasing if possible
+ if(vid.support.arb_multisample)
+ {
+ int samples = 0;
+ qglGetIntegerv(GL_SAMPLES_ARB, &samples);
+ if (samples > 1)
+ qglEnable(GL_MULTISAMPLE_ARB);
+ else
+ vid.allowalphatocoverage = false;
+ }
+ else
+ vid.allowalphatocoverage = false;
+
// VorteX: set other info (maybe place them in VID_InitMode?)
Cvar_SetQuick(&gl_info_vendor, gl_vendor);
Cvar_SetQuick(&gl_info_renderer, gl_renderer);
wantgamma = 0;
#define BOUNDCVAR(cvar, m1, m2) c = &(cvar);f = bound(m1, c->value, m2);if (c->value != f) Cvar_SetValueQuick(c, f);
BOUNDCVAR(v_gamma, 0.1, 5);
- BOUNDCVAR(v_contrast, 1, 5);
- BOUNDCVAR(v_brightness, 0, 0.8);
+ BOUNDCVAR(v_contrast, 0.2, 5);
+ BOUNDCVAR(v_brightness, -v_contrast.value * 0.8, 0.8);
//BOUNDCVAR(v_contrastboost, 0.0625, 16);
BOUNDCVAR(v_color_black_r, 0, 0.8);
BOUNDCVAR(v_color_black_g, 0, 0.8);
Cvar_RegisterVariable(&vid_height);
Cvar_RegisterVariable(&vid_bitsperpixel);
Cvar_RegisterVariable(&vid_samples);
- Cvar_RegisterVariable(&vid_multisampling);
Cvar_RegisterVariable(&vid_refreshrate);
Cvar_RegisterVariable(&vid_userefreshrate);
Cvar_RegisterVariable(&vid_stereobuffer);
{
viddef_mode_t mode;
-#if 0
- // LordHavoc: FIXME: VorteX broke vid_restart with this, it is a mystery why it would ever work, commented out
- // multisampling should set at least 2 samples
- if (vid.support.arb_multisample)
- {
- GL_MultiSampling(false);
- if (vid_multisampling.integer)
- samples = max(2, samples);
- }
-#endif
-
memset(&mode, 0, sizeof(mode));
mode.fullscreen = fullscreen != 0;
mode.width = width;
Cvar_SetValueQuick(&vid_refreshrate, vid.mode.refreshrate);
Cvar_SetValueQuick(&vid_stereobuffer, vid.mode.stereobuffer);
- // activate multisampling
- if (vid_multisampling.integer)
- GL_MultiSampling(true);
-
return true;
}
else