summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlhofhansl <lhofhansl@yahoo.com>2017-10-28 01:33:47 -0700
committerLoïc Blot <nerzhul@users.noreply.github.com>2017-10-28 10:33:47 +0200
commit610ea6f21629933be3b38c2b5fce53a35c5aac3a (patch)
tree76df2249f16c4dd36941c676d999b8ca8bbd2c9e
parenta5d5728f241fec8644ba65cb3b98c7dd1be2eee3 (diff)
downloadminetest-610ea6f21629933be3b38c2b5fce53a35c5aac3a.tar.gz
minetest-610ea6f21629933be3b38c2b5fce53a35c5aac3a.tar.bz2
minetest-610ea6f21629933be3b38c2b5fce53a35c5aac3a.zip
Avoid filtering low-res textures for animated meshes (incl. players) (#6562)
-rw-r--r--src/content_cao.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/content_cao.cpp b/src/content_cao.cpp
index 7178debaa..8bc9ad88e 100644
--- a/src/content_cao.cpp
+++ b/src/content_cao.cpp
@@ -1028,6 +1028,13 @@ void GenericCAO::updateTextures(std::string mod)
material.setFlag(video::EMF_LIGHTING, false);
material.setFlag(video::EMF_BILINEAR_FILTER, false);
+ // don't filter low-res textures, makes them look blurry
+ // player models have a res of 64
+ const core::dimension2d<u32> &size = texture->getOriginalSize();
+ const u32 res = std::min(size.Height, size.Width);
+ use_trilinear_filter &= res > 64;
+ use_bilinear_filter &= res > 64;
+
m_animated_meshnode->getMaterial(i)
.setFlag(video::EMF_TRILINEAR_FILTER, use_trilinear_filter);
m_animated_meshnode->getMaterial(i)