]> de.git.xonotic.org Git - xonotic/darkplaces.git/blob - r_light.h
5c7c116b74148adef7e245dcec516b07bcf4836b
[xonotic/darkplaces.git] / r_light.h
1
2 #ifndef R_LIGHT_H
3 #define R_LIGHT_H
4
5 typedef struct
6 {
7         vec3_t origin;
8         vec_t cullradius2; // only for culling comparisons, squared version
9         vec3_t light; // the brightness of the light
10         vec_t cullradius; // only for culling comparisons
11         vec_t subtract; // to avoid sudden brightness change at cullradius, subtract this
12         entity_render_t *ent; // owner of this light
13
14         matrix4x4_t matrix_lighttoworld;
15         matrix4x4_t matrix_worldtolight;
16         matrix4x4_t matrix_worldtoattenuationxyz;
17         matrix4x4_t matrix_worldtoattenuationz;
18
19         vec3_t color;
20         vec_t radius;
21         int cubemapnum;
22         int shadow;
23         vec_t corona;
24 }
25 rdlight_t;
26
27 extern int r_numdlights;
28 extern rdlight_t r_dlight[MAX_DLIGHTS];
29
30 void R_UpdateLights(void);
31 void R_MarkLights(entity_render_t *ent);
32 void R_DrawCoronas(void);
33 void R_CompleteLightPoint(vec3_t ambientcolor, vec3_t diffusecolor, vec3_t diffusenormal, const vec3_t p, int dynamic, const mleaf_t *leaf);
34 int R_LightModel(float *ambient4f, float *diffusecolor, float *diffusenormal, const entity_render_t *ent, float colorr, float colorg, float colorb, float colora, int worldcoords);
35 void R_LightModel_CalcVertexColors(const float *ambientcolor4f, const float *diffusecolor, const float *diffusenormal, int numverts, const float *vertex3f, const float *normal3f, float *color4f);
36 void R_UpdateEntLights(entity_render_t *ent);
37
38 #endif
39