Skip to content
Permalink
Browse files

Avoid filtering low-res textures for animated meshes (incl. players) (#…

  • Loading branch information...
lhofhansl authored and nerzhul committed Oct 28, 2017
1 parent a5d5728 commit 610ea6f21629933be3b38c2b5fce53a35c5aac3a
Showing with 7 additions and 0 deletions.
  1. +7 −0 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)

0 comments on commit 610ea6f

Please sign in to comment.
You can’t perform that action at this time.