1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-20 03:35:18 +02: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
8 changed files with 52 additions and 94 deletions

View File

@@ -503,3 +503,18 @@ scene::IMesh* convertNodeboxesToMesh(const std::vector<aabb3f> &boxes,
}
return dst_mesh;
}
void setMaterialFilters(video::SMaterialLayer &tex, bool bilinear, bool trilinear, bool anisotropic) {
if (trilinear)
tex.MinFilter = video::ETMINF_LINEAR_MIPMAP_LINEAR;
else if (bilinear)
tex.MinFilter = video::ETMINF_LINEAR_MIPMAP_NEAREST;
else
tex.MinFilter = video::ETMINF_NEAREST_MIPMAP_NEAREST;
// "We don't want blurriness after all." ~ Desour, #13108
// (because of pixel art)
tex.MagFilter = video::ETMAGF_NEAREST;
tex.AnisotropicFilter = anisotropic ? 0xFF : 0;
}