r_lightmap.c File Reference

#include "r_local.h"
#include "r_error.h"
#include "r_entity.h"
#include "r_lightmap.h"
Include dependency graph for r_lightmap.c:

Go to the source code of this file.

Functions

static void R_UploadLightmapBlock (void)
static qboolean 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, writing processed lightmap and deluxemap RGBA to the specified destinations.
void R_CreateSurfaceLightmap (mBspSurface_t *surf)
void R_BeginBuildingLightmaps (void)
void R_EndBuildingLightmaps (void)
void R_Trace (vec3_t start, vec3_t end, float size, 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 RGBA blocks. In the bsp, they are just RGB, and we retrieve them using floating point for precision.

Definition in file r_lightmap.c.


Function Documentation

static qboolean R_AllocLightmapBlock ( int  w,
int  h,
int *  x,
int *  y 
) [static]

returns a texture number and the position inside it

Definition at line 78 of file r_lightmap.c.

References lightmaps_s::allocated, i, qfalse, qtrue, and lightmaps_s::size.

Referenced by R_CreateSurfaceLightmap().

void R_BeginBuildingLightmaps ( void   ) 
static void R_BuildDefaultLightmap ( mBspSurface_t surf,
byte sout,
byte dout,
int  stride 
) [static]
static void R_BuildLightmap ( mBspSurface_t surf,
byte sout,
byte dout,
int  stride 
) [static]
void R_CreateSurfaceLightmap ( mBspSurface_t surf  ) 
void R_EndBuildingLightmaps ( void   ) 
See also:
R_BeginBuildingLightmaps
R_ModBeginLoading

Definition at line 294 of file r_lightmap.c.

References R_UploadLightmapBlock().

Referenced by R_ModEndLoading().

void R_Trace ( vec3_t  start,
vec3_t  end,
float  size,
int  contentmask 
)

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

Parameters:
[in] start Start vector to start the trace from
[in] end End vector to stop the trace at
[in] size Bounding box size used for tracing
[in] contentmask Searched content the trace should watch for

Definition at line 308 of file r_lightmap.c.

References model_s::bsp, CM_CompleteBoxTrace(), CM_TransformedBoxTrace, mBspModel_s::firstnode, trace_s::fraction, i, m, trace_s::mapTile, mBspModel_s::maptile, mapTiles_t::mapTiles, rendererData_t::mapTiles, mod_bsp_submodel, rendererData_t::numEntities, entity_t::origin, R_GetEntity(), r_locals, r_numMapTiles, refdef, rendererData_t::trace, rendererData_t::traceEntity, rlocals_s::tracenum, TRACING_ALL_VISIBLE_LEVELS, model_s::type, and VectorSet.

Referenced by R_DrawFlareSurfaces().

static void R_UploadLightmapBlock ( void   )  [static]

Variable Documentation

Definition at line 32 of file r_lightmap.c.

Referenced by R_LoadBspVertexArrays().


Generated by  doxygen 1.6.2