Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Macros | Enumerations | Functions | Variables
lightmap.hpp File Reference
#include "inexor/shared/cube_types.hpp"
#include "inexor/shared/cube_vector.hpp"
#include "inexor/shared/geom.hpp"

Go to the source code of this file.

Classes

struct  PackNode
 
struct  LightMap
 
struct  LightMapTexture
 
struct  lerpvert
 
struct  lerpbounds
 

Macros

#define LM_MINW   2
 
#define LM_MINH   2
 
#define LM_MAXW   128
 
#define LM_MAXH   128
 
#define LM_PACKW   512
 
#define LM_PACKH   512
 
#define CHECK_CALCLIGHT_PROGRESS_LOCKED(exit, show_calclight_progress, before, after)
 
#define CHECK_CALCLIGHT_PROGRESS(exit, show_calclight_progress)   CHECK_CALCLIGHT_PROGRESS_LOCKED(exit, show_calclight_progress, , )
 

Enumerations

enum  {
  LM_DIFFUSE = 0, LM_BUMPMAP0, LM_BUMPMAP1, LM_TYPE = 0x0F,
  LM_ALPHA = 1<<4, LM_FLAGS = 0xF0
}
 

Functions

void clearlights ()
 
void initlights ()
 
void lightents (bool force=false)
 
void clearlightcache (int id=-1)
 
void resetlightmaps (bool fullclean=true)
 
void brightencube (cube &c)
 
void setsurfaces (cube &c, const surfaceinfo *surfs, const vertinfo *verts, int numverts)
 
void setsurface (cube &c, int orient, const surfaceinfo &surf, const vertinfo *verts, int numverts)
 
void previewblends (const ivec &bo, const ivec &bs)
 
void calcnormals (bool lerptjoints=false)
 
void clearnormals ()
 
void findnormal (const vec &key, const vec &surface, vec &v)
 
void calclerpverts (const vec2 *c, const vec *n, lerpvert *lv, int &numv)
 
void initlerpbounds (float u, float v, const lerpvert *lv, int numv, lerpbounds &start, lerpbounds &end)
 
void lerpnormal (float u, float v, const lerpvert *lv, int numv, lerpbounds &start, lerpbounds &end, vec &normal, vec &nstep)
 
void check_calclight_canceled ()
 
void lightent (extentity &e, float height=8.0f)
 
void lightreaching (const vec &target, vec &color, vec &dir, bool fast=false, extentity *e=nullptr, float ambient=0.4f)
 
entitybrightestlight (const vec &target, const vec &dir)
 

Variables

vector< LightMaplightmaps
 
vector< LightMapTexturelightmaptexs
 
bvec ambientcolor
 
bvec skylightcolor
 
bool calclight_canceled
 
volatile bool check_calclight_progress
 
int lightmapping
 

Class Documentation

struct lerpbounds
Class Members
const lerpvert * max
const lerpvert * min
vec normal
vec nstep
float u
float ustep
int winding

Macro Definition Documentation

#define CHECK_CALCLIGHT_PROGRESS (   exit,
  show_calclight_progress 
)    CHECK_CALCLIGHT_PROGRESS_LOCKED(exit, show_calclight_progress, , )

Referenced by addnormals().

#define CHECK_CALCLIGHT_PROGRESS_LOCKED (   exit,
  show_calclight_progress,
  before,
  after 
)
Value:
{ \
{ \
before; \
after; \
} \
if(calclight_canceled) { exit; } \
}
void check_calclight_canceled()
Definition: lightmap.cpp:291
void show_calclight_progress()
Definition: lightmap.cpp:301
volatile bool check_calclight_progress
Definition: lightmap.cpp:289
if(NOT DEFINED PROJECT_ARCH) message(FATAL_ERROR"You are generating from the wrong folder! \"Where is the Source
Definition: CMakeLists.txt:2
bool calclight_canceled
Definition: lightmap.cpp:288
#define LM_MAXH   128
#define LM_MAXW   128
#define LM_MINH   2

Referenced by setupsurface().

#define LM_MINW   2

Referenced by setupsurface().

#define LM_PACKH   512
#define LM_PACKW   512

Enumeration Type Documentation

anonymous enum
Enumerator
LM_DIFFUSE 
LM_BUMPMAP0 
LM_BUMPMAP1 
LM_TYPE 
LM_ALPHA 
LM_FLAGS 

Function Documentation

void brightencube ( cube c)
entity* brightestlight ( const vec target,
const vec dir 
)
void calclerpverts ( const vec2 c,
const vec n,
lerpvert lv,
int &  numv 
)

References loopj, lerpvert::normal, and lerpvert::tc.

Referenced by setupsurface().

void calcnormals ( bool  lerptjoints = false)
void check_calclight_canceled ( )
void clearlightcache ( int  id = -1)
void clearlights ( )
void clearnormals ( )
void findnormal ( const vec key,
const vec surface,
vec v 
)
void initlerpbounds ( float  u,
float  v,
const lerpvert lv,
int  numv,
lerpbounds start,
lerpbounds end 
)
void initlights ( )
void lerpnormal ( float  u,
float  v,
const lerpvert lv,
int  numv,
lerpbounds start,
lerpbounds end,
vec normal,
vec nstep 
)
void lightent ( extentity e,
float  height = 8.0f 
)
void lightents ( bool  force = false)
void lightreaching ( const vec target,
vec color,
vec dir,
bool  fast = false,
extentity e = nullptr,
float  ambient = 0.4f 
)
void previewblends ( const ivec bo,
const ivec bs 
)
void resetlightmaps ( bool  fullclean = true)
void setsurface ( cube c,
int  orient,
const surfaceinfo surf,
const vertinfo verts,
int  numverts 
)
void setsurfaces ( cube c,
const surfaceinfo surfs,
const vertinfo verts,
int  numverts 
)

Variable Documentation

bvec ambientcolor
bool calclight_canceled
volatile bool check_calclight_progress
int lightmapping
vector<LightMap> lightmaps
vector<LightMapTexture> lightmaptexs
bvec skylightcolor