for ( i = 0; i < w->numpoints; i++ )
{
VectorSubtract( w->p[ i ], point, dirs[ i ] );
- VectorNormalize( dirs[ i ], dirs[ i ] );
+ VectorFastNormalize( dirs[ i ], dirs[ i ] );
}
/* duplicate first vertex to avoid mod operation */
angle = acos( dot );
CrossProduct( dirs[ i ], dirs[ j ], triVector );
- if ( VectorNormalize( triVector, triNormal ) < 0.0001f ) {
+ if ( VectorFastNormalize( triVector, triNormal ) < 0.0001f ) {
continue;
}
Sys_Printf( "No lightmaps yo\n" );
}
+ else if ( !strcmp( argv[ i ], "-bouncecolorratio" ) ) {
+ f = atof( argv[ i + 1 ] );
+ bounceColorRatio *= f;
+ if ( bounceColorRatio > 1 ) {
+ bounceColorRatio = 1;
+ }
+ if ( bounceColorRatio < 0 ) {
+ bounceColorRatio = 0;
+ }
+ Sys_Printf( "Bounce color ratio set to %f\n", bounceColorRatio );
+ i++;
+ }
+
else if ( !strcmp( argv[ i ], "-bouncescale" ) ) {
f = atof( argv[ i + 1 ] );
bounceScale *= f;
i++;
}
+ /* Lighting brightness */
+ else if( !strcmp( argv[ i ], "-brightness" ) ){
+ f = atof( argv[ i + 1 ] );
+ lightmapBrightness = f;
+ Sys_Printf( "Lighting brightness set to %f\n", lightmapBrightness );
+ i++;
+ }
+
+ /* Lighting contrast */
+ else if( !strcmp( argv[ i ], "-contrast" ) ){
+ f = atof( argv[ i + 1 ] );
+ lightmapContrast = f;
+ if( lightmapContrast > 255 ){
+ lightmapContrast = 255;
+ }
+ else if( lightmapContrast < -255 ){
+ lightmapContrast = -255;
+ }
+ Sys_Printf( "Lighting contrast set to %f\n", lightmapContrast );
+ i++;
+ /* change to factor in range of 0 to 129.5 */
+ lightmapContrast = ( 259 * ( lightmapContrast + 255 ) ) / ( 255 * ( 259 - lightmapContrast ) );
+ }
+
/* ydnar switches */
else if ( !strcmp( argv[ i ], "-bounce" ) ) {
bounce = atoi( argv[ i + 1 ] );
i++;
Sys_Printf( "Lightmaps sample scale set to %d\n", sampleScale );
}
+ else if ( !strcmp( argv[ i ], "-debugsamplesize" ) ) {
+ debugSampleSize = 1;
+ Sys_Printf( "debugging Lightmaps SampleSize\n" );
+ }
else if ( !strcmp( argv[ i ], "-novertex" ) ) {
noVertexLighting = 1;
if ( ( atof( argv[ i + 1 ] ) != 0 ) && ( atof( argv[ i + 1 ] )) < 1 ) {
noVertexLighting = ( atof( argv[ i + 1 ] ) );
i++;
- Sys_Printf( "Setting vertex lighting globally to %d\n", noVertexLighting );
+ Sys_Printf( "Setting vertex lighting globally to %f\n", noVertexLighting );
}
else{
Sys_Printf( "Disabling vertex lighting\n" );