1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-12 16:15:20 +02:00

Allow FXAA to be used together with FSAA or SSAA (#16555)

This allows FXAA post-processing to be used together with FSAA or SSAA
This commit is contained in:
lhofhansl
2025-10-11 20:50:23 -07:00
committed by GitHub
parent 0b13fd0b01
commit 7ca5f3baa0
4 changed files with 18 additions and 8 deletions

View File

@@ -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

View File

@@ -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.

View File

@@ -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");

View File

@@ -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");
}
}