ENABLE_ANISOTROPIC_FILTER_ON_BED_TEXTURES set as default

This commit is contained in:
Enrico Turri 2019-02-20 13:53:33 +01:00
parent e2731416bf
commit 0b0457186b
2 changed files with 2 additions and 8 deletions

View file

@ -38,8 +38,6 @@
#define ENABLE_MOVE_MIN_THRESHOLD (1 && ENABLE_1_42_0_ALPHA4) #define ENABLE_MOVE_MIN_THRESHOLD (1 && ENABLE_1_42_0_ALPHA4)
// Modified initial default placement of generic subparts // Modified initial default placement of generic subparts
#define ENABLE_GENERIC_SUBPARTS_PLACEMENT (1 && ENABLE_1_42_0_ALPHA4) #define ENABLE_GENERIC_SUBPARTS_PLACEMENT (1 && ENABLE_1_42_0_ALPHA4)
// Use anisotropic filtering on bed plate texture
#define ENABLE_ANISOTROPIC_FILTER_ON_BED_TEXTURES (1 && ENABLE_1_42_0_ALPHA4)
// Bunch of fixes related to volumes centering // Bunch of fixes related to volumes centering
#define ENABLE_VOLUMES_CENTERING_FIXES (1 && ENABLE_1_42_0_ALPHA4) #define ENABLE_VOLUMES_CENTERING_FIXES (1 && ENABLE_1_42_0_ALPHA4)

View file

@ -367,12 +367,10 @@ void Bed3D::render_prusa(const std::string &key, float theta, bool useVBOs) cons
std::string model_path = resources_dir() + "/models/" + key; std::string model_path = resources_dir() + "/models/" + key;
#if ENABLE_ANISOTROPIC_FILTER_ON_BED_TEXTURES
// use anisotropic filter if graphic card allows // use anisotropic filter if graphic card allows
GLfloat max_anisotropy = 0.0f; GLfloat max_anisotropy = 0.0f;
if (glewIsSupported("GL_EXT_texture_filter_anisotropic")) if (glewIsSupported("GL_EXT_texture_filter_anisotropic"))
::glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &max_anisotropy); ::glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &max_anisotropy);
#endif // ENABLE_ANISOTROPIC_FILTER_ON_BED_TEXTURES
std::string filename = tex_path + "_top.png"; std::string filename = tex_path + "_top.png";
if ((m_top_texture.get_id() == 0) || (m_top_texture.get_source() != filename)) if ((m_top_texture.get_id() == 0) || (m_top_texture.get_source() != filename))
@ -382,14 +380,13 @@ void Bed3D::render_prusa(const std::string &key, float theta, bool useVBOs) cons
render_custom(); render_custom();
return; return;
} }
#if ENABLE_ANISOTROPIC_FILTER_ON_BED_TEXTURES
if (max_anisotropy > 0.0f) if (max_anisotropy > 0.0f)
{ {
glsafe(::glBindTexture(GL_TEXTURE_2D, m_top_texture.get_id())); glsafe(::glBindTexture(GL_TEXTURE_2D, m_top_texture.get_id()));
glsafe(::glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, max_anisotropy)); glsafe(::glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, max_anisotropy));
glsafe(::glBindTexture(GL_TEXTURE_2D, 0)); glsafe(::glBindTexture(GL_TEXTURE_2D, 0));
} }
#endif // ENABLE_ANISOTROPIC_FILTER_ON_BED_TEXTURES
} }
filename = tex_path + "_bottom.png"; filename = tex_path + "_bottom.png";
@ -400,14 +397,13 @@ void Bed3D::render_prusa(const std::string &key, float theta, bool useVBOs) cons
render_custom(); render_custom();
return; return;
} }
#if ENABLE_ANISOTROPIC_FILTER_ON_BED_TEXTURES
if (max_anisotropy > 0.0f) if (max_anisotropy > 0.0f)
{ {
glsafe(::glBindTexture(GL_TEXTURE_2D, m_bottom_texture.get_id())); glsafe(::glBindTexture(GL_TEXTURE_2D, m_bottom_texture.get_id()));
glsafe(::glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, max_anisotropy)); glsafe(::glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, max_anisotropy));
glsafe(::glBindTexture(GL_TEXTURE_2D, 0)); glsafe(::glBindTexture(GL_TEXTURE_2D, 0));
} }
#endif // ENABLE_ANISOTROPIC_FILTER_ON_BED_TEXTURES
} }
if (theta <= 90.0f) if (theta <= 90.0f)