From 7f2d9153e2639492546528d3be59dfac6ff99fde Mon Sep 17 00:00:00 2001 From: Marco Hladik Date: Mon, 7 Dec 2020 18:58:58 +0100 Subject: [PATCH] Dropped support for the RtCW lighting model (linear only). You can still mark select lights as linear if you please. --- tools/vmap/game__null.h | 1 - tools/vmap/game_fte.h | 1 - tools/vmap/help.c | 4 --- tools/vmap/light.c | 61 ++++++----------------------------------- tools/vmap/vmap.h | 7 ++--- 5 files changed, 11 insertions(+), 63 deletions(-) diff --git a/tools/vmap/game__null.h b/tools/vmap/game__null.h index 2bcc855..8366452 100644 --- a/tools/vmap/game__null.h +++ b/tools/vmap/game__null.h @@ -58,7 +58,6 @@ 0, /* max lightmapped surface verts */ 0, /* max surface verts */ 0, /* max surface indexes */ - qfalse, /* wolf lighting model? */ 0, /* lightmap width/height */ 0, /* lightmap gamma */ qfalse, /* lightmap sRGB */ diff --git a/tools/vmap/game_fte.h b/tools/vmap/game_fte.h index 80a366f..8a72d0b 100644 --- a/tools/vmap/game_fte.h +++ b/tools/vmap/game_fte.h @@ -103,7 +103,6 @@ 65535, /* max lightmapped surface verts */ 65535, /* max surface verts */ 1048575, /* max surface indexes */ - qfalse, /* wolf lighting model? */ 512, /* lightmap width/height */ 1.0f, /* lightmap gamma */ qfalse, /* lightmap sRGB */ diff --git a/tools/vmap/help.c b/tools/vmap/help.c index 14a3ded..8a182a7 100644 --- a/tools/vmap/help.c +++ b/tools/vmap/help.c @@ -153,7 +153,6 @@ void HelpLight() { struct HelpOption light[] = { {"-light ", "Switch that enters this stage"}, - {"-vlight ", "Deprecated alias for `-light -fast` ... filename.map"}, {"-approx ", "Vertex light approximation tolerance (never use in conjunction with deluxemapping)"}, {"-areascale ", "Scaling factor for area lights (surfacelight)"}, {"-border", "Add a red border to lightmaps for debugging"}, @@ -220,7 +219,6 @@ void HelpLight() {"-novertex", "Disable vertex lighting"}, {"-patchshadows", "Cast shadows from patches"}, {"-pointscale ", "Scaling factor for point lights (light entities)"}, - {"-q3", "Use nonlinear falloff curve by default (like Q3A)"}, {"-samplescale ", "Scales all lightmap resolutions"}, {"-samplesize ", "Sets default lightmap resolution in luxels/qu"}, {"-samples ", "Adaptive supersampling quality"}, @@ -228,7 +226,6 @@ void HelpLight() {"-shadeangle ", "Angle for phong shading"}, {"-shade", "Enable phong shading at default shade angle"}, {"-skyscale ", "Scaling factor for sky and sun light"}, - {"-smooth", "Deprecated alias for `-samples 2`"}, {"-srffile ", "Surface file to read"}, {"-style, -styles", "Enable support for light styles"}, {"-sunonly", "Only compute sun light"}, @@ -236,7 +233,6 @@ void HelpLight() {"-thresh ", "Triangle subdivision threshold"}, {"-trianglecheck", "Broken check that should ensure luxels apply to the right triangle"}, {"-trisoup", "Convert brush faces to triangle soup"}, - {"-wolf", "Use linear falloff curve by default (like W:ET)"}, }; HelpOptions("Light Stage", 0, 80, light, sizeof(light)/sizeof(struct HelpOption)); diff --git a/tools/vmap/light.c b/tools/vmap/light.c index 19283ec..7662360 100644 --- a/tools/vmap/light.c +++ b/tools/vmap/light.c @@ -357,43 +357,21 @@ void CreateEntityLights( void ){ /* handle spawnflags */ spawnflags = IntForKey( e, "spawnflags" ); - /* ydnar: quake 3+ light behavior */ - if ( wolfLight == qfalse ) { - /* set default flags */ - flags = LIGHT_Q3A_DEFAULT; + flags = LIGHT_Q3A_DEFAULT; - /* linear attenuation? */ - /*if ( spawnflags & 1 ) { - flags |= LIGHT_ATTEN_LINEAR; - flags &= ~LIGHT_ATTEN_ANGLE; - }*/ - - /* no angle attenuate? */ - /*if ( spawnflags & 2 ) { - flags &= ~LIGHT_ATTEN_ANGLE; - }*/ + /* linear attenuation? */ + if ( spawnflags & 1 ) { + flags |= LIGHT_ATTEN_LINEAR; + flags &= ~LIGHT_ATTEN_ANGLE; } - /* ydnar: wolf light behavior */ - else - { - /* set default flags */ - flags = LIGHT_WOLF_DEFAULT; - - /* inverse distance squared attenuation? */ - /*if ( spawnflags & 1 ) { - flags &= ~LIGHT_ATTEN_LINEAR; - flags |= LIGHT_ATTEN_ANGLE; - }*/ - - /* angle attenuate? */ - /*if ( spawnflags & 2 ) { - flags |= LIGHT_ATTEN_ANGLE; - }*/ + /* no angle attenuate? */ + if ( spawnflags & 2 ) { + flags &= ~LIGHT_ATTEN_ANGLE; } + /* other flags (borrowed from wolf) */ - /* wolf dark light? */ if ( ( spawnflags & 4 ) || ( spawnflags & 8 ) ) { flags |= LIGHT_DARK; @@ -2258,15 +2236,6 @@ int LightMain( int argc, char **argv ){ Sys_Printf( "--- Light ---\n" ); Sys_Printf( "--- ProcessGameSpecific ---\n" ); - /* set standard game flags */ - wolfLight = game->wolfLight; - if ( wolfLight == qtrue ) { - Sys_Printf( " lighting model: wolf\n" ); - } - else{ - Sys_Printf( " lighting model: quake3\n" ); - } - lmCustomSize = game->lightmapSize; Sys_Printf( " lightmap size: %d x %d pixels\n", lmCustomSize, lmCustomSize ); @@ -2688,18 +2657,6 @@ int LightMain( int argc, char **argv ){ useCustomInfoParms = qtrue; } - else if ( !strcmp( argv[ i ], "-wolf" ) ) { - /* -game should already be set */ - wolfLight = qtrue; - Sys_Printf( "Enabling Wolf lighting model (linear default)\n" ); - } - - else if ( !strcmp( argv[ i ], "-q3" ) ) { - /* -game should already be set */ - wolfLight = qfalse; - Sys_Printf( "Enabling Quake 3 lighting model (nonlinear default)\n" ); - } - else if ( !strcmp( argv[ i ], "-extradist" ) ) { extraDist = atof( argv[ i + 1 ] ); if ( extraDist < 0 ) { diff --git a/tools/vmap/vmap.h b/tools/vmap/vmap.h index 0484aab..1a65f36 100644 --- a/tools/vmap/vmap.h +++ b/tools/vmap/vmap.h @@ -242,9 +242,8 @@ #define LIGHT_UNNORMALIZED 2048 /* vortex: do not normalize _color */ #define LIGHT_SUN_DEFAULT ( LIGHT_ATTEN_ANGLE | LIGHT_GRID | LIGHT_SURFACES ) -#define LIGHT_AREA_DEFAULT ( LIGHT_ATTEN_ANGLE | LIGHT_ATTEN_DISTANCE | LIGHT_GRID | LIGHT_SURFACES ) /* q3a and wolf are the same */ +#define LIGHT_AREA_DEFAULT ( LIGHT_ATTEN_ANGLE | LIGHT_ATTEN_DISTANCE | LIGHT_GRID | LIGHT_SURFACES ) #define LIGHT_Q3A_DEFAULT ( LIGHT_ATTEN_ANGLE | LIGHT_ATTEN_DISTANCE | LIGHT_GRID | LIGHT_SURFACES | LIGHT_FAST ) -#define LIGHT_WOLF_DEFAULT ( LIGHT_ATTEN_LINEAR | LIGHT_ATTEN_DISTANCE | LIGHT_GRID | LIGHT_SURFACES | LIGHT_FAST ) #define MAX_TRACE_TEST_NODES 256 #define DEFAULT_INHIBIT_RADIUS 1.5f @@ -537,12 +536,11 @@ typedef struct game_s int maxLMSurfaceVerts; /* default maximum meta surface verts */ int maxSurfaceVerts; /* default maximum surface verts */ int maxSurfaceIndexes; /* default maximum surface indexes (tris * 3) */ - qboolean wolfLight; /* when true, lights work like wolf q3map */ int lightmapSize; /* bsp lightmap width/height */ float lightmapGamma; /* default lightmap gamma */ qboolean lightmapsRGB; /* default lightmap sRGB mode */ qboolean texturesRGB; /* default texture sRGB mode */ - qboolean colorsRGB; /* default color sRGB mode */ + qboolean colorsRGB; /* default color sRGB mode */ float lightmapExposure; /* default lightmap exposure */ float lightmapCompensate; /* default lightmap compensate value */ float gridScale; /* vortex: default lightgrid scale (affects both directional and ambient spectres) */ @@ -2196,7 +2194,6 @@ Q_EXTERN vportal_t *sorted_portals[ MAX_MAP_PORTALS * 2 ]; ------------------------------------------------------------------------------- */ /* commandline arguments */ -Q_EXTERN qboolean wolfLight Q_ASSIGN( qfalse ); Q_EXTERN float extraDist Q_ASSIGN( 0.0f ); Q_EXTERN qboolean loMem Q_ASSIGN( qfalse ); Q_EXTERN qboolean noStyles Q_ASSIGN( qfalse );