cvar_t r_nearest_2d = {CVAR_SAVE, "r_nearest_2d", "0", "use nearest filtering on all 2d textures (including conchars)"};
cvar_t r_nearest_conchars = {CVAR_SAVE, "r_nearest_conchars", "0", "use nearest filtering on conchars texture"};
-extern cvar_t v_glslgamma;
-
//=============================================================================
/* Support Routines */
r_refdef.draw2dstage = -1; // next draw call will set viewport etc. again
}
-static float blendvertex3f[9] = {-5000, -5000, 10, 10000, -5000, 10, -5000, 10000, 10};
-void R_DrawGamma(void)
-{
- float c[4];
- switch(vid.renderpath)
- {
- case RENDERPATH_GL20:
- case RENDERPATH_D3D9:
- case RENDERPATH_D3D10:
- case RENDERPATH_D3D11:
- case RENDERPATH_GLES2:
- if (v_glslgamma.integer)
- return;
- break;
- case RENDERPATH_GL11:
- case RENDERPATH_GL13:
- break;
- case RENDERPATH_GLES1:
- case RENDERPATH_SOFT:
- return;
- }
- // all the blends ignore depth
-// R_Mesh_ResetTextureState();
- R_SetupShader_Generic_NoTexture(true, true);
- GL_DepthMask(true);
- GL_DepthRange(0, 1);
- GL_PolygonOffset(0, 0);
- GL_DepthTest(false);
-
- // interpretation of brightness and contrast:
- // color range := brightness .. (brightness + contrast)
- // i.e. "c *= contrast; c += brightness"
- // plausible values for brightness thus range from -contrast to 1
-
- // apply pre-brightness (subtractive brightness, for where contrast was >= 1)
- if (vid.support.ext_blend_subtract)
- {
- if (v_color_enable.integer)
- {
- c[0] = -v_color_black_r.value / v_color_white_r.value;
- c[1] = -v_color_black_g.value / v_color_white_g.value;
- c[2] = -v_color_black_b.value / v_color_white_b.value;
- }
- else
- c[0] = c[1] = c[2] = -v_brightness.value / v_contrast.value;
- if (c[0] >= 0.01f || c[1] >= 0.01f || c[2] >= 0.01f)
- {
- // need SUBTRACTIVE blending to do this!
- GL_BlendEquationSubtract(true);
- GL_BlendFunc(GL_ONE, GL_ONE);
- GL_Color(c[0], c[1], c[2], 1);
- R_Mesh_PrepareVertices_Generic_Arrays(3, blendvertex3f, NULL, NULL);
- R_Mesh_Draw(0, 3, 0, 1, polygonelement3i, NULL, 0, polygonelement3s, NULL, 0);
- GL_BlendEquationSubtract(false);
- }
- }
-
- // apply contrast
- if (v_color_enable.integer)
- {
- c[0] = v_color_white_r.value;
- c[1] = v_color_white_g.value;
- c[2] = v_color_white_b.value;
- }
- else
- c[0] = c[1] = c[2] = v_contrast.value;
- if (c[0] >= 1.003f || c[1] >= 1.003f || c[2] >= 1.003f)
- {
- GL_BlendFunc(GL_DST_COLOR, GL_ONE);
- while (c[0] >= 1.003f || c[1] >= 1.003f || c[2] >= 1.003f)
- {
- float cc[4];
- cc[0] = bound(0, c[0] - 1, 1);
- cc[1] = bound(0, c[1] - 1, 1);
- cc[2] = bound(0, c[2] - 1, 1);
- GL_Color(cc[0], cc[1], cc[2], 1);
- R_Mesh_PrepareVertices_Generic_Arrays(3, blendvertex3f, NULL, NULL);
- R_Mesh_Draw(0, 3, 0, 1, polygonelement3i, NULL, 0, polygonelement3s, NULL, 0);
- c[0] /= 1 + cc[0];
- c[1] /= 1 + cc[1];
- c[2] /= 1 + cc[2];
- }
- }
- if (c[0] <= 0.997f || c[1] <= 0.997f || c[2] <= 0.997f)
- {
- GL_BlendFunc(GL_DST_COLOR, GL_ZERO);
- GL_Color(c[0], c[1], c[2], 1);
- R_Mesh_PrepareVertices_Generic_Arrays(3, blendvertex3f, NULL, NULL);
- R_Mesh_Draw(0, 3, 0, 1, polygonelement3i, NULL, 0, polygonelement3s, NULL, 0);
- }
-
- // apply post-brightness (additive brightness, for where contrast was <= 1)
- if (v_color_enable.integer)
- {
- c[0] = v_color_black_r.value;
- c[1] = v_color_black_g.value;
- c[2] = v_color_black_b.value;
- }
- else
- c[0] = c[1] = c[2] = v_brightness.value;
- if (c[0] >= 0.01f || c[1] >= 0.01f || c[2] >= 0.01f)
- {
- GL_BlendFunc(GL_ONE, GL_ONE);
- GL_Color(c[0], c[1], c[2], 1);
- R_Mesh_PrepareVertices_Generic_Arrays(3, blendvertex3f, NULL, NULL);
- R_Mesh_Draw(0, 3, 0, 1, polygonelement3i, NULL, 0, polygonelement3s, NULL, 0);
- }
-}
-
{CVAR_SAVE, "r_buffermegs_uniform", "0.25", "uniform buffer size for one frame"},
};
-extern cvar_t v_glslgamma;
extern cvar_t v_glslgamma_2d;
extern qboolean v_flipped_state;
permutation |= SHADERPERMUTATION_GLOW;
else if (texturemode == GL_DECAL)
permutation |= SHADERPERMUTATION_VERTEXTEXTUREBLEND;
- if (usegamma && v_glslgamma.integer && v_glslgamma_2d.integer && !vid.sRGB2D && r_texture_gammaramps && !vid_gammatables_trivial)
+ if (usegamma && v_glslgamma_2d.integer && !vid.sRGB2D && r_texture_gammaramps && !vid_gammatables_trivial)
permutation |= SHADERPERMUTATION_GAMMARAMPS;
if (suppresstexalpha)
permutation |= SHADERPERMUTATION_REFLECTCUBE;
R_Mesh_TexBind(GL20TU_FIRST , first );
R_Mesh_TexBind(GL20TU_SECOND, second);
if (permutation & SHADERPERMUTATION_GAMMARAMPS)
- R_Mesh_TexBind(r_glsl_permutation->tex_Texture_GammaRamps, r_texture_gammaramps);
+ R_Mesh_TexBind(GL20TU_GAMMARAMPS, r_texture_gammaramps);
#endif
break;
case RENDERPATH_D3D10:
case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GLES1:
+ return; // don't bother
case RENDERPATH_GLES2:
case RENDERPATH_D3D9:
case RENDERPATH_D3D10:
Cvar_SetValueQuick(&r_damageblur, 0);
}
- if (!((r_glsl_postprocess.integer || r_fxaa.integer) || (!R_Stereo_ColorMasking() && r_glsl_saturation.value != 1) || (v_glslgamma.integer && !vid_gammatables_trivial))
+ if (!((r_glsl_postprocess.integer || r_fxaa.integer) || (!R_Stereo_ColorMasking() && r_glsl_saturation.value != 1) || !vid_gammatables_trivial)
&& !r_bloom.integer
&& (R_Stereo_Active() || (r_motionblur.value <= 0 && r_damageblur.value <= 0))
&& !useviewfbo
permutation =
(r_fb.bloomtexture[r_fb.bloomindex] ? SHADERPERMUTATION_BLOOM : 0)
| (r_refdef.viewblend[3] > 0 ? SHADERPERMUTATION_VIEWTINT : 0)
- | ((v_glslgamma.value && !vid_gammatables_trivial) ? SHADERPERMUTATION_GAMMARAMPS : 0)
+ | (!vid_gammatables_trivial ? SHADERPERMUTATION_GAMMARAMPS : 0)
| (r_glsl_postprocess.integer ? SHADERPERMUTATION_POSTPROCESSING : 0)
| ((!R_Stereo_ColorMasking() && r_glsl_saturation.value != 1) ? SHADERPERMUTATION_SATURATION : 0);
case RENDERPATH_D3D11:
case RENDERPATH_SOFT:
case RENDERPATH_GLES2:
- if(v_glslgamma.integer && !vid_gammatables_trivial)
+ if(!vid_gammatables_trivial)
{
if(!r_texture_gammaramps || vid_gammatables_serial != r_texture_gammaramps_serial)
{
cvar_t v_color_white_r = {CVAR_SAVE, "v_color_white_r", "1", "desired color of white"};
cvar_t v_color_white_g = {CVAR_SAVE, "v_color_white_g", "1", "desired color of white"};
cvar_t v_color_white_b = {CVAR_SAVE, "v_color_white_b", "1", "desired color of white"};
-cvar_t v_glslgamma = {CVAR_SAVE, "v_glslgamma", "1", "enables use of GLSL to apply gamma correction ramps"};
-cvar_t v_glslgamma_2d = {CVAR_SAVE, "v_glslgamma_2d", "0", "applies GLSL gamma to 2d pictures (HUD, fonts)"};
+cvar_t v_glslgamma_2d = {CVAR_SAVE, "v_glslgamma_2d", "1", "applies GLSL gamma to 2d pictures (HUD, fonts)"};
cvar_t v_psycho = {0, "v_psycho", "0", "easter egg - R.I.P. zinx http://obits.al.com/obituaries/birmingham/obituary.aspx?n=christopher-robert-lais&pid=186080667"};
// brand of graphics chip
vid.support.arb_texture_cube_map = GL_CheckExtension("GL_ARB_texture_cube_map", NULL, "-nocubemap", false);
vid.support.arb_texture_env_combine = GL_CheckExtension("GL_ARB_texture_env_combine", NULL, "-nocombine", false) || GL_CheckExtension("GL_EXT_texture_env_combine", NULL, "-nocombine", false);
vid.support.arb_texture_gather = GL_CheckExtension("GL_ARB_texture_gather", NULL, "-notexturegather", false);
-#ifndef __APPLE__
- // LordHavoc: too many bugs on OSX!
vid.support.arb_texture_non_power_of_two = GL_CheckExtension("GL_ARB_texture_non_power_of_two", NULL, "-notexturenonpoweroftwo", false);
-#endif
vid.support.arb_vertex_buffer_object = GL_CheckExtension("GL_ARB_vertex_buffer_object", vbofuncs, "-novbo", false);
vid.support.arb_uniform_buffer_object = GL_CheckExtension("GL_ARB_uniform_buffer_object", ubofuncs, "-noubo", false);
vid.support.ati_separate_stencil = GL_CheckExtension("separatestencil", gl2separatestencilfuncs, "-noseparatestencil", true) || GL_CheckExtension("GL_ATI_separate_stencil", atiseparatestencilfuncs, "-noseparatestencil", false);
Cvar_RegisterVariable(&v_color_white_g);
Cvar_RegisterVariable(&v_color_white_b);
- Cvar_RegisterVariable(&v_glslgamma);
Cvar_RegisterVariable(&v_glslgamma_2d);
Cvar_RegisterVariable(&v_psycho);