]> icculus.org git repositories - divverent/darkplaces.git/blob - r_shadow.h
changed client input packets to be sent at a fixed 50fps (configurable by cvar) rathe...
[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_lightattenuationpower;
12 extern cvar_t r_shadow_lightattenuationscale;
13 extern cvar_t r_shadow_lightintensityscale;
14 extern cvar_t r_shadow_portallight;
15 extern cvar_t r_shadow_projectdistance;
16 extern cvar_t r_shadow_realtime_dlight;
17 extern cvar_t r_shadow_realtime_dlight_shadows;
18 extern cvar_t r_shadow_realtime_dlight_portalculling;
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_realtime_world_compile;
24 extern cvar_t r_shadow_realtime_world_compileshadow;
25 extern cvar_t r_shadow_scissor;
26 extern cvar_t r_shadow_shadow_polygonfactor;
27 extern cvar_t r_shadow_shadow_polygonoffset;
28 extern cvar_t r_shadow_singlepassvolumegeneration;
29 extern cvar_t r_shadow_texture3d;
30 extern cvar_t r_shadow_visiblelighting;
31 extern cvar_t r_shadow_visiblevolumes;
32 extern cvar_t gl_ext_stenciltwoside;
33
34 extern mempool_t *r_shadow_mempool;
35
36 void R_Shadow_Init(void);
37 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);
38 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);
39 void R_Shadow_RenderSurfacesLighting(const entity_render_t *ent, const texture_t *texture, int numsurfaces, msurface_t **surfacelist);
40 void R_Shadow_RenderMode_Begin(void);
41 void R_Shadow_RenderMode_ActiveLight(rtlight_t *rtlight);
42 void R_Shadow_RenderMode_Reset(void);
43 void R_Shadow_RenderMode_StencilShadowVolumes(void);
44 void R_Shadow_RenderMode_Lighting(qboolean stenciltest, qboolean transparent);
45 void R_Shadow_RenderMode_VisibleShadowVolumes(void);
46 void R_Shadow_RenderMode_VisibleLighting(qboolean stenciltest, qboolean transparent);
47 void R_Shadow_RenderMode_End(void);
48 void R_Shadow_SetupEntityLight(const entity_render_t *ent);
49
50 // light currently being rendered
51 extern rtlight_t *r_shadow_rtlight;
52
53 // this is the location of the eye in entity space
54 extern vec3_t r_shadow_entityeyeorigin;
55 // this is the location of the light in entity space
56 extern vec3_t r_shadow_entitylightorigin;
57 // this transforms entity coordinates to light filter cubemap coordinates
58 // (also often used for other purposes)
59 extern matrix4x4_t r_shadow_entitytolight;
60 // based on entitytolight this transforms -1 to +1 to 0 to 1 for purposes
61 // of attenuation texturing in full 3D (Z result often ignored)
62 extern matrix4x4_t r_shadow_entitytoattenuationxyz;
63 // this transforms only the Z to S, and T is always 0.5
64 extern matrix4x4_t r_shadow_entitytoattenuationz;
65
66 void R_Shadow_RenderVolume(int numvertices, int numtriangles, const float *vertex3f, const int *element3i);
67 qboolean R_Shadow_ScissorForBBox(const float *mins, const float *maxs);
68
69 // these never change, they are used to create attenuation matrices
70 extern matrix4x4_t matrix_attenuationxyz;
71 extern matrix4x4_t matrix_attenuationz;
72
73 rtexture_t *R_Shadow_Cubemap(const char *basename);
74
75 extern dlight_t *r_shadow_worldlightchain;
76
77 void R_Shadow_UpdateWorldLightSelection(void);
78
79 extern rtlight_t *r_shadow_compilingrtlight;
80
81 void R_RTLight_Update(dlight_t *light, int isstatic);
82 void R_RTLight_Compile(rtlight_t *rtlight);
83 void R_RTLight_Uncompile(rtlight_t *rtlight);
84
85 void R_ShadowVolumeLighting(qboolean visible);
86
87 int *R_Shadow_ResizeShadowElements(int numtris);
88
89 extern int maxshadowmark;
90 extern int numshadowmark;
91 extern int *shadowmark;
92 extern int *shadowmarklist;
93 extern int shadowmarkcount;
94 void R_Shadow_PrepareShadowMark(int numtris);
95
96 #endif