diff --git a/include/light/light.hh b/include/light/light.hh index 46b7d624..bfadf83a 100644 --- a/include/light/light.hh +++ b/include/light/light.hh @@ -150,6 +150,8 @@ typedef struct { /* debug */ +extern bool debug_highlightseams; + typedef enum { debugmode_none = 0, debugmode_phong, diff --git a/light/light.cc b/light/light.cc index 363d99c6..fd43a195 100644 --- a/light/light.cc +++ b/light/light.cc @@ -91,6 +91,7 @@ qboolean onlyents = false; qboolean novisapprox = false; bool nolights = false; backend_t rtbackend = backend_embree; +bool debug_highlightseams = false; debugmode_t debugmode = debugmode_none; bool verbose_log = false; @@ -1019,6 +1020,9 @@ light_main(int argc, const char **argv) CheckNoDebugModeSet(); debugmode = debugmode_debugneighbours; + } else if ( !strcmp( argv[ i ], "-highlightseams" ) ) { + logprint("Highlighting lightmap seams\n"); + debug_highlightseams = true; } else if ( !strcmp( argv[ i ], "-verbose" ) ) { verbose_log = true; } else if ( !strcmp( argv[ i ], "-help" ) ) { diff --git a/light/ltface.cc b/light/ltface.cc index d1d88776..17bdaf9b 100644 --- a/light/ltface.cc +++ b/light/ltface.cc @@ -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 s = 0; s < 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); + if (debug_highlightseams && color[3] == 0) { + color = qvec4f(255, 0, 0, 1); + } + *lit++ = color[0]; *lit++ = color[1]; *lit++ = color[2];