From c84f8561abc27820d6e1174d90167a4d65f45661 Mon Sep 17 00:00:00 2001 From: Skyth <19259897+blueskythlikesclouds@users.noreply.github.com> Date: Fri, 17 Jan 2025 22:13:27 +0300 Subject: [PATCH] Fix procedural filtering logic in ImGui pixel shader. --- UnleashedRecomp/gpu/shader/imgui_ps.hlsl | 6 +++--- UnleashedRecomp/ui/options_menu.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/UnleashedRecomp/gpu/shader/imgui_ps.hlsl b/UnleashedRecomp/gpu/shader/imgui_ps.hlsl index a1a5d59a..c105258c 100644 --- a/UnleashedRecomp/gpu/shader/imgui_ps.hlsl +++ b/UnleashedRecomp/gpu/shader/imgui_ps.hlsl @@ -65,10 +65,10 @@ float4 PixelAntialiasing(float2 uvTexspace) uvTexspace = (uvTexspace - seam) / fwidth(uvTexspace) + seam; uvTexspace = clamp(uvTexspace, seam - 0.5, seam + 0.5); - if (g_PushConstants.InverseDisplaySize.x < g_PushConstants.InverseDisplaySize.y) - uvTexspace *= min(1.0, g_PushConstants.InverseDisplaySize.y * 720.0f); + if ((g_PushConstants.InverseDisplaySize.y / g_PushConstants.InverseDisplaySize.x) >= (4.0 / 3.0)) + uvTexspace *= g_PushConstants.InverseDisplaySize.y * 720.0f; else - uvTexspace *= min(1.0, g_PushConstants.InverseDisplaySize.x * 1280.0f); + uvTexspace *= g_PushConstants.InverseDisplaySize.x * 960.0f; return SampleLinear(uvTexspace); } diff --git a/UnleashedRecomp/ui/options_menu.cpp b/UnleashedRecomp/ui/options_menu.cpp index 49998d2c..e79247e8 100644 --- a/UnleashedRecomp/ui/options_menu.cpp +++ b/UnleashedRecomp/ui/options_menu.cpp @@ -162,7 +162,7 @@ static void DrawScanlineBars() ( g_dfsogeistdFont, Scale(48.0f), - { Scale(122.0f), Scale(56.0f) }, + { Scale((1.0f - g_narrowOffsetScale) * -20.0f + 122.0f), Scale(56.0f) }, IM_COL32(255, 190, 33, 255), Localise("Options_Header_Name").c_str(), 4,