]> de.git.xonotic.org Git - xonotic/darkplaces.git/blob - r_shadow.h
cleaned up rtlight handling, merging most code between world rtlights and dlights...
[xonotic/darkplaces.git] / r_shadow.h
1
2 #ifndef R_SHADOW_H
3 #define R_SHADOW_H
4
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;
17
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, 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, 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);
23
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);
32
33 // these never change, they are used to create attenuation matrices
34 extern matrix4x4_t matrix_attenuationxyz;
35 extern matrix4x4_t matrix_attenuationz;
36
37 rtexture_t *R_Shadow_Cubemap(const char *basename);
38
39 extern dlight_t *r_shadow_worldlightchain;
40
41 void R_Shadow_UpdateWorldLightSelection(void);
42
43 void R_RTLight_UpdateFromDLight(rtlight_t *rtlight, const dlight_t *light, int isstatic);
44 void R_RTLight_Compile(rtlight_t *rtlight);
45 void R_RTLight_Uncompile(rtlight_t *rtlight);
46
47 void R_ShadowVolumeLighting(int visiblevolumes);
48
49 #endif