]> icculus.org git repositories - divverent/darkplaces.git/blob - r_shadow.h
364
[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_portallight;
16 extern cvar_t r_shadow_projectdistance;
17 extern cvar_t r_shadow_realtime_dlight;
18 extern cvar_t r_shadow_realtime_dlight_shadows;
19 extern cvar_t r_shadow_realtime_world;
20 extern cvar_t r_shadow_realtime_world_dlightshadows;
21 extern cvar_t r_shadow_realtime_world_lightmaps;
22 extern cvar_t r_shadow_realtime_world_shadows;
23 extern cvar_t r_shadow_scissor;
24 extern cvar_t r_shadow_shadow_polygonfactor;
25 extern cvar_t r_shadow_shadow_polygonoffset;
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 int R_Shadow_ScissorForBBox(const float *mins, const float *maxs);
45
46 // these never change, they are used to create attenuation matrices
47 extern matrix4x4_t matrix_attenuationxyz;
48 extern matrix4x4_t matrix_attenuationz;
49
50 rtexture_t *R_Shadow_Cubemap(const char *basename);
51
52 extern dlight_t *r_shadow_worldlightchain;
53
54 void R_Shadow_UpdateWorldLightSelection(void);
55
56 extern rtlight_t *r_shadow_compilingrtlight;
57
58 void R_RTLight_UpdateFromDLight(rtlight_t *rtlight, const dlight_t *light, int isstatic);
59 void R_RTLight_Compile(rtlight_t *rtlight);
60 void R_RTLight_Uncompile(rtlight_t *rtlight);
61
62 void R_ShadowVolumeLighting(int visiblevolumes);
63
64 int *R_Shadow_ResizeShadowElements(int numtris);
65
66 extern int maxshadowmark;
67 extern int numshadowmark;
68 extern int *shadowmark;
69 extern int *shadowmarklist;
70 extern int shadowmarkcount;
71 void R_Shadow_PrepareShadowMark(int numtris);
72
73 #endif