1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-28 14:15:18 +01:00

Don't use bilinear/trilinear filter on small overlay if large base texture

This commit is contained in:
cx384
2025-10-24 15:47:36 +02:00
committed by sfan5
parent 35357e4300
commit ff15b413b0
2 changed files with 12 additions and 1 deletions

View File

@@ -350,8 +350,12 @@ void WieldMeshSceneNode::setExtruded(video::ITexture *texture,
material.MaterialTypeParam = 0.5f;
material.BackfaceCulling = true;
// don't filter low-res textures, makes them look blurry
bool f_ok = std::min(dim.Width, dim.Height) >= TEXTURE_FILTER_MIN_SIZE;
material.forEachTexture([=] (auto &tex) {
video::ITexture *t = tex.Texture;
if (!t)
return;
core::dimension2d<u32> d = t->getSize();
bool f_ok = std::min(d.Width, d.Height) >= TEXTURE_FILTER_MIN_SIZE;
setMaterialFilters(tex, m_bilinear_filter && f_ok,
m_trilinear_filter && f_ok, m_anisotropic_filter);
});