|
UFO: Alien Invasion
|


Go to the source code of this file.
Data Structures | |
| struct | patch_t |
Macros | |
| #define | MAX_PATCHES 65000 |
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 entity lights. | |
| void | BuildPatches (void) |
| Create surface fragments for light-emitting surfaces so that light sources may be computed along them. | |
| void | SubdividePatches (void) |
| Iterate all of the head face patches, subdividing them as necessary. | |
| void | CalcTextureReflectivity (void) |
| Calculates the texture color that is used for light emitting surfaces. | |
| void | LightWorld (void) |
| Build the lightmap out of light entities and surface lights (patches). | |
| 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_t * | face_patches [MAX_MAP_FACES] |
| vec3_t | face_offset [MAX_MAP_FACES] |
| #define MAX_PATCHES 65000 |
Definition at line 31 of file lighting.h.
Definition at line 753 of file lightmap.cpp.
References BuildFacelights(), CalcLightinfoExtents(), CalcLightinfoVectors(), CalcPoints(), extents_t::center, Com_Printf(), mapConfig_t::compile_for_day, config, curTile, facelight_t::directions, dBspPlane_t::dist, DotProduct, mapConfig_t::extrasamples, lightinfo_t::face, face_extents, face_offset, lightinfo_t::facedist, facelight, lightinfo_t::facenormal, dMapTile_t::faces, GatherSampleLight(), i, MAX_MAP_FACES, MAX_SAMPLES, Mem_AllocTypeN, Mem_Free, lightinfo_t::modelorg, dBspPlane_t::normal, NudgeSamplePosition(), numlights, facelight_t::numsamples, lightinfo_t::numsurfpt, OBJZERO, dBspSurface_t::planenum, dMapTile_t::planes, SampleNormal(), sampleofs, facelight_t::samples, dBspSurface_t::side, mapConfig_t::soft, SOFT_SAMPLES, lightinfo_t::step, SURF_PHONG, SURF_WARP, dBspTexinfo_t::surfaceFlags, lightinfo_t::surfpt, TangentVectors(), dBspSurface_t::texinfo, dMapTile_t::texinfo, lightinfo_t::textoworld, dBspTexinfo_t::vecs, VectorCopy, VectorEmpty, VectorMA(), VectorNegate, VectorNormalize(), VectorNotEmpty, and VectorSet.
Referenced by BuildFacelights(), and LightWorld().
Create lights out of patches and entity lights.
Definition at line 293 of file lightmap.cpp.
References ANGLE_DOWN, ANGLE_UP, AngleVectors(), mapConfig_t::brightness, BuildLights(), light_t::color, ColorNormalize(), Com_Printf(), mapConfig_t::compile_for_day, config, mapConfig_t::contrast, dest, emit_point, emit_spotlight, emit_surface, entities, mapConfig_t::entity_scale, f, face_patches, FindTargetEntity(), FloatForKey(), GetVectorForKey(), GetVectorFromString(), i, light_t::intensity, mapConfig_t::lightquant, lights, MAX_MAP_FACES, Mem_AllocType, name, light_t::next, patch_t::next, light_t::normal, num_entities, numlights, light_t::origin, Q_streq, Q_strstart(), mapConfig_t::saturation, light_t::stopdot, sun_ambient_color, sun_angles, sun_color, sun_intensity, sun_normal, mapConfig_t::surface_scale, Sys_Error(), torad, light_t::type, ValueForKey(), VectorClear, VectorCopy, VectorEmpty, VectorNormalize(), VectorSet, VectorSubtract, VERB_EXTRA, VERB_NORMAL, and Verb_Printf().
Referenced by BuildLights(), and 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(), BuildPatches(), curTile, EntityForModel(), f, face_offset, face_patches, dMapTile_t::faces, dBspModel_t::firstface, GetVectorForKey(), HasLight(), i, dMapTile_t::models, dBspModel_t::numfaces, dMapTile_t::nummodels, winding_t::numpoints, OBJZERO, winding_t::p, VectorAdd, VectorCopy, and WindingFromFace().
Referenced by BuildPatches(), and 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(), BuildVertexNormals(), curTile, face_extents, dMapTile_t::faces, FacesWithVert(), i, MAX_VERT_FACES, extents_t::maxs, extents_t::mins, dBspNormal_t::normal, dBspPlane_t::normal, dMapTile_t::normals, dMapTile_t::numvertexes, dBspSurface_t::planenum, dMapTile_t::planes, dBspSurface_t::side, VectorAdd, VectorClear, VectorLength(), VectorNormalize(), VectorScale, and VectorSubtract.
Referenced by BuildVertexNormals(), LightWorld(), and main().
Calculates the texture color that is used for light emitting surfaces.
Definition at line 41 of file patches.cpp.
References CalcTextureReflectivity(), Com_sprintf(), curTile, i, Img_LoadImage(), MAX_QPATH, dMapTile_t::numtexinfo, Q_streq, dMapTile_t::texinfo, dBspTexinfo_t::texture, texture_reflectivity, VectorCopy, VectorSet, VERB_EXTRA, VERB_NORMAL, and Verb_Printf().
Referenced by CalcTextureReflectivity(), and 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(), ExportLightmaps(), and MAX_QPATH.
Referenced by ExportLightmaps(), and 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 mapConfig_t::brightness, mapConfig_t::compile_for_day, config, mapConfig_t::contrast, curTile, dest, facelight_t::directions, DotProduct, f, facelight, dMapTile_t::faces, FinalLightFace(), dMapTile_t::lightdata, dMapTile_t::lightdatasize, luminosity, MAX_MAP_LIGHTING, facelight_t::numsamples, facelight_t::samples, mapConfig_t::saturation, sun_ambient_color, SURF_WARP, dBspTexinfo_t::surfaceFlags, Sys_Error(), dMapTile_t::texinfo, dBspTexinfo_t::texture, ThreadLock(), ThreadUnlock(), VectorAdd, VectorCopy, VectorMix(), VectorScale, and VectorSet.
Referenced by FinalLightFace(), and LightWorld().
After light sources have been created, patches may be freed.
Definition at line 325 of file patches.cpp.
References face_patches, FreePatches(), i, MAX_MAP_FACES, Mem_Free, and patch_t::next.
Referenced by FreePatches(), and 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(), mapConfig_t::compile_for_day, config, curTile, FinalLightFace(), FreePatches(), LEVEL_LASTLIGHTBLOCKING, dMapTile_t::lightdata, dMapTile_t::lightdatasize, mapConfig_t::lightquant, LightWorld(), MakeTracingNodes(), dMapTile_t::numfaces, dMapTile_t::numnodes, RunThreadsOn(), SubdividePatches(), Sys_Error(), VERB_NORMAL, and mapConfig_t::verbosity.
Referenced by LightWorld(), and main().
Iterate all of the head face patches, subdividing them as necessary.
Definition at line 312 of file patches.cpp.
References face_patches, i, MAX_MAP_FACES, SubdividePatch(), and SubdividePatches().
Referenced by LightWorld(), and SubdividePatches().
|
extern |
for rotating bmodels
Definition at line 34 of file lightmap.cpp.
Referenced by BuildFacelights(), and BuildPatches().
|
extern |
Definition at line 30 of file patches.cpp.
Referenced by BuildLights(), BuildPatch(), BuildPatches(), FreePatches(), and SubdividePatches().