light: add -highlightseams flag

This commit is contained in:
Eric Wasylishen 2017-12-05 15:09:34 -07:00
parent cf9344f684
commit 69879b4104
3 changed files with 11 additions and 1 deletions

View File

@ -150,6 +150,8 @@ typedef struct {
/* debug */ /* debug */
extern bool debug_highlightseams;
typedef enum { typedef enum {
debugmode_none = 0, debugmode_none = 0,
debugmode_phong, debugmode_phong,

View File

@ -91,6 +91,7 @@ qboolean onlyents = false;
qboolean novisapprox = false; qboolean novisapprox = false;
bool nolights = false; bool nolights = false;
backend_t rtbackend = backend_embree; backend_t rtbackend = backend_embree;
bool debug_highlightseams = false;
debugmode_t debugmode = debugmode_none; debugmode_t debugmode = debugmode_none;
bool verbose_log = false; bool verbose_log = false;
@ -1019,6 +1020,9 @@ light_main(int argc, const char **argv)
CheckNoDebugModeSet(); CheckNoDebugModeSet();
debugmode = debugmode_debugneighbours; debugmode = debugmode_debugneighbours;
} else if ( !strcmp( argv[ i ], "-highlightseams" ) ) {
logprint("Highlighting lightmap seams\n");
debug_highlightseams = true;
} else if ( !strcmp( argv[ i ], "-verbose" ) ) { } else if ( !strcmp( argv[ i ], "-verbose" ) ) {
verbose_log = true; verbose_log = true;
} else if ( !strcmp( argv[ i ], "-help" ) ) { } else if ( !strcmp( argv[ i ], "-help" ) ) {

View File

@ -2797,9 +2797,13 @@ WriteLightmaps(const mbsp_t *bsp, bsp2_dface_t *face, facesup_t *facesup, const
for (int t = 0; t < actual_height; t++) { for (int t = 0; t < actual_height; t++) {
for (int s = 0; s < actual_width; s++) { for (int s = 0; s < actual_width; s++) {
const int sampleindex = (t * actual_width) + s; const int sampleindex = (t * actual_width) + s;
const qvec4f &color = output_color.at(sampleindex); qvec4f color = output_color.at(sampleindex);
const qvec4f &direction = output_dir.at(sampleindex); const qvec4f &direction = output_dir.at(sampleindex);
if (debug_highlightseams && color[3] == 0) {
color = qvec4f(255, 0, 0, 1);
}
*lit++ = color[0]; *lit++ = color[0];
*lit++ = color[1]; *lit++ = color[1];
*lit++ = color[2]; *lit++ = color[2];