]> icculus.org git repositories - divverent/darkplaces.git/blob - r_shadow.h
The Linux version doesn't need libjpeg.h anymore
[divverent/darkplaces.git] / r_shadow.h
1
2 #ifndef R_SHADOW_H
3 #define R_SHADOW_H
4
5 extern cvar_t r_shadow_lightattenuationscale;
6 extern cvar_t r_shadow_lightintensityscale;
7 extern cvar_t r_shadow_realtime;
8 extern cvar_t r_shadow_gloss;
9 extern cvar_t r_shadow_debuglight;
10
11 void R_Shadow_Init(void);
12 void R_Shadow_Volume(int numverts, int numtris, int *elements, int *neighbors, vec3_t relativelightorigin, float lightradius, float projectdistance);
13 void R_Shadow_DiffuseLighting(int numverts, int numtriangles, const int *elements, const float *svectors, const float *tvectors, const float *normals, const float *texcoords, const float *relativelightorigin, float lightradius, const float *lightcolor, rtexture_t *basetexture, rtexture_t *bumptexture, rtexture_t *lightcubemap);
14 void R_Shadow_SpecularLighting(int numverts, int numtriangles, const int *elements, const float *svectors, const float *tvectors, const float *normals, const float *texcoords, const float *relativelightorigin, const float *relativeeyeorigin, float lightradius, const float *lightcolor, rtexture_t *glosstexture, rtexture_t *bumptexture, rtexture_t *lightcubemap);
15 void R_Shadow_ClearStencil(void);
16
17 void R_Shadow_RenderVolume(int numverts, int numtris, int *elements);
18 void R_Shadow_RenderShadowMeshVolume(shadowmesh_t *mesh);
19 void R_Shadow_Stage_Begin(void);
20 void R_Shadow_Stage_ShadowVolumes(void);
21 void R_Shadow_Stage_Light(void);
22 void R_Shadow_Stage_End(void);
23 int R_Shadow_ScissorForBBoxAndSphere(const float *mins, const float *maxs, const float *origin, float radius);
24
25 typedef struct worldlight_s
26 {
27         vec3_t origin;
28         vec3_t light;
29         vec3_t mins;
30         vec3_t maxs;
31         vec_t lightradius;
32         vec_t cullradius;
33         struct worldlight_s *next;
34         msurface_t **surfaces;
35         int numsurfaces;
36         mleaf_t **leafs;
37         int numleafs;
38         rtexture_t *cubemap;
39         char *cubemapname;
40         int style;
41         shadowmesh_t *shadowvolume;
42         int selected;
43 }
44 worldlight_t;
45
46 extern worldlight_t *r_shadow_worldlightchain;
47
48 // 0 = normal, 1 = dynamic light shadows, 2 = world and dynamic light shadows
49 extern int r_shadow_lightingmode;
50 void R_Shadow_UpdateLightingMode(void);
51
52 void R_Shadow_UpdateWorldLightSelection(void);
53
54 #endif