]> icculus.org git repositories - divverent/darkplaces.git/blob - r_shadow.h
slight cleanup of surface clipping code (got rid of a rather redundent function)
[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_dlight_portalculling;
20 extern cvar_t r_shadow_realtime_world;
21 extern cvar_t r_shadow_realtime_world_dlightshadows;
22 extern cvar_t r_shadow_realtime_world_lightmaps;
23 extern cvar_t r_shadow_realtime_world_shadows;
24 extern cvar_t r_shadow_realtime_world_compile;
25 extern cvar_t r_shadow_realtime_world_compilelight;
26 extern cvar_t r_shadow_realtime_world_compileshadow;
27 extern cvar_t r_shadow_scissor;
28 extern cvar_t r_shadow_shadow_polygonfactor;
29 extern cvar_t r_shadow_shadow_polygonoffset;
30 extern cvar_t r_shadow_singlepassvolumegeneration;
31 extern cvar_t r_shadow_texture3d;
32 extern cvar_t r_shadow_visiblelighting;
33 extern cvar_t r_shadow_visiblevolumes;
34 extern cvar_t gl_ext_stenciltwoside;
35
36 extern mempool_t *r_shadow_mempool;
37
38 void R_Shadow_Init(void);
39 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);
40 void R_Shadow_MarkVolumeFromBox(int firsttriangle, int numtris, const float *invertex3f, const int *elements, const vec3_t projectorigin, const vec3_t lightmins, const vec3_t lightmaxs, const vec3_t surfacemins, const vec3_t surfacemaxs);
41 void R_Shadow_RenderLighting(int firstvertex, int numvertices, int numtriangles, const int *elements, const float *vertex3f, const float *svector3f, const float *tvector3f, const float *normal3f, const float *texcoord2f, const float *relativelightorigin, const float *relativeeyeorigin, const float *lightcolorbase, const float *lightcolorpants, const float *lightcolorshirt, const matrix4x4_t *matrix_modeltolight, const matrix4x4_t *matrix_modeltoattenuationxyz, const matrix4x4_t *matrix_modeltoattenuationz, rtexture_t *basetexture, rtexture_t *pantstexture, rtexture_t *shirttexture, rtexture_t *bumptexture, rtexture_t *glosstexture, rtexture_t *lightcubemap, vec_t ambientscale, vec_t diffusescale, vec_t specularscale, int visiblelighting);
42 void R_Shadow_ClearStencil(void);
43
44 void R_Shadow_RenderVolume(int numvertices, int numtriangles, const float *vertex3f, const int *element3i);
45 int R_Shadow_ScissorForBBox(const float *mins, const float *maxs);
46
47 // these never change, they are used to create attenuation matrices
48 extern matrix4x4_t matrix_attenuationxyz;
49 extern matrix4x4_t matrix_attenuationz;
50
51 rtexture_t *R_Shadow_Cubemap(const char *basename);
52
53 extern dlight_t *r_shadow_worldlightchain;
54
55 void R_Shadow_UpdateWorldLightSelection(void);
56
57 extern rtlight_t *r_shadow_compilingrtlight;
58
59 void R_RTLight_UpdateFromDLight(rtlight_t *rtlight, const dlight_t *light, int isstatic);
60 void R_RTLight_Compile(rtlight_t *rtlight);
61 void R_RTLight_Uncompile(rtlight_t *rtlight);
62
63 void R_ShadowVolumeLighting(int visiblelighting, int visiblevolumes);
64
65 int *R_Shadow_ResizeShadowElements(int numtris);
66
67 extern int maxshadowmark;
68 extern int numshadowmark;
69 extern int *shadowmark;
70 extern int *shadowmarklist;
71 extern int shadowmarkcount;
72 void R_Shadow_PrepareShadowMark(int numtris);
73
74 #endif