From: Rudolf Polzer Date: Wed, 22 Sep 2010 04:38:02 +0000 (+0200) Subject: new funny option: -samplessearchboxsize, tunes the size of the search box of -samples... X-Git-Tag: xonotic-v0.5.0~220 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4243255b4a3a425d9c762106f88624c785a35cd3;p=xonotic%2Fnetradiant.git new funny option: -samplessearchboxsize, tunes the size of the search box of -samples (default 1 = "correct" size, can be up to 4) --- diff --git a/tools/quake3/q3map2/light.c b/tools/quake3/q3map2/light.c index 69f730ba..868bb8d1 100644 --- a/tools/quake3/q3map2/light.c +++ b/tools/quake3/q3map2/light.c @@ -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; diff --git a/tools/quake3/q3map2/light_ydnar.c b/tools/quake3/q3map2/light_ydnar.c index 3587c47e..1f81bf21 100644 --- a/tools/quake3/q3map2/light_ydnar.c +++ b/tools/quake3/q3map2/light_ydnar.c @@ -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 ); diff --git a/tools/quake3/q3map2/q3map2.h b/tools/quake3/q3map2/q3map2.h index 897bfdc4..dbb39d72 100644 --- a/tools/quake3/q3map2/q3map2.h +++ b/tools/quake3/q3map2/q3map2.h @@ -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 );