]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3map2/light_ydnar.c
Merge commit '70f0925f0000a132c709b935aa5cb0942b5080d9' into master-merge
[xonotic/netradiant.git] / tools / quake3 / q3map2 / light_ydnar.c
index 38f5bf8a0e08dbc793b638348407c1ad77da1383..6317d14755466fe1a625e601efd622e9c81c5146 100644 (file)
@@ -1775,7 +1775,7 @@ static qboolean SubmapRawLuxel( rawLightmap_t *lm, int x, int y, float bx, float
                origin2 = SUPER_ORIGIN( x, y );
                //%     normal2 = SUPER_NORMAL( x, y );
        }
-       else {
+       else{
                Sys_FPrintf( SYS_WRN, "WARNING: Spurious lightmap T vector\n" );
        }
 
@@ -2219,13 +2219,13 @@ void IlluminateRawLightmap( int rawLightmapNum ){
                        }
 
                        /* set luxel filter radius */
-                       luxelFilterRadius = lm->sampleSize != 0 ? superSample * filterRadius / lm->sampleSize : 0;
+                       luxelFilterRadius = superSample * filterRadius / lm->sampleSize;
                        if ( luxelFilterRadius == 0 && ( filterRadius > 0.0f || filter ) ) {
                                luxelFilterRadius = 1;
                        }
 
                        /* allocate sampling flags storage */
-                       if ( ( lightSamples > 1 || lightRandomSamples ) && luxelFilterRadius == 0 ) {
+                       if ( lightSamples > 1 || lightRandomSamples ) {
                                size = lm->sw * lm->sh * SUPER_LUXEL_SIZE * sizeof( unsigned char );
                                if ( lm->superFlags == NULL ) {
                                        lm->superFlags = safe_malloc( size );
@@ -2269,8 +2269,8 @@ void IlluminateRawLightmap( int rawLightmapNum ){
                                        }
 
                                        /* check for evilness */
-                                       if ( trace.forceSubsampling > 1.0f && ( lightSamples > 1 || lightRandomSamples ) && luxelFilterRadius == 0 ) {
-                                                       totalLighted++;
+                                       if ( trace.forceSubsampling > 1.0f && ( lightSamples > 1 || lightRandomSamples ) ) {
+                                               totalLighted++;
                                                *flag |= FLAG_FORCE_SUBSAMPLING; /* force */
                                        }
                                        /* add to count */
@@ -2287,7 +2287,7 @@ void IlluminateRawLightmap( int rawLightmapNum ){
 
                        /* secondary pass, adaptive supersampling (fixme: use a contrast function to determine if subsampling is necessary) */
                        /* 2003-09-27: changed it so filtering disamples supersampling, as it would waste time */
-                       if ( ( lightSamples > 1 || lightRandomSamples ) && luxelFilterRadius == 0 ) {
+                       if ( lightSamples > 1 || lightRandomSamples ) {
                                /* walk luxels */
                                for ( y = 0; y < ( lm->sh - 1 ); y++ )
                                {
@@ -2808,6 +2808,14 @@ void IlluminateVertexes( int num ){
                                radVertLuxel[ 2 ] = ( verts[ i ].normal[ 2 ] + 1.0f ) * 127.5f;
                        }
 
+                       else if ( info->si->noVertexLight ) {
+                               VectorSet( radVertLuxel, 127.5f, 127.5f, 127.5f );
+                       }
+
+                       else if ( noVertexLighting > 0 ) {
+                               VectorSet( radVertLuxel, 127.5f * noVertexLighting, 127.5f * noVertexLighting, 127.5f * noVertexLighting );
+                       }
+
                        /* illuminate the vertex */
                        else
                        {
@@ -3057,6 +3065,14 @@ void IlluminateVertexes( int num ){
                                VectorCopy( debugColors[ num % 12 ], radVertLuxel );
                        }
 
+                       else if ( info->si->noVertexLight ) {
+                               VectorSet( radVertLuxel, 127.5f, 127.5f, 127.5f );
+                       }
+
+                       else if ( noVertexLighting > 0 ) {
+                               VectorSet( radVertLuxel, 127.5f * noVertexLighting, 127.5f * noVertexLighting, 127.5f * noVertexLighting );
+                       }
+
                        /* divine color from the superluxels */
                        else
                        {