From 0384f7814fcc873ac7d7a394e8e6a7b2cdc0d347 Mon Sep 17 00:00:00 2001 From: getdls <25286924+getdls@users.noreply.github.com> Date: Sun, 19 Jan 2020 17:57:08 +0100 Subject: [PATCH] [MK8] [Filters] FXAA options and settings --- Enhancements/MarioKart8_FXAA/output.glsl | 10 ++-- Enhancements/MarioKart8_FXAA/rules.txt | 65 ++++++++++++++++++++++- Filters/FXAA/output.glsl | 10 ++-- Filters/FXAA/rules.txt | 67 +++++++++++++++++++++++- 4 files changed, 136 insertions(+), 16 deletions(-) diff --git a/Enhancements/MarioKart8_FXAA/output.glsl b/Enhancements/MarioKart8_FXAA/output.glsl index 937c17a1..eb3c8b8d 100644 --- a/Enhancements/MarioKart8_FXAA/output.glsl +++ b/Enhancements/MarioKart8_FXAA/output.glsl @@ -10,19 +10,17 @@ layout(binding=0) uniform sampler2D textureSrc; layout(location = 0) out vec4 colorOut0; #endif - - /*-----------------------------settings-------------------------------------*/ -#define Subpix 0.75 //[0.000 to 1.000] Choose the amount of sub-pixel aliasing removal. -#define EdgeThreshold 0.5 //[0.000 to 1.000] Edge detection threshold. The minimum amount of local contrast required to apply algorithm. -#define EdgeThresholdMin 0.02 //[0.000 to 1.000] Darkness threshold. Trims the algorithm from processing darks. +#define Subpix $Subpix //[0.000 to 1.000] Choose the amount of sub-pixel aliasing removal. +#define EdgeThreshold $EdgeThreshold //[0.000 to 1.000] Edge detection threshold. The minimum amount of local contrast required to apply algorithm. +#define EdgeThresholdMin $EdgeThresholdMin //[0.000 to 1.000] Darkness threshold. Trims the algorithm from processing darks. /*--------------------------------------------------------------------------*/ #define FXAA_PC 1 #define FXAA_GLSL_130 1 -#define FXAA_QUALITY_PRESET 23 +#define FXAA_QUALITY_PRESET $FXAA_QUALITY_PRESET //15 //->29 - 39 #define FXAA_GREEN_AS_LUMA 1 #define FXAA_DISCARD 0 diff --git a/Enhancements/MarioKart8_FXAA/rules.txt b/Enhancements/MarioKart8_FXAA/rules.txt index a168ddc6..fdae664d 100644 --- a/Enhancements/MarioKart8_FXAA/rules.txt +++ b/Enhancements/MarioKart8_FXAA/rules.txt @@ -2,7 +2,68 @@ titleIds = 000500001010ec00,000500001010ed00,000500001010eb00 name = FXAA path = "Mario Kart 8/Enhancements/FXAA" -description = FXAA brute forced +description = Local contrast based AA version = 4 -#Cheers Skalfate, I'd prob never would have done this copypasta without your Xeno AA port. +[OutputShader] +upscaleMagFilter = Linear +downscaleMagFilter = Linear + +[Preset] +name = Fast default ET 0.5 FX 11 +$Subpix:float = 0.5 +$EdgeThreshold:float = 0.45 +$EdgeThresholdMin:float = 0.05 +$FXAA_QUALITY_PRESET:int = 11 + +[Preset] +name = Fastest ET 0.75 FX 10 +$Subpix:float = 0.75 +$EdgeThreshold:float = 0.75 +$EdgeThresholdMin:float = 0.1 +$FXAA_QUALITY_PRESET:int = 10 + +[Preset] +name = More edges but more smearing ET 0.4 FX 11 +$Subpix:float = 0.75 +$EdgeThreshold:float = 0.25 +$EdgeThresholdMin:float = 0.05 +$FXAA_QUALITY_PRESET:int = 11 + +[Preset] +name = Slower bit better quality ET 0.5 FX 15 +$Subpix:float = 0.75 +$EdgeThreshold:float = 0.4 +$EdgeThresholdMin:float = 0.05 +$FXAA_QUALITY_PRESET:int = 15 + +[Preset] +name = Much slower bit better quality ET 0.4 FX 25 +$Subpix:float = 0.75 +$EdgeThreshold:float = 0.4 +$EdgeThresholdMin:float = 0.05 +$FXAA_QUALITY_PRESET:int = 25 + +[Preset] +name = Test process everthing ET 0.05 FX 39 +$Subpix:float = 0.5 +$EdgeThreshold:float = 0.05 +$EdgeThresholdMin:float = 0.003 +$FXAA_QUALITY_PRESET:int = 39 + +#We don't have access to alpha or depth, just contrast detection with green channel as alpha substitute +#Since games have different styles there are no "correct" values. +#3200x1800 looks a lot worse than 3840x2160. Maybe N x 16 res is preferable? + + +#FXAA_QUALITY_PRESET +# 10 to 15 - default medium dither (10=fastest, 15=highest quality) //mostly relevant for Cemu +# 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality) +# 39 - no dither, very expensive //maybe for memory constrained scenarios? + +# [0.000 to 1.000] +#Subpix:0.01 slowest -> 0.9 fastest - ?? -> More +#EdgeThreshold contrast cut off: 0.01 slowest -> 0.9 fastest - More edges processing -> Less +#EdgeThresholdMin black cut off: 0.01 slowest -> 0.9 fastest - Don't process below. Note green cutoff, as we don't have alpha + +#Cheers Skalfate, I'd prob never would have done this without your Xeno AA port. diff --git a/Filters/FXAA/output.glsl b/Filters/FXAA/output.glsl index 937c17a1..eb3c8b8d 100644 --- a/Filters/FXAA/output.glsl +++ b/Filters/FXAA/output.glsl @@ -10,19 +10,17 @@ layout(binding=0) uniform sampler2D textureSrc; layout(location = 0) out vec4 colorOut0; #endif - - /*-----------------------------settings-------------------------------------*/ -#define Subpix 0.75 //[0.000 to 1.000] Choose the amount of sub-pixel aliasing removal. -#define EdgeThreshold 0.5 //[0.000 to 1.000] Edge detection threshold. The minimum amount of local contrast required to apply algorithm. -#define EdgeThresholdMin 0.02 //[0.000 to 1.000] Darkness threshold. Trims the algorithm from processing darks. +#define Subpix $Subpix //[0.000 to 1.000] Choose the amount of sub-pixel aliasing removal. +#define EdgeThreshold $EdgeThreshold //[0.000 to 1.000] Edge detection threshold. The minimum amount of local contrast required to apply algorithm. +#define EdgeThresholdMin $EdgeThresholdMin //[0.000 to 1.000] Darkness threshold. Trims the algorithm from processing darks. /*--------------------------------------------------------------------------*/ #define FXAA_PC 1 #define FXAA_GLSL_130 1 -#define FXAA_QUALITY_PRESET 23 +#define FXAA_QUALITY_PRESET $FXAA_QUALITY_PRESET //15 //->29 - 39 #define FXAA_GREEN_AS_LUMA 1 #define FXAA_DISCARD 0 diff --git a/Filters/FXAA/rules.txt b/Filters/FXAA/rules.txt index 90d50d9c..9d2f2971 100644 --- a/Filters/FXAA/rules.txt +++ b/Filters/FXAA/rules.txt @@ -2,5 +2,68 @@ titleIds = name = FXAA path = "Filters/FXAA" -description = Local contrast based FXAA -version = 4 \ No newline at end of file +description = Local contrast based AA +version = 4 + +[OutputShader] +upscaleMagFilter = Linear +downscaleMagFilter = Linear + +[Preset] +name = Fast default ET 0.5 FX 11 +$Subpix:float = 0.5 +$EdgeThreshold:float = 0.45 +$EdgeThresholdMin:float = 0.05 +$FXAA_QUALITY_PRESET:int = 11 + +[Preset] +name = Fastest ET 0.75 FX 10 +$Subpix:float = 0.75 +$EdgeThreshold:float = 0.75 +$EdgeThresholdMin:float = 0.1 +$FXAA_QUALITY_PRESET:int = 10 + +[Preset] +name = More edges but more smearing ET 0.4 FX 11 +$Subpix:float = 0.75 +$EdgeThreshold:float = 0.25 +$EdgeThresholdMin:float = 0.05 +$FXAA_QUALITY_PRESET:int = 11 + +[Preset] +name = Slower bit better quality ET 0.5 FX 15 +$Subpix:float = 0.75 +$EdgeThreshold:float = 0.4 +$EdgeThresholdMin:float = 0.05 +$FXAA_QUALITY_PRESET:int = 15 + +[Preset] +name = Much slower bit better quality ET 0.4 FX 25 +$Subpix:float = 0.75 +$EdgeThreshold:float = 0.4 +$EdgeThresholdMin:float = 0.05 +$FXAA_QUALITY_PRESET:int = 25 + +[Preset] +name = Test process everthing ET 0.05 FX 39 +$Subpix:float = 0.5 +$EdgeThreshold:float = 0.05 +$EdgeThresholdMin:float = 0.003 +$FXAA_QUALITY_PRESET:int = 39 + +#We don't have access to alpha or depth, just contrast detection with green channel as alpha substitute +#Since games have different styles there are no "correct" values. +#3200x1800 looks a lot worse than 3840x2160. Maybe N x 16 res is preferable? + + +#FXAA_QUALITY_PRESET +# 10 to 15 - default medium dither (10=fastest, 15=highest quality) //mostly relevant for Cemu +# 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality) +# 39 - no dither, very expensive //maybe for memory constrained scenarios? + +# [0.000 to 1.000] +#Subpix:0.01 slowest -> 0.9 fastest - ?? -> More +#EdgeThreshold contrast cut off: 0.01 slowest -> 0.9 fastest - More edges processing -> Less +#EdgeThresholdMin black cut off: 0.01 slowest -> 0.9 fastest - Don't process below. Note green cutoff, as we don't have alpha + +#Cheers Skalfate, I'd prob never would have done this without your Xeno AA port.