lighting.h

Go to the documentation of this file.
00001 
00005 /*
00006 Copyright (C) 1997-2001 Id Software, Inc.
00007 
00008 This program is free software; you can redistribute it and/or
00009 modify it under the terms of the GNU General Public License
00010 as published by the Free Software Foundation; either version 2
00011 of the License, or (at your option) any later version.
00012 
00013 This program is distributed in the hope that it will be useful,
00014 but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016 
00017 See the GNU General Public License for more details.
00018 
00019 You should have received a copy of the GNU General Public License
00020 along with this program; if not, write to the Free Software
00021 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00022 
00023 */
00024 
00025 #include "common/shared.h"
00026 #include "common/bspfile.h"
00027 #include "common/polylib.h"
00028 
00029 #define MAX_PATCHES 65000           /* larger will cause 32 bit overflows */
00030 
00031 typedef struct patch_s {
00032     dBspSurface_t       *face;
00033     winding_t       *winding;
00034 
00035     vec3_t          origin;
00036     vec3_t          normal;
00037 
00038     float           area;
00039     vec3_t          light;      
00041     struct patch_s  *next;      
00042 } patch_t;
00043 
00044 extern patch_t *face_patches[MAX_MAP_FACES];
00046 extern vec3_t face_offset[MAX_MAP_FACES];
00047 
00048 void BuildFacelights(unsigned int facenum);
00049 void FinalLightFace(unsigned int facenum);
00050 void ExportLightmaps(const char *bspFileName);
00051 void BuildLights(void);
00052 
00053 void BuildPatches(void);
00054 void SubdividePatches(void);
00055 void CalcTextureReflectivity(void);
00056 void LightWorld(void);
00057 void BuildVertexNormals(void);
00058 void FreePatches(void);

Generated by  doxygen 1.6.2