]> icculus.org git repositories - divverent/darkplaces.git/blob - r_shadow.h
oops... buffer overflow after a 640GB video file... fixed :P
[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_debuglight;
8 extern cvar_t r_shadow_gloss;
9 extern cvar_t r_shadow_gloss2intensity;
10 extern cvar_t r_shadow_glossintensity;
11 extern cvar_t r_shadow_glossexponent;
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_lightradiusscale;
16 extern cvar_t r_shadow_portallight;
17 extern cvar_t r_shadow_projectdistance;
18 extern cvar_t r_shadow_frontsidecasting;
19 extern cvar_t r_shadow_realtime_dlight;
20 extern cvar_t r_shadow_realtime_dlight_shadows;
21 extern cvar_t r_shadow_realtime_dlight_svbspculling;
22 extern cvar_t r_shadow_realtime_dlight_portalculling;
23 extern cvar_t r_shadow_realtime_world;
24 extern cvar_t r_shadow_realtime_world_lightmaps;
25 extern cvar_t r_shadow_realtime_world_shadows;
26 extern cvar_t r_shadow_realtime_world_compile;
27 extern cvar_t r_shadow_realtime_world_compileshadow;
28 extern cvar_t r_shadow_realtime_world_compilesvbsp;
29 extern cvar_t r_shadow_realtime_world_compileportalculling;
30 extern cvar_t r_shadow_scissor;
31 extern cvar_t r_shadow_culltriangles;
32 extern cvar_t r_shadow_polygonfactor;
33 extern cvar_t r_shadow_polygonoffset;
34 extern cvar_t r_shadow_singlepassvolumegeneration;
35 extern cvar_t r_shadow_texture3d;
36 extern cvar_t gl_ext_separatestencil;
37 extern cvar_t gl_ext_stenciltwoside;
38
39 void R_Shadow_Init(void);
40 void R_Shadow_VolumeFromList(int numverts, int numtris, const float *invertex3f, const int *elements, const int *neighbors, const vec3_t projectorigin, const vec3_t projectdirection, float projectdistance, int nummarktris, const int *marktris);
41 void R_Shadow_MarkVolumeFromBox(int firsttriangle, int numtris, const float *invertex3f, const int *elements, const vec3_t projectorigin, const vec3_t projectdirection, const vec3_t lightmins, const vec3_t lightmaxs, const vec3_t surfacemins, const vec3_t surfacemaxs);
42 void R_Shadow_RenderLighting(int firstvertex, int numvertices, int numtriangles, const int *element3i, int element3i_bufferobject, size_t element3i_bufferoffset);
43 void R_Shadow_RenderMode_Begin(void);
44 void R_Shadow_RenderMode_ActiveLight(rtlight_t *rtlight);
45 void R_Shadow_RenderMode_Reset(void);
46 void R_Shadow_RenderMode_StencilShadowVolumes(qboolean clearstencil);
47 void R_Shadow_RenderMode_Lighting(qboolean stenciltest, qboolean transparent);
48 void R_Shadow_RenderMode_VisibleShadowVolumes(void);
49 void R_Shadow_RenderMode_VisibleLighting(qboolean stenciltest, qboolean transparent);
50 void R_Shadow_RenderMode_End(void);
51 void R_Shadow_SetupEntityLight(const entity_render_t *ent);
52
53 void R_Shadow_RenderVolume(int numvertices, int numtriangles, const float *vertex3f, const int *element3i);
54 qboolean R_Shadow_ScissorForBBox(const float *mins, const float *maxs);
55
56 // these never change, they are used to create attenuation matrices
57 extern matrix4x4_t matrix_attenuationxyz;
58 extern matrix4x4_t matrix_attenuationz;
59
60 rtexture_t *R_Shadow_Cubemap(const char *basename);
61
62 extern dlight_t *r_shadow_worldlightchain;
63
64 void R_Shadow_UpdateWorldLightSelection(void);
65
66 extern rtlight_t *r_shadow_compilingrtlight;
67
68 void R_RTLight_Update(rtlight_t *rtlight, int isstatic, matrix4x4_t *matrix, vec3_t color, int style, const char *cubemapname, qboolean shadow, vec_t corona, vec_t coronasizescale, vec_t ambientscale, vec_t diffusescale, vec_t specularscale, int flags);
69 void R_RTLight_Compile(rtlight_t *rtlight);
70 void R_RTLight_Uncompile(rtlight_t *rtlight);
71
72 void R_ShadowVolumeLighting(qboolean visible);
73
74 int *R_Shadow_ResizeShadowElements(int numtris);
75
76 extern int maxshadowmark;
77 extern int numshadowmark;
78 extern int *shadowmark;
79 extern int *shadowmarklist;
80 extern int shadowmarkcount;
81 void R_Shadow_PrepareShadowMark(int numtris);
82
83 #endif