cvar_t r_usesurfaceculling = {0, "r_usesurfaceculling", "1", "skip off-screen surfaces (1 = cull surfaces if the map is likely to benefit, 2 = always cull surfaces)"};
cvar_t r_q3bsp_renderskydepth = {0, "r_q3bsp_renderskydepth", "0", "draws sky depth masking in q3 maps (as in q1 maps), this means for example that sky polygons can hide other things"};
extern cvar_t vid_sRGB;
+extern cvar_t vid_sRGB_fallback;
/*
===============
}
}
- if(vid_sRGB.integer && !vid.sRGBcapable3D)
+ if(vid_sRGB.integer && vid_sRGB_fallback.integer && !vid.sRGB3D)
Image_MakesRGBColorsFromLinear_Lightmap(templight, templight, size);
R_UpdateTexture(surface->lightmaptexture, templight, surface->lightmapinfo->lightmaporigin[0], surface->lightmapinfo->lightmaporigin[1], 0, smax, tmax, 1);
cvar_t mod_collision_bih = {0, "mod_collision_bih", "1", "enables use of generated Bounding Interval Hierarchy tree instead of compiled bsp tree in collision code"};
cvar_t mod_recalculatenodeboxes = {0, "mod_recalculatenodeboxes", "1", "enables use of generated node bounding boxes based on BSP tree portal reconstruction, rather than the node boxes supplied by the map compiler"};
extern cvar_t vid_sRGB;
+extern cvar_t vid_sRGB_fallback;
static texture_t mod_q1bsp_texture_solid;
static texture_t mod_q1bsp_texture_sky;
loadmodel->brushq3.data_texcoordlightmap2f[i * 2 + 0] = LittleFloat(in->lightmap2f[0]);
loadmodel->brushq3.data_texcoordlightmap2f[i * 2 + 1] = LittleFloat(in->lightmap2f[1]);
// svector/tvector are calculated later in face loading
- if(vid_sRGB.integer && !vid.sRGBcapable3D)
+ if(vid_sRGB.integer && vid_sRGB_fallback.integer && !vid.sRGB3D)
{
loadmodel->brushq3.data_color4f[i * 4 + 0] = Image_sRGBFloatFromLinear_Lightmap(in->color4ub[0]);
loadmodel->brushq3.data_color4f[i * 4 + 1] = Image_sRGBFloatFromLinear_Lightmap(in->color4ub[1]);
loadmodel->brushq3.data_deluxemaps[lightmapindex] = R_LoadTexture2D(loadmodel->texturepool, va("deluxemap%04i", lightmapindex), mergedwidth, mergedheight, mergeddeluxepixels, TEXTYPE_BGRA, TEXF_FORCELINEAR | (gl_texturecompression_q3bspdeluxemaps.integer ? TEXF_COMPRESS : 0), -1, NULL);
else
{
- if(vid_sRGB.integer && !vid.sRGBcapable3D)
+ if(vid_sRGB.integer && vid_sRGB_fallback.integer && !vid.sRGB3D)
Image_MakesRGBColorsFromLinear_Lightmap(mergedpixels, mergedpixels, mergedwidth * mergedheight);
loadmodel->brushq3.data_lightmaps [lightmapindex] = R_LoadTexture2D(loadmodel->texturepool, va("lightmap%04i", lightmapindex), mergedwidth, mergedheight, mergedpixels, TEXTYPE_BGRA, TEXF_FORCELINEAR | (gl_texturecompression_q3bsplightmaps.integer ? TEXF_COMPRESS : 0), -1, NULL);
}
cvar_t vid_gl20 = {0, "vid_gl20", "1", "enables faster rendering using OpenGL 2.0 features (such as GL_ARB_fragment_shader extension)"};
cvar_t gl_finish = {0, "gl_finish", "0", "make the cpu wait for the graphics processor at the end of each rendered frame (can help with strange input or video lag problems on some machines)"};
cvar_t vid_sRGB = {CVAR_SAVE, "vid_sRGB", "0", "if hardware is capable, modify rendering to be gamma corrected for the sRGB color standard (computer monitors, TVs), recommended"};
+cvar_t vid_sRGB_fallback = {CVAR_SAVE, "vid_sRGB_fallback", "0", "do an approximate sRGB fallback if not properly supported by hardware (2: always use the fallback even if sRGB is supported)"};
cvar_t vid_touchscreen = {0, "vid_touchscreen", "0", "Use touchscreen-style input (no mouse grab, track mouse motion only while button is down, screen areas for mimicing joystick axes and buttons"};
cvar_t vid_stick_mouse = {CVAR_SAVE, "vid_stick_mouse", "0", "have the mouse stuck in the center of the screen" };
Cvar_RegisterVariable(&vid_gl20);
Cvar_RegisterVariable(&gl_finish);
Cvar_RegisterVariable(&vid_sRGB);
+ Cvar_RegisterVariable(&vid_sRGB_fallback);
Cvar_RegisterVariable(&joy_active);
#ifdef WIN32
vid.userefreshrate = vid.mode.userefreshrate;
vid.stereobuffer = vid.mode.stereobuffer;
vid.stencil = vid.mode.bitsperpixel > 16;
- vid.sRGB2D = vid_sRGB.integer >= 1 && vid.sRGBcapable2D;
- vid.sRGB3D = vid_sRGB.integer >= 1 && vid.sRGBcapable3D;
+ vid.sRGB2D = vid_sRGB.integer >= 1 && vid_sRGB_fallback.integer <= 1 && vid.sRGBcapable2D;
+ vid.sRGB3D = vid_sRGB.integer >= 1 && vid_sRGB_fallback.integer <= 1 && vid.sRGBcapable3D;
if(vid.samples != vid.mode.samples)
Con_Printf("NOTE: requested %dx AA, got %dx AA\n", vid.mode.samples, vid.samples);