1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Clean up texture filtering settings (#13683)

This commit is contained in:
Gregor Parzefall 2023-08-24 10:50:47 +02:00 committed by GitHub
parent d0ee63c766
commit 72ef90885d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 52 additions and 94 deletions

View file

@ -297,11 +297,8 @@ void WieldMeshSceneNode::setExtruded(const std::string &imagename,
material.MaterialType = m_material_type;
material.MaterialTypeParam = 0.5f;
material.BackfaceCulling = true;
// Enable bi/trilinear filtering only for high resolution textures
bool bilinear_filter = dim.Width > 32 && m_bilinear_filter;
bool trilinear_filter = dim.Width > 32 && m_trilinear_filter;
material.forEachTexture([=] (auto &tex) {
tex.setFiltersMinetest(bilinear_filter, trilinear_filter,
setMaterialFilters(tex, m_bilinear_filter, m_trilinear_filter,
m_anisotropic_filter);
});
// mipmaps cause "thin black line" artifacts
@ -465,7 +462,7 @@ void WieldMeshSceneNode::setItem(const ItemStack &item, Client *client, bool che
material.MaterialTypeParam = 0.5f;
material.BackfaceCulling = cull_backface;
material.forEachTexture([this] (auto &tex) {
tex.setFiltersMinetest(m_bilinear_filter, m_trilinear_filter,
setMaterialFilters(tex, m_bilinear_filter, m_trilinear_filter,
m_anisotropic_filter);
});
}