]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3map2/light_bounce.c
Found why RadSubdivideDiffuseLight happens with !bouncing. Trying
[xonotic/netradiant.git] / tools / quake3 / q3map2 / light_bounce.c
index f72653ab88fb21f849a820b341e1a6808a6e7931..37d8c4e57ca4f6ed141cc37f2f8e24dd01a47d6a 100644 (file)
@@ -264,6 +264,8 @@ static void RadSample( int lightmapNum, bspDrawSurface_t *ds, rawLightmap_t *lm,
        float st[ 2 ], lightmap[ 2 ], *radLuxel;
        radVert_t   *rv[ 3 ];
 
+       if (!bouncing)
+               Sys_Printf( "BUG: RadSample: !bouncing shouldn't happen\n" );
 
        /* initial setup */
        ClearBounds( mins, maxs );
@@ -551,6 +553,9 @@ static void RadSubdivideDiffuseLight( int lightmapNum, bspDrawSurface_t *ds, raw
 
        /* bouncing light? */
        if ( !bouncing ) {
+               /* This is weird. This actually handles surfacelight and not
+                * bounces. */
+
                /* handle first-pass lights in normal q3a style */
                value = si->value;
                light->photons = value * area * areaScale;
@@ -616,6 +621,9 @@ static void RadSubdivideDiffuseLight( int lightmapNum, bspDrawSurface_t *ds, raw
                light->dist = DotProduct( light->origin, normal );
        }
 
+       if (light->photons < 0 || light->add < 0 || light->color[0] < 0 || light->color[1] < 0 || light->color[2] < 0)
+               Sys_Printf( "BUG: RadSubdivideDiffuseLight created a darkbulb\n" );
+
        /* emit light from both sides? */
        if ( si->compileFlags & C_FOG || si->twoSided ) {
                light->flags |= LIGHT_TWOSIDED;