mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-29 15:23:02 +00:00
Increase the effective radius of dynamic lights in GL.
This commit is contained in:
parent
d5d4036334
commit
6c2ae3cb47
2 changed files with 6 additions and 7 deletions
|
@ -545,7 +545,7 @@ void R_DrawAliasModel (entity_t *e)
|
||||||
VectorSubtract (currententity->origin,
|
VectorSubtract (currententity->origin,
|
||||||
cl_dlights[lnum].origin,
|
cl_dlights[lnum].origin,
|
||||||
dist);
|
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) {
|
if (add > 0) {
|
||||||
ambientlight += add;
|
ambientlight += add;
|
||||||
|
@ -752,7 +752,8 @@ void R_DrawViewModel (void)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
VectorSubtract (currententity->origin, dl->origin, dist);
|
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)
|
if (add > 0)
|
||||||
ambientlight += add;
|
ambientlight += add;
|
||||||
}
|
}
|
||||||
|
|
|
@ -151,10 +151,8 @@ R_AddDynamicLights (msurface_t *surf)
|
||||||
blue = cl_dlights[lnum].color[2];
|
blue = cl_dlights[lnum].color[2];
|
||||||
brightness = max(red, max(green, blue));
|
brightness = max(red, max(green, blue));
|
||||||
|
|
||||||
rada = cl_dlights[lnum].radius * cl_dlights[lnum].radius
|
rada = (cl_dlights[lnum].radius * cl_dlights[lnum].radius * 8) / (4.0/16.0); // comparison to min acceptable light
|
||||||
* (4.0/16.0); // comparison to min acceptable light
|
if (rada*brightness >= (sd*sd + td*td + dist)) {
|
||||||
if (rada*brightness >= (sd*sd + td*td + dist))
|
|
||||||
{
|
|
||||||
radb = cl_dlights[lnum].radius
|
radb = cl_dlights[lnum].radius
|
||||||
* cl_dlights[lnum].radius * (256.0*4.0);
|
* cl_dlights[lnum].radius * (256.0*4.0);
|
||||||
bl = blocklights;
|
bl = blocklights;
|
||||||
|
@ -167,7 +165,7 @@ R_AddDynamicLights (msurface_t *surf)
|
||||||
for (s = 0; s < smax; s++)
|
for (s = 0; s < smax; s++)
|
||||||
{
|
{
|
||||||
sd = local[0] - s*16;
|
sd = local[0] - s*16;
|
||||||
if (rada >= (sd*sd+td)) // minimum light
|
if (rada >= (sd*sd+td)) // minimum light
|
||||||
{
|
{
|
||||||
brightness = radb / (sd*sd+td);
|
brightness = radb / (sd*sd+td);
|
||||||
*bl++ += brightness * red;
|
*bl++ += brightness * red;
|
||||||
|
|
Loading…
Reference in a new issue