FTEQW
Documentation of the FTE engine source tree.
gl_shadow.c File Reference

Typedefs

typedef struct shadowmesh_s shadowmesh_t
 

Functions

 DECLARE_HANDLE (HMONITOR)
 
void D3D9BE_Cull (unsigned int sflags)
 
void D3D9BE_RenderShadowBuffer (unsigned int numverts, IDirect3DVertexBuffer9 *vbuf, unsigned int numindicies, IDirect3DIndexBuffer9 *ibuf)
 
void D3D11BE_GenerateShadowBuffer (void **vbuf, vecV_t *verts, int numverts, void **ibuf, index_t *indicies, int numindicies)
 
void D3D11BE_RenderShadowBuffer (unsigned int numverts, void *vbuf, unsigned int numindicies, void *ibuf)
 
void D3D11_DestroyShadowBuffer (void *vbuf, void *ibuf)
 
void D3D11BE_DoneShadows (void)
 
void GLBE_RenderShadowBuffer (unsigned int numverts, int vbo, vecV_t *verts, unsigned numindicies, int ibo, index_t *indicies)
 
void Sh_Reset (void)
 
void Sh_Shutdown (void)
 
void SH_FreeShadowMesh (shadowmesh_t *sm)
 
void CategorizePlane (mplane_t *plane)
 
void Q1BSP_GenerateShadowMesh (model_t *model, dlight_t *dl, const qbyte *lightvis, qbyte *litvis, void(*callback)(msurface_t *surf))
 
void Q2BSP_GenerateShadowMesh (model_t *model, dlight_t *dl, const qbyte *lightvis, qbyte *litvis, void(*callback)(msurface_t *surf))
 
void Q3BSP_GenerateShadowMesh (model_t *model, dlight_t *dl, const qbyte *lightvis, qbyte *litvis, void(*callback)(msurface_t *surf))
 
void D3D11BE_BeginShadowmapFace (void)
 
qboolean Sh_GenShadowMap (dlight_t *l, int lighttype, vec3_t axis[3], qbyte *lvis, int smsize, int txsize)
 
qboolean Sh_GenerateShadowMap (dlight_t *l, int lighttype)
 
void Sh_OrthoAlignToFrustum (dlight_t *dl, int smsize)
 
void Sh_GenerateFakeShadows (void)
 
qboolean Sh_CullLight (dlight_t *dl, qbyte *vvis)
 
void Sh_DrawCrepuscularLight (dlight_t *dl, float *colours)
 
void Sh_PurgeShadowMeshes (void)
 
void R_StaticEntityToRTLight (int i)
 
void Sh_PreGenerateLights (void)
 
void Com_ParseVector (char *str, vec3_t out)
 
void Sh_CheckSettings (void)
 
void Sh_CalcPointLight (vec3_t point, vec3_t light)
 
void Sh_DrawLights (qbyte *vis)
 
qboolean Sh_StencilShadowsActive (void)
 
void Sh_RegisterCvars (void)
 

Variables

LPDIRECT3DDEVICE9 pD3DDev9
 
qboolean r_pushdepth
 
texid_t crepuscular_texture_id
 
fbostate_t crepuscular_fbo
 
shader_tcrepuscular_shader
 
cvar_t r_shadow_shadowmapping_nearclip = CVAR("r_shadow_shadowmapping_nearclip", "1")
 
cvar_t r_shadow_shadowmapping_bias = CVAR("r_shadow_shadowmapping_bias", "0.03")
 
cvar_t r_shadow_scissor = CVARD("r_shadow_scissor", "1", "constrains stencil shadows to the onscreen box that contains the maxmium extents of the light. This avoids unnecessary work.")
 
cvar_t r_shadow_realtime_world = CVARFD ("r_shadow_realtime_world", "0", CVAR_ARCHIVE, "Enables the use of static/world realtime lights.")
 
cvar_t r_shadow_realtime_world_shadows = CVARF ("r_shadow_realtime_world_shadows", "1", CVAR_ARCHIVE)
 
cvar_t r_shadow_realtime_world_lightmaps = CVARFD ("r_shadow_realtime_world_lightmaps", "0", 0, "Specifies how much of the map's normal lightmap to retain when using world realtime lights. 0 completely replaces lighting.")
 
float r_shadow_realtime_world_lightmaps_force
 
cvar_t r_shadow_realtime_world_importlightentitiesfrommap = CVARFD ("r_shadow_realtime_world_importlightentitiesfrommap", "0", CVAR_ARCHIVE, "Controls default loading of map-based realtime lights.\n0: Load explicit .rtlight files only.\n1: Load explicit lights then try fallback to parsing the entities lump.\n2: Load only the entities lump.")
 
cvar_t r_shadow_realtime_dlight = CVARAFD ("r_shadow_realtime_dlight", "1", "r_shadow_realtime_dynamic", CVAR_ARCHIVE, "Enables the use of dynamic realtime lights, allowing explosions to use bumpmaps etc properly.")
 
cvar_t r_shadow_realtime_dlight_shadows = CVARFD ("r_shadow_realtime_dlight_shadows", "1", CVAR_ARCHIVE, "Allows dynamic realtime lights to cast shadows as they move.")
 
cvar_t r_shadow_realtime_dlight_ambient = CVAR ("r_shadow_realtime_dlight_ambient", "0")
 
cvar_t r_shadow_realtime_dlight_diffuse = CVAR ("r_shadow_realtime_dlight_diffuse", "1")
 
cvar_t r_shadow_realtime_dlight_specular = CVAR ("r_shadow_realtime_dlight_specular", "4")
 
cvar_t r_shadow_playershadows = CVARD ("r_shadow_playershadows", "1", "Controls the presence of shadows on the local player.")
 
cvar_t r_shadow_shadowmapping = CVARFD ("r_shadow_shadowmapping", "1", CVAR_ARCHIVE, "Enables soft shadows instead of stencil shadows.")
 
cvar_t r_shadow_shadowmapping_precision = CVARD ("r_shadow_shadowmapping_precision", "1", "Scales the shadowmap detail level up or down.")
 
cvar_t r_sun_dir = CVARD ("r_sun_dir", "0.2 0.5 0.8", "Specifies the direction that crepusular rays appear along")
 
cvar_t r_sun_colour = CVARFD ("r_sun_colour", "0 0 0", CVAR_ARCHIVE, "Specifies the colour of sunlight that appears in the form of crepuscular rays.")
 
int sh_shadowframe
 
qboolean r_fakeshadows
 

Typedef Documentation

◆ shadowmesh_t

typedef struct shadowmesh_s shadowmesh_t

Function Documentation

◆ CategorizePlane()

void CategorizePlane ( mplane_t plane)

◆ Com_ParseVector()

void Com_ParseVector ( char *  str,
vec3_t  out 
)

◆ D3D11_DestroyShadowBuffer()

void D3D11_DestroyShadowBuffer ( void vbuf,
void ibuf 
)

◆ D3D11BE_BeginShadowmapFace()

void D3D11BE_BeginShadowmapFace ( void  )

◆ D3D11BE_DoneShadows()

void D3D11BE_DoneShadows ( void  )

◆ D3D11BE_GenerateShadowBuffer()

void D3D11BE_GenerateShadowBuffer ( void **  vbuf,
vecV_t *  verts,
int  numverts,
void **  ibuf,
index_t indicies,
int  numindicies 
)

◆ D3D11BE_RenderShadowBuffer()

void D3D11BE_RenderShadowBuffer ( unsigned int  numverts,
void vbuf,
unsigned int  numindicies,
void ibuf 
)

◆ D3D9BE_Cull()

void D3D9BE_Cull ( unsigned int  sflags)

◆ D3D9BE_RenderShadowBuffer()

void D3D9BE_RenderShadowBuffer ( unsigned int  numverts,
IDirect3DVertexBuffer9 *  vbuf,
unsigned int  numindicies,
IDirect3DIndexBuffer9 *  ibuf 
)

◆ DECLARE_HANDLE()

DECLARE_HANDLE ( HMONITOR  )

◆ GLBE_RenderShadowBuffer()

void GLBE_RenderShadowBuffer ( unsigned int  numverts,
int  vbo,
vecV_t *  verts,
unsigned  numindicies,
int  ibo,
index_t indicies 
)

◆ Q1BSP_GenerateShadowMesh()

void Q1BSP_GenerateShadowMesh ( model_t model,
dlight_t dl,
const qbyte lightvis,
qbyte litvis,
void(*)(msurface_t *surf callback 
)

◆ Q2BSP_GenerateShadowMesh()

void Q2BSP_GenerateShadowMesh ( model_t model,
dlight_t dl,
const qbyte lightvis,
qbyte litvis,
void(*)(msurface_t *surf callback 
)

◆ Q3BSP_GenerateShadowMesh()

void Q3BSP_GenerateShadowMesh ( model_t model,
dlight_t dl,
const qbyte lightvis,
qbyte litvis,
void(*)(msurface_t *surf callback 
)

◆ R_StaticEntityToRTLight()

void R_StaticEntityToRTLight ( int  i)

◆ Sh_CalcPointLight()

void Sh_CalcPointLight ( vec3_t  point,
vec3_t  light 
)

◆ Sh_CheckSettings()

void Sh_CheckSettings ( void  )

◆ Sh_CullLight()

qboolean Sh_CullLight ( dlight_t dl,
qbyte vvis 
)

◆ Sh_DrawCrepuscularLight()

void Sh_DrawCrepuscularLight ( dlight_t dl,
float *  colours 
)

◆ Sh_DrawLights()

void Sh_DrawLights ( qbyte vis)

r_lightstylesmooth.ival ||

◆ SH_FreeShadowMesh()

void SH_FreeShadowMesh ( shadowmesh_t sm)

◆ Sh_GenerateFakeShadows()

void Sh_GenerateFakeShadows ( void  )

◆ Sh_GenerateShadowMap()

qboolean Sh_GenerateShadowMap ( dlight_t l,
int  lighttype 
)

◆ Sh_GenShadowMap()

qboolean Sh_GenShadowMap ( dlight_t l,
int  lighttype,
vec3_t  axis[3],
qbyte lvis,
int  smsize,
int  txsize 
)

◆ Sh_OrthoAlignToFrustum()

void Sh_OrthoAlignToFrustum ( dlight_t dl,
int  smsize 
)

◆ Sh_PreGenerateLights()

void Sh_PreGenerateLights ( void  )

◆ Sh_PurgeShadowMeshes()

void Sh_PurgeShadowMeshes ( void  )

◆ Sh_RegisterCvars()

void Sh_RegisterCvars ( void  )

◆ Sh_Reset()

void Sh_Reset ( void  )

◆ Sh_Shutdown()

void Sh_Shutdown ( void  )

◆ Sh_StencilShadowsActive()

qboolean Sh_StencilShadowsActive ( void  )

Variable Documentation

◆ count

short count

◆ count2

short count2

◆ crepuscular_fbo

fbostate_t crepuscular_fbo

◆ crepuscular_shader

shader_t* crepuscular_shader

◆ crepuscular_texture_id

texid_t crepuscular_texture_id

◆ 

struct { ... } * edges

◆ edgeuses

int* edgeuses

◆ maxedges

unsigned int maxedges

◆ maxedgeuses

unsigned int maxedgeuses

◆ maxpoints

unsigned int maxpoints

◆ maxtris

unsigned int maxtris

◆ next

int next

◆ numedges

unsigned int numedges

◆ numpoints

unsigned int numpoints

◆ numtris

unsigned int numtris

◆ pD3DDev9

LPDIRECT3DDEVICE9 pD3DDev9
extern

◆ points

GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat * points

◆ prev

int prev

◆ r_fakeshadows

qboolean r_fakeshadows

◆ r_pushdepth

qboolean r_pushdepth
extern

◆ r_shadow_playershadows

cvar_t r_shadow_playershadows = CVARD ("r_shadow_playershadows", "1", "Controls the presence of shadows on the local player.")

◆ r_shadow_realtime_dlight

cvar_t r_shadow_realtime_dlight = CVARAFD ("r_shadow_realtime_dlight", "1", "r_shadow_realtime_dynamic", CVAR_ARCHIVE, "Enables the use of dynamic realtime lights, allowing explosions to use bumpmaps etc properly.")

◆ r_shadow_realtime_dlight_ambient

cvar_t r_shadow_realtime_dlight_ambient = CVAR ("r_shadow_realtime_dlight_ambient", "0")

◆ r_shadow_realtime_dlight_diffuse

cvar_t r_shadow_realtime_dlight_diffuse = CVAR ("r_shadow_realtime_dlight_diffuse", "1")

◆ r_shadow_realtime_dlight_shadows

cvar_t r_shadow_realtime_dlight_shadows = CVARFD ("r_shadow_realtime_dlight_shadows", "1", CVAR_ARCHIVE, "Allows dynamic realtime lights to cast shadows as they move.")

◆ r_shadow_realtime_dlight_specular

cvar_t r_shadow_realtime_dlight_specular = CVAR ("r_shadow_realtime_dlight_specular", "4")

◆ r_shadow_realtime_world

cvar_t r_shadow_realtime_world = CVARFD ("r_shadow_realtime_world", "0", CVAR_ARCHIVE, "Enables the use of static/world realtime lights.")

◆ r_shadow_realtime_world_importlightentitiesfrommap

cvar_t r_shadow_realtime_world_importlightentitiesfrommap = CVARFD ("r_shadow_realtime_world_importlightentitiesfrommap", "0", CVAR_ARCHIVE, "Controls default loading of map-based realtime lights.\n0: Load explicit .rtlight files only.\n1: Load explicit lights then try fallback to parsing the entities lump.\n2: Load only the entities lump.")

◆ r_shadow_realtime_world_lightmaps

cvar_t r_shadow_realtime_world_lightmaps = CVARFD ("r_shadow_realtime_world_lightmaps", "0", 0, "Specifies how much of the map's normal lightmap to retain when using world realtime lights. 0 completely replaces lighting.")

◆ r_shadow_realtime_world_lightmaps_force

float r_shadow_realtime_world_lightmaps_force

◆ r_shadow_realtime_world_shadows

cvar_t r_shadow_realtime_world_shadows = CVARF ("r_shadow_realtime_world_shadows", "1", CVAR_ARCHIVE)

◆ r_shadow_scissor

cvar_t r_shadow_scissor = CVARD("r_shadow_scissor", "1", "constrains stencil shadows to the onscreen box that contains the maxmium extents of the light. This avoids unnecessary work.")

◆ r_shadow_shadowmapping

cvar_t r_shadow_shadowmapping = CVARFD ("r_shadow_shadowmapping", "1", CVAR_ARCHIVE, "Enables soft shadows instead of stencil shadows.")

◆ r_shadow_shadowmapping_bias

cvar_t r_shadow_shadowmapping_bias = CVAR("r_shadow_shadowmapping_bias", "0.03")

◆ r_shadow_shadowmapping_nearclip

cvar_t r_shadow_shadowmapping_nearclip = CVAR("r_shadow_shadowmapping_nearclip", "1")

◆ r_shadow_shadowmapping_precision

cvar_t r_shadow_shadowmapping_precision = CVARD ("r_shadow_shadowmapping_precision", "1", "Scales the shadowmap detail level up or down.")

◆ r_sun_colour

cvar_t r_sun_colour = CVARFD ("r_sun_colour", "0 0 0", CVAR_ARCHIVE, "Specifies the colour of sunlight that appears in the form of crepuscular rays.")

◆ r_sun_dir

cvar_t r_sun_dir = CVARD ("r_sun_dir", "0.2 0.5 0.8", "Specifies the direction that crepusular rays appear along")

◆ sh_shadowframe

int sh_shadowframe

◆ 

struct { ... } * tris

◆ vert

unsigned int vert[2]