From 68d824341d59e3a8bce2c84894fbba7c68910912 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Sun, 14 Oct 2012 03:56:43 -0400 Subject: [PATCH] Added optional anisotropic filtering, mip-mapping, bilinear filtering, and trilinear filtering, and a minimal amount of code to make it possible to then each one on/off via the config file. No GUI stuff yet. Does not implement the desired bi/trilinear threshold yet. --- src/clientmap.cpp | 5 +++++ src/defaultsettings.cpp | 5 +++++ src/main.cpp | 6 ++++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/clientmap.cpp b/src/clientmap.cpp index 64d5656d4..f80551b29 100644 --- a/src/clientmap.cpp +++ b/src/clientmap.cpp @@ -544,6 +544,11 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass) for(u32 i=0; igetMeshBuffer(i); + + buf->getMaterial().setFlag(video::EMF_TRILINEAR_FILTER, g_settings->getBool("trilinear_filter")); + buf->getMaterial().setFlag(video::EMF_BILINEAR_FILTER, g_settings->getBool("bilinear_filter")); + buf->getMaterial().setFlag(video::EMF_ANISOTROPIC_FILTER, g_settings->getBool("anisotropic_filter")); + const video::SMaterial& material = buf->getMaterial(); video::IMaterialRenderer* rnd = driver->getMaterialRenderer(material.MaterialType); diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 3b37c18dc..f02d81e3f 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -142,5 +142,10 @@ void set_default_settings(Settings *settings) settings->setDefault("full_block_send_enable_min_time_from_building", "2.0"); settings->setDefault("dedicated_server_step", "0.05"); settings->setDefault("ignore_world_load_errors", "false"); + + settings->setDefault("mip_map", "false"); + settings->setDefault("anisotropic_filter", "false"); + settings->setDefault("bilinear_filter", "false"); + settings->setDefault("trilinear_filter", "false"); } diff --git a/src/main.cpp b/src/main.cpp index 6075e9d10..81d2eb825 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1292,8 +1292,10 @@ int main(int argc, char *argv[]) video::IVideoDriver* driver = device->getVideoDriver(); - // Disable mipmaps (because some of them look ugly) - driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false); + // Allow user to set mip-mapping by config file + // (see also, clientmap.cpp line 548) + + driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, g_settings->getBool("mip_map")); /* This changes the minimum allowed number of vertices in a VBO.