UFO: Alien Invasion
Loading...
Searching...
No Matches
r_lightmap.cpp File Reference
#include "r_local.h"
#include "r_error.h"
#include "r_entity.h"
#include "r_lightmap.h"
Include dependency graph for r_lightmap.cpp:

Go to the source code of this file.

Functions

static void R_UploadLightmapPage (void)
static bool R_AllocLightmapBlock (int w, int h, int *x, int *y)
 returns a texture number and the position inside it
static void R_BuildDefaultLightmap (mBspSurface_t *surf, byte *sout, byte *dout, int stride)
 Fullbridght lightmap.
static void R_BuildLightmap (mBspSurface_t *surf, byte *sout, byte *dout, int stride)
 Consume raw lightmap and deluxemap RGB/XYZ data from the surface samples, and write them into the strided block in the atlas page.
void R_CreateSurfaceLightmap (mBspSurface_t *surf)
static void R_DisposeLightmaps (void)
void R_BeginBuildingLightmaps (void)
void R_EndBuildingLightmaps (void)
void R_Trace (const Line &trLine, float sizesize, int contentmask)
 Moves the given mins/maxs volume through the world from start to end.

Variables

lightmaps_t r_lightmaps

Detailed Description

In video memory, lightmaps are chunked into NxN RGB pages. In the bsp, they are just sequentially stored RGB blocks per surface

Definition in file r_lightmap.cpp.

Function Documentation

◆ R_AllocLightmapBlock()

bool R_AllocLightmapBlock ( int w,
int h,
int * x,
int * y )
static

returns a texture number and the position inside it

Find a suitable location to store data in the texture atlas

Definition at line 96 of file r_lightmap.cpp.

References lightmaps_t::allocated, lightmaps_t::deluxemap_count, lightmaps_t::deluxemap_texnums, glGenTextures(), i, lightmaps_t::incomplete_atlas, lightmaps_t::lightmap_count, lightmaps_t::lightmap_texnums, R_AllocLightmapBlock(), r_lightmaps, and lightmaps_t::size.

Referenced by R_AllocLightmapBlock(), and R_CreateSurfaceLightmap().

◆ R_BeginBuildingLightmaps()

◆ R_BuildDefaultLightmap()

◆ R_BuildLightmap()

void R_BuildLightmap ( mBspSurface_t * surf,
byte * sout,
byte * dout,
int stride )
static

◆ R_CreateSurfaceLightmap()

◆ R_DisposeLightmaps()

◆ R_EndBuildingLightmaps()

◆ R_Trace()

void R_Trace ( const Line & trLine,
float size,
int contentmask )

Moves the given mins/maxs volume through the world from start to end.

Parameters
[in]trLineStart and end vectors of the trace
[in]sizeBounding box size used for tracing
[in]contentmaskSearched content the trace should watch for

Definition at line 317 of file r_lightmap.cpp.

References entity_t::angles, model_t::bsp, CM_CompleteBoxTrace(), CM_TransformedBoxTrace, AABB::expand(), mBspModel_t::firstnode, trace_t::fraction, i, trace_t::mapTile, mBspModel_t::maptile, mapTiles_t::mapTiles, rendererData_t::mapTiles, mod_bsp_submodel, entity_t::model, rendererData_t::numEntities, entity_t::origin, R_GetEntity(), r_locals, r_numMapTiles, R_Trace(), refdef, rendererData_t::trace, TRACE_ALL_LEVELS, rendererData_t::traceEntity, rlocals_t::tracenum, and model_t::type.

Referenced by R_DrawFlareSurfaces(), R_Trace(), R_UpdateLightList(), and R_UpdateShadowOrigin().

◆ R_UploadLightmapPage()

Variable Documentation

◆ r_lightmaps