diff --git a/src/graphics/material.cpp b/src/graphics/material.cpp index 4d4349c98..62456b45f 100644 --- a/src/graphics/material.cpp +++ b/src/graphics/material.cpp @@ -60,6 +60,7 @@ Material::Material(const XMLNode *node, int index) node->get("reset", &m_resetter ); node->get("max-speed", &m_max_speed_fraction); node->get("slowdown", &m_slowdown ); + node->get("anisotropic", &m_anisotropic ); std::string s(""); node->get("graphical-effect", &s ); if(s=="water") @@ -102,6 +103,7 @@ void Material::init(unsigned int index) m_lightmap = false; m_alpha_blending = false; m_lighting = true; + m_anisotropic = false; m_sphere_map = false; m_friction = 1.0f; m_ignore = false; @@ -159,8 +161,10 @@ void Material::setMaterialProperties(video::SMaterial *m) const m->SpecularColor = video::SColor(255, 255, 255, 255); } - //FIXME: only set on textures viewed at oblique angles, to avoid slowing down the game with this everywhere - m->setFlag(video::EMF_ANISOTROPIC_FILTER, true); + if (m_anisotropic) + { + m->setFlag(video::EMF_ANISOTROPIC_FILTER, true); + } #if (IRRLICHT_VERSION_MAJOR == 1) && (IRRLICHT_VERSION_MINOR >= 7) diff --git a/src/graphics/material.hpp b/src/graphics/material.hpp index b0ba36534..07ad6f314 100644 --- a/src/graphics/material.hpp +++ b/src/graphics/material.hpp @@ -46,6 +46,10 @@ private: bool m_sphere_map; bool m_alpha_testing; bool m_alpha_blending; + + /** Whether to use anisotropic filtering for this texture */ + bool m_anisotropic; + /** True if lightmapping is enabled for this material. */ bool m_lightmap; float m_friction;