]> de.git.xonotic.org Git - xonotic/darkplaces.git/blob - r_shadow.h
got rid of Cshader system as it really wasn't helping anything, now all surfaces...
[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_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
18 extern mempool_t *r_shadow_mempool;
19
20 void R_Shadow_Init(void);
21 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);
22 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);
23 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);
24 #define LIGHTING_DIFFUSE 1
25 #define LIGHTING_SPECULAR 2
26 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);
27 void R_Shadow_ClearStencil(void);
28
29 void R_Shadow_RenderVolume(int numvertices, int numtriangles, const float *vertex3f, const int *element3i);
30 void R_Shadow_Stage_Begin(void);
31 void R_Shadow_LoadWorldLightsIfNeeded(void);
32 void R_Shadow_Stage_ShadowVolumes(void);
33 void R_Shadow_Stage_LightWithShadows(void);
34 void R_Shadow_Stage_LightWithoutShadows(void);
35 void R_Shadow_Stage_End(void);
36 int R_Shadow_ScissorForBBox(const float *mins, const float *maxs);
37
38 // these never change, they are used to create attenuation matrices
39 extern matrix4x4_t matrix_attenuationxyz;
40 extern matrix4x4_t matrix_attenuationz;
41
42 rtexture_t *R_Shadow_Cubemap(const char *basename);
43
44 extern dlight_t *r_shadow_worldlightchain;
45
46 void R_Shadow_UpdateWorldLightSelection(void);
47
48 extern rtlight_t *r_shadow_compilingrtlight;
49
50 void R_RTLight_UpdateFromDLight(rtlight_t *rtlight, const dlight_t *light, int isstatic);
51 void R_RTLight_Compile(rtlight_t *rtlight);
52 void R_RTLight_Uncompile(rtlight_t *rtlight);
53
54 void R_ShadowVolumeLighting(int visiblevolumes);
55
56 int *R_Shadow_ResizeShadowElements(int numtris);
57
58 extern int maxshadowmark;
59 extern int numshadowmark;
60 extern int *shadowmark;
61 extern int *shadowmarklist;
62 extern int shadowmarkcount;
63 void R_Shadow_PrepareShadowMark(int numtris);
64
65 #endif