]> de.git.xonotic.org Git - xonotic/darkplaces.git/blob - r_shadow.h
added VectorBlend and Matrix4x4_Blend
[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_LightWithShadows(void);
24 void R_Shadow_Stage_LightWithoutShadows(void);
25 void R_Shadow_Stage_End(void);
26 int R_Shadow_ScissorForBBoxAndSphere(const float *mins, const float *maxs, const float *origin, float radius);
27
28 typedef struct worldlight_s
29 {
30         // saved properties
31         vec3_t origin;
32         vec_t lightradius;
33         vec3_t light;
34         int castshadows;
35         char *cubemapname;
36
37         // generated properties
38         vec3_t mins;
39         vec3_t maxs;
40         vec_t cullradius;
41         struct worldlight_s *next;
42         msurface_t **surfaces;
43         int numsurfaces;
44         mleaf_t **leafs;
45         int numleafs;
46         rtexture_t *cubemap;
47         int style;
48         shadowmesh_t *shadowvolume;
49         int selected;
50 }
51 worldlight_t;
52
53 extern worldlight_t *r_shadow_worldlightchain;
54
55 // 0 = normal, 1 = dynamic light shadows, 2 = world and dynamic light shadows
56 extern int r_shadow_lightingmode;
57 void R_Shadow_UpdateLightingMode(void);
58
59 void R_Shadow_UpdateWorldLightSelection(void);
60
61 #endif