From fc0d4519f79d369efd149781ff25a5e8f9227cd1 Mon Sep 17 00:00:00 2001 From: hunterk Date: Fri, 27 Sep 2019 16:15:14 -0500 Subject: [PATCH] fix no-aa mode in royale --- .../src/crt-royale-geometry-aa-last-pass.h | 3 +- .../src/crt-royale-last-pass-no-geom.slang | 96 ------------------- presets/crt-royale-kurozumi.slangp | 2 +- 3 files changed, 3 insertions(+), 98 deletions(-) delete mode 100644 crt/shaders/crt-royale/src/crt-royale-last-pass-no-geom.slang diff --git a/crt/shaders/crt-royale/src/crt-royale-geometry-aa-last-pass.h b/crt/shaders/crt-royale/src/crt-royale-geometry-aa-last-pass.h index 5665da9..8cd145e 100644 --- a/crt/shaders/crt-royale/src/crt-royale-geometry-aa-last-pass.h +++ b/crt/shaders/crt-royale/src/crt-royale-geometry-aa-last-pass.h @@ -265,7 +265,8 @@ void main() // 2.) Overscan == float2(1.0, 1.0) // Skipping AA is sharper, but it's only faster with dynamic branches. const float2 abs_aa_r_offset = abs(get_aa_subpixel_r_offset()); - const bool need_subpixel_aa = abs_aa_r_offset.x + abs_aa_r_offset.y > 0.0; + // this next check seems to always return true, even when it shouldn't so disabling it for now + const bool need_subpixel_aa = false;//abs_aa_r_offset.x + abs_aa_r_offset.y > 0.0; float3 color; if(aa_level > 0.5 && (geom_mode > 0.5 || any(bool2((geom_overscan.x != 1.0), (geom_overscan.y != 1.0))))) diff --git a/crt/shaders/crt-royale/src/crt-royale-last-pass-no-geom.slang b/crt/shaders/crt-royale/src/crt-royale-last-pass-no-geom.slang deleted file mode 100644 index 83a0336..0000000 --- a/crt/shaders/crt-royale/src/crt-royale-last-pass-no-geom.slang +++ /dev/null @@ -1,96 +0,0 @@ -#version 450 - -layout(push_constant) uniform Push -{ - vec4 SourceSize; - vec4 OriginalSize; - vec4 OutputSize; - uint FrameCount; -} params; - -layout(std140, set = 0, binding = 0) uniform UBO -{ - mat4 MVP; - float crt_gamma; - float lcd_gamma; - float levels_contrast; - float halation_weight; - float diffusion_weight; - float bloom_underestimate_levels; - float bloom_excess; - float beam_min_sigma; - float beam_max_sigma; - float beam_spot_power; - float beam_min_shape; - float beam_max_shape; - float beam_shape_power; - float beam_horiz_filter; - float beam_horiz_sigma; - float beam_horiz_linear_rgb_weight; - float convergence_offset_x_r; - float convergence_offset_x_g; - float convergence_offset_x_b; - float convergence_offset_y_r; - float convergence_offset_y_g; - float convergence_offset_y_b; - float mask_type; - float mask_sample_mode_desired; - float mask_num_triads_desired; - float mask_triad_size_desired; - float mask_specify_num_triads; - float aa_subpixel_r_offset_x_runtime; - float aa_subpixel_r_offset_y_runtime; - float aa_cubic_c; - float aa_gauss_sigma; - float geom_mode_runtime; - float geom_radius; - float geom_view_dist; - float geom_tilt_angle_x; - float geom_tilt_angle_y; - float geom_aspect_ratio_x; - float geom_aspect_ratio_y; - float geom_overscan_x; - float geom_overscan_y; - float border_size; - float border_darkness; - float border_compress; - float interlace_bff; - float interlace_1080i; - vec4 MASKED_SCANLINESSize; - vec4 HALATION_BLURSize; - vec4 BRIGHTPASSSize; -} global; - -///////////////////////////// SETTINGS MANAGEMENT //////////////////////////// - -#define LAST_PASS -#define SIMULATE_CRT_ON_LCD -#include "../../../../include/compat_macros.inc" -#include "../user-settings.h" -#include "derived-settings-and-constants.h" -#include "bind-shader-params.h" - -////////////////////////////////// INCLUDES ////////////////////////////////// - -#include "../../../../include/gamma-management.h" - -#pragma stage vertex -layout(location = 0) in vec4 Position; -layout(location = 1) in vec2 TexCoord; -layout(location = 0) out vec2 vTexCoord; - -void main() -{ - gl_Position = global.MVP * Position; - vTexCoord = TexCoord; -} - -#pragma stage fragment -layout(location = 0) in vec2 vTexCoord; -layout(location = 0) out vec4 FragColor; -layout(set = 0, binding = 2) uniform sampler2D Source; - -void main() -{ - FragColor = encode_output(vec4(texture(Source, vTexCoord).rgb, 1.0)); -} diff --git a/presets/crt-royale-kurozumi.slangp b/presets/crt-royale-kurozumi.slangp index 7889984..16918b6 100755 --- a/presets/crt-royale-kurozumi.slangp +++ b/presets/crt-royale-kurozumi.slangp @@ -205,7 +205,7 @@ scale11 = "1.0" srgb_framebuffer11 = "true" # Pass 12: Compute curvature/AA: -shader12 = "../crt/shaders/crt-royale/src/crt-royale-last-pass-no-geom.slang" +shader12 = "../crt/shaders/crt-royale/src/crt-royale-geometry-aa-last-pass.slang" filter_linear12 = "true" scale_type12 = "viewport" mipmap_input12 = "true"