mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-26 14:54:16 +00:00
ref: gl: fix toggling nearest filter on TF_NOMIPMAP textures
This commit is contained in:
parent
072b0cef27
commit
ab15662d78
@ -282,30 +282,16 @@ static void GL_UpdateTextureParams( int iTexture )
|
||||
if( GL_Support( GL_TEXTURE_LOD_BIAS ) && ( tex->numMips > 1 ) && !FBitSet( tex->flags, TF_DEPTHMAP ))
|
||||
pglTexParameterf( tex->target, GL_TEXTURE_LOD_BIAS_EXT, gl_texture_lodbias.value );
|
||||
|
||||
if( IsLightMap( tex ))
|
||||
{
|
||||
if( gl_lightmap_nearest.value )
|
||||
{
|
||||
pglTexParameteri( tex->target, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
|
||||
pglTexParameteri( tex->target, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
|
||||
}
|
||||
else
|
||||
{
|
||||
pglTexParameteri( tex->target, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
|
||||
pglTexParameteri( tex->target, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
|
||||
}
|
||||
}
|
||||
nomipmap = tex->numMips <= 1 || FBitSet( tex->flags, TF_NOMIPMAP|TF_DEPTHMAP );
|
||||
|
||||
if( tex->numMips <= 1 ) return;
|
||||
|
||||
if( FBitSet( tex->flags, TF_NEAREST ) || gl_texture_nearest.value )
|
||||
if( !GL_TextureFilteringEnabled( tex ))
|
||||
{
|
||||
pglTexParameteri( tex->target, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST );
|
||||
pglTexParameteri( tex->target, GL_TEXTURE_MIN_FILTER, nomipmap ? GL_NEAREST : GL_NEAREST_MIPMAP_NEAREST );
|
||||
pglTexParameteri( tex->target, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
|
||||
}
|
||||
else
|
||||
{
|
||||
pglTexParameteri( tex->target, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR );
|
||||
pglTexParameteri( tex->target, GL_TEXTURE_MIN_FILTER, nomipmap ? GL_LINEAR : GL_LINEAR_MIPMAP_LINEAR );
|
||||
pglTexParameteri( tex->target, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user