diff --git a/builtin/settingtypes.txt b/builtin/settingtypes.txt index d260b1e38d..9a03285cb8 100644 --- a/builtin/settingtypes.txt +++ b/builtin/settingtypes.txt @@ -614,19 +614,22 @@ anisotropic_filter (Anisotropic filtering) bool false # Also, if Post Processing is disabled, FSAA will not work together with # undersampling or a non-default "3d_mode" setting. # -# * FXAA - Fast approximate antialiasing -# Applies a post-processing filter to detect and smoothen high-contrast edges. -# Provides balance between speed and image quality. -# # * SSAA - Super-sampling antialiasing # Renders higher-resolution image of the scene, then scales down to reduce # the aliasing effects. This is the slowest and the most accurate method. -antialiasing (Antialiasing method) enum none none,fsaa,fxaa,ssaa +antialiasing (Antialiasing method) enum none none,fsaa,ssaa # Defines the size of the sampling grid for FSAA and SSAA antialiasing methods. # Value of 2 means taking 2x2 = 4 samples. fsaa (Anti-aliasing scale) enum 2 2,4,8,16 +# Applies a post-processing filter to detect and smoothen high-contrast edges. +# Provides balance between speed and image quality. +# fxaa can used in combination with the other anti-aliasing methods +# +# Requires: enable_post_processing +fxaa (Fast approximate antialiasing) bool false + [**Occlusion Culling] # Type of occlusion_culler diff --git a/src/client/render/secondstage.cpp b/src/client/render/secondstage.cpp index 10887b860a..a03e368dd7 100644 --- a/src/client/render/secondstage.cpp +++ b/src/client/render/secondstage.cpp @@ -132,11 +132,11 @@ RenderStep *addPostProcessing(RenderPipeline *pipeline, RenderStep *previousStep << "combination with post-processing by the current video driver." << std::endl; const bool enable_ssaa = antialiasing == "ssaa"; - const bool enable_fxaa = antialiasing == "fxaa"; + const bool enable_fxaa = g_settings->getBool("fxaa"); verbosestream << "addPostProcessing(): AA = " - << (enable_msaa ? "msaa" : enable_ssaa ? "ssaa" : enable_fxaa ? "fxaa" : "none") - << " " << antialiasing_scale << "x" << std::endl; + << (enable_msaa ? "msaa" : enable_ssaa ? "ssaa" : "none") + << " " << antialiasing_scale << "x" << (enable_fxaa ? " + fxaa" : "") << std::endl; // Super-sampling is simply rendering into a larger texture. // Downscaling is done by the final step when rendering to the screen. diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index e1f45f869c..4068f776ec 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -336,6 +336,7 @@ void set_default_settings() settings->setDefault("enable_auto_exposure", "false"); settings->setDefault("debanding", "true"); settings->setDefault("antialiasing", "none"); + settings->setDefault("fxaa", "false"); settings->setDefault("enable_bloom", "false"); settings->setDefault("enable_bloom_debug", "false"); settings->setDefault("enable_volumetric_lighting", "false"); diff --git a/src/migratesettings.h b/src/migratesettings.h index 4839f94794..b3ae3fc1ae 100644 --- a/src/migratesettings.h +++ b/src/migratesettings.h @@ -35,4 +35,10 @@ void migrate_settings() g_settings->set("touch_interaction_style", value ? "tap_crosshair" : "tap"); g_settings->remove("touch_use_crosshair"); } + + // turn FXAA into its own setting + if (g_settings->get("antialiasing") == "fxaa") { + g_settings->setBool("fxaa", true); + g_settings->remove("antialiasing"); + } }