UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
lighting.h
Go to the documentation of this file.
1 
5 /*
6 Copyright (C) 1997-2001 Id Software, Inc.
7 
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
12 
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 
17 See the GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 
23 */
24 
25 #pragma once
26 
27 #include "common/shared.h"
28 #include "common/bspfile.h"
29 #include "common/polylib.h"
30 
31 #define MAX_PATCHES 65000 /* larger will cause 32 bit overflows */
32 
33 typedef struct patch_s {
36 
39 
40  float area;
43  struct patch_s* next;
44 } patch_t;
45 
49 
50 void BuildFacelights(unsigned int facenum);
51 void FinalLightFace(unsigned int facenum);
52 void ExportLightmaps(const char* bspFileName);
53 void BuildLights(void);
54 
55 void BuildPatches(void);
56 void SubdividePatches(void);
57 void CalcTextureReflectivity(void);
58 void LightWorld(void);
59 void BuildVertexNormals(void);
60 void FreePatches(void);
void BuildVertexNormals(void)
Calculate per-vertex (instead of per-plane) normal vectors. This is done by finding all of the faces ...
Definition: lightmap.cpp:673
void BuildLights(void)
Create lights out of patches and entity lights.
Definition: lightmap.cpp:293
#define MAX_MAP_FACES
Definition: defines.h:144
void SubdividePatches(void)
Iterate all of the head face patches, subdividing them as necessary.
Definition: patches.cpp:312
vec3_t origin
Definition: lighting.h:37
void LightWorld(void)
Build the lightmap out of light entities and surface lights (patches)
Definition: lighting.cpp:34
winding_t * winding
Definition: lighting.h:35
vec3_t light
Definition: lighting.h:41
void CalcTextureReflectivity(void)
Calculates the texture color that is used for light emitting surfaces.
Definition: patches.cpp:41
void BuildPatches(void)
Create surface fragments for light-emitting surfaces so that light sources may be computed along them...
Definition: patches.cpp:198
for storing the vertices of the side of a brush or other polygon
Definition: polylib.h:30
float area
Definition: lighting.h:40
vec3_t normal
Definition: lighting.h:38
patch_t * face_patches[MAX_MAP_FACES]
Definition: patches.cpp:30
void FinalLightFace(unsigned int facenum)
Add the indirect lighting on top of the direct lighting and save into final map format.
Definition: lightmap.cpp:987
vec3_t face_offset[MAX_MAP_FACES]
Definition: lightmap.cpp:34
struct patch_s * next
Definition: lighting.h:43
void FreePatches(void)
After light sources have been created, patches may be freed.
Definition: patches.cpp:325
vec_t vec3_t[3]
Definition: ufotypes.h:39
struct patch_s patch_t
dBspSurface_t * face
Definition: lighting.h:34
void ExportLightmaps(const char *bspFileName)
Export the day and night lightmap and direction data for the given map.
Definition: lightmap.cpp:963
void BuildFacelights(unsigned int facenum)
Definition: lightmap.cpp:753