UFO: Alien Invasion
|
Go to the source code of this file.
Data Structures | |
struct | patch_s |
Macros | |
#define | MAX_PATCHES 65000 /* larger will cause 32 bit overflows */ |
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. More... | |
void | ExportLightmaps (const char *bspFileName) |
Export the day and night lightmap and direction data for the given map. More... | |
void | BuildLights (void) |
Create lights out of patches and entity lights. More... | |
void | BuildPatches (void) |
Create surface fragments for light-emitting surfaces so that light sources may be computed along them. More... | |
void | SubdividePatches (void) |
Iterate all of the head face patches, subdividing them as necessary. More... | |
void | CalcTextureReflectivity (void) |
Calculates the texture color that is used for light emitting surfaces. More... | |
void | LightWorld (void) |
Build the lightmap out of light entities and surface lights (patches) More... | |
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. More... | |
void | FreePatches (void) |
After light sources have been created, patches may be freed. More... | |
Variables | |
patch_t * | face_patches [MAX_MAP_FACES] |
vec3_t | face_offset [MAX_MAP_FACES] |
#define MAX_PATCHES 65000 /* larger will cause 32 bit overflows */ |
Definition at line 31 of file lighting.h.
Definition at line 753 of file lightmap.cpp.
References CalcLightinfoExtents(), CalcLightinfoVectors(), CalcPoints(), extents_s::center, Com_Printf(), config, curTile, facelight_s::directions, dBspPlane_t::dist, DotProduct, lightinfo_t::face, face_offset, lightinfo_t::facedist, lightinfo_t::facenormal, dMapTile_t::faces, GatherSampleLight(), i, MAX_MAP_FACES, MAX_SAMPLES, Mem_AllocTypeN, Mem_Free, lightinfo_t::modelorg, light_s::normal, dBspPlane_t::normal, NudgeSamplePosition(), numlights, facelight_s::numsamples, lightinfo_t::numsurfpt, OBJZERO, dBspSurface_t::planenum, dMapTile_t::planes, SampleNormal(), sampleofs, facelight_s::samples, scale, dBspSurface_t::side, SOFT_SAMPLES, lightinfo_t::step, SURF_PHONG, SURF_WARP, texinfo_s::surfaceFlags, lightinfo_t::surfpt, TangentVectors(), dBspSurface_t::texinfo, dMapTile_t::texinfo, lightinfo_t::textoworld, texinfo_s::vecs, VectorCopy, VectorEmpty, VectorMA(), VectorNegate, VectorNormalize(), VectorNotEmpty, and VectorSet.
Referenced by LightWorld().
Create lights out of patches and entity lights.
Definition at line 293 of file lightmap.cpp.
References ANGLE_DOWN, ANGLE_UP, AngleVectors(), light_s::color, ColorNormalize(), Com_Printf(), config, dest, emit_point, emit_spotlight, emit_surface, entities, f, face_patches, FindTargetEntity(), FloatForKey(), GetVectorForKey(), GetVectorFromString(), i, light_s::intensity, MAX_MAP_FACES, Mem_AllocType, name, patch_s::next, light_s::next, light_s::normal, num_entities, numlights, light_s::origin, Q_streq, Q_strstart(), light_s::stopdot, sun_ambient_color, sun_angles, sun_color, sun_intensity, sun_normal, Sys_Error(), torad, light_s::type, ValueForKey(), VectorClear, VectorCopy, VectorEmpty, VectorNormalize(), VectorSet, VectorSubtract, VERB_EXTRA, VERB_NORMAL, and Verb_Printf().
Referenced by LightWorld().
Create surface fragments for light-emitting surfaces so that light sources may be computed along them.
Definition at line 198 of file patches.cpp.
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, OBJZERO, winding_s::p, VectorAdd, VectorCopy, and WindingFromFace().
Referenced by LightWorld().
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 673 of file lightmap.cpp.
References BuildFaceExtents(), curTile, dMapTile_t::faces, FacesWithVert(), i, MAX_VERT_FACES, extents_s::maxs, extents_s::mins, dBspNormal_t::normal, dBspPlane_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().
Calculates the texture color that is used for light emitting surfaces.
Definition at line 41 of file patches.cpp.
References Com_sprintf(), curTile, i, Img_LoadImage(), MAX_QPATH, dMapTile_t::numtexinfo, Q_streq, dMapTile_t::texinfo, texinfo_s::texture, texture_reflectivity, VectorCopy, VectorSet, VERB_EXTRA, VERB_NORMAL, and Verb_Printf().
Referenced by main().
void ExportLightmaps | ( | const char * | bspFileName | ) |
Export the day and night lightmap and direction data for the given map.
bspFileName | The path of the loaded bsp file. |
Definition at line 963 of file lightmap.cpp.
References BuildFaceExtents(), Com_FilePath(), Com_Printf(), Com_SkipPath(), Com_StripExtension(), ExportLightmap(), and MAX_QPATH.
Referenced by main().
Add the indirect lighting on top of the direct lighting and save into final map format.
Definition at line 987 of file lightmap.cpp.
References config, curTile, dest, facelight_s::directions, DotProduct, f, dMapTile_t::faces, light_s::intensity, dMapTile_t::lightdata, dMapTile_t::lightdatasize, dBspSurface_t::lightofs, luminosity, MAX_MAP_LIGHTING, facelight_s::numsamples, facelight_s::samples, sun_ambient_color, SURF_WARP, texinfo_s::surfaceFlags, Sys_Error(), dBspSurface_t::texinfo, dMapTile_t::texinfo, texinfo_s::texture, ThreadLock(), ThreadUnlock(), VectorAdd, VectorCopy, VectorMix(), VectorScale, and VectorSet.
Referenced by LightWorld().
After light sources have been created, patches may be freed.
Definition at line 325 of file patches.cpp.
References i, MAX_MAP_FACES, Mem_Free, and patch_s::next.
Referenced by LightWorld().
Build the lightmap out of light entities and surface lights (patches)
CalcTextureReflectivity
before entering this function Definition at line 34 of file lighting.cpp.
References BuildFacelights(), BuildLights(), BuildPatches(), BuildVertexNormals(), CloseTracingNodes(), config, curTile, FinalLightFace(), FreePatches(), LEVEL_LASTLIGHTBLOCKING, dMapTile_t::lightdata, dMapTile_t::lightdatasize, MakeTracingNodes(), dMapTile_t::numfaces, dMapTile_t::numnodes, RunThreadsOn(), SubdividePatches(), Sys_Error(), and VERB_NORMAL.
Referenced by main().
Iterate all of the head face patches, subdividing them as necessary.
Definition at line 312 of file patches.cpp.
References i, MAX_MAP_FACES, and SubdividePatch().
Referenced by LightWorld().
vec3_t face_offset[MAX_MAP_FACES] |
for rotating bmodels
Definition at line 34 of file lightmap.cpp.
Referenced by BuildFacelights(), and BuildPatches().
patch_t* face_patches[MAX_MAP_FACES] |
Definition at line 30 of file patches.cpp.
Referenced by BuildLights().