lighting.h File Reference

#include "common/shared.h"
#include "common/bspfile.h"
#include "common/polylib.h"
Include dependency graph for lighting.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  patch_s

Defines

#define MAX_PATCHES   65000

Typedefs

typedef struct patch_s patch_t

Functions

void BuildFacelights (unsigned int facenum)
void FinalLightFace (unsigned int facenum)
 Add the indirect lighting on top of the direct lighting and save into final map format.
void ExportLightmaps (const char *bspFileName)
 Export the day and night lightmap and direction data for the given map.
void BuildLights (void)
 Create lights out of patches and lights.
void BuildPatches (void)
 Create surface fragments for light-emitting surfaces so that light sources may be computed along them. This function is responsible for one.
void SubdividePatches (void)
 Iterate all of the head face patches, subdividing them as necessary.
void CalcTextureReflectivity (void)
void LightWorld (void)
void BuildVertexNormals (void)
 Calculate per-vertex (instead of per-plane) normal vectors. This is done by finding all of the faces which share a given vertex, and calculating a weighted average of their normals.
void FreePatches (void)
 After light sources have been created, patches may be freed.

Variables

patch_tface_patches [MAX_MAP_FACES]
vec3_t face_offset [MAX_MAP_FACES]

Detailed Description

Definition in file lighting.h.


Define Documentation

#define MAX_PATCHES   65000

Definition at line 29 of file lighting.h.


Typedef Documentation

typedef struct patch_s patch_t

Function Documentation

void BuildFacelights ( unsigned int  facenum  ) 
void BuildLights ( void   ) 
void BuildPatches ( void   ) 

Create surface fragments for light-emitting surfaces so that light sources may be computed along them. This function is responsible for one.

Definition at line 194 of file patches.c.

References BuildPatch(), curTile, EntityForModel(), f, face_offset, dMapTile_t::faces, dBspModel_t::firstface, GetVectorForKey(), HasLight(), i, dMapTile_t::models, dBspModel_t::numfaces, dMapTile_t::nummodels, winding_s::numpoints, winding_s::p, VectorAdd, VectorCopy, and WindingFromFace().

Referenced by LightWorld().

void BuildVertexNormals ( void   ) 

Calculate per-vertex (instead of per-plane) normal vectors. This is done by finding all of the faces which share a given vertex, and calculating a weighted average of their normals.

Definition at line 665 of file lightmap.c.

References BuildFaceExtents(), curTile, dMapTile_t::faces, FacesWithVert(), i, MAX_VERT_FACES, dBspPlane_t::normal, dBspNormal_t::normal, dMapTile_t::normals, dMapTile_t::numvertexes, dBspSurface_t::planenum, dMapTile_t::planes, scale, dBspSurface_t::side, VectorAdd, VectorClear, VectorLength(), VectorNormalize(), VectorScale, and VectorSubtract.

Referenced by LightWorld(), and main().

void CalcTextureReflectivity ( void   ) 
void ExportLightmaps ( const char *  bspFileName  ) 

Export the day and night lightmap and direction data for the given map.

Note:
The bsp file must already be loaded.
Parameters:
bspFileName The path of the loaded bsp file.

Definition at line 965 of file lightmap.c.

References BuildFaceExtents(), Com_FilePath(), Com_Printf(), Com_SkipPath(), Com_StripExtension(), ExportLightmap(), MAX_QPATH, qfalse, and qtrue.

Referenced by main().

void FinalLightFace ( unsigned int  facenum  ) 
void FreePatches ( void   ) 

After light sources have been created, patches may be freed.

Definition at line 326 of file patches.c.

References i, MAX_MAP_FACES, Mem_Free, and patch_s::next.

Referenced by LightWorld().

void LightWorld ( void   ) 
void SubdividePatches ( void   ) 

Iterate all of the head face patches, subdividing them as necessary.

Definition at line 311 of file patches.c.

References i, MAX_MAP_FACES, and SubdividePatch().

Referenced by LightWorld().


Variable Documentation

vec3_t face_offset[MAX_MAP_FACES]

for rotating bmodels

Definition at line 34 of file lightmap.c.

Referenced by BuildFacelights(), and BuildPatches().

patch_t* face_patches[MAX_MAP_FACES]

Definition at line 30 of file patches.c.

Referenced by BuildLights().


Generated by  doxygen 1.6.2