]> icculus.org git repositories - divverent/darkplaces.git/blob - r_shadow.h
renamed q3mface_t to q3msurface_t
[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_world;
8 extern cvar_t r_shadow_realtime_world_lightmaps;
9 extern cvar_t r_shadow_realtime_dlight;
10 extern cvar_t r_shadow_visiblevolumes;
11 extern cvar_t r_shadow_gloss;
12 extern cvar_t r_shadow_debuglight;
13 extern cvar_t r_shadow_bumpscale_bumpmap;
14 extern cvar_t r_shadow_bumpscale_basetexture;
15 extern cvar_t r_shadow_worldshadows;
16 extern cvar_t r_shadow_dlightshadows;
17 extern cvar_t r_shadow_projectdistance;
18
19 extern mempool_t *r_shadow_mempool;
20
21 void R_Shadow_Init(void);
22 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);
23 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);
24 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);
25 #define LIGHTING_DIFFUSE 1
26 #define LIGHTING_SPECULAR 2
27 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);
28 void R_Shadow_ClearStencil(void);
29
30 void R_Shadow_RenderVolume(int numvertices, int numtriangles, const float *vertex3f, const int *element3i);
31 void R_Shadow_Stage_Begin(void);
32 void R_Shadow_LoadWorldLightsIfNeeded(void);
33 void R_Shadow_Stage_ShadowVolumes(void);
34 void R_Shadow_Stage_LightWithShadows(void);
35 void R_Shadow_Stage_LightWithoutShadows(void);
36 void R_Shadow_Stage_End(void);
37 int R_Shadow_ScissorForBBox(const float *mins, const float *maxs);
38
39 // these never change, they are used to create attenuation matrices
40 extern matrix4x4_t matrix_attenuationxyz;
41 extern matrix4x4_t matrix_attenuationz;
42
43 rtexture_t *R_Shadow_Cubemap(const char *basename);
44
45 extern dlight_t *r_shadow_worldlightchain;
46
47 void R_Shadow_UpdateWorldLightSelection(void);
48
49 extern rtlight_t *r_shadow_compilingrtlight;
50
51 void R_RTLight_UpdateFromDLight(rtlight_t *rtlight, const dlight_t *light, int isstatic);
52 void R_RTLight_Compile(rtlight_t *rtlight);
53 void R_RTLight_Uncompile(rtlight_t *rtlight);
54
55 void R_ShadowVolumeLighting(int visiblevolumes);
56
57 int *R_Shadow_ResizeShadowElements(int numtris);
58
59 extern int maxshadowmark;
60 extern int numshadowmark;
61 extern int *shadowmark;
62 extern int *shadowmarklist;
63 extern int shadowmarkcount;
64 void R_Shadow_PrepareShadowMark(int numtris);
65
66 #endif