Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Macros | Functions | Variables
shadowmap.cpp File Reference
#include <SDL_opengl.h>
#include <math.h>
#include <algorithm>
#include "inexor/engine/glemu.hpp"
#include "inexor/engine/glexts.hpp"
#include "inexor/engine/lightmap.hpp"
#include "inexor/engine/octree.hpp"
#include "inexor/engine/rendergl.hpp"
#include "inexor/engine/rendertarget.hpp"
#include "inexor/engine/shader.hpp"
#include "inexor/engine/shadowmap.hpp"
#include "inexor/fpsgame/entities.hpp"
#include "inexor/physics/physics.hpp"
#include "inexor/shared/command.hpp"
#include "inexor/shared/cube_loops.hpp"
#include "inexor/shared/cube_types.hpp"
#include "inexor/shared/cube_vector.hpp"
#include "inexor/shared/ents.hpp"
#include "inexor/shared/geom.hpp"
#include "inexor/shared/tools.hpp"

Classes

struct  shadowmaptexture
 

Macros

#define SHADOWSKEW   0.7071068f
 

Functions

 VARP (shadowmap, 0, 0, 1)
 
void cleanshadowmap ()
 
 VARFP (shadowmapsize, 7, 9, 11, cleanshadowmap())
 
 VARP (shadowmapradius, 64, 96, 256)
 
 VAR (shadowmapheight, 0, 32, 128)
 
 VARP (shadowmapdist, 128, 256, 512)
 
 VARFP (fpshadowmap, 0, 0, 1, cleanshadowmap())
 
 VARFP (shadowmapprecision, 0, 0, 1, cleanshadowmap())
 
 HVARFR (shadowmapambient, 0, 0, 0xFFFFFF,{if(shadowmapambient<=255) shadowmapambient|=(shadowmapambient<< 8)|(shadowmapambient<< 16);shadowmapambientcolor=bvec((shadowmapambient >>16)&0xFF,(shadowmapambient >>8)&0xFF, shadowmapambient &0xFF);})
 
 VARP (shadowmapintensity, 0, 40, 100)
 
 VARP (blurshadowmap, 0, 1, 3)
 
 VARP (blursmsigma, 1, 100, 200)
 
 VAR_NOSYNC (shadowmapcasters, 1, 0, 0)
 
void setshadowdir (int angle)
 
 VARFR (shadowmapangle, 0, 0, 360, setshadowdir(shadowmapangle))
 
void guessshadowdir ()
 
 VARP (shadowmapbias, 0, 5, 1024)
 
 VARP (shadowmappeelbias, 0, 20, 1024)
 
 VAR (smdepthpeel, 0, 1, 1)
 
 VAR (smoothshadowmappeel, 1, 0, 0)
 
void calcshadowmapbb (const vec &o, float xyrad, float zrad, float &x1, float &y1, float &x2, float &y2)
 
bool addshadowmapcaster (const vec &o, float xyrad, float zrad)
 
bool isshadowmapreceiver (vtxarray *va)
 
bool isshadowmapcaster (const vec &o, float rad)
 
void pushshadowmap ()
 
void popshadowmap ()
 
void rendershadowmap ()
 
 VAR (debugsm, 0, 0, 1)
 
void viewshadowmap ()
 

Variables

bool hasVAO
 
bool hasFBO
 
bool hasAFBO
 
bool hasDS
 
bool hasTF
 
bool hasTRG
 
bool hasTSW
 
bool hasS3TC
 
bool hasFXT1
 
bool hasAF
 
bool hasFBB
 
bool hasUBO
 
bool hasMBR
 
bvec shadowmapambientcolor (0, 0, 0)
 
vec shadowoffset (0, 0, 0)
 
vec shadowfocus (0, 0, 0)
 
vec shadowdir (0, SHADOWSKEW, 1)
 
float shadowmapmaxz = 0
 
bool shadowmapping = false
 
matrix4 shadowmatrix
 
shadowmaptexture shadowmaptex
 

Macro Definition Documentation

#define SHADOWSKEW   0.7071068f

Function Documentation

bool addshadowmapcaster ( const vec o,
float  xyrad,
float  zrad 
)
void calcshadowmapbb ( const vec o,
float  xyrad,
float  zrad,
float &  x1,
float &  y1,
float &  x2,
float &  y2 
)
void cleanshadowmap ( )

References rendertarget::cleanup(), and shadowmaptex.

Referenced by resetgl().

void guessshadowdir ( )
HVARFR ( shadowmapambient  ,
,
,
0xFFFFFF  ,
{if(shadowmapambient<=255) shadowmapambient|=(shadowmapambient<< 8)|(shadowmapambient<< 16);shadowmapambientcolor=bvec((shadowmapambient >>16)&0xFF,(shadowmapambient >>8)&0xFF, shadowmapambient &0xFF);}   
)
bool isshadowmapcaster ( const vec o,
float  rad 
)

References shadowdir, shadowfocus, and SHADOWSKEW.

Referenced by cullmodel().

bool isshadowmapreceiver ( vtxarray va)
void popshadowmap ( )

References rendertarget::rendertex, shadowmap, and shadowmaptex.

Referenced by rendergeom().

void pushshadowmap ( )
void rendershadowmap ( )

References f(), rendertarget::render(), shadowmap, and shadowmaptex.

Referenced by rendergeom().

void setshadowdir ( int  angle)
VAR ( shadowmapheight  ,
,
32  ,
128   
)
VAR ( smdepthpeel  ,
,
,
 
)
VAR ( smoothshadowmappeel  ,
,
,
 
)
VAR ( debugsm  ,
,
,
 
)
VAR_NOSYNC ( shadowmapcasters  ,
,
,
 
)
VARFP ( shadowmapsize  ,
,
,
11  ,
cleanshadowmap()   
)
VARFP ( fpshadowmap  ,
,
,
,
cleanshadowmap()   
)
VARFP ( shadowmapprecision  ,
,
,
,
cleanshadowmap()   
)
VARFR ( shadowmapangle  ,
,
,
360  ,
setshadowdir(shadowmapangle)   
)
VARP ( shadowmap  ,
,
,
 
)
VARP ( shadowmapradius  ,
64  ,
96  ,
256   
)
VARP ( shadowmapdist  ,
128  ,
256  ,
512   
)
VARP ( shadowmapintensity  ,
,
40  ,
100   
)
VARP ( blurshadowmap  ,
,
,
 
)
VARP ( blursmsigma  ,
,
100  ,
200   
)
VARP ( shadowmapbias  ,
,
,
1024   
)
VARP ( shadowmappeelbias  ,
,
20  ,
1024   
)
void viewshadowmap ( )

References rendertarget::debug(), shadowmap, and shadowmaptex.

Referenced by gl_drawhud().

Variable Documentation

bool hasAF
bool hasAFBO

Referenced by gl_checkextensions().

bool hasDS
bool hasFBB
bool hasFBO

Referenced by gl_checkextensions().

bool hasFXT1

Referenced by gl_checkextensions().

bool hasMBR

Referenced by gl_checkextensions().

bool hasS3TC

Referenced by gendds(), gl_checkextensions(), and loaddds().

bool hasTF
bool hasTRG
bool hasTSW

Referenced by gl_checkextensions().

bool hasUBO
bool hasVAO

Referenced by gl_checkextensions().

vec shadowdir(0, SHADOWSKEW, 1)
vec shadowfocus(0, 0, 0)
bvec shadowmapambientcolor(0, 0, 0)

Referenced by pushshadowmap().

float shadowmapmaxz = 0
bool shadowmapping = false
shadowmaptexture shadowmaptex
static
matrix4 shadowmatrix
vec shadowoffset(0, 0, 0)