Increase the effective radius of dynamic lights in GL.

This commit is contained in:
Jeff Teunissen 2000-06-04 12:56:28 +00:00
parent d5d4036334
commit 6c2ae3cb47
2 changed files with 6 additions and 7 deletions

View file

@ -545,7 +545,7 @@ void R_DrawAliasModel (entity_t *e)
VectorSubtract (currententity->origin,
cl_dlights[lnum].origin,
dist);
add = cl_dlights[lnum].radius - Length(dist);
add = (cl_dlights[lnum].radius * cl_dlights[lnum].radius * 8) / (Length(dist) * Length(dist)); // FIXME Deek
if (add > 0) {
ambientlight += add;
@ -752,7 +752,8 @@ void R_DrawViewModel (void)
continue;
VectorSubtract (currententity->origin, dl->origin, dist);
add = dl->radius - Length(dist);
add = (dl->radius * dl->radius * 8) / (Length(dist) * Length(dist)); // FIXME Deek
// add = dl->radius - Length(dist);
if (add > 0)
ambientlight += add;
}

View file

@ -151,10 +151,8 @@ R_AddDynamicLights (msurface_t *surf)
blue = cl_dlights[lnum].color[2];
brightness = max(red, max(green, blue));
rada = cl_dlights[lnum].radius * cl_dlights[lnum].radius
* (4.0/16.0); // comparison to min acceptable light
if (rada*brightness >= (sd*sd + td*td + dist))
{
rada = (cl_dlights[lnum].radius * cl_dlights[lnum].radius * 8) / (4.0/16.0); // comparison to min acceptable light
if (rada*brightness >= (sd*sd + td*td + dist)) {
radb = cl_dlights[lnum].radius
* cl_dlights[lnum].radius * (256.0*4.0);
bl = blocklights;
@ -167,7 +165,7 @@ R_AddDynamicLights (msurface_t *surf)
for (s = 0; s < smax; s++)
{
sd = local[0] - s*16;
if (rada >= (sd*sd+td)) // minimum light
if (rada >= (sd*sd+td)) // minimum light
{
brightness = radb / (sd*sd+td);
*bl++ += brightness * red;