]> icculus.org git repositories - divverent/darkplaces.git/blob - r_shadow.h
Tomaz's patch to add fov to options menu
[divverent/darkplaces.git] / r_shadow.h
1
2 #ifndef R_SHADOW_H
3 #define R_SHADOW_H
4
5 extern cvar_t r_shadow_bumpscale_basetexture;
6 extern cvar_t r_shadow_bumpscale_bumpmap;
7 extern cvar_t r_shadow_cull;
8 extern cvar_t r_shadow_debuglight;
9 extern cvar_t r_shadow_gloss;
10 extern cvar_t r_shadow_gloss2intensity;
11 extern cvar_t r_shadow_glossintensity;
12 extern cvar_t r_shadow_lightattenuationpower;
13 extern cvar_t r_shadow_lightattenuationscale;
14 extern cvar_t r_shadow_lightintensityscale;
15 extern cvar_t r_shadow_polygonfactor;
16 extern cvar_t r_shadow_polygonoffset;
17 extern cvar_t r_shadow_portallight;
18 extern cvar_t r_shadow_projectdistance;
19 extern cvar_t r_shadow_realtime_dlight;
20 extern cvar_t r_shadow_realtime_dlight_shadows;
21 extern cvar_t r_shadow_realtime_world;
22 extern cvar_t r_shadow_realtime_world_dlightshadows;
23 extern cvar_t r_shadow_realtime_world_lightmaps;
24 extern cvar_t r_shadow_realtime_world_shadows;
25 extern cvar_t r_shadow_scissor;
26 extern cvar_t r_shadow_singlepassvolumegeneration;
27 extern cvar_t r_shadow_staticworldlights;
28 extern cvar_t r_shadow_texture3d;
29 extern cvar_t r_shadow_visiblevolumes;
30 extern cvar_t gl_ext_stenciltwoside;
31
32 extern mempool_t *r_shadow_mempool;
33
34 void R_Shadow_Init(void);
35 void R_Shadow_VolumeFromList(int numverts, int numtris, const float *invertex3f, const int *elements, const int *neighbors, const vec3_t projectorigin, float projectdistance, int nummarktris, const int *marktris);
36 void R_Shadow_VolumeFromBox(int numverts, int numtris, const float *invertex3f, const int *elements, const int *neighbors, const vec3_t projectorigin, float projectdistance, const vec3_t mins, const vec3_t maxs);
37 void R_Shadow_VolumeFromSphere(int numverts, int numtris, const float *invertex3f, const int *elements, const int *neighbors, const vec3_t projectorigin, float projectdistance, float radius);
38 #define LIGHTING_DIFFUSE 1
39 #define LIGHTING_SPECULAR 2
40 void R_Shadow_RenderLighting(int numverts, int numtriangles, const int *elements, const float *vertices, const float *svectors, const float *tvectors, const float *normals, const float *texcoords, const float *relativelightorigin, const float *relativeeyeorigin, const float *lightcolor, const matrix4x4_t *matrix_worldtolight, const matrix4x4_t *matrix_worldtoattenuationxyz, const matrix4x4_t *matrix_worldtoattenuationz, rtexture_t *basetexture, rtexture_t *bumptexture, rtexture_t *glosstexture, rtexture_t *lightcubemap, int lightingflags);
41 void R_Shadow_ClearStencil(void);
42
43 void R_Shadow_RenderVolume(int numvertices, int numtriangles, const float *vertex3f, const int *element3i);
44 void R_Shadow_Stage_Begin(void);
45 void R_Shadow_LoadWorldLightsIfNeeded(void);
46 void R_Shadow_Stage_ShadowVolumes(void);
47 void R_Shadow_Stage_LightWithShadows(void);
48 void R_Shadow_Stage_LightWithoutShadows(void);
49 void R_Shadow_Stage_End(void);
50 int R_Shadow_ScissorForBBox(const float *mins, const float *maxs);
51
52 // these never change, they are used to create attenuation matrices
53 extern matrix4x4_t matrix_attenuationxyz;
54 extern matrix4x4_t matrix_attenuationz;
55
56 rtexture_t *R_Shadow_Cubemap(const char *basename);
57
58 extern dlight_t *r_shadow_worldlightchain;
59
60 void R_Shadow_UpdateWorldLightSelection(void);
61
62 extern rtlight_t *r_shadow_compilingrtlight;
63
64 void R_RTLight_UpdateFromDLight(rtlight_t *rtlight, const dlight_t *light, int isstatic);
65 void R_RTLight_Compile(rtlight_t *rtlight);
66 void R_RTLight_Uncompile(rtlight_t *rtlight);
67
68 void R_ShadowVolumeLighting(int visiblevolumes);
69
70 int *R_Shadow_ResizeShadowElements(int numtris);
71
72 extern int maxshadowmark;
73 extern int numshadowmark;
74 extern int *shadowmark;
75 extern int *shadowmarklist;
76 extern int shadowmarkcount;
77 void R_Shadow_PrepareShadowMark(int numtris);
78
79 #endif