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_dlightshadows;
25 extern cvar_t r_shadow_realtime_world_lightmaps;
26 extern cvar_t r_shadow_realtime_world_shadows;
27 extern cvar_t r_shadow_realtime_world_compile;
28 extern cvar_t r_shadow_realtime_world_compileshadow;
29 extern cvar_t r_shadow_realtime_world_compilesvbsp;
30 extern cvar_t r_shadow_realtime_world_compileportalculling;
31 extern cvar_t r_shadow_scissor;
32 extern cvar_t r_shadow_culltriangles;
33 extern cvar_t r_shadow_shadow_polygonfactor;
34 extern cvar_t r_shadow_shadow_polygonoffset;
35 extern cvar_t r_shadow_singlepassvolumegeneration;
36 extern cvar_t r_shadow_texture3d;
37 extern cvar_t gl_ext_separatestencil;
38 extern cvar_t gl_ext_stenciltwoside;
40 void R_Shadow_Init(void);
41 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);
42 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);
43 void R_Shadow_RenderLighting(int firstvertex, int numvertices, int numtriangles, const int *element3i, int element3i_bufferobject, size_t element3i_bufferoffset);
44 void R_Shadow_RenderMode_Begin(void);
45 void R_Shadow_RenderMode_ActiveLight(rtlight_t *rtlight);
46 void R_Shadow_RenderMode_Reset(void);
47 void R_Shadow_RenderMode_StencilShadowVolumes(qboolean clearstencil);
48 void R_Shadow_RenderMode_Lighting(qboolean stenciltest, qboolean transparent);
49 void R_Shadow_RenderMode_VisibleShadowVolumes(void);
50 void R_Shadow_RenderMode_VisibleLighting(qboolean stenciltest, qboolean transparent);
51 void R_Shadow_RenderMode_End(void);
52 void R_Shadow_SetupEntityLight(const entity_render_t *ent);
54 // light currently being rendered
55 extern rtlight_t *r_shadow_rtlight;
57 // this is the location of the light in entity space
58 extern vec3_t r_shadow_entitylightorigin;
59 // this transforms entity coordinates to light filter cubemap coordinates
60 // (also often used for other purposes)
61 extern matrix4x4_t r_shadow_entitytolight;
62 // based on entitytolight this transforms -1 to +1 to 0 to 1 for purposes
63 // of attenuation texturing in full 3D (Z result often ignored)
64 extern matrix4x4_t r_shadow_entitytoattenuationxyz;
65 // this transforms only the Z to S, and T is always 0.5
66 extern matrix4x4_t r_shadow_entitytoattenuationz;
68 // current light's cull box (copied out of an rtlight or calculated by GetLightInfo)
69 extern vec3_t r_shadow_rtlight_cullmins;
70 extern vec3_t r_shadow_rtlight_cullmaxs;
71 // current light's culling planes
72 extern int r_shadow_rtlight_numfrustumplanes;
73 extern mplane_t r_shadow_rtlight_frustumplanes[12+6+6]; // see R_Shadow_ComputeShadowCasterCullingPlanes
75 void R_Shadow_RenderVolume(int numvertices, int numtriangles, const float *vertex3f, const int *element3i);
76 qboolean R_Shadow_ScissorForBBox(const float *mins, const float *maxs);
78 // these never change, they are used to create attenuation matrices
79 extern matrix4x4_t matrix_attenuationxyz;
80 extern matrix4x4_t matrix_attenuationz;
82 rtexture_t *R_Shadow_Cubemap(const char *basename);
84 extern dlight_t *r_shadow_worldlightchain;
86 void R_Shadow_UpdateWorldLightSelection(void);
88 extern rtlight_t *r_shadow_compilingrtlight;
90 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);
91 void R_RTLight_Compile(rtlight_t *rtlight);
92 void R_RTLight_Uncompile(rtlight_t *rtlight);
94 void R_ShadowVolumeLighting(qboolean visible);
96 int *R_Shadow_ResizeShadowElements(int numtris);
98 extern int maxshadowmark;
99 extern int numshadowmark;
100 extern int *shadowmark;
101 extern int *shadowmarklist;
102 extern int shadowmarkcount;
103 void R_Shadow_PrepareShadowMark(int numtris);