Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions utils/pxrad/ambientcube.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ bool R_GetDirectLightFromSurface( dface_t *surf, const vec3_t point, lightpoint_
faceneighbor_t *fn = &g_faceneighbor[surf - g_dfaces];
int texture_step = GetTextureStep( surf );
dtexinfo_t *tex = g_texinfo + surf->texinfo;
int map, size, smax, tmax;
int map;
float lmvecs[2][4];
vec_t s, t;
byte *lm;
Expand All @@ -181,14 +181,12 @@ bool R_GetDirectLightFromSurface( dface_t *surf, const vec3_t point, lightpoint_
if( surf->lightofs == -1 )
return false;

smax = (fn->lightextents[0] / texture_step) + 1;
tmax = (fn->lightextents[1] / texture_step) + 1;
s /= (vec_t)texture_step;
t /= (vec_t)texture_step;

facelight_t *fl = &g_facelight[surf - g_dfaces];
sample_t *samp = fl->samples;
int offset = Q_rint( t ) * smax + Q_rint( s );
int offset = Q_rint( t ) * fl->width + Q_rint( s );

for( map = 0; map < MAXLIGHTMAPS; map++ )
{
Expand Down
2 changes: 2 additions & 0 deletions utils/pxrad/lightmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2927,6 +2927,7 @@ static void CalcLightmap( int thread, lightinfo_t *l, facelight_t *fl )
// allocate light samples
fl->samples = (sample_t *)Mem_Alloc( l->numsurfpt * sizeof( sample_t ));
fl->numsamples = l->numsurfpt;
fl->width = w;

// stats
g_direct_luxels[thread] += fl->numsamples;
Expand Down Expand Up @@ -3122,6 +3123,7 @@ static void CalcLightmapAA( int thread, lightinfo_t *l, facelight_t *fl )
// allocate light samples
fl->samples = (sample_t *)Mem_Alloc( l->numsurfpt * sizeof( sample_t ));
fl->numsamples = l->numsurfpt;
fl->width = w;

plane = GetPlaneFromFace( f );

Expand Down
1 change: 1 addition & 0 deletions utils/pxrad/qrad.h
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ typedef struct
sample_t *samples;
vec3_t average[MAXLIGHTMAPS];
vec3_t texlight[MAXLIGHTMAPS];
short width;
} facelight_t;

typedef struct
Expand Down
Loading