vkQuake2 doxygen  1.0 dev
r_light.c File Reference
#include "r_local.h"

Go to the source code of this file.

Functions

void R_MarkLights (dlight_t *light, int bit, mnode_t *node)
 
void R_PushDlights (model_t *model)
 
int RecursiveLightPoint (mnode_t *node, vec3_t start, vec3_t end)
 
void R_LightPoint (vec3_t p, vec3_t color)
 
int RecursiveLightPointColor (mnode_t *node, vec3_t start, vec3_t end)
 
void R_LightPointColor (vec3_t p, vec3_t color)
 
void R_AddDynamicLights (void)
 
void R_BuildLightMap (void)
 
void R_AddDynamicLightsRGB (void)
 
void R_BuildLightMapRGB (void)
 

Variables

int r_dlightframecount
 
vec3_t pointcolor
 
mplane_tlightplane
 
vec3_t lightspot
 
unsigned blocklights [1024 *3]
 

Function Documentation

◆ R_AddDynamicLights()

void R_AddDynamicLights ( void  )

Definition at line 451 of file r_light.c.

452 {
453  msurface_t *surf;
454  int lnum;
455  int sd, td;
456  float dist, rad, minlight;
457  vec3_t impact, local;
458  int s, t;
459  int i;
460  int smax, tmax;
461  mtexinfo_t *tex;
462  dlight_t *dl;
463  int negativeLight; //PGM
464 
465  surf = r_drawsurf.surf;
466  smax = (surf->extents[0] >> 4) + 1;
467  tmax = (surf->extents[1] >> 4) + 1;
468  tex = surf->texinfo;
469 
470  for (lnum = 0; lnum < r_newrefdef.num_dlights; lnum++)
471  {
472  if (!(surf->dlightbits & (1 << lnum)))
473  continue; // not lit by this light
474 
475  dl = &r_newrefdef.dlights[lnum];
476  rad = dl->intensity;
477 
478  //=====
479  //PGM
480  negativeLight = 0;
481  if (rad < 0)
482  {
483  negativeLight = 1;
484  rad = -rad;
485  }
486  //PGM
487  //=====
488 
489  dist = DotProduct(dl->origin, surf->plane->normal) -
490  surf->plane->dist;
491  rad -= fabs(dist);
492  minlight = 32; // dl->minlight;
493  if (rad < minlight)
494  continue;
495  minlight = rad - minlight;
496 
497  for (i = 0; i < 3; i++)
498  {
499  impact[i] = dl->origin[i] -
500  surf->plane->normal[i] * dist;
501  }
502 
503  local[0] = DotProduct(impact, tex->vecs[0]) + tex->vecs[0][3];
504  local[1] = DotProduct(impact, tex->vecs[1]) + tex->vecs[1][3];
505 
506  local[0] -= surf->texturemins[0];
507  local[1] -= surf->texturemins[1];
508 
509  for (t = 0; t < tmax; t++)
510  {
511  td = local[1] - t * 16;
512  if (td < 0)
513  td = -td;
514  for (s = 0; s < smax; s++)
515  {
516  sd = local[0] - s * 16;
517  if (sd < 0)
518  sd = -sd;
519  if (sd > td)
520  dist = sd + (td >> 1);
521  else
522  dist = td + (sd >> 1);
523  //====
524  //PGM
525  if (!negativeLight)
526  {
527  if (dist < minlight)
528  blocklights[t*smax + s] += (rad - dist) * 256;
529  }
530  else
531  {
532  if (dist < minlight)
533  blocklights[t*smax + s] -= (rad - dist) * 256;
534  if (blocklights[t*smax + s] < minlight)
535  blocklights[t*smax + s] = minlight;
536  }
537  //PGM
538  //====
539  }
540  }
541  }
542 }

Referenced by R_BuildLightMap().

◆ R_AddDynamicLightsRGB()

void R_AddDynamicLightsRGB ( void  )

Definition at line 620 of file r_light.c.

621 {
622  msurface_t *surf;
623  int lnum;
624  int sd, td;
625  float dist, rad, minlight;
626  vec3_t impact, local;
627  int s, t;
628  int i;
629  int smax, tmax;
630  mtexinfo_t *tex;
631  dlight_t *dl;
632  int negativeLight; //PGM
633  float cred, cgreen, cblue, brightness;
634  unsigned *bl;
635  surf = r_drawsurf.surf;
636  smax = (surf->extents[0] >> 4) + 1;
637  tmax = (surf->extents[1] >> 4) + 1;
638  tex = surf->texinfo;
639 
640  for (lnum = 0; lnum < r_newrefdef.num_dlights; lnum++)
641  {
642  if (!(surf->dlightbits & (1 << lnum)))
643  continue; // not lit by this light
644 
645  dl = &r_newrefdef.dlights[lnum];
646  rad = dl->intensity;
647 
648  //=====
649  //PGM
650  negativeLight = 0;
651  if (rad < 0)
652  {
653  negativeLight = 1;
654  rad = -rad;
655  }
656  //PGM
657  //=====
658 
659  dist = DotProduct(dl->origin, surf->plane->normal) -
660  surf->plane->dist;
661  rad -= fabs(dist);
662  minlight = 32; // dl->minlight;
663  if (rad < minlight)
664  continue;
665  minlight = rad - minlight;
666 
667  for (i = 0; i < 3; i++)
668  {
669  impact[i] = dl->origin[i] -
670  surf->plane->normal[i] * dist;
671  }
672 
673  local[0] = DotProduct(impact, tex->vecs[0]) + tex->vecs[0][3];
674  local[1] = DotProduct(impact, tex->vecs[1]) + tex->vecs[1][3];
675 
676  local[0] -= surf->texturemins[0];
677  local[1] -= surf->texturemins[1];
678  cred = dl[lnum].color[0] * 256.0f;
679  cgreen = dl[lnum].color[1] * 256.0f;
680  cblue = dl[lnum].color[2] * 256.0f;
681 
682  bl = blocklights;
683  for (t = 0; t < tmax; t++)
684  {
685  td = local[1] - t * 16;
686  if (td < 0)
687  td = -td;
688  for (s = 0; s < smax; s++)
689  {
690  sd = local[0] - s * 16;
691  if (sd < 0)
692  sd = -sd;
693  if (sd > td)
694  dist = sd + (td >> 1);
695  else
696  dist = td + (sd >> 1);
697  //====
698  //PGM
699 
700  if (!negativeLight)
701  {
702  if (dist < minlight)
703  {
704  brightness = rad - dist;
705  bl[0] += (int)(brightness * cred);
706  bl[1] += (int)(brightness * cgreen);
707  bl[2] += (int)(brightness * cblue);
708  }
709  bl += 3;
710  }
711  else
712  {
713  if (dist < minlight)
714  {
715  brightness = rad - dist;
716  bl[0] -= (int)(brightness * cred);
717  bl[1] -= (int)(brightness * cgreen);
718  bl[2] -= (int)(brightness * cblue);
719  if (bl[0] < minlight) bl[0] = minlight;
720  if (bl[1] < minlight) bl[1] = minlight;
721  if (bl[2] < minlight) bl[2] = minlight;
722  }
723  bl += 3;
724  }
725  //PGM
726  //====
727  }
728  }
729  }
730 }

Referenced by R_BuildLightMapRGB().

◆ R_BuildLightMap()

void R_BuildLightMap ( void  )

Definition at line 551 of file r_light.c.

552 {
553  int smax, tmax;
554  int t;
555  int i, size;
556  byte *lightmap;
557  unsigned scale;
558  int maps;
559  msurface_t *surf;
560 
561  surf = r_drawsurf.surf;
562 
563  smax = (surf->extents[0] >> 4) + 1;
564  tmax = (surf->extents[1] >> 4) + 1;
565  size = smax*tmax;
566 
568  {
569  for (i = 0; i < size; i++)
570  blocklights[i] = 0;
571  return;
572  }
573 
574  // clear to no light
575  for (i = 0; i < size; i++)
576  blocklights[i] = 0;
577 
578 
579  // add all the lightmaps
580  lightmap = surf->samples;
581  if (lightmap)
582  for (maps = 0; maps < MAXLIGHTMAPS && surf->styles[maps] != 255;
583  maps++)
584  {
585  scale = r_drawsurf.lightadj[maps]; // 8.8 fraction
586  for (i = 0; i < size; i++)
587  blocklights[i] += lightmap[i] * scale;
588  lightmap += size; // skip to next lightmap
589  }
590 
591  // add all the dynamic lights
592  if (surf->dlightframe == r_framecount)
594 
595  // bound, invert, and shift
596  for (i = 0; i < size; i++)
597  {
598  t = (int)blocklights[i];
599  if (t < 0)
600  t = 0;
601  t = (255 * 256 - t) >> (8 - VID_CBITS);
602 
603  if (t < (1 << 6))
604  t = (1 << 6);
605 
606  blocklights[i] = t;
607  }
608 }

Referenced by D_CacheSurface().

◆ R_BuildLightMapRGB()

void R_BuildLightMapRGB ( void  )

Definition at line 732 of file r_light.c.

733 {
734  int smax, tmax;
735  int i, size;
736  byte *lightmap;
737  int scale;
738  int maps;
739  msurface_t *surf;
740  int r;
741  surf = r_drawsurf.surf;
742 
743  smax = (surf->extents[0] >> 4) + 1;
744  tmax = (surf->extents[1] >> 4) + 1;
745  size = smax*tmax * 3;
746  lightmap = surf->samples;
747 
749  {
750  for (i = 0; i < size; i++){
751  blocklights[i] = 0;
752  blocklights[i + 1] = 0;
753  blocklights[i + 2] = 0;
754  }
755  return;
756  }
757 
758 
759  // clear to ambient
760  for (i = 0; i < size; i++)
762 
763 
764  // add all the lightmaps
765  if (lightmap)
766  for (maps = 0; maps < MAXLIGHTMAPS && surf->styles[maps] != 255;
767  maps++)
768  {
769  scale = r_drawsurf.lightadj[maps]; // 8.8 fraction
770  for (i = 0; i < size; i += 3)
771  {
772  blocklights[i] += lightmap[i] * scale;
773  blocklights[i + 1] += lightmap[i + 1] * scale;
774  blocklights[i + 2] += lightmap[i + 2] * scale;
775  }
776  lightmap += size; // skip to next lightmap
777  }
778 
779  // add all the dynamic lights
780  if (surf->dlightframe == r_framecount)
782 
783  // bound, invert, and shift
784 
785  // how quake2 should have really looked
786  //qb: always do 'overbrights' on colored lights.
787  for (i = 0; i < size; i++)
788  {
789  r = blocklights[i];
790  blocklights[i] = (r < 256) ? 256 : (r > 65536) ? 65536 : r; // leilei - made min 256 to rid visual artifacts and gain speed
791  }
792 }

Referenced by D_CacheSurface().

◆ R_LightPoint()

void R_LightPoint ( vec3_t  p,
vec3_t  color 
)

Definition at line 226 of file r_light.c.

227 {
228  vec3_t end;
229  float r;
230  int lnum;
231  dlight_t *dl;
232  vec3_t dist;
233  float add;
234 
235  if (!r_worldmodel->lightdata)
236  {
237  color[0] = color[1] = color[2] = 1.0;
238  return;
239  }
240 
241  end[0] = p[0];
242  end[1] = p[1];
243  end[2] = p[2] - 2048;
244 
246 
247  if (r == -1)
248  {
249  VectorCopy(vec3_origin, color);
250  }
251  else
252  {
253  VectorCopy(pointcolor, color);
254  }
255 
256  //
257  // add dynamic lights
258  //
259  for (lnum = 0; lnum<r_newrefdef.num_dlights; lnum++)
260  {
261  dl = &r_newrefdef.dlights[lnum];
263  dl->origin,
264  dist);
265  add = dl->intensity - VectorLength(dist);
266  add *= (1.0 / 256);
267  if (add > 0)
268  {
269  VectorMA(color, add, dl->color, color);
270  }
271  }
272 }

Referenced by R_DrawAliasModel(), R_DrawNullModel(), and R_SetLightLevel().

◆ R_LightPointColor()

void R_LightPointColor ( vec3_t  p,
vec3_t  color 
)

Definition at line 387 of file r_light.c.

388 {
389  vec3_t end;
390  float r;
391  int lnum;
392  dlight_t *dl;
393  float light;
394  vec3_t dist;
395  float add;
396 
397  if (!r_worldmodel->lightdata)
398  {
399  color[0] = color[1] = color[2] = 1.0;
400  return;
401  }
402 
403  end[0] = p[0];
404  end[1] = p[1];
405  end[2] = p[2] - 2048;
406 
408 
409  if (r == -1)
410  {
411  VectorCopy(vec3_origin, color);
412  }
413  else
414  {
415  VectorCopy(pointcolor, color);
416  }
417 
418  //
419  // add dynamic lights
420  //
421  light = 0;
422  dl = r_newrefdef.dlights;
423  for (lnum = 0; lnum<r_newrefdef.num_dlights; lnum++, dl++)
424  {
426  dl->origin,
427  dist);
428  add = dl->intensity - VectorLength(dist);
429  add *= (1.0 / 256);
430  if (add > 0)
431  {
432  VectorMA(color, add, dl->color, color);
433  }
434  }
435 
436  VectorScale(color, 1, color);
437 }

Referenced by R_AliasSetupLighting().

◆ R_MarkLights()

void R_MarkLights ( dlight_t light,
int  bit,
mnode_t node 
)

Definition at line 40 of file r_light.c.

41 {
42  mplane_t *splitplane;
43  float dist;
44  msurface_t *surf;
45  int i;
46 
47  if (node->contents != -1)
48  return;
49 
50  splitplane = node->plane;
51  dist = DotProduct(light->origin, splitplane->normal) - splitplane->dist;
52 
53  //=====
54  //PGM
55  i = light->intensity;
56  if (i<0)
57  i = -i;
58  //PGM
59  //=====
60 
61  if (dist > i) // PGM (dist > light->intensity)
62  {
63  R_MarkLights(light, bit, node->children[0]);
64  return;
65  }
66  if (dist < -i) // PGM (dist < -light->intensity)
67  {
68  R_MarkLights(light, bit, node->children[1]);
69  return;
70  }
71 
72  // mark the polygons
73  surf = r_worldmodel->surfaces + node->firstsurface;
74  for (i = 0; i < node->numsurfaces; i++, surf++)
75  {
76  if (surf->dlightframe != r_dlightframecount)
77  {
78  surf->dlightbits = 0;
80  }
81  surf->dlightbits |= bit;
82  }
83 
84  R_MarkLights(light, bit, node->children[0]);
85  R_MarkLights(light, bit, node->children[1]);
86 }

Referenced by R_DrawInlineBModel(), R_MarkLights(), and R_PushDlights().

◆ R_PushDlights()

void R_PushDlights ( model_t model)

Definition at line 94 of file r_light.c.

95 {
96  int i;
97  dlight_t *l;
98 
100  for (i = 0, l = r_newrefdef.dlights; i < r_newrefdef.num_dlights; i++, l++)
101  {
102  R_MarkLights(l, 1 << i,
103  model->nodes + model->firstnode);
104  }
105 }

Referenced by R_DrawBEntitiesOnList(), R_RenderFrame(), and R_RenderView().

◆ RecursiveLightPoint()

int RecursiveLightPoint ( mnode_t node,
vec3_t  start,
vec3_t  end 
)

Definition at line 120 of file r_light.c.

121 {
122  float front, back, frac;
123  int side;
124  mplane_t *plane;
125  vec3_t mid;
126  msurface_t *surf;
127  int s, t, ds, dt;
128  int i;
129  mtexinfo_t *tex;
130  byte *lightmap;
131  float *scales;
132  int maps;
133  float samp;
134  int r;
135 
136  if (node->contents != -1)
137  return -1; // didn't hit anything
138 
139  // calculate mid point
140 
141  // FIXME: optimize for axial
142  plane = node->plane;
143  front = DotProduct(start, plane->normal) - plane->dist;
144  back = DotProduct(end, plane->normal) - plane->dist;
145  side = front < 0;
146 
147  if ((back < 0) == side)
148  return RecursiveLightPoint(node->children[side], start, end);
149 
150  frac = front / (front - back);
151  mid[0] = start[0] + (end[0] - start[0])*frac;
152  mid[1] = start[1] + (end[1] - start[1])*frac;
153  mid[2] = start[2] + (end[2] - start[2])*frac;
154  if (plane->type < 3) // axial planes
155  mid[plane->type] = plane->dist;
156 
157  // go down front side
158  r = RecursiveLightPoint(node->children[side], start, mid);
159  if (r >= 0)
160  return r; // hit something
161 
162  if ((back < 0) == side)
163  return -1; // didn't hit anuthing
164 
165  // check for impact on this node
166  VectorCopy(mid, lightspot);
167  lightplane = plane;
168 
169  surf = r_worldmodel->surfaces + node->firstsurface;
170  for (i = 0; i < node->numsurfaces; i++, surf++)
171  {
172  if (surf->flags&(SURF_DRAWTURB | SURF_DRAWSKY))
173  continue; // no lightmaps
174 
175  tex = surf->texinfo;
176 
177  s = DotProduct(mid, tex->vecs[0]) + tex->vecs[0][3];
178  t = DotProduct(mid, tex->vecs[1]) + tex->vecs[1][3];
179  if (s < surf->texturemins[0] ||
180  t < surf->texturemins[1])
181  continue;
182 
183  ds = s - surf->texturemins[0];
184  dt = t - surf->texturemins[1];
185 
186  if (ds > surf->extents[0] || dt > surf->extents[1])
187  continue;
188 
189  if (!surf->samples)
190  return 0;
191 
192  ds >>= 4;
193  dt >>= 4;
194 
195  lightmap = surf->samples;
197  if (lightmap)
198  {
199  lightmap += dt * ((surf->extents[0] >> 4) + 1) + ds;
200 
201  for (maps = 0; maps < MAXLIGHTMAPS && surf->styles[maps] != 255;
202  maps++)
203  {
204  samp = *lightmap * /* 0.5 * */ (1.0 / 255); // adjust for gl scale
205  scales = r_newrefdef.lightstyles[surf->styles[maps]].rgb;
206  VectorMA(pointcolor, samp, scales, pointcolor);
207  lightmap += ((surf->extents[0] >> 4) + 1) *
208  ((surf->extents[1] >> 4) + 1);
209  }
210  }
211 
212  return 1;
213  }
214 
215  // go down back side
216  return RecursiveLightPoint(node->children[!side], mid, end);
217 }

Referenced by R_LightPoint().

◆ RecursiveLightPointColor()

int RecursiveLightPointColor ( mnode_t node,
vec3_t  start,
vec3_t  end 
)

Definition at line 281 of file r_light.c.

282 {
283  float front, back, frac;
284  int side;
285  mplane_t *plane;
286  vec3_t mid;
287  msurface_t *surf;
288  int s, t, ds, dt;
289  int i;
290  mtexinfo_t *tex;
291  byte *lightmap;
292  int maps;
293  int r;
294 
295  if (node->contents != -1)
296  return -1; // didn't hit anything
297 
298  // calculate mid point
299 
300  // FIXME: optimize for axial
301  plane = node->plane;
302  front = DotProduct(start, plane->normal) - plane->dist;
303  back = DotProduct(end, plane->normal) - plane->dist;
304  side = front < 0;
305 
306  if ((back < 0) == side)
307  return RecursiveLightPointColor(node->children[side], start, end);
308 
309  frac = front / (front - back);
310  mid[0] = start[0] + (end[0] - start[0])*frac;
311  mid[1] = start[1] + (end[1] - start[1])*frac;
312  mid[2] = start[2] + (end[2] - start[2])*frac;
313 
314  // go down front side
315  r = RecursiveLightPointColor(node->children[side], start, mid);
316  if (r >= 0)
317  return r; // hit something
318 
319  if ((back < 0) == side)
320  return -1; // didn't hit anuthing
321 
322  // check for impact on this node
323  VectorCopy(mid, lightspot);
324  lightplane = plane;
325 
326  surf = r_worldmodel->surfaces + node->firstsurface;
327  for (i = 0; i < node->numsurfaces; i++, surf++)
328  {
329  if (surf->flags&(SURF_DRAWTURB | SURF_DRAWSKY))
330  continue; // no lightmaps
331 
332  tex = surf->texinfo;
333 
334  s = DotProduct(mid, tex->vecs[0]) + tex->vecs[0][3];
335  t = DotProduct(mid, tex->vecs[1]) + tex->vecs[1][3];;
336 
337  if (s < surf->texturemins[0] ||
338  t < surf->texturemins[1])
339  continue;
340 
341  ds = s - surf->texturemins[0];
342  dt = t - surf->texturemins[1];
343 
344  if (ds > surf->extents[0] || dt > surf->extents[1])
345  continue;
346 
347  if (!surf->samples)
348  return 0;
349 
350  ds >>= 4;
351  dt >>= 4;
352 
353  lightmap = surf->samples;
355  if (lightmap)
356  {
357  vec3_t scale;
358 
359  lightmap += 3 * (dt * ((surf->extents[0] >> 4) + 1) + ds);
360 
361  for (maps = 0; maps < MAXLIGHTMAPS && surf->styles[maps] != 255;
362  maps++)
363  {
364  for (i = 0; i < 3; i++)
365  scale[i] = 1 * r_newrefdef.lightstyles[surf->styles[maps]].rgb[i];
366 
367  pointcolor[0] += lightmap[0] * scale[0] * (1.0 / 255);
368  pointcolor[1] += lightmap[1] * scale[1] * (1.0 / 255);
369  pointcolor[2] += lightmap[2] * scale[2] * (1.0 / 255);
370  lightmap += 3 * ((surf->extents[0] >> 4) + 1) *
371  ((surf->extents[1] >> 4) + 1);
372  }
373  }
374 
375  return 1;
376  }
377 
378  // go down back side
379  return RecursiveLightPointColor(node->children[!side], mid, end);
380 }

Referenced by R_LightPointColor().

Variable Documentation

◆ blocklights

unsigned blocklights[1024 *3]

◆ lightplane

mplane_t* lightplane

Definition at line 117 of file r_light.c.

Referenced by RecursiveLightPoint(), and RecursiveLightPointColor().

◆ lightspot

vec3_t lightspot

Definition at line 118 of file r_light.c.

Referenced by RecursiveLightPoint(), and RecursiveLightPointColor().

◆ pointcolor

vec3_t pointcolor

◆ r_dlightframecount

int r_dlightframecount

Definition at line 24 of file r_light.c.

Referenced by R_DrawBEntitiesOnList(), R_MarkLights(), and R_PushDlights().

R_AddDynamicLights
void R_AddDynamicLights(void)
Definition: r_light.c:451
r_framecount
int r_framecount
Definition: r_main.c:97
msurface_s::plane
mplane_t * plane
Definition: r_model.h:100
msurface_s::styles
byte styles[MAXLIGHTMAPS]
Definition: r_model.h:115
entity_s::origin
float origin[3]
Definition: ref.h:57
lightstyle_t::rgb
float rgb[3]
Definition: ref.h:98
int
CONST PIXELFORMATDESCRIPTOR int
Definition: qgl_win.c:35
VectorSubtract
#define VectorSubtract(a, b, c)
Definition: q_shared.h:163
mtexinfo_s
Definition: r_model.h:83
VectorScale
void VectorScale(vec3_t in, vec_t scale, vec3_t out)
Definition: q_shared.c:782
blocklights
unsigned blocklights[1024 *3]
Definition: r_light.c:444
i
int i
Definition: q_shared.c:305
msurface_s::dlightframe
int dlightframe
Definition: r_model.h:97
model_s::firstnode
int firstnode
Definition: r_model.h:214
dlight_t::origin
vec3_t origin
Definition: ref.h:84
pointcolor
vec3_t pointcolor
Definition: r_light.c:116
msurface_s::samples
byte * samples
Definition: r_model.h:116
r_drawsurf
drawsurf_t r_drawsurf
Definition: r_surf.c:24
mnode_s::children
struct mnode_s * children[2]
Definition: r_model.h:135
currententity
entity_t * currententity
Definition: r_bsp.c:28
mplane_s::normal
vec3_t normal
Definition: r_model.h:59
msurface_s::extents
short extents[2]
Definition: r_model.h:110
R_MarkLights
void R_MarkLights(dlight_t *light, int bit, mnode_t *node)
Definition: r_light.c:40
r
GLdouble GLdouble r
Definition: qgl_win.c:336
mplane_s::dist
float dist
Definition: r_model.h:60
refdef_t::num_dlights
int num_dlights
Definition: ref.h:119
VectorLength
vec_t VectorLength(vec3_t v)
Definition: q_shared.c:762
msurface_s::texinfo
mtexinfo_t * texinfo
Definition: r_model.h:112
t
GLdouble t
Definition: qgl_win.c:328
model_s::nodes
mnode_t * nodes
Definition: r_model.h:215
SURF_DRAWSKY
#define SURF_DRAWSKY
Definition: r_model.h:69
RecursiveLightPointColor
int RecursiveLightPointColor(mnode_t *node, vec3_t start, vec3_t end)
Definition: r_light.c:281
dlight_t::color
vec3_t color
Definition: ref.h:85
r_newrefdef
refdef_t r_newrefdef
Definition: r_main.c:38
DotProduct
#define DotProduct(x, y)
Definition: q_shared.h:162
r_worldmodel
model_t * r_worldmodel
Definition: r_main.c:41
cvar_s::value
float value
Definition: q_shared.h:331
model_s::lightdata
byte * lightdata
Definition: r_model.h:231
lightplane
mplane_t * lightplane
Definition: r_light.c:117
SURF_DRAWTURB
#define SURF_DRAWTURB
Definition: r_model.h:70
RecursiveLightPoint
int RecursiveLightPoint(mnode_t *node, vec3_t start, vec3_t end)
Definition: r_light.c:120
MAXLIGHTMAPS
#define MAXLIGHTMAPS
Definition: qfiles.h:409
msurface_s::flags
int flags
Definition: r_model.h:101
s
static fixed16_t s
Definition: r_scan.c:30
R_AddDynamicLightsRGB
void R_AddDynamicLightsRGB(void)
Definition: r_light.c:620
VectorCopy
#define VectorCopy(a, b)
Definition: q_shared.h:165
refdef_t::lightstyles
lightstyle_t * lightstyles
Definition: ref.h:114
mtexinfo_s::vecs
float vecs[2][4]
Definition: r_model.h:85
drawsurf_t::surf
msurface_t * surf
Definition: r_local.h:345
vec3_origin
vec3_t vec3_origin
Definition: q_shared.c:24
mnode_s::contents
int contents
Definition: r_model.h:126
mnode_s::firstsurface
unsigned short firstsurface
Definition: r_model.h:137
mplane_s::type
byte type
Definition: r_model.h:61
dlight_t
Definition: ref.h:82
drawsurf_t::lightadj
fixed8_t lightadj[MAXLIGHTMAPS]
Definition: r_local.h:346
model_s::surfaces
msurface_t * surfaces
Definition: r_model.h:221
mnode_s::plane
mplane_t * plane
Definition: r_model.h:134
VectorMA
void VectorMA(vec3_t veca, float scale, vec3_t vecb, vec3_t vecc)
Definition: q_shared.c:719
local
static vec3_t local
Definition: r_part.c:468
r_dlightframecount
int r_dlightframecount
Definition: r_light.c:24
msurface_s
Definition: r_model.h:93
mplane_s
Definition: r_model.h:57
refdef_t::dlights
dlight_t * dlights
Definition: ref.h:120
msurface_s::texturemins
short texturemins[2]
Definition: r_model.h:109
lightspot
vec3_t lightspot
Definition: r_light.c:118
msurface_s::dlightbits
int dlightbits
Definition: r_model.h:98
mnode_s::numsurfaces
unsigned short numsurfaces
Definition: r_model.h:138
r_fullbright
cvar_t * r_fullbright
Definition: r_main.c:137
dlight_t::intensity
float intensity
Definition: ref.h:86
vec3_t
vec_t vec3_t[3]
Definition: q_shared.h:134
VID_CBITS
#define VID_CBITS
Definition: r_local.h:158
r_refdef
oldrefdef_t r_refdef
Definition: r_main.c:80
oldrefdef_t::ambientlight
unsigned ambientlight
Definition: r_local.h:141