From a95e58400a85b1db957062af3fbc7709ce0ae91f Mon Sep 17 00:00:00 2001 From: xHybred <137299477+xHybred@users.noreply.github.com> Date: Thu, 8 Feb 2024 00:27:58 -0500 Subject: [PATCH] Update AsymetricSamplingAA.fx --- Shaders/Hybred/AsymetricSamplingAA.fx | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/Shaders/Hybred/AsymetricSamplingAA.fx b/Shaders/Hybred/AsymetricSamplingAA.fx index 45c5693..7030003 100644 --- a/Shaders/Hybred/AsymetricSamplingAA.fx +++ b/Shaders/Hybred/AsymetricSamplingAA.fx @@ -10,7 +10,7 @@ uniform float JitterAmount < \ ui_label = "Jitter Amount"; \ ui_min = 0.0; \ ui_max = 2.0; \ - ui_step = 0.005; \ + ui_step = 0.01; \ ui_type = "slider"; \ ui_tooltip = "How much the noise moves, which is what causes the AA effect"; \ > = 0.35; @@ -19,11 +19,20 @@ uniform float NoiseMultiplier < \ ui_label = "Noise Amount"; \ ui_min = 1.0; \ ui_max = 25.0; \ - ui_step = 0.5; \ + ui_step = 1.0; \ ui_type = "slider"; \ ui_tooltip = "How strong the noise is"; \ > = 15.0; +uniform float BlurAmount < \ + ui_label = "Blur Amount"; \ + ui_min = 0.0; \ + ui_max = 0.45; \ + ui_step = 0.05; \ + ui_type = "slider"; \ + ui_tooltip = "How much blurring occurs"; \ +> = 0.25; + uniform float LuminanceThreshold < \ ui_label = "Luma Edge Threshold"; \ ui_min = 0.0; \ @@ -50,7 +59,18 @@ void PS_Main(in VSOUT i, out float4 o : SV_Target0) float edge = saturate((lum - threshold) * NoiseMultiplier); i.uv += (GetGoldNoise(i.vpos.xy, frame_count % 16 + 1) * 2.0 - 1.0) * BUFFER_PIXEL_SIZE * JitterAmount * edge; - o = tex2D(sColorTex, i.uv); + + // Apply blur + float blur = BlurAmount; + float2 blurDir = float2(blur, 0.0) * BUFFER_PIXEL_SIZE; + float4 blurredSample = 0.25 * ( + tex2D(sColorTex, i.uv - blurDir) + + tex2D(sColorTex, i.uv + blurDir) + + tex2D(sColorTex, i.uv - 2.0 * blurDir) + + tex2D(sColorTex, i.uv + 2.0 * blurDir) + ); + + o = lerp(tex2D(sColorTex, i.uv), blurredSample, blur * edge); } technique ASAA