}
/* vortex: apply gridscale and gridambientscale here */
- ColorToBytes( color, bgp->ambient[ i ], gridScale * gridAmbientScale );
+ if (gp->directed[i][0] || gp->directed[i][1] || gp->directed[i][2]) {
+ /*
+ * HACK: if there's a non-zero directed component, this
+ * lightgrid cell is useful. However, ioq3 skips grid
+ * cells with zero ambient. So let's force ambient to be
+ * nonzero unless directed is zero too.
+ */
+ ColorToBytesNonZero(color, bgp->ambient[i], gridScale * gridAmbientScale);
+ } else {
+ ColorToBytes(color, bgp->ambient[i], gridScale * gridAmbientScale);
+ }
ColorToBytes( gp->directed[ i ], bgp->directed[ i ], gridScale );
}
does what it says...
*/
-void LightWorld( const char *BSPFilePath, qboolean fastLightmapSearch, qboolean noBounceStore ){
+void LightWorld( const char *BSPFilePath, qboolean fastAllocate, qboolean noBounceStore ){
vec3_t color;
float f;
int b, bt;
qboolean storeForReal = !noBounceStore;
/* store off the bsp between bounces */
- StoreSurfaceLightmaps( fastLightmapSearch, storeForReal );
+ StoreSurfaceLightmaps( fastAllocate, storeForReal );
UnparseEntities();
if ( storeForReal ) {
}
/* ydnar: store off lightmaps */
- StoreSurfaceLightmaps( fastLightmapSearch, qtrue );
+ StoreSurfaceLightmaps( fastAllocate, qtrue );
}
const char *value;
int lightmapMergeSize = 0;
qboolean lightSamplesInsist = qfalse;
- qboolean fastLightmapSearch = qfalse;
+ qboolean fastAllocate = qfalse;
qboolean noBounceStore = qfalse;
/* note it */
Sys_Printf( "Storing all lightmaps externally\n" );
}
+ else if ( !strcmp( argv[ i ], "-externalnames" ) ) {
+ externalLightmaps = qtrue;
+ externalLightmapNames = qtrue;
+ Sys_Printf( "Writing lightstyle shader using external lightmap names\n" );
+ }
+
else if ( !strcmp( argv[ i ], "-lightmapsize" ) ) {
lmCustomSize = atoi( argv[ i + 1 ] );
else if ( !strcmp( argv[ i ], "-lightmapdir" ) ) {
lmCustomDir = argv[i + 1];
+ argv[ i ] = NULL;
i++;
+ argv[ i ] = NULL;
Sys_Printf( "Lightmap directory set to %s\n", lmCustomDir );
externalLightmaps = qtrue;
Sys_Printf( "Storing all lightmaps externally\n" );
Sys_Printf( "Faster mode enabled\n" );
}
- else if ( !strcmp( argv[ i ], "-fastlightmapsearch" ) || !strcmp( argv[ i ], "-fastallocate") ) {
- fastLightmapSearch = qtrue;
+ else if ( !strcmp( argv[ i ], "-fastallocate" ) || !strcmp( argv[ i ], "-fastlightmapsearch" ) ) {
+ fastAllocate = qtrue;
- if ( !strcmp( argv[ i ], "-fastallocate" ) ) {
- Sys_Printf( "The -fastallocate argument is deprecated, use \"-fastlightmapsearch\" instead\n" );
+ if ( !strcmp( argv[ i ], "-fastlightmapsearch" ) ) {
+ Sys_Printf( "The -fastlightmapsearch argument is deprecated, use \"-fastallocate\" instead\n" );
}
else {
- Sys_Printf( "Fast lightmap search enabled\n" );
+ Sys_Printf( "Fast lightmap allocation mode enabled\n" );
}
}
+ else if ( !strcmp( argv[ i ], "-slowallocate" ) ) {
+ fastAllocate = qfalse;
+ Sys_Printf( "Slow lightmap allocation mode enabled (default)\n" );
+ }
+
else if ( !strcmp( argv[ i ], "-fastgrid" ) ) {
fastgrid = qtrue;
Sys_Printf( "Fast grid lighting enabled\n" );
else if ( !strcmp( argv[ i ], "-bspfile" ) )
{
strcpy( BSPFilePath, argv[i + 1] );
+ argv[ i ] = NULL;
i++;
+ argv[ i ] = NULL;
Sys_Printf( "Use %s as bsp file\n", BSPFilePath );
}
else if ( !strcmp( argv[ i ], "-srffile" ) )
{
strcpy( surfaceFilePath, argv[i + 1] );
+ argv[ i ] = NULL;
i++;
+ argv[ i ] = NULL;
Sys_Printf( "Use %s as surface file\n", surfaceFilePath );
}
/* unhandled args */
SetupTraceNodes();
/* light the world */
- LightWorld( BSPFilePath, fastLightmapSearch, noBounceStore );
+ LightWorld( BSPFilePath, fastAllocate, noBounceStore );
/* write out the bsp */
UnparseEntities();