UFO: Alien Invasion
Loading...
Searching...
No Matches
lighting.h
Go to the documentation of this file.
1
4
5/*
6Copyright (C) 1997-2001 Id Software, Inc.
7
8This program is free software; you can redistribute it and/or
9modify it under the terms of the GNU General Public License
10as published by the Free Software Foundation; either version 2
11of the License, or (at your option) any later version.
12
13This program is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
17See the GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, 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
33typedef struct patch_s {
36
39
40 float area;
42
43 struct patch_s* next;
44} patch_t;
45
49
50void BuildFacelights(unsigned int facenum);
51void FinalLightFace(unsigned int facenum);
52void ExportLightmaps(const char* bspFileName);
53void BuildLights(void);
54
55void BuildPatches(void);
56void SubdividePatches(void);
58void LightWorld(void);
59void BuildVertexNormals(void);
60void FreePatches(void);
#define MAX_MAP_FACES
Definition defines.h:144
vec3_t face_offset[MAX_MAP_FACES]
Definition lightmap.cpp:34
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
void SubdividePatches(void)
Iterate all of the head face patches, subdividing them as necessary.
Definition patches.cpp:312
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
void BuildFacelights(unsigned int facenum)
Definition lightmap.cpp:753
void CalcTextureReflectivity(void)
Calculates the texture color that is used for light emitting surfaces.
Definition patches.cpp:41
void ExportLightmaps(const char *bspFileName)
Export the day and night lightmap and direction data for the given map.
Definition lightmap.cpp:963
void LightWorld(void)
Build the lightmap out of light entities and surface lights (patches).
Definition lighting.cpp:34
void FreePatches(void)
After light sources have been created, patches may be freed.
Definition patches.cpp:325
void BuildPatches(void)
Create surface fragments for light-emitting surfaces so that light sources may be computed along them...
Definition patches.cpp:198
winding_t * winding
Definition lighting.h:35
struct patch_s * next
Definition lighting.h:43
vec3_t light
Definition lighting.h:41
vec3_t normal
Definition lighting.h:38
dBspSurface_t * face
Definition lighting.h:34
vec3_t origin
Definition lighting.h:37
float area
Definition lighting.h:40
for storing the vertices of the side of a brush or other polygon
Definition polylib.h:30
vec_t vec3_t[3]
Definition ufotypes.h:39