From 210315ec46e67a1ed71bd42404854789919b7d2b Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Wed, 3 Jan 2018 17:09:23 +0700 Subject: [PATCH] Fix texture filtering when mip-mapiing is off, #1699 --- src/Textures.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Textures.cpp b/src/Textures.cpp index 1990ed2d..aaa6d48e 100644 --- a/src/Textures.cpp +++ b/src/Textures.cpp @@ -1310,12 +1310,19 @@ void TextureCache::activateTexture(u32 _t, CachedTexture *_pTexture) const s32 texLevel = bUseLOD ? _pTexture->max_level : 0; params.maxMipmapLevel = Parameter(texLevel); - if (texLevel > 0) { // Apply standard bilinear to mipmap textures + if (bUseLOD) { if (bUseBilinear) { - params.minFilter = textureParameters::FILTER_LINEAR_MIPMAP_NEAREST; + // Apply standard bilinear to mipmap textures + if (texLevel > 0) + params.minFilter = textureParameters::FILTER_LINEAR_MIPMAP_NEAREST; + else + params.minFilter = textureParameters::FILTER_LINEAR; params.magFilter = textureParameters::FILTER_LINEAR; } else { - params.minFilter = textureParameters::FILTER_NEAREST_MIPMAP_NEAREST; + if (texLevel > 0) + params.minFilter = textureParameters::FILTER_NEAREST_MIPMAP_NEAREST; + else + params.minFilter = textureParameters::FILTER_NEAREST; params.magFilter = textureParameters::FILTER_NEAREST; } } else if (bUseBilinear && config.generalEmulation.enableLOD != 0 && bUseLOD) { // Apply standard bilinear to first tile of mipmap texture