mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Avoid filtering low-res textures for animated meshes (incl. players) (#6562)
This commit is contained in:
parent
7b8288d605
commit
73baeb82ef
1 changed files with 7 additions and 0 deletions
|
@ -1355,6 +1355,13 @@ void GenericCAO::updateTextures(std::string mod)
|
||||||
material.setFlag(video::EMF_LIGHTING, false);
|
material.setFlag(video::EMF_LIGHTING, false);
|
||||||
material.setFlag(video::EMF_BILINEAR_FILTER, 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)
|
m_animated_meshnode->getMaterial(i)
|
||||||
.setFlag(video::EMF_TRILINEAR_FILTER, use_trilinear_filter);
|
.setFlag(video::EMF_TRILINEAR_FILTER, use_trilinear_filter);
|
||||||
m_animated_meshnode->getMaterial(i)
|
m_animated_meshnode->getMaterial(i)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue