diff --git a/source/build/src/polymost.cpp b/source/build/src/polymost.cpp index 74dada52e..34addb9d9 100644 --- a/source/build/src/polymost.cpp +++ b/source/build/src/polymost.cpp @@ -35,6 +35,7 @@ bool hw_int_useindexedcolortextures; CUSTOM_CVARD(Bool, hw_useindexedcolortextures, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG, "enable/disable indexed color texture rendering") { hw_int_useindexedcolortextures = self; + if (screen) screen->SetTextureFilterMode(); } diff --git a/source/common/rendering/gl/gl_samplers.cpp b/source/common/rendering/gl/gl_samplers.cpp index 0e2ef0546..ca3426e7a 100644 --- a/source/common/rendering/gl/gl_samplers.cpp +++ b/source/common/rendering/gl/gl_samplers.cpp @@ -125,7 +125,7 @@ void FSamplerManager::SetTextureFilterMode() { glSamplerParameteri(mSamplers[i], GL_TEXTURE_MIN_FILTER, TexFilter[filter].minfilter); glSamplerParameteri(mSamplers[i], GL_TEXTURE_MAG_FILTER, TexFilter[filter].magfilter); - glSamplerParameterf(mSamplers[i], GL_TEXTURE_MAX_ANISOTROPY_EXT, gl_texture_filter_anisotropic); + glSamplerParameterf(mSamplers[i], GL_TEXTURE_MAX_ANISOTROPY_EXT, filter > 0? gl_texture_filter_anisotropic : 1.0); } glSamplerParameteri(mSamplers[CLAMP_XY_NOMIP], GL_TEXTURE_MIN_FILTER, TexFilter[filter].magfilter); glSamplerParameteri(mSamplers[CLAMP_XY_NOMIP], GL_TEXTURE_MAG_FILTER, TexFilter[filter].magfilter); diff --git a/source/glbackend/gl_texture.cpp b/source/glbackend/gl_texture.cpp index 399b2d3b4..726ba236e 100644 --- a/source/glbackend/gl_texture.cpp +++ b/source/glbackend/gl_texture.cpp @@ -70,11 +70,6 @@ bool GLInstance::SetTexture(int picnum, FGameTexture* tex, int paletteid, int sa if (!PickTexture(picnum, tex, paletteid, texpick)) return false; int TextureType = (texpick.translation & 0x80000000) ? TT_INDEXED : TT_TRUECOLOR; - if (TextureType == TT_INDEXED) - { - sampler = sampler + CLAMP_NOFILTER - CLAMP_NONE; - } - // This is intentionally the same value for both parameters. The shader does not use the same uniform for modulation and overlay colors. SetTinting(texpick.tintFlags, texpick.tintColor, texpick.tintColor);