]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
new funny option: -samplessearchboxsize, tunes the size of the search box of -samples...
authorRudolf Polzer <divverent@alientrap.org>
Wed, 22 Sep 2010 04:38:02 +0000 (06:38 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Wed, 22 Sep 2010 04:38:02 +0000 (06:38 +0200)
tools/quake3/q3map2/light.c
tools/quake3/q3map2/light_ydnar.c
tools/quake3/q3map2/q3map2.h

index 69f730ba5be125d2fd19d6cb1951385c382981cb..868bb8d118cf4735c6e180d4666bc3ef1dc45d84 100644 (file)
@@ -2216,6 +2216,18 @@ int LightMain( int argc, char **argv )
                        i++;
                }
                
+               else if( !strcmp( argv[ i ], "-samplessearchboxsize" ) )
+               {
+                       lightSamplesSearchBoxSize = atoi( argv[ i + 1 ] );
+                       if( lightSamplesSearchBoxSize <= 0 )
+                               lightSamplesSearchBoxSize = 1;
+                       if( lightSamplesSearchBoxSize > 4 )
+                               lightSamplesSearchBoxSize = 4; /* more makes no sense */
+                       else if( lightSamplesSearchBoxSize != 1 )
+                               Sys_Printf( "Adaptive supersampling uses %f times the normal search box size\n", lightSamplesSearchBoxSize );
+                       i++;
+               }
+
                else if( !strcmp( argv[ i ], "-filter" ) )
                {
                        filter = qtrue;
index 3587c47edb429eabf4ce78e4072b502150cfa6ef..1f81bf212a388af9ecc6f1b230e39cf7b5083f56 100644 (file)
@@ -2203,8 +2203,7 @@ void IlluminateRawLightmap( int rawLightmapNum )
                                                                //%             continue;
                                                                
                                                                /* subsample it */
-                                                               SubsampleRawLuxel_r( lm, &trace, origin, sx, sy, 0.25f, lightLuxel );
-                                                               /* will do: first -1/3 .. +1/3, then subsample these corners the same way -> -1/9 .. +1/9 around them, etc. -> 1/3 + 1/9 + 1/27 + ... = 0.5 */
+                                                               SubsampleRawLuxel_r( lm, &trace, origin, sx, sy, 0.25f * lightSamplesSearchBoxSize, lightLuxel );
                                                                
                                                                /* debug code to colorize subsampled areas to yellow */
                                                                //%     luxel = SUPER_LUXEL( lightmapNum, sx, sy );
index 897bfdc43d75efaa77093ea18b7254b3d678d3c7..dbb39d7246b0bbfdf76082d4ee860009b66e9bef 100644 (file)
@@ -2183,6 +2183,7 @@ Q_EXTERN qboolean                 shade Q_ASSIGN( qfalse );
 Q_EXTERN float                         shadeAngleDegrees Q_ASSIGN( 0.0f );
 Q_EXTERN int                           superSample Q_ASSIGN( 0 );
 Q_EXTERN int                           lightSamples Q_ASSIGN( 1 );
+Q_EXTERN int                           lightSamplesSearchBoxSize Q_ASSIGN( 1 );
 Q_EXTERN qboolean                      filter Q_ASSIGN( qfalse );
 Q_EXTERN qboolean                      dark Q_ASSIGN( qfalse );
 Q_EXTERN qboolean                      sunOnly Q_ASSIGN( qfalse );