Merge branch 'master' into game/eliteforce

Conflicts:
	code/client/cl_main.c
This commit is contained in:
Zack Middleton 2015-06-24 16:48:46 -05:00
commit 73de855c27
13 changed files with 1661 additions and 664 deletions

View file

@ -72,6 +72,13 @@ PLATFORM=$(COMPILE_PLATFORM)
endif endif
export PLATFORM export PLATFORM
ifeq ($(PLATFORM),mingw32)
MINGW=1
endif
ifeq ($(PLATFORM),mingw64)
MINGW=1
endif
ifeq ($(COMPILE_ARCH),i86pc) ifeq ($(COMPILE_ARCH),i86pc)
COMPILE_ARCH=x86 COMPILE_ARCH=x86
endif endif
@ -187,7 +194,7 @@ USE_CURL=1
endif endif
ifndef USE_CURL_DLOPEN ifndef USE_CURL_DLOPEN
ifeq ($(PLATFORM),mingw32) ifdef MINGW
USE_CURL_DLOPEN=0 USE_CURL_DLOPEN=0
else else
USE_CURL_DLOPEN=1 USE_CURL_DLOPEN=1
@ -367,18 +374,16 @@ ifneq (,$(findstring "$(PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu"))
-pipe -DUSE_ICON -pipe -DUSE_ICON
CLIENT_CFLAGS += $(SDL_CFLAGS) CLIENT_CFLAGS += $(SDL_CFLAGS)
OPTIMIZEVM = -O3 -funroll-loops -fomit-frame-pointer OPTIMIZEVM = -O3
OPTIMIZE = $(OPTIMIZEVM) -ffast-math OPTIMIZE = $(OPTIMIZEVM) -ffast-math
ifeq ($(ARCH),x86_64) ifeq ($(ARCH),x86_64)
OPTIMIZEVM = -O3 -fomit-frame-pointer -funroll-loops \ OPTIMIZEVM = -O3
-falign-functions=2 -fstrength-reduce
OPTIMIZE = $(OPTIMIZEVM) -ffast-math OPTIMIZE = $(OPTIMIZEVM) -ffast-math
HAVE_VM_COMPILED = true HAVE_VM_COMPILED = true
else else
ifeq ($(ARCH),x86) ifeq ($(ARCH),x86)
OPTIMIZEVM = -O3 -march=i586 -fomit-frame-pointer \ OPTIMIZEVM = -O3 -march=i586
-funroll-loops -falign-functions=2 -fstrength-reduce
OPTIMIZE = $(OPTIMIZEVM) -ffast-math OPTIMIZE = $(OPTIMIZEVM) -ffast-math
HAVE_VM_COMPILED=true HAVE_VM_COMPILED=true
else else
@ -479,13 +484,13 @@ ifeq ($(PLATFORM),darwin)
endif endif
ifeq ($(CROSS_COMPILING),1) ifeq ($(CROSS_COMPILING),1)
ifeq ($(ARCH),ppc) ifeq ($(ARCH),x86_64)
CC=powerpc-apple-darwin10-gcc CC=x86_64-apple-darwin13-cc
RANLIB=powerpc-apple-darwin10-ranlib RANLIB=x86_64-apple-darwin13-ranlib
else else
ifeq ($(ARCH),x86) ifeq ($(ARCH),x86)
CC=i686-apple-darwin10-gcc CC=i386-apple-darwin13-cc
RANLIB=i686-apple-darwin10-ranlib RANLIB=i386-apple-darwin13-ranlib
else else
$(error Architecture $(ARCH) is not supported when cross compiling) $(error Architecture $(ARCH) is not supported when cross compiling)
endif endif
@ -539,7 +544,7 @@ else # ifeq darwin
# SETUP AND BUILD -- MINGW32 # SETUP AND BUILD -- MINGW32
############################################################################# #############################################################################
ifeq ($(PLATFORM),mingw32) ifdef MINGW
ifeq ($(CROSS_COMPILING),1) ifeq ($(CROSS_COMPILING),1)
# If CC is already set to something generic, we probably want to use # If CC is already set to something generic, we probably want to use
@ -553,7 +558,7 @@ ifeq ($(PLATFORM),mingw32)
MINGW_PREFIXES=amd64-mingw32msvc x86_64-w64-mingw32 MINGW_PREFIXES=amd64-mingw32msvc x86_64-w64-mingw32
endif endif
ifeq ($(ARCH),x86) ifeq ($(ARCH),x86)
MINGW_PREFIXES=i586-mingw32msvc i686-w64-mingw32 MINGW_PREFIXES=i586-mingw32msvc i686-w64-mingw32 i686-pc-mingw32
endif endif
ifndef CC ifndef CC
@ -597,14 +602,12 @@ ifeq ($(PLATFORM),mingw32)
endif endif
ifeq ($(ARCH),x86_64) ifeq ($(ARCH),x86_64)
OPTIMIZEVM = -O3 -fno-omit-frame-pointer \ OPTIMIZEVM = -O3
-funroll-loops -falign-functions=2 -fstrength-reduce
OPTIMIZE = $(OPTIMIZEVM) -ffast-math OPTIMIZE = $(OPTIMIZEVM) -ffast-math
HAVE_VM_COMPILED = true HAVE_VM_COMPILED = true
endif endif
ifeq ($(ARCH),x86) ifeq ($(ARCH),x86)
OPTIMIZEVM = -O3 -march=i586 -fno-omit-frame-pointer \ OPTIMIZEVM = -O3 -march=i586
-funroll-loops -falign-functions=2 -fstrength-reduce
OPTIMIZE = $(OPTIMIZEVM) -ffast-math OPTIMIZE = $(OPTIMIZEVM) -ffast-math
HAVE_VM_COMPILED = true HAVE_VM_COMPILED = true
endif endif
@ -687,7 +690,7 @@ ifeq ($(PLATFORM),mingw32)
SDLDLL=SDL2.dll SDLDLL=SDL2.dll
endif endif
else # ifeq mingw32 else # ifdef MINGW
############################################################################# #############################################################################
# SETUP AND BUILD -- FREEBSD # SETUP AND BUILD -- FREEBSD
@ -702,7 +705,7 @@ ifeq ($(PLATFORM),freebsd)
CLIENT_CFLAGS += $(SDL_CFLAGS) CLIENT_CFLAGS += $(SDL_CFLAGS)
HAVE_VM_COMPILED = true HAVE_VM_COMPILED = true
OPTIMIZEVM = -O3 -funroll-loops -fomit-frame-pointer OPTIMIZEVM = -O3
OPTIMIZE = $(OPTIMIZEVM) -ffast-math OPTIMIZE = $(OPTIMIZEVM) -ffast-math
SHLIBEXT=so SHLIBEXT=so
@ -755,18 +758,16 @@ ifeq ($(PLATFORM),openbsd)
-pipe -DUSE_ICON -DMAP_ANONYMOUS=MAP_ANON -pipe -DUSE_ICON -DMAP_ANONYMOUS=MAP_ANON
CLIENT_CFLAGS += $(SDL_CFLAGS) CLIENT_CFLAGS += $(SDL_CFLAGS)
OPTIMIZEVM = -O3 -funroll-loops -fomit-frame-pointer OPTIMIZEVM = -O3
OPTIMIZE = $(OPTIMIZEVM) -ffast-math OPTIMIZE = $(OPTIMIZEVM) -ffast-math
ifeq ($(ARCH),x86_64) ifeq ($(ARCH),x86_64)
OPTIMIZEVM = -O3 -fomit-frame-pointer -funroll-loops \ OPTIMIZEVM = -O3
-falign-functions=2 -fstrength-reduce
OPTIMIZE = $(OPTIMIZEVM) -ffast-math OPTIMIZE = $(OPTIMIZEVM) -ffast-math
HAVE_VM_COMPILED = true HAVE_VM_COMPILED = true
else else
ifeq ($(ARCH),x86) ifeq ($(ARCH),x86)
OPTIMIZEVM = -O3 -march=i586 -fomit-frame-pointer \ OPTIMIZEVM = -O3 -march=i586
-funroll-loops -falign-functions=2 -fstrength-reduce
OPTIMIZE = $(OPTIMIZEVM) -ffast-math OPTIMIZE = $(OPTIMIZEVM) -ffast-math
HAVE_VM_COMPILED=true HAVE_VM_COMPILED=true
else else
@ -940,7 +941,7 @@ else # ifeq sunos
endif #Linux endif #Linux
endif #darwin endif #darwin
endif #mingw32 endif #MINGW
endif #FreeBSD endif #FreeBSD
endif #OpenBSD endif #OpenBSD
endif #NetBSD endif #NetBSD
@ -1690,7 +1691,7 @@ Q3OBJ = \
$(B)/client/con_log.o \ $(B)/client/con_log.o \
$(B)/client/sys_main.o $(B)/client/sys_main.o
ifeq ($(PLATFORM),mingw32) ifdef MINGW
Q3OBJ += \ Q3OBJ += \
$(B)/client/con_passive.o $(B)/client/con_passive.o
else else
@ -1711,11 +1712,11 @@ Q3R2OBJ = \
$(B)/renderergl2/tr_font.o \ $(B)/renderergl2/tr_font.o \
$(B)/renderergl2/tr_glsl.o \ $(B)/renderergl2/tr_glsl.o \
$(B)/renderergl2/tr_image.o \ $(B)/renderergl2/tr_image.o \
$(B)/renderergl2/tr_image_png.o \
$(B)/renderergl2/tr_image_jpg.o \
$(B)/renderergl2/tr_image_bmp.o \ $(B)/renderergl2/tr_image_bmp.o \
$(B)/renderergl2/tr_image_tga.o \ $(B)/renderergl2/tr_image_jpg.o \
$(B)/renderergl2/tr_image_pcx.o \ $(B)/renderergl2/tr_image_pcx.o \
$(B)/renderergl2/tr_image_png.o \
$(B)/renderergl2/tr_image_tga.o \
$(B)/renderergl2/tr_init.o \ $(B)/renderergl2/tr_init.o \
$(B)/renderergl2/tr_light.o \ $(B)/renderergl2/tr_light.o \
$(B)/renderergl2/tr_main.o \ $(B)/renderergl2/tr_main.o \
@ -1777,11 +1778,11 @@ Q3ROBJ = \
$(B)/renderergl1/tr_flares.o \ $(B)/renderergl1/tr_flares.o \
$(B)/renderergl1/tr_font.o \ $(B)/renderergl1/tr_font.o \
$(B)/renderergl1/tr_image.o \ $(B)/renderergl1/tr_image.o \
$(B)/renderergl1/tr_image_png.o \
$(B)/renderergl1/tr_image_jpg.o \
$(B)/renderergl1/tr_image_bmp.o \ $(B)/renderergl1/tr_image_bmp.o \
$(B)/renderergl1/tr_image_tga.o \ $(B)/renderergl1/tr_image_jpg.o \
$(B)/renderergl1/tr_image_pcx.o \ $(B)/renderergl1/tr_image_pcx.o \
$(B)/renderergl1/tr_image_png.o \
$(B)/renderergl1/tr_image_tga.o \
$(B)/renderergl1/tr_init.o \ $(B)/renderergl1/tr_init.o \
$(B)/renderergl1/tr_light.o \ $(B)/renderergl1/tr_light.o \
$(B)/renderergl1/tr_main.o \ $(B)/renderergl1/tr_main.o \
@ -2134,7 +2135,7 @@ ifeq ($(HAVE_VM_COMPILED),true)
endif endif
endif endif
ifeq ($(PLATFORM),mingw32) ifdef MINGW
Q3OBJ += \ Q3OBJ += \
$(B)/client/win_resource.o \ $(B)/client/win_resource.o \
$(B)/client/sys_win32.o $(B)/client/sys_win32.o
@ -2302,7 +2303,7 @@ ifeq ($(HAVE_VM_COMPILED),true)
endif endif
endif endif
ifeq ($(PLATFORM),mingw32) ifdef MINGW
Q3DOBJ += \ Q3DOBJ += \
$(B)/ded/win_resource.o \ $(B)/ded/win_resource.o \
$(B)/ded/sys_win32.o \ $(B)/ded/sys_win32.o \
@ -2918,7 +2919,7 @@ distclean: clean toolsclean
@rm -rf $(BUILD_DIR) @rm -rf $(BUILD_DIR)
installer: release installer: release
ifeq ($(PLATFORM),mingw32) ifdef MINGW
@$(MAKE) VERSION=$(VERSION) -C $(NSISDIR) V=$(V) \ @$(MAKE) VERSION=$(VERSION) -C $(NSISDIR) V=$(V) \
SDLDLL=$(SDLDLL) \ SDLDLL=$(SDLDLL) \
USE_RENDERER_DLOPEN=$(USE_RENDERER_DLOPEN) \ USE_RENDERER_DLOPEN=$(USE_RENDERER_DLOPEN) \

View file

@ -2363,9 +2363,9 @@ Resend a connect message if the last one has timed out
================= =================
*/ */
void CL_CheckForResend( void ) { void CL_CheckForResend( void ) {
int port, i; int port;
char info[MAX_INFO_STRING]; char info[MAX_INFO_STRING];
char data[MAX_INFO_STRING]; char data[MAX_INFO_STRING + 10];
// don't send anything if playing back a demo // don't send anything if playing back a demo
if ( clc.demoplaying ) { if ( clc.demoplaying ) {
@ -2419,22 +2419,11 @@ void CL_CheckForResend( void ) {
Info_SetValueForKey( info, "qport", va("%i", port ) ); Info_SetValueForKey( info, "qport", va("%i", port ) );
Info_SetValueForKey( info, "challenge", va("%i", clc.challenge ) ); Info_SetValueForKey( info, "challenge", va("%i", clc.challenge ) );
strcpy(data, "connect "); Com_sprintf( data, sizeof(data), "connect \"%s\"", info );
// TTimo adding " " around the userinfo string to avoid truncated userinfo on the server
// (Com_TokenizeString tokenizes around spaces)
data[8] = '"';
for(i=0;i<strlen(info);i++) {
data[9+i] = info[i]; // + (clc.challenge)&0x3;
}
data[9+i] = '"';
data[10+i] = 0;
// NOTE TTimo don't forget to set the right data length!
#ifdef ELITEFORCE #ifdef ELITEFORCE
NET_OutOfBandPrint( NS_CLIENT, clc.serverAddress, "%s", data); NET_OutOfBandPrint( NS_CLIENT, clc.serverAddress, "%s", data);
#else #else
NET_OutOfBandData( NS_CLIENT, clc.serverAddress, (byte *) &data[0], i+10 ); NET_OutOfBandData( NS_CLIENT, clc.serverAddress, (byte *) data, strlen ( data ) );
#endif #endif
// the most current userinfo has been sent, so watch for any // the most current userinfo has been sent, so watch for any
// newer changes to userinfo variables // newer changes to userinfo variables

View file

@ -1256,7 +1256,7 @@ void Info_RemoveKey_Big( char *s, const char *key ) {
if (!strcmp (key, pkey) ) if (!strcmp (key, pkey) )
{ {
strcpy (start, s); // remove this part memmove(start, s, strlen(s) + 1); // remove this part
return; return;
} }

View file

@ -144,6 +144,20 @@ void R_InitFreeType( void );
void R_DoneFreeType( void ); void R_DoneFreeType( void );
void RE_RegisterFont(const char *fontName, int pointSize, fontInfo_t *font); void RE_RegisterFont(const char *fontName, int pointSize, fontInfo_t *font);
/*
=============================================================
IMAGE LOADERS
=============================================================
*/
void R_LoadBMP( const char *name, byte **pic, int *width, int *height );
void R_LoadJPG( const char *name, byte **pic, int *width, int *height );
void R_LoadPCX( const char *name, byte **pic, int *width, int *height );
void R_LoadPNG( const char *name, byte **pic, int *width, int *height );
void R_LoadTGA( const char *name, byte **pic, int *width, int *height );
/* /*
==================================================================== ====================================================================

View file

@ -1391,20 +1391,6 @@ int R_IQMLerpTag( orientation_t *tag, iqmData_t *data,
int startFrame, int endFrame, int startFrame, int endFrame,
float frac, const char *tagName ); float frac, const char *tagName );
/*
=============================================================
IMAGE LOADERS
=============================================================
*/
void R_LoadBMP( const char *name, byte **pic, int *width, int *height );
void R_LoadJPG( const char *name, byte **pic, int *width, int *height );
void R_LoadPCX( const char *name, byte **pic, int *width, int *height );
void R_LoadPNG( const char *name, byte **pic, int *width, int *height );
void R_LoadTGA( const char *name, byte **pic, int *width, int *height );
/* /*
============================================================= =============================================================
============================================================= =============================================================

View file

@ -2276,20 +2276,6 @@ int R_IQMLerpTag( orientation_t *tag, iqmData_t *data,
int startFrame, int endFrame, int startFrame, int endFrame,
float frac, const char *tagName ); float frac, const char *tagName );
/*
=============================================================
IMAGE LOADERS
=============================================================
*/
void R_LoadBMP( const char *name, byte **pic, int *width, int *height );
void R_LoadJPG( const char *name, byte **pic, int *width, int *height );
void R_LoadPCX( const char *name, byte **pic, int *width, int *height );
void R_LoadPNG( const char *name, byte **pic, int *width, int *height );
void R_LoadTGA( const char *name, byte **pic, int *width, int *height );
/* /*
============================================================= =============================================================
============================================================= =============================================================

View file

@ -130,7 +130,8 @@ static void GLimp_DetectAvailableModes(void)
{ {
int i, j; int i, j;
char buf[ MAX_STRING_CHARS ] = { 0 }; char buf[ MAX_STRING_CHARS ] = { 0 };
SDL_Rect modes[ 128 ]; size_t numSDLModes;
SDL_Rect *modes;
int numModes = 0; int numModes = 0;
int display = SDL_GetWindowDisplayIndex( SDL_window ); int display = SDL_GetWindowDisplayIndex( SDL_window );
@ -142,7 +143,14 @@ static void GLimp_DetectAvailableModes(void)
return; return;
} }
for( i = 0; i < SDL_GetNumDisplayModes( display ); i++ ) numSDLModes = SDL_GetNumDisplayModes( display );
modes = SDL_calloc( numSDLModes, sizeof( SDL_Rect ) );
if ( !modes )
{
ri.Error( ERR_FATAL, "Out of memory" );
}
for( i = 0; i < numSDLModes; i++ )
{ {
SDL_DisplayMode mode; SDL_DisplayMode mode;
@ -152,6 +160,7 @@ static void GLimp_DetectAvailableModes(void)
if( !mode.w || !mode.h ) if( !mode.w || !mode.h )
{ {
ri.Printf( PRINT_ALL, "Display supports any resolution\n" ); ri.Printf( PRINT_ALL, "Display supports any resolution\n" );
SDL_free( modes );
return; return;
} }
@ -193,6 +202,7 @@ static void GLimp_DetectAvailableModes(void)
ri.Printf( PRINT_ALL, "Available modes: '%s'\n", buf ); ri.Printf( PRINT_ALL, "Available modes: '%s'\n", buf );
ri.Cvar_Set( "r_availableModes", buf ); ri.Cvar_Set( "r_availableModes", buf );
} }
SDL_free( modes );
} }
/* /*

View file

@ -833,7 +833,7 @@ static void IN_ProcessEvents( void )
Com_QueueEvent( 0, SE_KEY, K_MWHEELUP, qtrue, 0, NULL ); Com_QueueEvent( 0, SE_KEY, K_MWHEELUP, qtrue, 0, NULL );
Com_QueueEvent( 0, SE_KEY, K_MWHEELUP, qfalse, 0, NULL ); Com_QueueEvent( 0, SE_KEY, K_MWHEELUP, qfalse, 0, NULL );
} }
else else if( e.wheel.y < 0 )
{ {
Com_QueueEvent( 0, SE_KEY, K_MWHEELDOWN, qtrue, 0, NULL ); Com_QueueEvent( 0, SE_KEY, K_MWHEELDOWN, qtrue, 0, NULL );
Com_QueueEvent( 0, SE_KEY, K_MWHEELDOWN, qfalse, 0, NULL ); Com_QueueEvent( 0, SE_KEY, K_MWHEELDOWN, qfalse, 0, NULL );

View file

@ -813,7 +813,7 @@ void Sys_PlatformInit( void )
signal( SIGHUP, Sys_SigHandler ); signal( SIGHUP, Sys_SigHandler );
signal( SIGQUIT, Sys_SigHandler ); signal( SIGQUIT, Sys_SigHandler );
signal( SIGTRAP, Sys_SigHandler ); signal( SIGTRAP, Sys_SigHandler );
signal( SIGIOT, Sys_SigHandler ); signal( SIGABRT, Sys_SigHandler );
signal( SIGBUS, Sys_SigHandler ); signal( SIGBUS, Sys_SigHandler );
Sys_SetFloatEnv(); Sys_SetFloatEnv();

View file

@ -105,7 +105,8 @@ char *basepath( char *fname )
/* memmove is defined here because some vendors don't provide it at /* memmove is defined here because some vendors don't provide it at
all and others do a terrible job (like calling malloc) */ all and others do a terrible job (like calling malloc) */
// -- ouch, that hurts -- ln // -- ouch, that hurts -- ln
#ifndef MACOS_X /* always use the system memmove() on Mac OS X. --ryan. */ /* always use the system memmove() on Mac OS X. --ryan. */
#if !defined(MACOS_X) && !defined(_MSC_VER)
#ifdef memmove #ifdef memmove
#undef memmove #undef memmove
#endif #endif

File diff suppressed because it is too large Load diff

View file

@ -199,4 +199,5 @@ void yywarn(char *fmt, ...) {
fprintf(stderr, "line %d: ", yylineno); fprintf(stderr, "line %d: ", yylineno);
fprintf(stderr, "warning: "); fprintf(stderr, "warning: ");
vfprintf(stderr, fmt, ap); vfprintf(stderr, fmt, ap);
va_end(ap);
} }

View file

@ -52,7 +52,9 @@ For Win32:
1. Start ioquake3. (ioquake3.x86.exe on Win32) 1. Start ioquake3. (ioquake3.x86.exe on Win32)
2. Open the console (default key ~) and type '/cl_renderer opengl2; vid_restart' 2. Open the console (the default key is tilde ~) and type
`/cl_renderer opengl2` and press enter
`/vid_restart` then press enter again.
3. Enjoy. 3. Enjoy.
@ -62,94 +64,94 @@ For Win32:
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Cvars for simple rendering features: Cvars for simple rendering features:
r_ext_compressed_textures - Automatically compress textures.
* `r_ext_compressed_textures` - Automatically compress textures.
0 - No texture compression. (default) 0 - No texture compression. (default)
1 - DXT/LATC texture compression if 1 - DXT/LATC texture compression if
supported. supported.
2 - BPTC texture compression if supported. 2 - BPTC texture compression if supported.
r_ext_framebuffer_multisample - Multisample Anti-aliasing. * `r_ext_framebuffer_multisample` - Multisample Anti-aliasing.
0 - None. (default) 0 - None. (default)
1-16 - Some. 1-16 - Some.
17+ - Too much! 17+ - Too much!
r_ssao - Enable screen-space ambient occlusion. * `r_ssao` - Enable screen-space ambient occlusion.
Currently eats framerate and has some Currently eats framerate and has some
visible artifacts. visible artifacts.
0 - No. (default) 0 - No. (default)
1 - Yes. 1 - Yes.
Cvars for HDR and tonemapping: Cvars for HDR and tonemapping:
r_hdr - Do scene rendering in a framebuffer with
* `r_hdr` - Do scene rendering in a framebuffer with
high dynamic range. (Less banding, and high dynamic range. (Less banding, and
exposure changes look much better) exposure changes look much better)
0 - No. 0 - No.
1 - Yes. (default) 1 - Yes. (default)
r_cameraExposure - Cheat. Alter brightness, in powers of two. * `r_cameraExposure` - Cheat. Alter brightness, in powers of two.
-2 - 4x as dark. -2 - 4x as dark.
0 - Normal. (default) 0 - Normal. (default)
0.5 - Sqrt(2)x as bright. 0.5 - Sqrt(2)x as bright.
2 - 4x as bright. 2 - 4x as bright.
r_postProcess - Enable post-processing. * `r_postProcess` - Enable post-processing.
0 - No. 0 - No.
1 - Yes. (default) 1 - Yes. (default)
r_toneMap - Enable tone mapping. Requires * `r_toneMap` - Enable tone mapping. Requires
r_hdr and r_postProcess. r_hdr and r_postProcess.
0 - No. 0 - No.
1 - Yes. (default) 1 - Yes. (default)
r_forceToneMap - Cheat. Override built-in and map tonemap * `r_forceToneMap` - Cheat. Override built-in and map tonemap settings and use cvars r_forceToneMapAvg, r_forceToneMapMin, and r_forceToneMapMax.
settings and use cvars r_forceToneMapAvg,
r_forceToneMapMin, and r_forceToneMapMax.
0 - No. (default) 0 - No. (default)
1 - Yes. 1 - Yes.
r_forceToneMapAvg - Cheat. Map average scene luminance to this * `r_forceToneMapAvg` - Cheat. Map average scene luminance to this
value, in powers of two. Requires value, in powers of two. Requires
r_forceToneMap. r_forceToneMap.
-2.0 - Dark. -2.0 - Dark.
-1.0 - Kinda dark. (default). -1.0 - Kinda dark. (default).
2.0 - Too bright. 2.0 - Too bright.
r_forceToneMapMin - Cheat. After mapping average, luminance * `r_forceToneMapMin` - Cheat. After mapping average, luminance
below this level is mapped to black. below this level is mapped to black.
Requires r_forceToneMap. Requires r_forceToneMap.
-5 - Not noticeable. -5 - Not noticeable.
-3.25 - Normal. (default) -3.25 - Normal. (default)
0.0 - Too dark. 0.0 - Too dark.
r_forceToneMapMin - Cheat. After mapping average, luminance * `r_forceToneMapMin` - Cheat. After mapping average, luminance
above this level is mapped to white. above this level is mapped to white.
Requires r_forceToneMap. Requires r_forceToneMap.
0.0 - Too bright. 0.0 - Too bright.
1.0 - Normal. (default). 1.0 - Normal. (default).
2.0 - Washed out. 2.0 - Washed out.
r_autoExposure - Do automatic exposure based on scene * `r_autoExposure` - Do automatic exposure based on scene
brightness. Hardcoded to -2 to 2 on maps brightness. Hardcoded to -2 to 2 on maps
that don't specify otherwise. Requires that don't specify otherwise. Requires
r_hdr, r_postprocess, and r_toneMap. r_hdr, r_postprocess, and r_toneMap.
0 - No. 0 - No.
1 - Yes. (default) 1 - Yes. (default)
r_forceAutoExposure - Cheat. Override built-in and map auto * `r_forceAutoExposure` - Cheat. Override built-in and map auto
exposure settings and use cvars exposure settings and use cvars
r_forceAutoExposureMin and r_forceAutoExposureMin and
r_forceAutoExposureMax. r_forceAutoExposureMax.
0 - No. (default) 0 - No. (default)
1 - Yes. 1 - Yes.
r_forceAutoExposureMin - Cheat. Set minimum exposure to this value, * `r_forceAutoExposureMin` - Cheat. Set minimum exposure to this value,
in powers of two. Requires in powers of two. Requires
r_forceAutoExpsure. r_forceAutoExpsure.
-3.0 - Dimmer. -3.0 - Dimmer.
-2.0 - Normal. (default) -2.0 - Normal. (default)
-1.0 - Brighter. -1.0 - Brighter.
r_forceAutoExposureMax - Cheat. Set maximum exposure to this value, * `r_forceAutoExposureMax` - Cheat. Set maximum exposure to this value,
in powers of two. Requires in powers of two. Requires
r_forceAutoExpsure. r_forceAutoExpsure.
1.0 - Dimmer. 1.0 - Dimmer.
@ -157,7 +159,8 @@ Cvars for HDR and tonemapping:
3.0 - Brighter. 3.0 - Brighter.
Cvars for advanced material usage: Cvars for advanced material usage:
r_normalMapping - Enable normal mapping for materials that
* `r_normalMapping` - Enable normal mapping for materials that
support it, and also specify advanced support it, and also specify advanced
shading techniques. shading techniques.
0 - No. 0 - No.
@ -167,7 +170,7 @@ Cvars for advanced material usage:
3 - Yes, and use tri-Ace's Oren-Nayar 3 - Yes, and use tri-Ace's Oren-Nayar
reflectance model. reflectance model.
r_specularMapping - Enable specular mapping for materials that * `r_specularMapping` - Enable specular mapping for materials that
support it, and also specify advanced support it, and also specify advanced
specular techniques. specular techniques.
0 - No. 0 - No.
@ -176,7 +179,7 @@ Cvars for advanced material usage:
3 - Yes, and use Cook-Torrance. 3 - Yes, and use Cook-Torrance.
4 - Yes, and use Torrance-Sparrow. 4 - Yes, and use Torrance-Sparrow.
r_deluxeMapping - Enable deluxe mapping. (Map is compiled * `r_deluxeMapping` - Enable deluxe mapping. (Map is compiled
with light directions.) Even if the map with light directions.) Even if the map
doesn't have deluxe mapping compiled in, doesn't have deluxe mapping compiled in,
an approximation based on the lightgrid an approximation based on the lightgrid
@ -184,27 +187,27 @@ Cvars for advanced material usage:
0 - No. 0 - No.
1 - Yes. (default) 1 - Yes. (default)
r_parallaxMapping - Enable parallax mapping for materials that * `r_parallaxMapping` - Enable parallax mapping for materials that
support it. support it.
0 - No. (default) 0 - No. (default)
1 - Use parallax occlusion mapping. 1 - Use parallax occlusion mapping.
2 - Use relief mapping. (slower) 2 - Use relief mapping. (slower)
r_baseSpecular - Set the specular reflectance of materials * `r_baseSpecular` - Set the specular reflectance of materials
which don't include a specular map or which don't include a specular map or
use the specularReflectance keyword. use the specularReflectance keyword.
0 - No. 0 - No.
0.04 - Realistic. (default) 0.04 - Realistic. (default)
1.0 - Ack. 1.0 - Ack.
r_baseGloss - Set the glossiness of materials which don't * `r_baseGloss` - Set the glossiness of materials which don't
include a specular map or use the include a specular map or use the
specularExponent keyword. specularExponent keyword.
0 - Rough. 0 - Rough.
0.3 - Default. 0.3 - Default.
1.0 - Shiny. 1.0 - Shiny.
r_baseNormalX - Set the scale of the X values from normal * `r_baseNormalX` - Set the scale of the X values from normal
maps when the normalScale keyword is not maps when the normalScale keyword is not
used. used.
-1 - Flip X. -1 - Flip X.
@ -212,7 +215,7 @@ Cvars for advanced material usage:
1 - Normal X. (default) 1 - Normal X. (default)
2 - Double X. 2 - Double X.
r_baseNormalY - Set the scale of the Y values from normal * `r_baseNormalY` - Set the scale of the Y values from normal
maps when the normalScale keyword is not maps when the normalScale keyword is not
used. used.
-1 - Flip Y. -1 - Flip Y.
@ -220,7 +223,7 @@ Cvars for advanced material usage:
1 - Normal Y. (default) 1 - Normal Y. (default)
2 - Double Y. 2 - Double Y.
r_baseParallax - Sets the scale of the parallax effect for * `r_baseParallax` - Sets the scale of the parallax effect for
materials when the parallaxDepth keyword materials when the parallaxDepth keyword
is not used. is not used.
0 - No depth. 0 - No depth.
@ -229,7 +232,8 @@ Cvars for advanced material usage:
0.1 - Looks broken. 0.1 - Looks broken.
Cvars for image interpolation and generation: Cvars for image interpolation and generation:
r_imageUpsample - Use interpolation to artifically increase
* `r_imageUpsample` - Use interpolation to artifically increase
the resolution of all textures. Looks good the resolution of all textures. Looks good
in certain circumstances. in certain circumstances.
0 - No. (default) 0 - No. (default)
@ -237,50 +241,48 @@ Cvars for image interpolation and generation:
2 - 4x size. 2 - 4x size.
3 - 8x size, etc 3 - 8x size, etc
r_imageUpsampleMaxSize - Maximum texture size when upsampling * `r_imageUpsampleMaxSize` - Maximum texture size when upsampling
textures. textures.
1024 - Default. 1024 - Default.
2048 - Really nice. 2048 - Really nice.
4096 - Really slow. 4096 - Really slow.
8192 - Crash. 8192 - Crash.
r_imageUpsampleType - Type of interpolation when upsampling * `r_imageUpsampleType` - Type of interpolation when upsampling
textures. textures.
0 - None. (probably broken) 0 - None. (probably broken)
1 - Bad but fast (default, 1 - Bad but fast (default,
FCBI without second derivatives) FCBI without second derivatives)
2 - Okay but slow (normal FCBI) 2 - Okay but slow (normal FCBI)
r_genNormalMaps - Naively generate normal maps for all * `r_genNormalMaps* - Naively generate normal maps for all
textures. textures.
0 - Don't. (default) 0 - Don't. (default)
1 - Do. 1 - Do.
Cvars for the sunlight and cascaded shadow maps: Cvars for the sunlight and cascaded shadow maps:
r_forceSun - Cheat. Force sunlight and shadows, using sun
position from sky material. * `r_forceSun` - Cheat. Force sunlight and shadows, using sun position from sky material.
0 - Don't. (default) 0 - Don't. (default)
1 - Do. 1 - Do.
2 - Sunrise, sunset. 2 - Sunrise, sunset.
r_forceSunMapLightScale - Cheat. Scale map brightness by this factor * `r_forceSunMapLightScale` - Cheat. Scale map brightness by this factor
when r_forceSun 1. when r_forceSun 1.
1.0 - Default 1.0 - Default
r_forceSunLightScale - Cheat. Scale sun brightness by this factor * `r_forceSunLightScale` - Cheat. Scale sun brightness by this factor
when r_forceSun 1. when r_forceSun 1.
1.0 - Default 1.0 - Default
r_forceSunAmbientScale - Cheat. Scale sun ambient brightness by this
factor when r_forceSun 1.
0.5 - Default
r_sunShadows - Enable sunlight and cascaded shadow maps for * `r_forceSunAmbientScale` - Cheat. Scale sun ambient brightness by this factor when r_forceSun 1. 0.5 - Default
* `r_sunShadows` - Enable sunlight and cascaded shadow maps for
it on maps that support it. it on maps that support it.
0 - No. 0 - No.
1 - Yes. (default) 1 - Yes. (default)
r_sunlightMode - Specify the method used to add sunlight to * `r_sunlightMode` - Specify the method used to add sunlight to
the scene. the scene.
0 - No. 0 - No.
1 - Multiply lit areas by light scale, and 1 - Multiply lit areas by light scale, and
@ -290,13 +292,13 @@ Cvars for the sunlight and cascaded shadow maps:
and doesn't integrate well with existing and doesn't integrate well with existing
maps. maps.
r_shadowFilter - Enable filtering shadows for a smoother * `r_shadowFilter` - Enable filtering shadows for a smoother
look. look.
0 - No. 0 - No.
1 - Some. (default) 1 - Some. (default)
2 - Much. 2 - Much.
r_shadowMapSize - Size of each cascaded shadow map. * `r_shadowMapSize` - Size of each cascaded shadow map.
256 - 256x256, ugly, probably shouldn't 256 - 256x256, ugly, probably shouldn't
go below this. go below this.
512 - 512x512, passable. 512 - 512x512, passable.
@ -306,77 +308,78 @@ Cvars for the sunlight and cascaded shadow maps:
2048. 2048.
Cvars that you probably don't care about or shouldn't mess with: Cvars that you probably don't care about or shouldn't mess with:
r_mergeMultidraws - Optimize number of calls to
* `r_mergeMultidraws` - Optimize number of calls to
glMultiDrawElements(). glMultiDrawElements().
0 - Don't. 0 - Don't.
1 - Do some. (default) 1 - Do some. (default)
2 - Do more than necessary (eats CPU). 2 - Do more than necessary (eats CPU).
r_mergeLeafSurfaces - Merge surfaces that share common materials * `r_mergeLeafSurfaces` - Merge surfaces that share common materials
and a common leaf. Speeds up rendering. and a common leaf. Speeds up rendering.
0 - Don't. 0 - Don't.
1 - Do. (default) 1 - Do. (default)
r_recalcMD3Normals - Recalculate the normals when loading an MD3. * `r_recalcMD3Normals` - Recalculate the normals when loading an MD3.
Fixes normal maps in some cases but looks Fixes normal maps in some cases but looks
ugly in others. ugly in others.
0 - Don't. (default) 0 - Don't. (default)
1 - Do. 1 - Do.
r_depthPrepass - Do a depth-only pass before rendering. * `r_depthPrepass` - Do a depth-only pass before rendering.
Speeds up rendering in cases where advanced Speeds up rendering in cases where advanced
features are used. Required for features are used. Required for
r_sunShadows. r_sunShadows.
0 - No. 0 - No.
1 - Yes. (default) 1 - Yes. (default)
r_normalAmbient - Split map light into ambient and directed * `r_normalAmbient` - Split map light into ambient and directed
portions when doing deluxe mapping. Not portions when doing deluxe mapping. Not
very useful. very useful.
0 - Don't. (default). 0 - Don't. (default).
0.3 - 30% ambient, 70% directed. 0.3 - 30% ambient, 70% directed.
1.0 - 100% ambient. 1.0 - 100% ambient.
r_mergeLightmaps - Merge the small (128x128) lightmaps into * `r_mergeLightmaps` - Merge the small (128x128) lightmaps into
2 or fewer giant (4096x4096) lightmaps. 2 or fewer giant (4096x4096) lightmaps.
Easy speedup. Easy speedup.
0 - Don't. 0 - Don't.
1 - Do. (default) 1 - Do. (default)
r_shadowCascadeZNear - Near plane for shadow cascade frustums. * `r_shadowCascadeZNear` - Near plane for shadow cascade frustums.
4 - Default. 4 - Default.
r_shadowCascadeZFar - Far plane for shadow cascade frustums. * `r_shadowCascadeZFar` - Far plane for shadow cascade frustums.
3072 - Default. 3072 - Default.
r_shadowCascadeZBias - Z-bias for shadow cascade frustums. * `r_shadowCascadeZBias` - Z-bias for shadow cascade frustums.
-256 - Default. -256 - Default.
r_materialGamma - Gamma level for material textures. * `r_materialGamma` - Gamma level for material textures.
(diffuse, specular) (diffuse, specular)
1.0 - Quake 3, fastest. (default) 1.0 - Quake 3, fastest. (default)
r_lightGamma - Gamma level for light. * `r_lightGamma` - Gamma level for light.
(lightmap, lightgrid, vertex lights) (lightmap, lightgrid, vertex lights)
1.0 - Quake 3, fastest. (default) 1.0 - Quake 3, fastest. (default)
r_framebufferGamma - Gamma level for framebuffers. * `r_framebufferGamma` - Gamma level for framebuffers.
1.0 - Quake 3, fastest. (default) 1.0 - Quake 3, fastest. (default)
r_tonemapGamma - Gamma applied after tonemapping. * `r_tonemapGamma` - Gamma applied after tonemapping.
1.0 - Quake 3, fastest. (default) 1.0 - Quake 3, fastest. (default)
Cvars that have broken bits: Cvars that have broken bits:
r_dlightMode - Change how dynamic lights look.
* `r_dlightMode` - Change how dynamic lights look.
0 - Quake 3 style dlights, fake 0 - Quake 3 style dlights, fake
brightening. (default) brightening. (default)
1 - Actual lighting, no shadows. 1 - Actual lighting, no shadows.
2 - Light and shadows. (broken) 2 - Light and shadows. (broken)
r_pshadowDist - Virtual camera distance when creating shadow * `r_pshadowDist` - Virtual camera distance when creating shadowmaps for projected shadows. Deprecated.
maps for projected shadows. Deprecated.
* `cg_shadows` - Old shadow code. Deprecated.
cg_shadows - Old shadow code. Deprecated.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------