* Anisotropic texture filtering (from Echon)
This commit is contained in:
parent
40d5eee8ef
commit
68b9eb3fba
8 changed files with 126 additions and 25 deletions
|
@ -699,11 +699,18 @@ done:
|
|||
|
||||
if (mipmap)
|
||||
{
|
||||
if ( glConfig.textureFilterAnisotropic )
|
||||
qglTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT,
|
||||
(GLint)Com_Clamp( 1, glConfig.maxAnisotropy, r_ext_max_anisotropy->integer ) );
|
||||
|
||||
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl_filter_min);
|
||||
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( glConfig.textureFilterAnisotropic )
|
||||
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_MAG_FILTER, GL_LINEAR );
|
||||
}
|
||||
|
|
|
@ -81,6 +81,8 @@ cvar_t *r_ext_gamma_control;
|
|||
cvar_t *r_ext_multitexture;
|
||||
cvar_t *r_ext_compiled_vertex_array;
|
||||
cvar_t *r_ext_texture_env_add;
|
||||
cvar_t *r_ext_texture_filter_anisotropic;
|
||||
cvar_t *r_ext_max_anisotropy;
|
||||
|
||||
cvar_t *r_ignoreGLErrors;
|
||||
cvar_t *r_logFile;
|
||||
|
@ -910,6 +912,10 @@ void R_Register( void )
|
|||
r_ext_texture_env_add = ri.Cvar_Get( "r_ext_texture_env_add", "1", CVAR_ARCHIVE | CVAR_LATCH);
|
||||
#endif
|
||||
|
||||
r_ext_texture_filter_anisotropic = ri.Cvar_Get( "r_ext_texture_filter_anisotropic",
|
||||
"0", CVAR_ARCHIVE | CVAR_LATCH );
|
||||
r_ext_max_anisotropy = ri.Cvar_Get( "r_ext_max_anisotropy", "2", CVAR_ARCHIVE | CVAR_LATCH );
|
||||
|
||||
r_picmip = ri.Cvar_Get ("r_picmip", "1", CVAR_ARCHIVE | CVAR_LATCH );
|
||||
r_roundImagesDown = ri.Cvar_Get ("r_roundImagesDown", "1", CVAR_ARCHIVE | CVAR_LATCH );
|
||||
r_colorMipLevels = ri.Cvar_Get ("r_colorMipLevels", "0", CVAR_LATCH );
|
||||
|
|
|
@ -1041,6 +1041,9 @@ extern cvar_t *r_ext_multitexture;
|
|||
extern cvar_t *r_ext_compiled_vertex_array;
|
||||
extern cvar_t *r_ext_texture_env_add;
|
||||
|
||||
extern cvar_t *r_ext_texture_filter_anisotropic;
|
||||
extern cvar_t *r_ext_max_anisotropy;
|
||||
|
||||
extern cvar_t *r_nobind; // turns off binding to appropriate textures
|
||||
extern cvar_t *r_singleShader; // make most world faces use default shader
|
||||
extern cvar_t *r_roundImagesDown;
|
||||
|
|
|
@ -200,6 +200,9 @@ typedef struct {
|
|||
qboolean isFullscreen;
|
||||
qboolean stereoEnabled;
|
||||
qboolean smpActive; // dual processor
|
||||
|
||||
qboolean textureFilterAnisotropic;
|
||||
int maxAnisotropy;
|
||||
} glconfig_t;
|
||||
|
||||
// FIXME: VM should be OS agnostic .. in theory
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue