cvar_t cl_locs_enable = {CVAR_SAVE, "locs_enable", "1", "enables replacement of certain % codes in chat messages: %l (location), %d (last death location), %h (health), %a (armor), %x (rockets), %c (cells), %r (rocket launcher status), %p (powerup status), %w (weapon status), %t (current time in level)"};
cvar_t cl_locs_show = {0, "locs_show", "0", "shows defined locations for editing purposes"};
-extern cvar_t r_equalize_entities_fullbright;
-
client_static_t cls;
client_state_t cl;
{
if (!(e->render.effects & EF_FULLBRIGHT))
e->render.flags |= RENDER_LIGHT;
- else if(r_equalize_entities_fullbright.integer)
- e->render.flags |= RENDER_LIGHT | RENDER_EQUALIZE;
}
// hide player shadow during intermission or nehahra movie
if (!(e->render.effects & (EF_NOSHADOW | EF_ADDITIVE | EF_NODEPTHTEST))
{
if (!(e->render.effects & EF_FULLBRIGHT))
e->render.flags |= RENDER_LIGHT;
- else if(r_equalize_entities_fullbright.integer)
- e->render.flags |= RENDER_LIGHT | RENDER_EQUALIZE;
}
// hide player shadow during intermission or nehahra movie
if (!(e->render.effects & (EF_NOSHADOW | EF_ADDITIVE | EF_NODEPTHTEST)) && (e->render.alpha >= 1))
extern cvar_t r_fullbright_directed_ambient;
extern cvar_t r_fullbright_directed_diffuse;
extern cvar_t r_fullbright_directed;
-extern cvar_t r_equalize_entities_minambient;
-extern cvar_t r_equalize_entities_to;
-extern cvar_t r_equalize_entities_by;
extern cvar_t r_hdr_glowintensity;
static void CL_UpdateEntityShading_GetDirectedFullbright(vec3_t ambient, vec3_t diffuse, vec3_t worldspacenormal)
CL_UpdateEntityShading_GetDirectedFullbright(a, c, dir);
else
R_CompleteLightPoint(a, c, dir, shadingorigin, LP_LIGHTMAP, r_refdef.scene.lightmapintensity, r_refdef.scene.ambientintensity);
-
- if (ent->flags & RENDER_EQUALIZE)
- {
- // first fix up ambient lighting...
- if (r_equalize_entities_minambient.value > 0)
- {
- fd = 0.299f * ent->render_modellight_diffuse[0] + 0.587f * ent->render_modellight_diffuse[1] + 0.114f * ent->render_modellight_diffuse[2];
- if (fd > 0)
- {
- fa = (0.299f * ent->render_modellight_ambient[0] + 0.587f * ent->render_modellight_ambient[1] + 0.114f * ent->render_modellight_ambient[2]);
- if (fa < r_equalize_entities_minambient.value * fd)
- {
- // solve:
- // fa'/fd' = minambient
- // fa'+0.25*fd' = fa+0.25*fd
- // ...
- // fa' = fd' * minambient
- // fd'*(0.25+minambient) = fa+0.25*fd
- // ...
- // fd' = (fa+0.25*fd) * 1 / (0.25+minambient)
- // fa' = (fa+0.25*fd) * minambient / (0.25+minambient)
- // ...
- fdd = (fa + 0.25f * fd) / (0.25f + r_equalize_entities_minambient.value);
- f = fdd / fd; // f>0 because all this is additive; f<1 because fdd<fd because this follows from fa < r_equalize_entities_minambient.value * fd
- for (q = 0; q < 3; q++)
- {
- a[q] = (1 - f)*0.25f * c[q];
- c[q] *= f;
- }
- }
- }
- }
-
- if (r_equalize_entities_to.value > 0 && r_equalize_entities_by.value != 0)
- {
- fa = 0.299f * a[0] + 0.587f * a[1] + 0.114f * a[2];
- fd = 0.299f * c[0] + 0.587f * c[1] + 0.114f * c[2];
- f = fa + 0.25 * fd;
- if (f > 0)
- {
- // adjust brightness and saturation to target
- float l2 = r_equalize_entities_by.value, l1 = 1 - l2;
- for (q = 0; q < 3; q++)
- {
- a[q] = l1 * a[q] + l2 * (fa / f);
- c[q] = l1 * c[q] + l2 * (fd / f);
- }
- }
- }
- }
}
for (q = 0; q < 3; q++)
//4 feature darkplaces csqc: add builtins to clientside qc for gl calls
extern cvar_t v_flipped;
-extern cvar_t r_equalize_entities_fullbright;
r_refdef_view_t csqc_original_r_refdef_view;
r_refdef_view_t csqc_main_r_refdef_view;
{
if (!(staticent->render.effects & EF_FULLBRIGHT))
staticent->render.flags |= RENDER_LIGHT;
- else if(r_equalize_entities_fullbright.integer)
- staticent->render.flags |= RENDER_LIGHT | RENDER_EQUALIZE;
}
// turn off shadows from transparent objects
if (!(staticent->render.effects & (EF_NOSHADOW | EF_ADDITIVE | EF_NODEPTHTEST)) && (staticent->render.alpha >= 1))
}
extern cvar_t cl_noplayershadow;
-extern cvar_t r_equalize_entities_fullbright;
qboolean CSQC_AddRenderEdict(prvm_edict_t *ed, int edictnum)
{
prvm_prog_t *prog = CLVM_prog;
{
if (!(entrender->effects & EF_FULLBRIGHT) && !(renderflags & RF_FULLBRIGHT))
entrender->flags |= RENDER_LIGHT;
- else if(r_equalize_entities_fullbright.integer)
- entrender->flags |= RENDER_LIGHT | RENDER_EQUALIZE;
}
// hide player shadow during intermission or nehahra movie
if (!(entrender->effects & (EF_NOSHADOW | EF_ADDITIVE | EF_NODEPTHTEST))
cvar_t r_motionblur_mousefactor_minspeed = {CVAR_SAVE, "r_motionblur_mousefactor_minspeed", "0", "lower value of mouse acceleration when it starts to factor into blur equation"};
cvar_t r_motionblur_mousefactor_maxspeed = {CVAR_SAVE, "r_motionblur_mousefactor_maxspeed", "50", "upper value of mouse acceleration when it reaches the peak factor into blur equation"};
-// TODO do we want a r_equalize_entities cvar that works on all ents, or would that be a cheat?
-cvar_t r_equalize_entities_fullbright = {CVAR_SAVE, "r_equalize_entities_fullbright", "0", "render fullbright entities by equalizing their lightness, not by not rendering light (DEPRECATED)"};
-cvar_t r_equalize_entities_minambient = {CVAR_SAVE, "r_equalize_entities_minambient", "0.5", "light equalizing: ensure at least this ambient/diffuse ratio (DEPRECATED)"};
-cvar_t r_equalize_entities_by = {CVAR_SAVE, "r_equalize_entities_by", "0.7", "light equalizing: exponent of dynamics compression (0 = no compression, 1 = full compression) (DEPRECATED)"};
-cvar_t r_equalize_entities_to = {CVAR_SAVE, "r_equalize_entities_to", "0.8", "light equalizing: target light level (DEPRECATED)"};
-
cvar_t r_depthfirst = {CVAR_SAVE, "r_depthfirst", "0", "renders a depth-only version of the scene before normal rendering begins to eliminate overdraw, values: 0 = off, 1 = world depth, 2 = world and model depth"};
cvar_t r_useinfinitefarclip = {CVAR_SAVE, "r_useinfinitefarclip", "1", "enables use of a special kind of projection matrix that has an extremely large farclip"};
cvar_t r_farclip_base = {0, "r_farclip_base", "65536", "farclip (furthest visible distance) for rendering when r_useinfinitefarclip is 0"};
Cvar_RegisterVariable(&r_motionblur_mousefactor);
Cvar_RegisterVariable(&r_motionblur_mousefactor_minspeed);
Cvar_RegisterVariable(&r_motionblur_mousefactor_maxspeed);
- Cvar_RegisterVariable(&r_equalize_entities_fullbright);
- Cvar_RegisterVariable(&r_equalize_entities_minambient);
- Cvar_RegisterVariable(&r_equalize_entities_by);
- Cvar_RegisterVariable(&r_equalize_entities_to);
Cvar_RegisterVariable(&r_depthfirst);
Cvar_RegisterVariable(&r_useinfinitefarclip);
Cvar_RegisterVariable(&r_farclip_base);
#define RENDER_LIGHT 131072 // receive light
#define RENDER_NOSELFSHADOW 262144 // render lighting on this entity before its own shadow is added to the scene
// (note: all RENDER_NOSELFSHADOW entities are grouped together and rendered in a batch before their shadows are rendered, so they can not shadow eachother either)
-#define RENDER_EQUALIZE 524288 // (subflag of RENDER_LIGHT) equalize the light from the light grid hitting this ent (less invasive EF_FULLBRIGHT implementation)
#define RENDER_NODEPTHTEST 1048576
#define RENDER_ADDITIVE 2097152
#define RENDER_DOUBLESIDED 4194304