cb += fogcolor[2] * fog;
}
}
- cr *= r_colorscale;
- cg *= r_colorscale;
- cb *= r_colorscale;
GL_Color(cr, cg, cb, ca);
texcoord2f[2] = s2;texcoord2f[3] = t1;
texcoord2f[4] = s2;texcoord2f[5] = t2;
texcoord2f[6] = s1;texcoord2f[7] = t2;
- R_FillColors(color4f, 4, r_colorscale, r_colorscale, r_colorscale, 1);
+ R_FillColors(color4f, 4, 1, 1, 1, 1);
vertex3f[ 0] = x1;vertex3f[ 1] = y1;vertex3f[ 2] = 0;
vertex3f[ 3] = x2;vertex3f[ 4] = y1;vertex3f[ 5] = 0;
vertex3f[ 6] = x2;vertex3f[ 7] = y2;vertex3f[ 8] = 0;
// these are externally accessible
int r_lightmapscalebit;
-float r_colorscale;
static matrix4x4_t backend_viewmatrix;
static matrix4x4_t backend_modelmatrix;
qboolean SCR_ScreenShot(char *filename, int x, int y, int width, int height, qboolean jpeg)
{
qboolean ret;
- int i, j;
qbyte *buffer;
if (!r_render.integer)
qglReadPixels (x, y, width, height, GL_RGB, GL_UNSIGNED_BYTE, buffer);
CHECKGLERROR
- // LordHavoc: compensate for v_overbrightbits when using hardware gamma
- if (v_hwgamma.integer)
- {
- for (i = 0;i < width * height * 3;i++)
- {
- j = buffer[i] << v_overbrightbits.integer;
- buffer[i] = (qbyte) (bound(0, j, 255));
- }
- }
-
if (jpeg)
ret = JPEG_SaveImage_preflipped (filename, width, height, buffer);
else
if (gl_combine.integer && (!gl_combine_extension || r_textureunits.integer < 2))
Cvar_SetValueQuick(&gl_combine, 0);
- // lighting scale
- r_colorscale = 1.0f / (float) (1 << v_overbrightbits.integer);
-
// lightmaps only
- r_lightmapscalebit = v_overbrightbits.integer;
+ r_lightmapscalebit = 0;
if (gl_combine.integer && r_textureunits.integer > 1)
r_lightmapscalebit += 2;
}
rmeshstate_t;
-// overbright rendering scale for the current state
+// lightmap overbright scaling
extern int r_lightmapscalebit;
-extern float r_colorscale;
// adds console variables and registers the render module (only call from GL_Init)
void gl_backend_init(void);
int quadelements[768];
void R_DrawQueue(void)
{
- int pos, num, chartexnum, overbright, texnum, batch;
+ int pos, num, chartexnum, texnum, batch;
float x, y, w, h, s, t, u, v, *av, *at, c[4];
cachepic_t *pic;
drawqueue_t *dq;
texnum = 0;
color = 0;
- overbright = v_overbrightbits.integer;
batch = false;
batchcount = 0;
for (pos = 0;pos < r_refdef.drawqueuesize;pos += ((drawqueue_t *)(r_refdef.drawqueue + pos))->size)
{
dq = (drawqueue_t *)(r_refdef.drawqueue + pos);
color = dq->color;
-
+
if(dq->flags & DRAWFLAG_ADDITIVE)
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE);
else if(dq->flags & DRAWFLAG_MODULATE)
GL_BlendFunc(GL_DST_COLOR, GL_ZERO);
else
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-
+
GL_DepthMask(true);
GL_DepthTest(false);
- c[0] = (float) ((color >> 24) & 0xFF) * (1.0f / 255.0f) * r_colorscale;
- c[1] = (float) ((color >> 16) & 0xFF) * (1.0f / 255.0f) * r_colorscale;
- c[2] = (float) ((color >> 8) & 0xFF) * (1.0f / 255.0f) * r_colorscale;
+ c[0] = (float) ((color >> 24) & 0xFF) * (1.0f / 255.0f);
+ c[1] = (float) ((color >> 16) & 0xFF) * (1.0f / 255.0f);
+ c[2] = (float) ((color >> 8) & 0xFF) * (1.0f / 255.0f);
c[3] = (float) ( color & 0xFF) * (1.0f / 255.0f);
x = dq->x;
y = dq->y;
}
else
c[0] = c[1] = c[2] = v_contrast.value;
- VectorScale(c, (float) (1 << v_overbrightbits.integer), c);
if (c[0] >= 1.01f || c[1] >= 1.01f || c[2] >= 1.01f)
{
GL_BlendFunc(GL_DST_COLOR, GL_ONE);
GL_DepthTest(true);
firstpass = false;
expandaliasvert(mesh->num_vertices);
- colorscale = r_colorscale;
+ colorscale = 1.0f;
memset(&m, 0, sizeof(m));
if (layer->texture != NULL)
GL_VertexPointer(varray_vertex3f);
memset(&mstate, 0, sizeof(mstate));
- colorscale = r_colorscale;
+ colorscale = 1.0f;
if (gl_combine.integer)
{
mstate.texrgbscale[0] = 4;
//mstate.pointer_texcoord = ent->model->alias.zymdata_texcoords;
R_Mesh_State_Texture(&mstate);
- GL_Color(fogcolor[0] * r_colorscale, fogcolor[1] * r_colorscale, fogcolor[2] * r_colorscale, ent->alpha * fog);
+ GL_Color(fogcolor[0], fogcolor[1], fogcolor[2], ent->alpha * fog);
ZymoticTransformVerts(numverts, varray_vertex3f, ent->model->alias.zymdata_vertbonecounts, ent->model->alias.zymdata_verts);
R_Mesh_Draw(numverts, numtriangles, elements);
c_alias_polys += numtriangles;
GL_DepthMask(false);
GL_DepthTest(r_shadow_visiblevolumes.integer < 2);
qglDisable(GL_CULL_FACE);
- GL_Color(0.0 * r_colorscale, 0.0125 * r_colorscale, 0.1 * r_colorscale, 1);
+ GL_Color(0.0, 0.0125, 0.1, 1);
}
else
R_Shadow_Stage_Begin();
vertex3f[18] = mins[0];vertex3f[19] = maxs[1];vertex3f[20] = maxs[2];
vertex3f[21] = maxs[0];vertex3f[22] = maxs[1];vertex3f[23] = maxs[2];
GL_ColorPointer(color);
- R_FillColors(color, 8, cr * r_colorscale, cg * r_colorscale, cb * r_colorscale, ca);
+ R_FillColors(color, 8, cr, cg, cb, ca);
if (fogenabled)
{
for (i = 0, v = vertex, c = color;i < 8;i++, v += 4, c += 4)
VectorSubtract(v, r_origin, diff);
f2 = exp(fogdensity/DotProduct(diff, diff));
f1 = 1 - f2;
- f2 *= r_colorscale;
c[0] = c[0] * f1 + fogcolor[0] * f2;
c[1] = c[1] * f1 + fogcolor[1] * f2;
c[2] = c[2] * f1 + fogcolor[2] * f2;
f1 = 1 - f2;
for (i = 0, c = color4f;i < 6;i++, c += 4)
{
- c[0] = (c[0] * f1 + fogcolor[0] * f2) * r_colorscale;
- c[1] = (c[1] * f1 + fogcolor[1] * f2) * r_colorscale;
- c[2] = (c[2] * f1 + fogcolor[2] * f2) * r_colorscale;
+ c[0] = (c[0] * f1 + fogcolor[0] * f2);
+ c[1] = (c[1] * f1 + fogcolor[1] * f2);
+ c[2] = (c[2] * f1 + fogcolor[2] * f2);
c[3] *= ent->alpha;
}
}
- else if (r_colorscale != 1 || ent->alpha != 1)
+ else if (ent->alpha != 1)
{
memcpy(color4f, nomodelcolor4f, sizeof(float[6*4]));
GL_ColorPointer(color4f);
for (i = 0, c = color4f;i < 6;i++, c += 4)
- {
- c[0] *= r_colorscale;
- c[1] *= r_colorscale;
- c[2] *= r_colorscale;
c[3] *= ent->alpha;
- }
}
else
GL_ColorPointer(nomodelcolor4f);
}
R_Mesh_Matrix(&r_identitymatrix);
- GL_Color(cr * r_colorscale, cg * r_colorscale, cb * r_colorscale, ca);
+ GL_Color(cr, cg, cb, ca);
GL_VertexPointer(varray_vertex3f);
GL_BlendFunc(blendfunc1, blendfunc2);
GL_DepthMask(false);
R_Mesh_Matrix(&ent->matrix);
- GL_Color(fogcolor[0] * r_colorscale, fogcolor[1] * r_colorscale, fogcolor[2] * r_colorscale, 1);
+ GL_Color(fogcolor[0], fogcolor[1], fogcolor[2], 1);
if (skyrendermasked)
{
// depth-only (masking)
{
const entity_render_t *ent = calldata1;
const msurface_t *surf = ent->model->brushq1.surfaces + calldata2;
- float f, colorscale;
+ float colorscale;
const surfmesh_t *mesh;
rmeshstate_t m;
float alpha;
}
else
m.tex[0] = R_GetTexture(texture->skin.base);
- colorscale = r_colorscale;
+ colorscale = 1;
if (gl_combine.integer)
{
m.texrgbscale[0] = 4;
colorscale *= 0.25f;
}
GL_DepthTest(true);
- GL_ColorPointer(varray_color4f);
+ if (fogenabled)
+ GL_ColorPointer(varray_color4f);
+ else
+ GL_Color(1, 1, 1, alpha);
+ if (gl_textureshader && r_watershader.integer)
+ {
+ GL_ActiveTexture (0);
+ qglTexEnvi (GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_TEXTURE_2D);
+ GL_ActiveTexture (1);
+ qglTexEnvi (GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_TEXTURE_2D);
+ qglTexEnvi (GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_OFFSET_TEXTURE_2D_NV);
+ qglTexEnvi (GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB);
+ qglTexEnvfv (GL_TEXTURE_SHADER_NV, GL_OFFSET_TEXTURE_MATRIX_NV, &args[0]);
+ qglEnable (GL_TEXTURE_SHADER_NV);
+ }
for (mesh = surf->mesh;mesh;mesh = mesh->chain)
{
GL_VertexPointer(mesh->vertex3f);
m.pointer_texcoord[1] = mesh->texcoordtexture2f;
m.texcombinergb[1] = GL_REPLACE;
R_Mesh_State_Texture(&m);
- f = surf->flags & SURF_DRAWFULLBRIGHT ? 1.0f : ((surf->flags & SURF_LIGHTMAP) ? 0 : 0.5f);
- R_FillColors(varray_color4f, mesh->numverts, f, f, f, alpha);
- if (!(surf->flags & SURF_DRAWFULLBRIGHT || ent->effects & EF_FULLBRIGHT))
- {
- if (surf->dlightframe == r_framecount)
- RSurf_LightSeparate_Vertex3f_Color4f(&ent->inversematrix, surf->dlightbits, mesh->numverts, mesh->vertex3f, varray_color4f, 1);
- if (surf->flags & SURF_LIGHTMAP)
- RSurf_AddLightmapToVertexColors_Color4f(mesh->lightmapoffsets, varray_color4f, mesh->numverts, surf->samples, ((surf->extents[0]>>4)+1)*((surf->extents[1]>>4)+1)*3, surf->styles);
- }
- RSurf_FogColors_Vertex3f_Color4f(mesh->vertex3f, varray_color4f, colorscale, mesh->numverts, modelorg);
- if (gl_textureshader && r_watershader.integer)
+ if (fogenabled)
{
- GL_ActiveTexture (0);
- qglTexEnvi (GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_TEXTURE_2D);
- GL_ActiveTexture (1);
- qglTexEnvi (GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_TEXTURE_2D);
- qglTexEnvi (GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_OFFSET_TEXTURE_2D_NV);
- qglTexEnvi (GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB);
- qglTexEnvfv (GL_TEXTURE_SHADER_NV, GL_OFFSET_TEXTURE_MATRIX_NV, &args[0]);
- qglEnable (GL_TEXTURE_SHADER_NV);
+ R_FillColors(varray_color4f, mesh->numverts, 1, 1, 1, alpha);
+ RSurf_FogColors_Vertex3f_Color4f(mesh->vertex3f, varray_color4f, colorscale, mesh->numverts, modelorg);
}
R_Mesh_Draw(mesh->numverts, mesh->numtriangles, mesh->element3i);
- if (gl_textureshader && r_watershader.integer)
- {
- qglDisable (GL_TEXTURE_SHADER_NV);
- GL_ActiveTexture (0);
- }
+ }
+ if (gl_textureshader && r_watershader.integer)
+ {
+ qglDisable (GL_TEXTURE_SHADER_NV);
+ GL_ActiveTexture (0);
}
if (fogenabled)
m.pointer_texcoord[0] = mesh->texcoordtexture2f;
GL_ColorPointer(varray_color4f);
R_Mesh_State_Texture(&m);
- RSurf_FogPassColors_Vertex3f_Color4f(mesh->vertex3f, varray_color4f, fogcolor[0], fogcolor[1], fogcolor[2], alpha, r_colorscale, mesh->numverts, modelorg);
+ RSurf_FogPassColors_Vertex3f_Color4f(mesh->vertex3f, varray_color4f, fogcolor[0], fogcolor[1], fogcolor[2], alpha, 1, mesh->numverts, modelorg);
R_Mesh_Draw(mesh->numverts, mesh->numtriangles, mesh->element3i);
}
}
GL_DepthMask(true);
}
m.tex[0] = R_GetTexture(texture->skin.base);
+ colorscale = 1;
+ if (gl_combine.integer)
+ {
+ m.texrgbscale[0] = 4;
+ colorscale *= 0.25f;
+ }
+ base = ent->effects & EF_FULLBRIGHT ? 2.0f : r_ambient.value * (1.0f / 64.0f);
GL_DepthTest(true);
- if (fogenabled)
- GL_ColorPointer(varray_color4f);
- else
- GL_Color(r_colorscale, r_colorscale, r_colorscale, currentalpha);
+ GL_ColorPointer(varray_color4f);
for (mesh = surf->mesh;mesh;mesh = mesh->chain)
{
GL_VertexPointer(mesh->vertex3f);
m.pointer_texcoord[0] = mesh->texcoordtexture2f;
R_Mesh_State_Texture(&m);
- if (fogenabled)
+ R_FillColors(varray_color4f, mesh->numverts, base, base, base, currentalpha);
+ if (!(ent->effects & EF_FULLBRIGHT))
{
- R_FillColors(varray_color4f, mesh->numverts, 1.0f, 1.0f, 1.0f, currentalpha);
- RSurf_FogColors_Vertex3f_Color4f(mesh->vertex3f, varray_color4f, r_colorscale, mesh->numverts, modelorg);
+ if (surf->dlightframe == r_framecount)
+ RSurf_LightSeparate_Vertex3f_Color4f(&ent->inversematrix, surf->dlightbits, mesh->numverts, mesh->vertex3f, varray_color4f, 1);
+ if (surf->flags & SURF_LIGHTMAP)
+ RSurf_AddLightmapToVertexColors_Color4f(mesh->lightmapoffsets, varray_color4f, mesh->numverts, surf->samples, ((surf->extents[0]>>4)+1)*((surf->extents[1]>>4)+1)*3, surf->styles);
}
+ RSurf_FogColors_Vertex3f_Color4f(mesh->vertex3f, varray_color4f, colorscale, mesh->numverts, modelorg);
R_Mesh_Draw(mesh->numverts, mesh->numtriangles, mesh->element3i);
}
}
if (m.tex[0])
m.pointer_texcoord[0] = mesh->texcoordtexture2f;
R_Mesh_State_Texture(&m);
- RSurf_FoggedColors_Vertex3f_Color4f(mesh->vertex3f, varray_color4f, 1, 1, 1, currentalpha, r_colorscale, mesh->numverts, modelorg);
+ RSurf_FoggedColors_Vertex3f_Color4f(mesh->vertex3f, varray_color4f, 1, 1, 1, currentalpha, 1, mesh->numverts, modelorg);
R_Mesh_Draw(mesh->numverts, mesh->numtriangles, mesh->element3i);
}
}
if (m.tex[0])
m.pointer_texcoord[0] = mesh->texcoordtexture2f;
R_Mesh_State_Texture(&m);
- RSurf_FogPassColors_Vertex3f_Color4f(mesh->vertex3f, varray_color4f, fogcolor[0], fogcolor[1], fogcolor[2], currentalpha, r_colorscale, mesh->numverts, modelorg);
+ RSurf_FogPassColors_Vertex3f_Color4f(mesh->vertex3f, varray_color4f, fogcolor[0], fogcolor[1], fogcolor[2], currentalpha, 1, mesh->numverts, modelorg);
R_Mesh_Draw(mesh->numverts, mesh->numtriangles, mesh->element3i);
}
}
m.texrgbscale[0] = 1;
m.texrgbscale[1] = 4;
m.texrgbscale[2] = 2;
- cl = (float) (1 << r_lightmapscalebit) * r_colorscale;
+ cl = (float) (1 << r_lightmapscalebit);
GL_Color(cl, cl, cl, 1);
while((surf = *surfchain++) != NULL)
m.tex[1] = R_GetTexture((**surfchain).lightmaptexture);
if (gl_combine.integer)
m.texrgbscale[1] = 4;
- GL_Color(r_colorscale, r_colorscale, r_colorscale, 1);
+ GL_Color(1, 1, 1, 1);
while((surf = *surfchain++) != NULL)
{
if (surf->visframe == r_framecount)
m.tex[0] = R_GetTexture((**surfchain).lightmaptexture);
if (gl_combine.integer)
m.texrgbscale[0] = 4;
- GL_Color(r_colorscale, r_colorscale, r_colorscale, 1);
+ GL_Color(1, 1, 1, 1);
while((surf = *surfchain++) != NULL)
{
if (surf->visframe == r_framecount)
GL_DepthMask(false);
GL_DepthTest(true);
m.tex[0] = R_GetTexture(texture->skin.base);
- colorscale = r_colorscale;
+ colorscale = 1;
if (gl_combine.integer)
{
m.texrgbscale[0] = 4;
if (m.tex[0])
m.pointer_texcoord[0] = mesh->texcoordtexture2f;
R_Mesh_State_Texture(&m);
- RSurf_FogPassColors_Vertex3f_Color4f(mesh->vertex3f, varray_color4f, fogcolor[0], fogcolor[1], fogcolor[2], 1, r_colorscale, mesh->numverts, modelorg);
+ RSurf_FogPassColors_Vertex3f_Color4f(mesh->vertex3f, varray_color4f, fogcolor[0], fogcolor[1], fogcolor[2], 1, 1, mesh->numverts, modelorg);
R_Mesh_Draw(mesh->numverts, mesh->numtriangles, mesh->element3i);
}
}
GL_DepthMask(false);
GL_DepthTest(true);
m.tex[0] = R_GetTexture(texture->skin.glow);
- GL_Color(r_colorscale, r_colorscale, r_colorscale, 1);
+ GL_Color(1, 1, 1, 1);
while((surf = *surfchain++) != NULL)
{
if (surf->visframe == r_framecount)
GL_DepthMask(true);
m.tex[0] = R_GetTexture(texture->skin.glow);
if (m.tex[0])
- GL_Color(r_colorscale, r_colorscale, r_colorscale, 1);
+ GL_Color(1, 1, 1, 1);
else
GL_Color(0, 0, 0, 1);
while((surf = *surfchain++) != NULL)
texture = texture->anim_frames[ent->frame != 0][(texture->anim_total[ent->frame != 0] >= 2) ? ((int) (cl.time * 5.0f) % texture->anim_total[ent->frame != 0]) : 0];
currentalpha = ent->alpha;
- if (texture->flags & SURF_WATERALPHA)
- currentalpha *= r_wateralpha.value;
if (ent->effects & EF_ADDITIVE)
rendertype = SURFRENDER_ADD;
else if (currentalpha < 1 || texture->skin.fog != NULL)
R_Mesh_State_Texture(&m);
i = portal - ent->model->brushq1.portals;
- GL_Color(((i & 0x0007) >> 0) * (1.0f / 7.0f) * r_colorscale,
- ((i & 0x0038) >> 3) * (1.0f / 7.0f) * r_colorscale,
- ((i & 0x01C0) >> 6) * (1.0f / 7.0f) * r_colorscale,
+ GL_Color(((i & 0x0007) >> 0) * (1.0f / 7.0f),
+ ((i & 0x0038) >> 3) * (1.0f / 7.0f),
+ ((i & 0x01C0) >> 6) * (1.0f / 7.0f),
0.125f);
if (PlaneDiff(r_origin, (&portal->plane)) < 0)
{
{
int i;
i = ((int)brush) / sizeof(colbrushf_t);
- GL_Color((i & 31) * (1.0f / 32.0f) * r_colorscale, ((i >> 5) & 31) * (1.0f / 32.0f) * r_colorscale, ((i >> 10) & 31) * (1.0f / 32.0f) * r_colorscale, 0.2f);
+ GL_Color((i & 31) * (1.0f / 32.0f), ((i >> 5) & 31) * (1.0f / 32.0f), ((i >> 10) & 31) * (1.0f / 32.0f), 0.2f);
GL_VertexPointer(brush->points->v);
R_Mesh_Draw(brush->numpoints, brush->numtriangles, brush->elements);
}
R_Mesh_Matrix(&ent->matrix);
- GL_Color(fogcolor[0] * r_colorscale, fogcolor[1] * r_colorscale, fogcolor[2] * r_colorscale, 1);
+ GL_Color(fogcolor[0], fogcolor[1], fogcolor[2], 1);
if (skyrendermasked)
{
// depth-only (masking)
m.tex[1] = R_GetTexture(face->lightmaptexture);
m.pointer_texcoord[1] = face->data_texcoordlightmap2f;
m.texrgbscale[1] = 2;
- GL_Color(r_colorscale, r_colorscale, r_colorscale, 1);
+ GL_Color(1, 1, 1, 1);
}
else
{
}
-#define OPTIONS_ITEMS 33
+#define OPTIONS_ITEMS 32
int options_cursor;
Cvar_SetValueQuick (&scr_screenshot_jpeg, !scr_screenshot_jpeg.integer);
else if (options_cursor == optnum++)
Cvar_SetValueQuick (&r_sky, !r_sky.integer);
- else if (options_cursor == optnum++)
- Cvar_SetValueQuick (&v_overbrightbits, bound(0, v_overbrightbits.integer + dir, 4));
else if (options_cursor == optnum++)
Cvar_SetValueQuick (&gl_combine, !gl_combine.integer);
else if (options_cursor == optnum++)
M_Options_PrintSlider( " Screen size", true, scr_viewsize.value, 30, 120);
M_Options_PrintCheckbox(" JPEG screenshots", jpeg_dll != NULL, scr_screenshot_jpeg.integer);
M_Options_PrintCheckbox(" Sky", true, r_sky.integer);
- M_Options_PrintSlider( " Overbright Bits", true, v_overbrightbits.value, 0, 4);
M_Options_PrintCheckbox(" Texture Combine", true, gl_combine.integer);
M_Options_PrintCheckbox(" Dithering", true, gl_dither.integer);
M_Options_PrintCheckbox("Delay gfx (faster)", true, gl_delayfinish.integer);
numtriangles = EXPLOSIONTRIS;
numverts = EXPLOSIONVERTS;
- alpha = e->alpha * r_colorscale;
+ alpha = e->alpha;
GL_Color(alpha, alpha, alpha, 1);
GL_VertexPointer(e->vert[0]);
GL_BlendFunc(GL_DST_ALPHA, GL_ONE);
if (lightcubemap)
R_Shadow_Transform_Vertex3f_TexCoord3f(varray_texcoord3f[1], numverts, vertex3f, matrix_modeltofilter);
- VectorScale(lightcolor, r_colorscale * r_shadow_lightintensityscale.value, color2);
+ VectorScale(lightcolor, r_shadow_lightintensityscale.value, color2);
for (renders = 0;renders < 64 && (color2[0] > 0 || color2[1] > 0 || color2[2] > 0);renders++, color2[0]--, color2[1]--, color2[2]--)
{
color[0] = bound(0, color2[0], 1);
GL_BlendFunc(GL_DST_ALPHA, GL_ONE);
if (lightcubemap)
R_Shadow_Transform_Vertex3f_TexCoord3f(varray_texcoord3f[1], numverts, vertex3f, matrix_modeltofilter);
- VectorScale(lightcolor, r_colorscale * r_shadow_lightintensityscale.value, color2);
+ VectorScale(lightcolor, r_shadow_lightintensityscale.value, color2);
for (renders = 0;renders < 64 && (color2[0] > 0 || color2[1] > 0 || color2[2] > 0);renders++, color2[0]--, color2[1]--, color2[2]--)
{
color[0] = bound(0, color2[0], 1);
qglColorMask(1,1,1,0);
GL_BlendFunc(GL_DST_ALPHA, GL_ONE);
R_Shadow_Transform_Vertex3f_TexCoord3f(varray_texcoord3f[1], numverts, vertex3f, matrix_modeltoattenuationxyz);
- VectorScale(lightcolor, r_colorscale * r_shadow_lightintensityscale.value, color2);
+ VectorScale(lightcolor, r_shadow_lightintensityscale.value, color2);
for (renders = 0;renders < 64 && (color2[0] > 0 || color2[1] > 0 || color2[2] > 0);renders++, color2[0]--, color2[1]--, color2[2]--)
{
color[0] = bound(0, color2[0], 1);
GL_BlendFunc(GL_DST_ALPHA, GL_ONE);
if (lightcubemap)
R_Shadow_Transform_Vertex3f_TexCoord3f(varray_texcoord3f[1], numverts, vertex3f, matrix_modeltofilter);
- VectorScale(lightcolor, r_colorscale * r_shadow_lightintensityscale.value, color2);
+ VectorScale(lightcolor, r_shadow_lightintensityscale.value, color2);
for (renders = 0;renders < 64 && (color2[0] > 0 || color2[1] > 0 || color2[2] > 0);renders++, color2[0]--, color2[1]--, color2[2]--)
{
color[0] = bound(0, color2[0], 1);
GL_BlendFunc(GL_DST_ALPHA, GL_ONE);
if (lightcubemap)
R_Shadow_Transform_Vertex3f_TexCoord3f(varray_texcoord3f[1], numverts, vertex3f, matrix_modeltofilter);
- VectorScale(lightcolor, r_colorscale * r_shadow_lightintensityscale.value, color2);
+ VectorScale(lightcolor, r_shadow_lightintensityscale.value, color2);
for (renders = 0;renders < 64 && (color2[0] > 0 || color2[1] > 0 || color2[2] > 0);renders++, color2[0]--, color2[1]--, color2[2]--)
{
color[0] = bound(0, color2[0], 1);
GL_DepthMask(false);
GL_DepthTest(true);
GL_ColorPointer(varray_color4f);
- VectorScale(lightcolor, r_colorscale * r_shadow_lightintensityscale.value, color2);
+ VectorScale(lightcolor, r_shadow_lightintensityscale.value, color2);
memset(&m, 0, sizeof(m));
m.tex[0] = R_GetTexture(basetexture);
m.pointer_texcoord[0] = texcoord2f;
glosstexture = r_shadow_blankglosstexture;
if (r_shadow_gloss.integer >= 2 || (r_shadow_gloss.integer >= 1 && glosstexture != r_shadow_blankglosstexture))
{
- colorscale = r_colorscale * r_shadow_glossintensity.value;
+ colorscale = r_shadow_glossintensity.value;
if (!bumptexture)
bumptexture = r_shadow_blankbumptexture;
if (glosstexture == r_shadow_blankglosstexture)
{
int i;
rmeshstate_t m;
- GL_Color(r_colorscale, r_colorscale, r_colorscale, 1);
+ GL_Color(1, 1, 1, 1);
memset(&m, 0, sizeof(m));
GL_BlendFunc(GL_ONE, GL_ZERO);
GL_DepthMask(true);
Matrix4x4_CreateIdentity(&identitymatrix);
GL_VertexPointer(skysphere_vertex3f);
- GL_Color(r_colorscale, r_colorscale, r_colorscale, 1);
+ GL_Color(1, 1, 1, 1);
GL_BlendFunc(GL_ONE, GL_ZERO);
GL_DepthMask(true);
GL_DepthTest(false); // don't modify or read zbuffer
m.tex[0] = R_GetTexture(solidskytexture);
m.pointer_texcoord[0] = skysphere_texcoord2f;
R_Mesh_TextureMatrix(0, &scroll1matrix);
- if (r_colorscale == 1 && r_textureunits.integer >= 2)
+ if (r_textureunits.integer >= 2)
{
// one pass using GL_DECAL or GL_INTERPOLATE_ARB for alpha layer
// LordHavoc: note that color is not set here because it does not
#include "meshqueue.h"
-extern float overbrightscale;
-
#include "r_lerpanim.h"
extern cvar_t r_render;
extern cvar_t v_color_white_r;
extern cvar_t v_color_white_g;
extern cvar_t v_color_white_b;
-extern cvar_t v_overbrightbits;
extern cvar_t v_hwgamma;
extern int gl_stencil;
cvar_t v_color_white_r = {CVAR_SAVE, "v_color_white_r", "1"};
cvar_t v_color_white_g = {CVAR_SAVE, "v_color_white_g", "1"};
cvar_t v_color_white_b = {CVAR_SAVE, "v_color_white_b", "1"};
-cvar_t v_overbrightbits = {CVAR_SAVE, "v_overbrightbits", "0"};
cvar_t v_hwgamma = {CVAR_SAVE, "v_hwgamma", "1"};
// brand of graphics chip
}
static float cachegamma, cachebrightness, cachecontrast, cacheblack[3], cachegrey[3], cachewhite[3];
-static int cacheoverbrightbits = -1, cachecolorenable, cachehwgamma;
+static int cachecolorenable, cachehwgamma;
#define BOUNDCVAR(cvar, m1, m2) c = &(cvar);f = bound(m1, c->value, m2);if (c->value != f) Cvar_SetValueQuick(c, f);
void VID_UpdateGamma(qboolean force)
{
if (!force
&& vid_usinghwgamma == (vid_allowhwgamma && v_hwgamma.integer)
- && v_overbrightbits.integer == cacheoverbrightbits
&& v_gamma.value == cachegamma
&& v_contrast.value == cachecontrast
&& v_brightness.value == cachebrightness
BOUNDCVAR(v_color_white_g, 1, 5);cachewhite[1] = v_color_white_g.value;
BOUNDCVAR(v_color_white_b, 1, 5);cachewhite[2] = v_color_white_b.value;
cachecolorenable = v_color_enable.integer;
- cacheoverbrightbits = v_overbrightbits.integer;
cachehwgamma = v_hwgamma.integer;
if (cachecolorenable)
{
- BuildGammaTable16((float) (1 << cacheoverbrightbits), invpow(0.5, 1 - cachegrey[0]), cachewhite[0], cacheblack[0], vid_gammaramps);
- BuildGammaTable16((float) (1 << cacheoverbrightbits), invpow(0.5, 1 - cachegrey[1]), cachewhite[1], cacheblack[1], vid_gammaramps + 256);
- BuildGammaTable16((float) (1 << cacheoverbrightbits), invpow(0.5, 1 - cachegrey[2]), cachewhite[2], cacheblack[2], vid_gammaramps + 512);
+ BuildGammaTable16(1.0f, invpow(0.5, 1 - cachegrey[0]), cachewhite[0], cacheblack[0], vid_gammaramps);
+ BuildGammaTable16(1.0f, invpow(0.5, 1 - cachegrey[1]), cachewhite[1], cacheblack[1], vid_gammaramps + 256);
+ BuildGammaTable16(1.0f, invpow(0.5, 1 - cachegrey[2]), cachewhite[2], cacheblack[2], vid_gammaramps + 512);
}
else
{
- BuildGammaTable16((float) (1 << cacheoverbrightbits), cachegamma, cachecontrast, cachebrightness, vid_gammaramps);
- BuildGammaTable16((float) (1 << cacheoverbrightbits), cachegamma, cachecontrast, cachebrightness, vid_gammaramps + 256);
- BuildGammaTable16((float) (1 << cacheoverbrightbits), cachegamma, cachecontrast, cachebrightness, vid_gammaramps + 512);
+ BuildGammaTable16(1.0f, cachegamma, cachecontrast, cachebrightness, vid_gammaramps);
+ BuildGammaTable16(1.0f, cachegamma, cachecontrast, cachebrightness, vid_gammaramps + 256);
+ BuildGammaTable16(1.0f, cachegamma, cachecontrast, cachebrightness, vid_gammaramps + 512);
}
vid_hardwaregammasupported = VID_SetGamma(vid_gammaramps);
Cvar_RegisterVariable(&v_color_white_b);
Cvar_RegisterVariable(&v_hwgamma);
- Cvar_RegisterVariable(&v_overbrightbits);
Cvar_RegisterVariable(&vid_fullscreen);
Cvar_RegisterVariable(&vid_width);