]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
-minsamplesize
authorrpolzer <rpolzer@61c419a2-8eb2-4b30-bcec-8cead039b335>
Mon, 22 Sep 2008 11:07:44 +0000 (11:07 +0000)
committerrpolzer <rpolzer@61c419a2-8eb2-4b30-bcec-8cead039b335>
Mon, 22 Sep 2008 11:07:44 +0000 (11:07 +0000)
git-svn-id: svn://svn.icculus.org/netradiant/trunk@99 61c419a2-8eb2-4b30-bcec-8cead039b335

tools/quake3/q3map2/bsp.c
tools/quake3/q3map2/light.c
tools/quake3/q3map2/q3map2.h
tools/quake3/q3map2/surface.c

index aeaf73635c618d713f3e04fd87e105d2e482c17c..00fd1fe8646091297162cec74068869f5cffde53 100644 (file)
@@ -732,6 +732,14 @@ int BSPMain( int argc, char **argv )
                        i++;
                        Sys_Printf( "Lightmap sample size set to %dx%d units\n", sampleSize, sampleSize );
                }
+               else if( !strcmp( argv[ i ], "-minsamplesize" ) )
+               {
+                       minSampleSize = atoi( argv[ i + 1 ] );
+                       if( minSampleSize < 1 )
+                               minSampleSize = 1;
+                       i++;
+                       Sys_Printf( "Minimum lightmap sample size set to %dx%d units\n", minSampleSize, minSampleSize );
+               }
                else if( !strcmp( argv[ i ],  "-custinfoparms") )
                {
                        Sys_Printf( "Custom info parms enabled\n" );
index ffaf40cd8f94f595535517b3e0bbe60b47f77e27..e5e526fb65df542ac90bfb73ae4eb596309c0d0e 100644 (file)
@@ -2216,6 +2216,14 @@ int LightMain( int argc, char **argv )
                        i++;
                        Sys_Printf( "Default lightmap sample size set to %dx%d units\n", sampleSize, sampleSize );
                }
+               else if( !strcmp( argv[ i ], "-minsamplesize" ) )
+               {
+                       minSampleSize = atoi( argv[ i + 1 ] );
+                       if( minSampleSize < 1 )
+                               minSampleSize = 1;
+                       i++;
+                       Sys_Printf( "Minimum lightmap sample size set to %dx%d units\n", minSampleSize, minSampleSize );
+               }
                else if( !strcmp( argv[ i ], "-novertex" ) )
                {
                        noVertexLighting = qtrue;
index 18db5b1af84b194bbed20c6f0b36132ea90c5e0c..a4545933dfbcefec49cb991f371d2e5dab4dcf15 100644 (file)
@@ -248,6 +248,7 @@ constants
 #define GRID_EPSILON                   0.0f
 
 #define DEFAULT_LIGHTMAP_SAMPLE_SIZE   16
+#define DEFAULT_LIGHTMAP_MIN_SAMPLE_SIZE       0
 #define DEFAULT_LIGHTMAP_SAMPLE_OFFSET 1.0f
 #define DEFAULT_SUBDIVIDE_THRESHOLD            1.0f
 
@@ -1656,6 +1657,7 @@ int                                                       GetSurfaceExtraEntityNum( int num );
 int                                                    GetSurfaceExtraCastShadows( int num );
 int                                                    GetSurfaceExtraRecvShadows( int num );
 int                                                    GetSurfaceExtraSampleSize( int num );
+int                                                    GetSurfaceExtraMinSampleSize( int num );
 float                                          GetSurfaceExtraLongestCurve( int num );
 void                                           GetSurfaceExtraLightmapAxis( int num, vec3_t lightmapAxis );
 
@@ -1953,6 +1955,7 @@ Q_EXTERN char                             source[ 1024 ];
 Q_EXTERN char                          outbase[ 32 ];
 
 Q_EXTERN int                           sampleSize;                                             /* lightmap sample size in units */
+Q_EXTERN int                           minSampleSize;                  /* minimum sample size to use at all */
 
 Q_EXTERN int                           mapEntityNum Q_ASSIGN( 0 );
 
@@ -2079,6 +2082,7 @@ Q_EXTERN qboolean                 loMem Q_ASSIGN( qfalse );
 Q_EXTERN qboolean                      noStyles Q_ASSIGN( qfalse );
 
 Q_EXTERN int                           sampleSize Q_ASSIGN( DEFAULT_LIGHTMAP_SAMPLE_SIZE );
+Q_EXTERN int                           minSampleSize Q_ASSIGN( DEFAULT_LIGHTMAP_MIN_SAMPLE_SIZE );
 Q_EXTERN qboolean                      noVertexLighting Q_ASSIGN( qfalse );
 Q_EXTERN qboolean                      noGridLighting Q_ASSIGN( qfalse );
 
index 5415ae105d8f89e65f935b386bb5bc3fd8780626..30b4be57223ed1644d818eff97c304e475a64eef 100644 (file)
@@ -640,7 +640,9 @@ void ClassifySurfaces( int numSurfs, mapDrawSurface_t *ds )
                                ds->sampleSize *= ds->lightmapScale;
                        if( ds->sampleSize <= 0 )
                                ds->sampleSize = 1;
-                       else if( ds->sampleSize > 16384 )       /* powers of 2 are preferred */
+                       if(ds->sampleSize < minSampleSize)
+                               ds->sampleSize = minSampleSize;
+                       if( ds->sampleSize > 16384 )    /* powers of 2 are preferred */
                                ds->sampleSize = 16384;
                }
        }