Skip to content
Snippets Groups Projects
Commit ec5188a4 authored by Kahrl's avatar Kahrl
Browse files

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).
parent dbae8a88
No related branches found
No related tags found
No related merge requests found
...@@ -206,6 +206,7 @@ WieldMeshSceneNode::WieldMeshSceneNode( ...@@ -206,6 +206,7 @@ WieldMeshSceneNode::WieldMeshSceneNode(
m_bounding_box(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) m_bounding_box(0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
{ {
m_enable_shaders = g_settings->getBool("enable_shaders"); 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_bilinear_filter = g_settings->getBool("bilinear_filter");
m_trilinear_filter = g_settings->getBool("trilinear_filter"); m_trilinear_filter = g_settings->getBool("trilinear_filter");
...@@ -280,14 +281,16 @@ void WieldMeshSceneNode::setExtruded(const std::string &imagename, ...@@ -280,14 +281,16 @@ void WieldMeshSceneNode::setExtruded(const std::string &imagename,
material.setFlag(video::EMF_BACK_FACE_CULLING, true); material.setFlag(video::EMF_BACK_FACE_CULLING, true);
// Enable filtering only for high resolution texures // Enable filtering only for high resolution texures
if (dim.Width > 32) { 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_BILINEAR_FILTER, m_bilinear_filter);
material.setFlag(video::EMF_TRILINEAR_FILTER, m_trilinear_filter); material.setFlag(video::EMF_TRILINEAR_FILTER, m_trilinear_filter);
} else { } else {
material.setFlag(video::EMF_ANISOTROPIC_FILTER, false);
material.setFlag(video::EMF_BILINEAR_FILTER, false); material.setFlag(video::EMF_BILINEAR_FILTER, false);
material.setFlag(video::EMF_TRILINEAR_FILTER, false); material.setFlag(video::EMF_TRILINEAR_FILTER, false);
} }
// anisotropic filtering removes "thin black line" artifacts // mipmaps cause "thin black line" artifacts
material.setFlag(video::EMF_ANISOTROPIC_FILTER, true); material.setFlag(video::EMF_USE_MIP_MAPS, false);
if (m_enable_shaders) if (m_enable_shaders)
material.setTexture(2, tsrc->getTexture("disable_img.png")); material.setTexture(2, tsrc->getTexture("disable_img.png"));
} }
......
...@@ -64,6 +64,7 @@ class WieldMeshSceneNode: public scene::ISceneNode ...@@ -64,6 +64,7 @@ class WieldMeshSceneNode: public scene::ISceneNode
bool m_lighting; bool m_lighting;
bool m_enable_shaders; bool m_enable_shaders;
bool m_anisotropic_filter;
bool m_bilinear_filter; bool m_bilinear_filter;
bool m_trilinear_filter; bool m_trilinear_filter;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment