]> de.git.xonotic.org Git - xonotic/darkplaces.git/blob - r_shadow.h
works with NULL worldmodel
[xonotic/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 extern cvar_t r_shadow_bumpscale_bumpmap;
11 extern cvar_t r_shadow_bumpscale_basetexture;
12
13 void R_Shadow_Init(void);
14 void R_Shadow_Volume(int numverts, int numtris, int *elements, int *neighbors, vec3_t relativelightorigin, float lightradius, float projectdistance);
15 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);
16 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);
17 void R_Shadow_ClearStencil(void);
18
19 void R_Shadow_RenderVolume(int numverts, int numtris, int *elements);
20 void R_Shadow_RenderShadowMeshVolume(shadowmesh_t *mesh);
21 void R_Shadow_Stage_Begin(void);
22 void R_Shadow_Stage_ShadowVolumes(void);
23 void R_Shadow_Stage_Light(void);
24 void R_Shadow_Stage_End(void);
25 int R_Shadow_ScissorForBBoxAndSphere(const float *mins, const float *maxs, const float *origin, float radius);
26
27 typedef struct worldlight_s
28 {
29         vec3_t origin;
30         vec3_t light;
31         vec3_t mins;
32         vec3_t maxs;
33         vec_t lightradius;
34         vec_t cullradius;
35         struct worldlight_s *next;
36         msurface_t **surfaces;
37         int numsurfaces;
38         mleaf_t **leafs;
39         int numleafs;
40         rtexture_t *cubemap;
41         char *cubemapname;
42         int style;
43         shadowmesh_t *shadowvolume;
44         int selected;
45 }
46 worldlight_t;
47
48 extern worldlight_t *r_shadow_worldlightchain;
49
50 // 0 = normal, 1 = dynamic light shadows, 2 = world and dynamic light shadows
51 extern int r_shadow_lightingmode;
52 void R_Shadow_UpdateLightingMode(void);
53
54 void R_Shadow_UpdateWorldLightSelection(void);
55
56 #endif