From c401adfe3e54fd94ac3e50c100947f8854ba6a3c Mon Sep 17 00:00:00 2001 From: Garux Date: Thu, 12 Dec 2019 00:20:00 +0300 Subject: [PATCH] * -brightness only affects lightmap brightness, like q3map_lightmapBrightness, as there are -vertexscale and -gridscale for the rest is multipled with q3map_lightmapBrightness --- tools/quake3/q3map2/light.c | 7 +++---- tools/quake3/q3map2/light_ydnar.c | 2 -- tools/quake3/q3map2/shaders.c | 3 ++- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/tools/quake3/q3map2/light.c b/tools/quake3/q3map2/light.c index 015305f7..1526774e 100644 --- a/tools/quake3/q3map2/light.c +++ b/tools/quake3/q3map2/light.c @@ -2422,11 +2422,10 @@ int LightMain( int argc, char **argv ){ i++; } - /* Lighting brightness */ + /* Lightmaps brightness */ else if( !strcmp( argv[ i ], "-brightness" ) ){ - f = atof( argv[ i + 1 ] ); - lightmapBrightness = f; - Sys_Printf( "Lighting brightness set to %f\n", lightmapBrightness ); + lightmapBrightness = atof( argv[ i + 1 ] ); + Sys_Printf( "Scaling lightmaps brightness by %f\n", lightmapBrightness ); i++; } diff --git a/tools/quake3/q3map2/light_ydnar.c b/tools/quake3/q3map2/light_ydnar.c index 2f351e89..10b190fe 100644 --- a/tools/quake3/q3map2/light_ydnar.c +++ b/tools/quake3/q3map2/light_ydnar.c @@ -55,8 +55,6 @@ void ColorToBytes( const float *color, byte *colorBytes, float scale ){ if ( scale <= 0.0f ) { scale = 1.0f; } - /* globally */ - scale *= lightmapBrightness; /* make a local copy */ VectorScale( color, scale, sample ); diff --git a/tools/quake3/q3map2/shaders.c b/tools/quake3/q3map2/shaders.c index 261f3635..63ba23a9 100644 --- a/tools/quake3/q3map2/shaders.c +++ b/tools/quake3/q3map2/shaders.c @@ -660,6 +660,7 @@ static shaderInfo_t *AllocShaderInfo( void ){ si->patchShadows = qfalse; si->vertexShadows = qtrue; /* ydnar: changed default behavior */ si->forceSunlight = qfalse; + si->lmBrightness = lightmapBrightness; si->vertexScale = vertexglobalscale; si->notjunc = qfalse; @@ -1599,7 +1600,7 @@ static void ParseShaderFile( const char *filename ){ /* ydnar: q3map_lightmapBrightness N (for autogenerated shaders + external tga lightmaps) */ else if ( !Q_stricmp( token, "q3map_lightmapBrightness" ) || !Q_stricmp( token, "q3map_lightmapGamma" ) ) { GetTokenAppend( shaderText, qfalse ); - si->lmBrightness = atof( token ); + si->lmBrightness *= atof( token ); if ( si->lmBrightness < 0 ) { si->lmBrightness = 1.0; }