new option -rawlightmapsizelimit to limit the size of RAW lightmaps (so you can use large lightmap size and still get small lightmap size-like limiting)

git-svn-id: svn://svn.icculus.org/netradiant/trunk@372 61c419a2-8eb2-4b30-bcec-8cead039b335
This commit is contained in:
divverent 2009-05-22 14:14:09 +00:00
parent 75641556de
commit 25b38e8a0e
3 changed files with 11 additions and 2 deletions

View File

@ -2122,6 +2122,14 @@ int LightMain( int argc, char **argv )
}
}
else if( !strcmp( argv[ i ], "-rawlightmapsizelimit" ) )
{
lmLimitSize = atoi( argv[ i + 1 ] );
i++;
Sys_Printf( "Raw lightmap size limit set to %d x %d pixels\n", lmLimitSize, lmLimitSize );
}
else if( !strcmp( argv[ i ], "-lightmapdir" ) )
{
lmCustomDir = argv[i + 1];

View File

@ -678,14 +678,14 @@ qboolean AddSurfaceToRawLightmap( int num, rawLightmap_t *lm )
size[ i ] = (maxs[ i ] - mins[ i ]) / sampleSize + 1.0f;
/* hack (god this sucks) */
if( size[ i ] > lm->customWidth || size[ i ] > lm->customHeight )
if( size[ i ] > lm->customWidth || size[ i ] > lm->customHeight || size[i] > lmLimitSize)
{
i = -1;
sampleSize += 1.0f;
}
}
if(sampleSize != lm->sampleSize)
if(sampleSize != lm->sampleSize && lmLimitSize == 0)
{
Sys_FPrintf(SYS_VRB,"WARNING: surface at (%6.0f %6.0f %6.0f) (%6.0f %6.0f %6.0f) too large for desired samplesize/lightmapsize/lightmapscale combination, increased samplesize from %d to %d\n",
info->mins[0],

View File

@ -2184,6 +2184,7 @@ Q_EXTERN qboolean exportLightmaps Q_ASSIGN( qfalse );
Q_EXTERN qboolean externalLightmaps Q_ASSIGN( qfalse );
Q_EXTERN int lmCustomSize Q_ASSIGN( LIGHTMAP_WIDTH );
Q_EXTERN char * lmCustomDir Q_ASSIGN( NULL );
Q_EXTERN int lmLimitSize Q_ASSIGN( 0 );
Q_EXTERN qboolean dirty Q_ASSIGN( qfalse );
Q_EXTERN qboolean dirtDebug Q_ASSIGN( qfalse );