-void R_Shadow_Init(void);
-void R_Shadow_Volume(int numverts, int numtris, int *elements, int *neighbors, vec3_t relativelightorigin, float lightradius, float projectdistance);
-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_worldtofilter, const matrix4x4_t *matrix_worldtoattenuationxyz, const matrix4x4_t *matrix_worldtoattenuationz, rtexture_t *basetexture, rtexture_t *bumptexture, rtexture_t *lightcubemap);
-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_worldtofilter, const matrix4x4_t *matrix_worldtoattenuationxyz, const matrix4x4_t *matrix_worldtoattenuationz, rtexture_t *glosstexture, rtexture_t *bumptexture, rtexture_t *lightcubemap);
-void R_Shadow_ClearStencil(void);
+#define R_SHADOW_SHADOWMAP_NUMCUBEMAPS 8
+
+extern struct cvar_s r_shadow_bumpscale_basetexture;
+extern struct cvar_s r_shadow_bumpscale_bumpmap;
+extern struct cvar_s r_shadow_debuglight;
+extern struct cvar_s r_shadow_gloss;
+extern struct cvar_s r_shadow_gloss2intensity;
+extern struct cvar_s r_shadow_glossintensity;
+extern struct cvar_s r_shadow_glossexponent;
+extern struct cvar_s r_shadow_gloss2exponent;
+extern struct cvar_s r_shadow_glossexact;
+extern struct cvar_s r_shadow_lightattenuationpower;
+extern struct cvar_s r_shadow_lightattenuationscale;
+extern struct cvar_s r_shadow_lightintensityscale;
+extern struct cvar_s r_shadow_lightradiusscale;
+extern struct cvar_s r_shadow_projectdistance;
+extern struct cvar_s r_shadow_frontsidecasting;
+extern struct cvar_s r_shadow_realtime_dlight;
+extern struct cvar_s r_shadow_realtime_dlight_shadows;
+extern struct cvar_s r_shadow_realtime_dlight_svbspculling;
+extern struct cvar_s r_shadow_realtime_dlight_portalculling;
+extern struct cvar_s r_shadow_realtime_world;
+extern struct cvar_s r_shadow_realtime_world_lightmaps;
+extern struct cvar_s r_shadow_realtime_world_shadows;
+extern struct cvar_s r_shadow_realtime_world_compile;
+extern struct cvar_s r_shadow_realtime_world_compileshadow;
+extern struct cvar_s r_shadow_realtime_world_compilesvbsp;
+extern struct cvar_s r_shadow_realtime_world_compileportalculling;
+extern struct cvar_s r_shadow_scissor;
+
+// used by shader for bouncegrid feature
+typedef struct r_shadow_bouncegrid_settings_s
+{
+ qbool staticmode;
+ qbool directionalshading;
+ qbool includedirectlighting;
+ qbool blur;
+ qbool normalizevectors;
+ int floatcolors;
+ float dlightparticlemultiplier;
+ qbool hitmodels;
+ float lightradiusscale;
+ int maxbounce;
+ float lightpathsize;
+ float particlebounceintensity;
+ float particleintensity;
+ int maxphotons;
+ float energyperphoton;
+ float spacing[3];
+ int rng_type;
+ int rng_seed;
+ float bounceminimumintensity2;
+ int subsamples;
+}
+r_shadow_bouncegrid_settings_t;