aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKahrl <kahrl@gmx.net>2014-11-26 15:17:17 +0100
committerKahrl <kahrl@gmx.net>2014-11-26 15:17:17 +0100
commitec5188a49a2ae5d69b8ab0df51ba1086b51e7891 (patch)
tree702a87dfa08a32ed5dfa6cc5f2e64432740b8923
parentdbae8a88545e52f4a7e84a18c760530388ad8c46 (diff)
downloadminetest-ec5188a49a2ae5d69b8ab0df51ba1086b51e7891.tar.gz
minetest-ec5188a49a2ae5d69b8ab0df51ba1086b51e7891.tar.bz2
minetest-ec5188a49a2ae5d69b8ab0df51ba1086b51e7891.zip
Wieldmesh: don't force anisotropic filtering on, instead disable mipmaps
This should fix #1844. Thanks to oleastre for making the first version of this commit (#1848).
-rw-r--r--src/wieldmesh.cpp7
-rw-r--r--src/wieldmesh.h1
2 files changed, 6 insertions, 2 deletions
diff --git a/src/wieldmesh.cpp b/src/wieldmesh.cpp
index 40cfdbc2b..ac0832057 100644
--- a/src/wieldmesh.cpp
+++ b/src/wieldmesh.cpp
@@ -206,6 +206,7 @@ WieldMeshSceneNode::WieldMeshSceneNode(
m_bounding_box(0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
{
m_enable_shaders = g_settings->getBool("enable_shaders");
+ m_anisotropic_filter = g_settings->getBool("anisotropic_filter");
m_bilinear_filter = g_settings->getBool("bilinear_filter");
m_trilinear_filter = g_settings->getBool("trilinear_filter");
@@ -280,14 +281,16 @@ void WieldMeshSceneNode::setExtruded(const std::string &imagename,
material.setFlag(video::EMF_BACK_FACE_CULLING, true);
// Enable filtering only for high resolution texures
if (dim.Width > 32) {
+ material.setFlag(video::EMF_ANISOTROPIC_FILTER, m_anisotropic_filter);
material.setFlag(video::EMF_BILINEAR_FILTER, m_bilinear_filter);
material.setFlag(video::EMF_TRILINEAR_FILTER, m_trilinear_filter);
} else {
+ material.setFlag(video::EMF_ANISOTROPIC_FILTER, false);
material.setFlag(video::EMF_BILINEAR_FILTER, false);
material.setFlag(video::EMF_TRILINEAR_FILTER, false);
}
- // anisotropic filtering removes "thin black line" artifacts
- material.setFlag(video::EMF_ANISOTROPIC_FILTER, true);
+ // mipmaps cause "thin black line" artifacts
+ material.setFlag(video::EMF_USE_MIP_MAPS, false);
if (m_enable_shaders)
material.setTexture(2, tsrc->getTexture("disable_img.png"));
}
diff --git a/src/wieldmesh.h b/src/wieldmesh.h
index 14bd85bca..3b39dbfac 100644
--- a/src/wieldmesh.h
+++ b/src/wieldmesh.h
@@ -64,6 +64,7 @@ private:
bool m_lighting;
bool m_enable_shaders;
+ bool m_anisotropic_filter;
bool m_bilinear_filter;
bool m_trilinear_filter;