- Fixed incompatibility to original VMs introduced by anisotropic filtering patch.

- Removed dependency of flares from tr.identityLight because they are barely visible with r_overbrightbits set to 1
This commit is contained in:
Thilo Schulz 2006-04-30 14:32:56 +00:00
parent 82c4c70535
commit 12a2b7694a
7 changed files with 31 additions and 22 deletions

View file

@ -351,7 +351,7 @@ void RB_RenderFlare( flare_t *f ) {
intensity = flareCoeff * size * size / (factor * factor); intensity = flareCoeff * size * size / (factor * factor);
VectorScale(f->color, f->drawIntensity * tr.identityLight * intensity, color); VectorScale(f->color, f->drawIntensity * intensity, color);
// Calculations for fogging // Calculations for fogging
if(tr.world && f->fogNum < tr.world->numfogs) if(tr.world && f->fogNum < tr.world->numfogs)

View file

@ -699,16 +699,16 @@ done:
if (mipmap) if (mipmap)
{ {
if ( glConfig.textureFilterAnisotropic ) if ( textureFilterAnisotropic )
qglTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, qglTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT,
(GLint)Com_Clamp( 1, glConfig.maxAnisotropy, r_ext_max_anisotropy->integer ) ); (GLint)Com_Clamp( 1, maxAnisotropy, r_ext_max_anisotropy->integer ) );
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl_filter_min); qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl_filter_min);
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max); qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max);
} }
else else
{ {
if ( glConfig.textureFilterAnisotropic ) if ( textureFilterAnisotropic )
qglTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1 ); qglTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1 );
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );

View file

@ -24,6 +24,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "tr_local.h" #include "tr_local.h"
glconfig_t glConfig; glconfig_t glConfig;
qboolean textureFilterAnisotropic = qfalse;
int maxAnisotropy = 0;
glstate_t glState; glstate_t glState;
static void GfxInfo_f( void ); static void GfxInfo_f( void );

View file

@ -970,6 +970,12 @@ extern trGlobals_t tr;
extern glconfig_t glConfig; // outside of TR since it shouldn't be cleared during ref re-init extern glconfig_t glConfig; // outside of TR since it shouldn't be cleared during ref re-init
extern glstate_t glState; // outside of TR since it shouldn't be cleared during ref re-init extern glstate_t glState; // outside of TR since it shouldn't be cleared during ref re-init
// These two variables should live inside glConfig but can't because of compatibility issues to the original ID vms.
// If you release a stand-alone game and your mod uses tr_types.h from this build you can safely move them to
// the glconfig_t struct.
extern qboolean textureFilterAnisotropic;
extern int maxAnisotropy;
// //
// cvars // cvars

View file

@ -1323,19 +1323,19 @@ static void GLW_InitExtensions( void )
ri.Printf( PRINT_ALL, "...GL_EXT_compiled_vertex_array not found\n" ); ri.Printf( PRINT_ALL, "...GL_EXT_compiled_vertex_array not found\n" );
} }
glConfig.textureFilterAnisotropic = qfalse; textureFilterAnisotropic = qfalse;
if ( strstr( glConfig.extensions_string, "GL_EXT_texture_filter_anisotropic" ) ) if ( strstr( glConfig.extensions_string, "GL_EXT_texture_filter_anisotropic" ) )
{ {
if ( r_ext_texture_filter_anisotropic->integer ) { if ( r_ext_texture_filter_anisotropic->integer ) {
qglGetIntegerv( GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &glConfig.maxAnisotropy ); qglGetIntegerv( GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &maxAnisotropy );
if ( glConfig.maxAnisotropy <= 0 ) { if ( maxAnisotropy <= 0 ) {
ri.Printf( PRINT_ALL, "...GL_EXT_texture_filter_anisotropic not properly supported!\n" ); ri.Printf( PRINT_ALL, "...GL_EXT_texture_filter_anisotropic not properly supported!\n" );
glConfig.maxAnisotropy = 0; maxAnisotropy = 0;
} }
else else
{ {
ri.Printf( PRINT_ALL, "...using GL_EXT_texture_filter_anisotropic (max: %i)\n", glConfig.maxAnisotropy ); ri.Printf( PRINT_ALL, "...using GL_EXT_texture_filter_anisotropic (max: %i)\n", maxAnisotropy );
glConfig.textureFilterAnisotropic = qtrue; textureFilterAnisotropic = qtrue;
} }
} }
else else

View file

@ -827,19 +827,19 @@ static void GLW_InitExtensions( void )
ri.Printf( PRINT_ALL, "...GL_EXT_compiled_vertex_array not found\n" ); ri.Printf( PRINT_ALL, "...GL_EXT_compiled_vertex_array not found\n" );
} }
glConfig.textureFilterAnisotropic = qfalse; textureFilterAnisotropic = qfalse;
if ( strstr( glConfig.extensions_string, "GL_EXT_texture_filter_anisotropic" ) ) if ( strstr( glConfig.extensions_string, "GL_EXT_texture_filter_anisotropic" ) )
{ {
if ( r_ext_texture_filter_anisotropic->integer ) { if ( r_ext_texture_filter_anisotropic->integer ) {
qglGetIntegerv( GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &glConfig.maxAnisotropy ); qglGetIntegerv( GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &maxAnisotropy );
if ( glConfig.maxAnisotropy <= 0 ) { if ( maxAnisotropy <= 0 ) {
ri.Printf( PRINT_ALL, "...GL_EXT_texture_filter_anisotropic not properly supported!\n" ); ri.Printf( PRINT_ALL, "...GL_EXT_texture_filter_anisotropic not properly supported!\n" );
glConfig.maxAnisotropy = 0; maxAnisotropy = 0;
} }
else else
{ {
ri.Printf( PRINT_ALL, "...using GL_EXT_texture_filter_anisotropic (max: %i)\n", glConfig.maxAnisotropy ); ri.Printf( PRINT_ALL, "...using GL_EXT_texture_filter_anisotropic (max: %i)\n", maxAnisotropy );
glConfig.textureFilterAnisotropic = qtrue; textureFilterAnisotropic = qtrue;
} }
} }
else else

View file

@ -1112,19 +1112,19 @@ static void GLW_InitExtensions( void )
ri.Printf( PRINT_ALL, "...WGL_3DFX_gamma_control not found\n" ); ri.Printf( PRINT_ALL, "...WGL_3DFX_gamma_control not found\n" );
} }
glConfig.textureFilterAnisotropic = qfalse; textureFilterAnisotropic = qfalse;
if ( strstr( glConfig.extensions_string, "GL_EXT_texture_filter_anisotropic" ) ) if ( strstr( glConfig.extensions_string, "GL_EXT_texture_filter_anisotropic" ) )
{ {
if ( r_ext_texture_filter_anisotropic->integer ) { if ( r_ext_texture_filter_anisotropic->integer ) {
qglGetIntegerv( GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &glConfig.maxAnisotropy ); qglGetIntegerv( GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &maxAnisotropy );
if ( glConfig.maxAnisotropy <= 0 ) { if ( maxAnisotropy <= 0 ) {
ri.Printf( PRINT_ALL, "...GL_EXT_texture_filter_anisotropic not properly supported!\n" ); ri.Printf( PRINT_ALL, "...GL_EXT_texture_filter_anisotropic not properly supported!\n" );
glConfig.maxAnisotropy = 0; maxAnisotropy = 0;
} }
else else
{ {
ri.Printf( PRINT_ALL, "...using GL_EXT_texture_filter_anisotropic (max: %i)\n", glConfig.maxAnisotropy ); ri.Printf( PRINT_ALL, "...using GL_EXT_texture_filter_anisotropic (max: %i)\n", maxAnisotropy );
glConfig.textureFilterAnisotropic = qtrue; textureFilterAnisotropic = qtrue;
} }
} }
else else