...
 
Commits (5)
......@@ -828,7 +828,37 @@ int BSPMain( int argc, char **argv ){
i++;
Sys_Printf( "Distance epsilon set to %f\n", distanceEpsilon );
}
else if ( !strcmp( argv[ i ], "-mv" ) ) {
else if ( !strcmp( argv[ i ], "-fastmeta" ) ) {
maxLMSurfaceVerts = 64;
maxSurfaceVerts = 999;
maxSurfaceIndexes = 6000;
Sys_Printf( "Maximum per-surface vertex count set to %d\n", maxSurfaceVerts );
Sys_Printf( "Maximum per-surface index count set to %d\n", maxSurfaceIndexes );
Sys_Printf( "Maximum lightmapped surface vertex count set to %d\n", maxLMSurfaceVerts );
}
else if ( !strcmp( argv[ i ], "-maxsurfacevertices" ) ) {
maxSurfaceVerts = atoi( argv[ i + 1 ] );
if ( maxSurfaceVerts < 3 ) {
maxSurfaceVerts = 3;
}
i++;
Sys_Printf( "Maximum per-surface vertex count set to %d\n", maxSurfaceVerts );
}
else if ( !strcmp( argv[ i ], "-maxsurfaceindexes" ) || !strcmp( argv[ i ], "-mi" ) ) {
maxSurfaceIndexes = atoi( argv[ i + 1 ] );
if ( maxSurfaceIndexes < 3 ) {
maxSurfaceIndexes = 3;
}
i++;
if ( !strcmp( argv[ i ], "-mi" ) ) {
Sys_Printf( "The -mi argument is deprecated, use \"-maxsurfaceindexes\" instead\n" );
}
else {
Sys_Printf( "Maximum per-surface index count set to %d\n", maxSurfaceIndexes );
}
}
else if ( !strcmp( argv[ i ], "-maxlightmapvertices" ) || !strcmp( argv[ i ], "-mv" ) ) {
maxLMSurfaceVerts = atoi( argv[ i + 1 ] );
if ( maxLMSurfaceVerts < 3 ) {
maxLMSurfaceVerts = 3;
......@@ -837,15 +867,13 @@ int BSPMain( int argc, char **argv ){
maxSurfaceVerts = maxLMSurfaceVerts;
}
i++;
Sys_Printf( "Maximum lightmapped surface vertex count set to %d\n", maxLMSurfaceVerts );
}
else if ( !strcmp( argv[ i ], "-mi" ) ) {
maxSurfaceIndexes = atoi( argv[ i + 1 ] );
if ( maxSurfaceIndexes < 3 ) {
maxSurfaceIndexes = 3;
if ( !strcmp( argv[ i ], "-mv" ) ) {
Sys_Printf( "The -mv argument is deprecated, use \"-maxlightmapvertices\" instead\n" );
}
else {
Sys_Printf( "Maximum lightmapped surface vertex count set to %d\n", maxLMSurfaceVerts );
}
i++;
Sys_Printf( "Maximum per-surface index count set to %d\n", maxSurfaceIndexes );
}
else if ( !strcmp( argv[ i ], "-np" ) ) {
npDegrees = atof( argv[ i + 1 ] );
......
......@@ -97,6 +97,7 @@ void HelpBsp()
{"-deep", "Use detail brushes in the BSP tree, but at lowest priority (should give more fps)"},
{"-de <F>", "Distance epsilon for plane snapping etc."},
{"-fakemap", "Write fakemap.map containing all world brushes"},
{"-fastmeta", "Use small lightmap/surface verts/number maximum numbers (like Q3A), to be used with `-meta`"},
{"-flares", "Turn on support for flares"},
{"-flat", "Enable flat shading (good for combining with -celshader)"},
{"-fulldetail", "Treat detail brushes as structural ones"},
......@@ -104,13 +105,16 @@ void HelpBsp()
{"-leaktest", "Abort if a leak was found"},
{"-linfile <filename.lin>", "Line file to write"},
{"-maxarea", "Use Max Area face surface generation"},
{"-maxlightmapvertices <N>", "Sets the maximum number of vertices per lightmapped surface"},
{"-maxsurfaceindexes <N>", "Sets the maximum number of indexes per surface"},
{"-maxsurfacevertices <N>", "Sets the maximum number of vertices per surface"},
{"-meta", "Combine adjacent triangles of the same texture to surfaces (ALWAYS USE THIS)"},
{"-metaadequatescore <N>", "Adequate score for adding triangles to meta surfaces"},
{"-metagoodscore <N>", "Good score for adding triangles to meta surfaces"},
{"-metamaxbboxdistance <F>", "Maximum bounding box distance for meta surfaces"},
{"-minsamplesize <N>", "Sets minimum lightmap resolution in luxels/qu"},
{"-mi <N>", "Sets the maximum number of indexes per surface"},
{"-mv <N>", "Sets the maximum number of vertices of a lightmapped surface"},
{"-mi <N>", "Deprecated alias for `-maxsurfaceindexes`"},
{"-mv <N>", "Deprecated alias for `-maxlightmapverts`"},
{"-ne <F>", "Normal epsilon for plane snapping etc."},
{"-nocurves", "Turn off support for patches"},
{"-nodetail", "Leave out detail brushes"},
......@@ -207,10 +211,11 @@ void HelpLight()
{"-extravisnudge", "Broken feature to nudge the luxel origin to a better vis cluster"},
{"-extrawide", "Deprecated alias for `-super 2 -filter`"},
{"-extra", "Deprecated alias for `-super 2`"},
{"-fastallocate", "Use `-fastallocate` to trade lightmap size against allocation time (useful with hi res lightmaps on large maps: reduce allocation time from days to minutes for only some extra bytes)"},
{"-fastallocate", "Deprecated alias for `-fastlightmapsearch`"},
{"-fastbounce", "Use `-fast` style lighting for radiosity"},
{"-faster", "Use a faster falloff curve for lighting; also implies `-fast`"},
{"-fastgrid", "Use `-fast` style lighting for the light grid"},
{"-fastlightmapsearch", "Use `-fastlightmapsearch` to trade lightmap size against packing time (useful with hi res lightmaps on large maps: reduce allocation time from days to minutes for only some extra bytes)"},
{"-fast", "Ignore tiny light contributions"},
{"-fill", "Fill lightmap colors from surrounding pixels to improve JPEG compression"},
{"-filter", "Lightmap filtering"},
......@@ -230,6 +235,7 @@ void HelpLight()
{"-lomem", "Low memory but slower lighting mode"},
{"-lowquality", "Low quality floodlight (appears to currently break floodlight)"},
{"-minsamplesize <N>", "Sets minimum lightmap resolution in luxels/qu"},
{"-nobouncestore", "Do not store BSP, lightmap and shader files between bounces"},
{"-nocollapse", "Do not collapse identical lightmaps"},
{"-nodeluxe, -nodeluxemap", "Disable deluxemapping"},
{"-nofastpoint", "Disable fast point light calculation"},
......
......@@ -1890,14 +1890,13 @@ void SetupGrid( void ){
does what it says...
*/
void LightWorld( const char *BSPFilePath, qboolean fastAllocate ){
void LightWorld( const char *BSPFilePath, qboolean fastLightmapSearch, qboolean noBounceStore ){
vec3_t color;
float f;
int b, bt;
qboolean minVertex, minGrid;
const char *value;
/* ydnar: smooth normals */
if ( shade ) {
Sys_Printf( "--- SmoothNormals ---\n" );
......@@ -2031,13 +2030,19 @@ void LightWorld( const char *BSPFilePath, qboolean fastAllocate ){
/* radiosity */
b = 1;
bt = bounce;
while ( bounce > 0 )
{
qboolean storeForReal = !noBounceStore;
/* store off the bsp between bounces */
StoreSurfaceLightmaps( fastAllocate );
StoreSurfaceLightmaps( fastLightmapSearch, storeForReal );
UnparseEntities();
Sys_Printf( "Writing %s\n", BSPFilePath );
WriteBSPFile( BSPFilePath );
if ( storeForReal ) {
Sys_Printf( "Writing %s\n", BSPFilePath );
WriteBSPFile( BSPFilePath );
}
/* note it */
Sys_Printf( "\n--- Radiosity (bounce %d of %d) ---\n", b, bt );
......@@ -2055,6 +2060,9 @@ void LightWorld( const char *BSPFilePath, qboolean fastAllocate ){
SetupEnvelopes( qfalse, fastbounce );
if ( numLights == 0 ) {
Sys_Printf( "No diffuse light to calculate, ending radiosity.\n" );
if ( noBounceStore ) {
break;
}
return;
}
......@@ -2098,8 +2106,9 @@ void LightWorld( const char *BSPFilePath, qboolean fastAllocate ){
bounce--;
b++;
}
/* ydnar: store off lightmaps */
StoreSurfaceLightmaps( fastAllocate );
StoreSurfaceLightmaps( fastLightmapSearch, qtrue );
}
......@@ -2139,7 +2148,8 @@ int LightMain( int argc, char **argv ){
const char *value;
int lightmapMergeSize = 0;
qboolean lightSamplesInsist = qfalse;
qboolean fastAllocate = qfalse;
qboolean fastLightmapSearch = qfalse;
qboolean noBounceStore = qfalse;
/* note it */
Sys_Printf( "--- Light ---\n" );
......@@ -2601,6 +2611,11 @@ int LightMain( int argc, char **argv ){
Sys_Printf( "Storing bounced light (radiosity) only\n" );
}
else if ( !strcmp( argv[ i ], "-nobouncestore" ) ) {
noBounceStore = qtrue;
Sys_Printf( "Do not store BSP, lightmap and shader files between bounces\n" );
}
else if ( !strcmp( argv[ i ], "-nocollapse" ) ) {
noCollapse = qtrue;
Sys_Printf( "Identical lightmap collapsing disabled\n" );
......@@ -2660,9 +2675,15 @@ int LightMain( int argc, char **argv ){
Sys_Printf( "Faster mode enabled\n" );
}
else if ( !strcmp( argv[ i ], "-fastallocate" ) ) {
fastAllocate = qtrue;
Sys_Printf( "Fast allocation mode enabled\n" );
else if ( !strcmp( argv[ i ], "-fastlightmapsearch" ) || !strcmp( argv[ i ], "-fastallocate") ) {
fastLightmapSearch = qtrue;
if ( !strcmp( argv[ i ], "-fastallocate" ) ) {
Sys_Printf( "The -fastallocate argument is deprecated, use \"-fastlightmapsearch\" instead\n" );
}
else {
Sys_Printf( "Fast lightmap search enabled\n" );
}
}
else if ( !strcmp( argv[ i ], "-fastgrid" ) ) {
......@@ -3022,7 +3043,7 @@ int LightMain( int argc, char **argv ){
SetupTraceNodes();
/* light the world */
LightWorld( BSPFilePath, fastAllocate );
LightWorld( BSPFilePath, fastLightmapSearch, noBounceStore );
/* write out the bsp */
UnparseEntities();
......
This diff is collapsed.
......@@ -1858,7 +1858,7 @@ int ImportLightmapsMain( int argc, char **argv );
void SetupSurfaceLightmaps( void );
void StitchSurfaceLightmaps( void );
void StoreSurfaceLightmaps( qboolean fastAllocate );
void StoreSurfaceLightmaps( qboolean fastLightmapSearch, qboolean storeForReal );
/* exportents.c */
......