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;
18 void R_Shadow_Init(void);
19 void R_Shadow_Volume(int numverts, int numtris, const float *invertex3f, int *elements, int *neighbors, vec3_t relativelightorigin, float lightradius, float projectdistance);
20 void R_Shadow_DiffuseLighting(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, float lightradius, 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 *lightcubemap);
21 void R_Shadow_SpecularLighting(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, float lightradius, const float *lightcolor, const matrix4x4_t *matrix_worldtolight, const matrix4x4_t *matrix_worldtoattenuationxyz, const matrix4x4_t *matrix_worldtoattenuationz, rtexture_t *glosstexture, rtexture_t *bumptexture, rtexture_t *lightcubemap);
22 void R_Shadow_ClearStencil(void);
24 void R_Shadow_RenderShadowMeshVolume(shadowmesh_t *mesh);
25 void R_Shadow_Stage_Begin(void);
26 void R_Shadow_LoadWorldLightsIfNeeded(void);
27 void R_Shadow_Stage_ShadowVolumes(void);
28 void R_Shadow_Stage_LightWithShadows(void);
29 void R_Shadow_Stage_LightWithoutShadows(void);
30 void R_Shadow_Stage_End(void);
31 int R_Shadow_ScissorForBBox(const float *mins, const float *maxs);
33 // these never change, they are used to create attenuation matrices
34 extern matrix4x4_t matrix_attenuationxyz;
35 extern matrix4x4_t matrix_attenuationz;
37 rtexture_t *R_Shadow_Cubemap(const char *basename);
39 typedef struct worldlight_s
50 // shadow volumes are done entirely in model space, so there are no matrices for dealing with them...
52 // note that the world to light matrices are inversely scaled (divided) by lightradius
54 // matrix for transforming world coordinates to light filter coordinates
55 //matrix4x4_t matrix_worldtolight;
56 // based on worldtolight this transforms -1 to +1 to 0 to 1 for purposes
57 // of attenuation texturing in full 3D (z result often ignored)
58 //matrix4x4_t matrix_worldtoattenuationxyz;
59 // this transforms only the Z to S, and T is always 0.5
60 //matrix4x4_t matrix_worldtoattenuationz;
62 // generated properties
66 struct worldlight_s *next;
71 matrix4x4_t matrix_lighttoworld;
72 matrix4x4_t matrix_worldtolight;
73 matrix4x4_t matrix_worldtoattenuationxyz;
74 matrix4x4_t matrix_worldtoattenuationz;
76 // premade shadow volumes and lit surfaces to render
77 shadowmesh_t *meshchain_shadow;
78 shadowmesh_t *meshchain_light;
80 // used for visibility testing
86 extern worldlight_t *r_shadow_worldlightchain;
88 void R_Shadow_UpdateWorldLightSelection(void);
90 void R_Shadow_DrawStaticWorldLight_Shadow(worldlight_t *light, matrix4x4_t *matrix);
91 void R_Shadow_DrawStaticWorldLight_Light(worldlight_t *light, matrix4x4_t *matrix, vec3_t relativelightorigin, vec3_t relativeeyeorigin, float lightradius, float *lightcolor, const matrix4x4_t *matrix_modeltolight, const matrix4x4_t *matrix_modeltoattenuationxyz, const matrix4x4_t *matrix_modeltoattenuationz);