cvar_t r_render = {0, "r_render", "1"};
cvar_t r_waterwarp = {CVAR_SAVE, "r_waterwarp", "1"};
+cvar_t gl_polyblend = {CVAR_SAVE, "gl_polyblend", "1"};
cvar_t gl_dither = {CVAR_SAVE, "gl_dither", "1"}; // whether or not to use dithering
cvar_t gl_lockarrays = {0, "gl_lockarrays", "1"};
Cvar_RegisterVariable(&r_render);
Cvar_RegisterVariable(&r_waterwarp);
+ Cvar_RegisterVariable(&gl_polyblend);
Cvar_RegisterVariable(&gl_dither);
Cvar_RegisterVariable(&gl_lockarrays);
Cvar_RegisterVariable(&gl_delayfinish);
}
}
-#define OPTIONS_EFFECTS_ITEMS 23
+#define OPTIONS_EFFECTS_ITEMS 24
int options_effects_cursor;
else if (options_effects_cursor == optnum++) Cvar_SetValueQuick (&cl_particles_blood_bloodhack, !cl_particles_blood_bloodhack.integer);
else if (options_effects_cursor == optnum++) Cvar_SetValueQuick (&r_lerpmodels, !r_lerpmodels.integer);
else if (options_effects_cursor == optnum++) Cvar_SetValueQuick (&r_lerpsprites, !r_lerpsprites.integer);
+ else if (options_effects_cursor == optnum++) Cvar_SetValueQuick (&gl_polyblend, bound(0, gl_polyblend.value + dir * 0.1, 1));
else if (options_effects_cursor == optnum++) Cvar_SetValueQuick (&r_waterwarp, bound(0, r_waterwarp.value + dir * 0.1, 1));
else if (options_effects_cursor == optnum++) Cvar_SetValueQuick (&r_wateralpha, bound(0, r_wateralpha.value + dir * 0.1, 1));
else if (options_effects_cursor == optnum++) Cvar_SetValueQuick (&r_waterscroll, bound(0, r_waterscroll.value + dir * 0.5, 10));
M_Options_PrintCheckbox("Force New Blood Effect", true, cl_particles_blood_bloodhack.integer);
M_Options_PrintCheckbox(" Model Interpolation", true, r_lerpmodels.integer);
M_Options_PrintCheckbox(" Sprite Interpolation", true, r_lerpsprites.integer);
+ M_Options_PrintSlider( " View Blend", true, gl_polyblend.value, 0, 1);
M_Options_PrintSlider( " Underwater View Warp", true, r_waterwarp.value, 0, 1);
M_Options_PrintSlider( " Water Alpha (opacity)", true, r_wateralpha.value, 0, 1);
M_Options_PrintSlider( " Water Movement", true, r_waterscroll.value, 0, 10);
extern cvar_t r_waterwarp;
extern cvar_t r_textureunits;
+extern cvar_t gl_polyblend;
extern cvar_t gl_dither;
#include "gl_backend.h"
r_refdef.viewblend[1] = 0;
r_refdef.viewblend[2] = 0;
r_refdef.viewblend[3] = 0;
- if (cls.state == ca_connected && cls.signon == SIGNONS)
+ if (cls.state == ca_connected && cls.signon == SIGNONS && gl_polyblend.value > 0)
{
// set contents color
switch (CL_PointQ1Contents(r_vieworigin))
if (a2 > 0)
{
VectorLerp(r_refdef.viewblend, a2, cl.cshifts[j].destcolor, r_refdef.viewblend);
- r_refdef.viewblend[3] = 1 - (1 - r_refdef.viewblend[3]) * (1 - a2); // correct alpha multiply... took a while to find it on the web
+ r_refdef.viewblend[3] = (1 - (1 - r_refdef.viewblend[3]) * (1 - a2)); // correct alpha multiply... took a while to find it on the web
}
}
// saturate color (to avoid blending in black)
r_refdef.viewblend[0] = bound(0.0f, r_refdef.viewblend[0] * (1.0f/255.0f), 1.0f);
r_refdef.viewblend[1] = bound(0.0f, r_refdef.viewblend[1] * (1.0f/255.0f), 1.0f);
r_refdef.viewblend[2] = bound(0.0f, r_refdef.viewblend[2] * (1.0f/255.0f), 1.0f);
- r_refdef.viewblend[3] = bound(0.0f, r_refdef.viewblend[3] , 1.0f);
+ r_refdef.viewblend[3] = bound(0.0f, r_refdef.viewblend[3] * gl_polyblend.value, 1.0f);
}
}