]> icculus.org git repositories - divverent/darkplaces.git/blob - r_shadow.h
fix viewmodel crash
[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_texture3d;
9 extern cvar_t r_shadow_gloss;
10 extern cvar_t r_shadow_debuglight;
11
12 void R_Shadow_Init(void);
13 void R_Shadow_Volume(int numverts, int numtris, int *elements, int *neighbors, vec3_t relativelightorigin, float lightradius, float projectdistance);
14 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);
15 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);
16 void R_Shadow_ClearStencil(void);
17
18 void R_Shadow_RenderVolume(int numverts, int numtris, int *elements);
19 void R_Shadow_RenderShadowMeshVolume(shadowmesh_t *mesh);
20 void R_Shadow_Stage_Begin(void);
21 void R_Shadow_Stage_ShadowVolumes(void);
22 void R_Shadow_Stage_Light(void);
23 // returns true if shadow volumes should be drawn again to erase,
24 // otherwise clears stencil
25 int R_Shadow_Stage_EraseShadowVolumes(void);
26 void R_Shadow_Stage_End(void);
27 int R_Shadow_ScissorForBBoxAndSphere(const float *mins, const float *maxs, const float *origin, float radius);
28
29 typedef struct worldlight_s
30 {
31         vec3_t origin;
32         vec3_t light;
33         vec3_t mins;
34         vec3_t maxs;
35         vec_t lightradius;
36         vec_t cullradius;
37         struct worldlight_s *next;
38         msurface_t **surfaces;
39         int numsurfaces;
40         mleaf_t **leafs;
41         int numleafs;
42         rtexture_t *cubemap;
43         char *cubemapname;
44         int style;
45         shadowmesh_t *shadowvolume;
46         int selected;
47 }
48 worldlight_t;
49
50 extern worldlight_t *r_shadow_worldlightchain;
51
52 // 0 = normal, 1 = dynamic light shadows, 2 = world and dynamic light shadows
53 extern int r_shadow_lightingmode;
54 void R_Shadow_UpdateLightingMode(void);
55
56 void R_Shadow_UpdateWorldLightSelection(void);
57
58 #endif