changes to ntsc-adaptive, more blurs, NDS color, gamma ramp (#178)

* add updated NDS color, Super Sleuth gamma ramp and more trogglemonkey blurs

* whoops, remove debug workaround

* remove reference to Cg shaders

* make ntsc-adaptive more custom, add RF preset, move some ntsc presets to 'presets'
This commit is contained in:
hunterk 2021-06-04 17:51:24 -05:00 committed by GitHub
parent 70256e15f6
commit 7c1a778f4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 110 additions and 75 deletions

View file

@ -16,3 +16,6 @@ filter_linear1 = false
shader2 = shaders/vt220/vt220.slang shader2 = shaders/vt220/vt220.slang
mipmap_input2 = true mipmap_input2 = true
wrap_mode2 = mirrored_repeat wrap_mode2 = mirrored_repeat
parameters = "quality"
quality = 1.0

View file

@ -10,35 +10,54 @@ layout(std140, set = 0, binding = 0) uniform UBO
vec4 OriginalSize; vec4 OriginalSize;
vec4 SourceSize; vec4 SourceSize;
uint FrameCount; uint FrameCount;
float quality, bw; float quality, ntsc_sat, cust_fringing, cust_artifacting, ntsc_bright;
} global; } global;
#pragma parameter quality "Quality (Composite = 0, Svideo = 1)" 0.0 0.0 1.0 1.0 #pragma parameter quality "Presets (Svideo=0 Composite=1 RF=2 Custom=-1)" 0.0 -1.0 2.0 1.0
#pragma parameter bw "Black and White" 0.0 0.0 1.0 1.0 #pragma parameter ntsc_sat "Color Saturation" 1.0 0.0 2.0 0.01
#pragma parameter ntsc_bright "Brightness" 1.0 0.0 1.5 0.01
#pragma parameter cust_fringing "Custom Fringing Value" 0.0 0.0 5.0 0.1
#pragma parameter cust_artifacting "Custom Artifacting Value" 0.0 0.0 5.0 0.1
#define PI 3.14159265
#pragma stage vertex #pragma stage vertex
layout(location = 0) in vec4 Position; layout(location = 0) in vec4 Position;
layout(location = 1) in vec2 TexCoord; layout(location = 1) in vec2 TexCoord;
layout(location = 0) out vec2 vTexCoord; layout(location = 0) out vec2 vTexCoord;
layout(location = 1) out vec2 pix_no; layout(location = 1) out vec2 pix_no;
layout(location = 2) out float phase;
layout(location = 3) out float BRIGHTNESS;
layout(location = 4) out float SATURATION;
layout(location = 5) out float FRINGING;
layout(location = 6) out float ARTIFACTING;
layout(location = 7) out float CHROMA_MOD_FREQ;
void main() void main()
{ {
gl_Position = global.MVP * Position; gl_Position = global.MVP * Position;
vTexCoord = TexCoord; vTexCoord = TexCoord;
pix_no = TexCoord * global.SourceSize.xy * (global.OutputSize.xy / global.SourceSize.xy); pix_no = TexCoord * global.SourceSize.xy * (global.OutputSize.xy / global.SourceSize.xy);
phase = (global.OriginalSize.x > 300.0) ? 2.0 : 3.0;
CHROMA_MOD_FREQ = (phase < 2.5) ? (4.0 * PI / 15.0) : (PI / 3.0);
ARTIFACTING = (global.quality > -0.5) ? global.quality : global.cust_artifacting;
FRINGING = (global.quality > -0.5) ? global.quality : global.cust_fringing;
SATURATION = global.ntsc_sat;
BRIGHTNESS = global.ntsc_bright;
} }
#pragma stage fragment #pragma stage fragment
layout(location = 0) in vec2 vTexCoord; layout(location = 0) in vec2 vTexCoord;
layout(location = 1) in vec2 pix_no; layout(location = 1) in vec2 pix_no;
layout(location = 2) in float phase;
layout(location = 3) in float BRIGHTNESS;
layout(location = 4) in float SATURATION;
layout(location = 5) in float FRINGING;
layout(location = 6) in float ARTIFACTING;
layout(location = 7) in float CHROMA_MOD_FREQ;
layout(location = 0) out vec4 FragColor; layout(location = 0) out vec4 FragColor;
layout(set = 0, binding = 2) uniform sampler2D Source; layout(set = 0, binding = 2) uniform sampler2D Source;
#define PI 3.14159265
float phase = (global.OriginalSize.x > 300.0) ? 2.0 : 3.0;
#define mix_mat mat3(BRIGHTNESS, FRINGING, FRINGING, ARTIFACTING, 2.0 * SATURATION, 0.0, ARTIFACTING, 0.0, 2.0 * SATURATION) #define mix_mat mat3(BRIGHTNESS, FRINGING, FRINGING, ARTIFACTING, 2.0 * SATURATION, 0.0, ARTIFACTING, 0.0, 2.0 * SATURATION)
const mat3 yiq2rgb_mat = mat3( const mat3 yiq2rgb_mat = mat3(
@ -64,12 +83,6 @@ vec3 rgb2yiq(vec3 col)
void main() void main()
{ {
float CHROMA_MOD_FREQ = (phase < 2.5) ? (4.0 * PI / 15.0) : (PI / 3.0);
float ARTIFACTING = 1.0 - global.quality;
float FRINGING = 1.0 - global.quality;
float SATURATION = 1.0 - global.bw;
// prevent some very slight clipping that happens at 1.0
const float BRIGHTNESS = 0.95;
vec3 col = texture(Source, vTexCoord).rgb; vec3 col = texture(Source, vTexCoord).rgb;
vec3 yiq = rgb2yiq(col); vec3 yiq = rgb2yiq(col);

View file

@ -76,3 +76,4 @@ DOTMASK = "0.0"
lum = "0.15" lum = "0.15"
interlace_detect = "0.0" interlace_detect = "0.0"
vertical_scanlines = "1.0" vertical_scanlines = "1.0"
quality = 1.0

View file

@ -75,3 +75,4 @@ scanline_weight = "0.25"
DOTMASK = "0.0" DOTMASK = "0.0"
lum = "0.15" lum = "0.15"
interlace_detect = "0.0" interlace_detect = "0.0"
quality = 1.0

View file

@ -92,3 +92,6 @@ filter_linear12 = true
scale_type12 = viewport scale_type12 = viewport
scale_x12 = 1.0 scale_x12 = 1.0
scale_y12 = 1.0 scale_y12 = 1.0
parameters = "quality"
quality = 1.0

View file

@ -86,3 +86,6 @@ filter_linear11 = true
scale_type11 = viewport scale_type11 = viewport
scale_x11 = 1.0 scale_x11 = 1.0
scale_y11 = 1.0 scale_y11 = 1.0
parameters = "quality"
quality = 1.0

View file

@ -79,3 +79,6 @@ filter_linear9 = true
scale_type9 = viewport scale_type9 = viewport
scale_x9 = 1.0 scale_x9 = 1.0
scale_y9 = 1.0 scale_y9 = 1.0
parameters = "quality"
quality = 1.0

View file

@ -98,3 +98,4 @@ shadowMask = "0.000000"
maskDark = "0.500000" maskDark = "0.500000"
maskLight = "1.500000" maskLight = "1.500000"
linearize = "1.0" linearize = "1.0"
quality = "1.0"

View file

@ -41,12 +41,12 @@ scale_y1 = 1.0
# non-mipmapped version and a large mipmapped version. # non-mipmapped version and a large mipmapped version.
# TODO: Test masks in other directories. # TODO: Test masks in other directories.
textures = "mask_grille_texture_small;mask_grille_texture_large;mask_slot_texture_small;mask_slot_texture_large;mask_shadow_texture_small;mask_shadow_texture_large" textures = "mask_grille_texture_small;mask_grille_texture_large;mask_slot_texture_small;mask_slot_texture_large;mask_shadow_texture_small;mask_shadow_texture_large"
mask_grille_texture_small = "shaders/crt-royale/TileableLinearApertureGrille15Wide8And5d5SpacingResizeTo64.png" mask_grille_texture_small = "../crt/shaders/crt-royale/TileableLinearApertureGrille15Wide8And5d5SpacingResizeTo64.png"
mask_grille_texture_large = "shaders/crt-royale/TileableLinearApertureGrille15Wide8And5d5Spacing.png" mask_grille_texture_large = "../crt/shaders/crt-royale/TileableLinearApertureGrille15Wide8And5d5Spacing.png"
mask_slot_texture_small = "shaders/crt-royale/TileableLinearSlotMaskTall15Wide9And4d5Horizontal9d14VerticalSpacingResizeTo64.png" mask_slot_texture_small = "../crt/shaders/crt-royale/TileableLinearSlotMaskTall15Wide9And4d5Horizontal9d14VerticalSpacingResizeTo64.png"
mask_slot_texture_large = "shaders/crt-royale/TileableLinearSlotMaskTall15Wide9And4d5Horizontal9d14VerticalSpacing.png" mask_slot_texture_large = "../crt/shaders/crt-royale/TileableLinearSlotMaskTall15Wide9And4d5Horizontal9d14VerticalSpacing.png"
mask_shadow_texture_small = "shaders/crt-royale/TileableLinearShadowMaskEDPResizeTo64.png" mask_shadow_texture_small = "../crt/shaders/crt-royale/TileableLinearShadowMaskEDPResizeTo64.png"
mask_shadow_texture_large = "shaders/crt-royale/TileableLinearShadowMaskEDP.png" mask_shadow_texture_large = "../crt/shaders/crt-royale/TileableLinearShadowMaskEDP.png"
mask_grille_texture_small_wrap_mode = "repeat" mask_grille_texture_small_wrap_mode = "repeat"
mask_grille_texture_large_wrap_mode = "repeat" mask_grille_texture_large_wrap_mode = "repeat"
mask_slot_texture_small_wrap_mode = "repeat" mask_slot_texture_small_wrap_mode = "repeat"
@ -69,7 +69,7 @@ mask_shadow_texture_large_mipmap = "true" # Essential for hardware-resized mas
# Pass2: Linearize the input based on CRT gamma and bob interlaced fields. # Pass2: Linearize the input based on CRT gamma and bob interlaced fields.
# (Bobbing ensures we can immediately blur without getting artifacts.) # (Bobbing ensures we can immediately blur without getting artifacts.)
shader2 = "shaders/crt-royale/src/crt-royale-first-pass-linearize-crt-gamma-bob-fields.slang" shader2 = "../crt/shaders/crt-royale/src/crt-royale-first-pass-linearize-crt-gamma-bob-fields.slang"
alias2 = "ORIG_LINEARIZED" alias2 = "ORIG_LINEARIZED"
filter_linear2 = "false" filter_linear2 = "false"
scale_type2 = "source" scale_type2 = "source"
@ -82,7 +82,7 @@ srgb_framebuffer2 = "true"
# it reduces our samples from vertical*horizontal to vertical+horizontal. # it reduces our samples from vertical*horizontal to vertical+horizontal.
# This has to come right after ORIG_LINEARIZED, because there's no # This has to come right after ORIG_LINEARIZED, because there's no
# "original_source" scale_type we can use later. # "original_source" scale_type we can use later.
shader3 = "shaders/crt-royale/src/crt-royale-scanlines-vertical-interlacing.slang" shader3 = "../crt/shaders/crt-royale/src/crt-royale-scanlines-vertical-interlacing.slang"
alias3 = "VERTICAL_SCANLINES" alias3 = "VERTICAL_SCANLINES"
filter_linear3 = "true" filter_linear3 = "true"
scale_type_x3 = "source" scale_type_x3 = "source"
@ -104,7 +104,7 @@ srgb_framebuffer3 = "true"
# may be a good thing for people who like to crank it up). # may be a good thing for people who like to crank it up).
# Note the 4:3 aspect ratio assumes the input has cropped geom_overscan (so it's # Note the 4:3 aspect ratio assumes the input has cropped geom_overscan (so it's
# *intended* for an ~4:3 aspect ratio). # *intended* for an ~4:3 aspect ratio).
shader4 = "shaders/crt-royale/src/crt-royale-bloom-approx.slang" shader4 = "../crt/shaders/crt-royale/src/crt-royale-bloom-approx.slang"
alias4 = "BLOOM_APPROX" alias4 = "BLOOM_APPROX"
filter_linear4 = "true" filter_linear4 = "true"
scale_type4 = "absolute" scale_type4 = "absolute"
@ -164,7 +164,7 @@ srgb_framebuffer6 = "true"
# scale_y7 = 4.0/3.0 * 2.0/(341.33333 / 8.0) = 0.0625 # scale_y7 = 4.0/3.0 * 2.0/(341.33333 / 8.0) = 0.0625
# IMPORTANT: The scales MUST be calculated in this way. If you wish to change # IMPORTANT: The scales MUST be calculated in this way. If you wish to change
# geom_max_aspect_ratio, update that constant in user-cgp-constants.h! # geom_max_aspect_ratio, update that constant in user-cgp-constants.h!
shader7 = "shaders/crt-royale/src/crt-royale-mask-resize-vertical.slang" shader7 = "../crt/shaders/crt-royale/src/crt-royale-mask-resize-vertical.slang"
filter_linear7 = "true" filter_linear7 = "true"
scale_type_x7 = "absolute" scale_type_x7 = "absolute"
scale_x7 = "64" scale_x7 = "64"
@ -174,7 +174,7 @@ scale_y7 = "0.0625" # Safe for >= 341.333 horizontal triads at viewport size
# Pass8: Lanczos-resize the phosphor mask horizontally. scale_x8 = scale_y7. # Pass8: Lanczos-resize the phosphor mask horizontally. scale_x8 = scale_y7.
# TODO: Check again if the shaders actually require equal scales. # TODO: Check again if the shaders actually require equal scales.
shader8 = "shaders/crt-royale/src/crt-royale-mask-resize-horizontal.slang" shader8 = "../crt/shaders/crt-royale/src/crt-royale-mask-resize-horizontal.slang"
alias8 = "MASK_RESIZE" alias8 = "MASK_RESIZE"
filter_linear8 = "false" filter_linear8 = "false"
scale_type_x8 = "viewport" scale_type_x8 = "viewport"
@ -185,7 +185,7 @@ scale_y8 = "1.0"
# Pass9: Resample (misconverged) scanlines horizontally, apply halation, and # Pass9: Resample (misconverged) scanlines horizontally, apply halation, and
# apply the phosphor mask. # apply the phosphor mask.
shader9 = "shaders/crt-royale/src/crt-royale-scanlines-horizontal-apply-mask.slang" shader9 = "../crt/shaders/crt-royale/src/crt-royale-scanlines-horizontal-apply-mask.slang"
alias9 = "MASKED_SCANLINES" alias9 = "MASKED_SCANLINES"
filter_linear9 = "true" # This could just as easily be nearest neighbor. filter_linear9 = "true" # This could just as easily be nearest neighbor.
scale_type9 = "viewport" scale_type9 = "viewport"
@ -194,7 +194,7 @@ scale9 = "1.0"
srgb_framebuffer9 = "true" srgb_framebuffer9 = "true"
# Pass 10: Compute a brightpass. This will require reading the final mask. # Pass 10: Compute a brightpass. This will require reading the final mask.
shader10 = "shaders/crt-royale/src/crt-royale-brightpass.slang" shader10 = "../crt/shaders/crt-royale/src/crt-royale-brightpass.slang"
alias10 = "BRIGHTPASS" alias10 = "BRIGHTPASS"
filter_linear10 = "true" # This could just as easily be nearest neighbor. filter_linear10 = "true" # This could just as easily be nearest neighbor.
scale_type10 = "viewport" scale_type10 = "viewport"
@ -202,23 +202,26 @@ scale10 = "1.0"
srgb_framebuffer10 = "true" srgb_framebuffer10 = "true"
# Pass 11: Blur the brightpass vertically # Pass 11: Blur the brightpass vertically
shader11 = "shaders/crt-royale/src/crt-royale-bloom-vertical.slang" shader11 = "../crt/shaders/crt-royale/src/crt-royale-bloom-vertical.slang"
filter_linear11 = "true" # This could just as easily be nearest neighbor. filter_linear11 = "true" # This could just as easily be nearest neighbor.
scale_type11 = "source" scale_type11 = "source"
scale11 = "1.0" scale11 = "1.0"
srgb_framebuffer11 = "true" srgb_framebuffer11 = "true"
# Pass 12: Blur the brightpass horizontally and combine it with the dimpass: # Pass 12: Blur the brightpass horizontally and combine it with the dimpass:
shader12 = "shaders/crt-royale/src/crt-royale-bloom-horizontal-reconstitute.slang" shader12 = "../crt/shaders/crt-royale/src/crt-royale-bloom-horizontal-reconstitute.slang"
filter_linear12 = "true" filter_linear12 = "true"
scale_type12 = "source" scale_type12 = "source"
scale12 = "1.0" scale12 = "1.0"
srgb_framebuffer12 = "true" srgb_framebuffer12 = "true"
# Pass 13: Compute curvature/AA: # Pass 13: Compute curvature/AA:
shader13 = "shaders/crt-royale/src/crt-royale-geometry-aa-last-pass.slang" shader13 = "../crt/shaders/crt-royale/src/crt-royale-geometry-aa-last-pass.slang"
filter_linear13 = "true" filter_linear13 = "true"
scale_type13 = "viewport" scale_type13 = "viewport"
mipmap_input13 = "true" mipmap_input13 = "true"
texture_wrap_mode13 = "clamp_to_edge" texture_wrap_mode13 = "clamp_to_edge"
parameters = "quality"
quality = 1.0

View file

@ -41,12 +41,12 @@ scale_y1 = 1.0
# non-mipmapped version and a large mipmapped version. # non-mipmapped version and a large mipmapped version.
# TODO: Test masks in other directories. # TODO: Test masks in other directories.
textures = "mask_grille_texture_small;mask_grille_texture_large;mask_slot_texture_small;mask_slot_texture_large;mask_shadow_texture_small;mask_shadow_texture_large" textures = "mask_grille_texture_small;mask_grille_texture_large;mask_slot_texture_small;mask_slot_texture_large;mask_shadow_texture_small;mask_shadow_texture_large"
mask_grille_texture_small = "shaders/crt-royale/TileableLinearApertureGrille15Wide8And5d5SpacingResizeTo64.png" mask_grille_texture_small = "../crt/shaders/crt-royale/TileableLinearApertureGrille15Wide8And5d5SpacingResizeTo64.png"
mask_grille_texture_large = "shaders/crt-royale/TileableLinearApertureGrille15Wide8And5d5Spacing.png" mask_grille_texture_large = "../crt/shaders/crt-royale/TileableLinearApertureGrille15Wide8And5d5Spacing.png"
mask_slot_texture_small = "shaders/crt-royale/TileableLinearSlotMaskTall15Wide9And4d5Horizontal9d14VerticalSpacingResizeTo64.png" mask_slot_texture_small = "../crt/shaders/crt-royale/TileableLinearSlotMaskTall15Wide9And4d5Horizontal9d14VerticalSpacingResizeTo64.png"
mask_slot_texture_large = "shaders/crt-royale/TileableLinearSlotMaskTall15Wide9And4d5Horizontal9d14VerticalSpacing.png" mask_slot_texture_large = "../crt/shaders/crt-royale/TileableLinearSlotMaskTall15Wide9And4d5Horizontal9d14VerticalSpacing.png"
mask_shadow_texture_small = "shaders/crt-royale/TileableLinearShadowMaskEDPResizeTo64.png" mask_shadow_texture_small = "../crt/shaders/crt-royale/TileableLinearShadowMaskEDPResizeTo64.png"
mask_shadow_texture_large = "shaders/crt-royale/TileableLinearShadowMaskEDP.png" mask_shadow_texture_large = "../crt/shaders/crt-royale/TileableLinearShadowMaskEDP.png"
mask_grille_texture_small_wrap_mode = "repeat" mask_grille_texture_small_wrap_mode = "repeat"
mask_grille_texture_large_wrap_mode = "repeat" mask_grille_texture_large_wrap_mode = "repeat"
mask_slot_texture_small_wrap_mode = "repeat" mask_slot_texture_small_wrap_mode = "repeat"
@ -69,7 +69,7 @@ mask_shadow_texture_large_mipmap = "true" # Essential for hardware-resized mas
# Pass2: Linearize the input based on CRT gamma and bob interlaced fields. # Pass2: Linearize the input based on CRT gamma and bob interlaced fields.
# (Bobbing ensures we can immediately blur without getting artifacts.) # (Bobbing ensures we can immediately blur without getting artifacts.)
shader2 = "shaders/crt-royale/src/crt-royale-first-pass-linearize-crt-gamma-bob-fields.slang" shader2 = "../crt/shaders/crt-royale/src/crt-royale-first-pass-linearize-crt-gamma-bob-fields.slang"
alias2 = "ORIG_LINEARIZED" alias2 = "ORIG_LINEARIZED"
filter_linear2 = "false" filter_linear2 = "false"
scale_type2 = "source" scale_type2 = "source"
@ -82,7 +82,7 @@ srgb_framebuffer2 = "true"
# it reduces our samples from vertical*horizontal to vertical+horizontal. # it reduces our samples from vertical*horizontal to vertical+horizontal.
# This has to come right after ORIG_LINEARIZED, because there's no # This has to come right after ORIG_LINEARIZED, because there's no
# "original_source" scale_type we can use later. # "original_source" scale_type we can use later.
shader3 = "shaders/crt-royale/src/crt-royale-scanlines-vertical-interlacing.slang" shader3 = "../crt/shaders/crt-royale/src/crt-royale-scanlines-vertical-interlacing.slang"
alias3 = "VERTICAL_SCANLINES" alias3 = "VERTICAL_SCANLINES"
filter_linear3 = "true" filter_linear3 = "true"
scale_type_x3 = "source" scale_type_x3 = "source"
@ -104,7 +104,7 @@ srgb_framebuffer3 = "true"
# may be a good thing for people who like to crank it up). # may be a good thing for people who like to crank it up).
# Note the 4:3 aspect ratio assumes the input has cropped geom_overscan (so it's # Note the 4:3 aspect ratio assumes the input has cropped geom_overscan (so it's
# *intended* for an ~4:3 aspect ratio). # *intended* for an ~4:3 aspect ratio).
shader4 = "shaders/crt-royale/src/crt-royale-bloom-approx.slang" shader4 = "../crt/shaders/crt-royale/src/crt-royale-bloom-approx.slang"
alias4 = "BLOOM_APPROX" alias4 = "BLOOM_APPROX"
filter_linear4 = "true" filter_linear4 = "true"
scale_type4 = "absolute" scale_type4 = "absolute"
@ -164,7 +164,7 @@ srgb_framebuffer6 = "true"
# scale_y7 = 4.0/3.0 * 2.0/(341.33333 / 8.0) = 0.0625 # scale_y7 = 4.0/3.0 * 2.0/(341.33333 / 8.0) = 0.0625
# IMPORTANT: The scales MUST be calculated in this way. If you wish to change # IMPORTANT: The scales MUST be calculated in this way. If you wish to change
# geom_max_aspect_ratio, update that constant in user-cgp-constants.h! # geom_max_aspect_ratio, update that constant in user-cgp-constants.h!
shader7 = "shaders/crt-royale/src/crt-royale-mask-resize-vertical.slang" shader7 = "../crt/shaders/crt-royale/src/crt-royale-mask-resize-vertical.slang"
filter_linear7 = "true" filter_linear7 = "true"
scale_type_x7 = "absolute" scale_type_x7 = "absolute"
scale_x7 = "64" scale_x7 = "64"
@ -174,7 +174,7 @@ scale_y7 = "0.0625" # Safe for >= 341.333 horizontal triads at viewport size
# Pass8: Lanczos-resize the phosphor mask horizontally. scale_x8 = scale_y7. # Pass8: Lanczos-resize the phosphor mask horizontally. scale_x8 = scale_y7.
# TODO: Check again if the shaders actually require equal scales. # TODO: Check again if the shaders actually require equal scales.
shader8 = "shaders/crt-royale/src/crt-royale-mask-resize-horizontal.slang" shader8 = "../crt/shaders/crt-royale/src/crt-royale-mask-resize-horizontal.slang"
alias8 = "MASK_RESIZE" alias8 = "MASK_RESIZE"
filter_linear8 = "false" filter_linear8 = "false"
scale_type_x8 = "viewport" scale_type_x8 = "viewport"
@ -185,7 +185,7 @@ scale_y8 = "1.0"
# Pass9: Resample (misconverged) scanlines horizontally, apply halation, and # Pass9: Resample (misconverged) scanlines horizontally, apply halation, and
# apply the phosphor mask. # apply the phosphor mask.
shader9 = "shaders/crt-royale/src/crt-royale-scanlines-horizontal-apply-mask.slang" shader9 = "../crt/shaders/crt-royale/src/crt-royale-scanlines-horizontal-apply-mask.slang"
alias9 = "MASKED_SCANLINES" alias9 = "MASKED_SCANLINES"
filter_linear9 = "true" # This could just as easily be nearest neighbor. filter_linear9 = "true" # This could just as easily be nearest neighbor.
scale_type9 = "viewport" scale_type9 = "viewport"
@ -194,7 +194,7 @@ scale9 = "1.0"
srgb_framebuffer9 = "true" srgb_framebuffer9 = "true"
# Pass 10: Compute a brightpass. This will require reading the final mask. # Pass 10: Compute a brightpass. This will require reading the final mask.
shader10 = "shaders/crt-royale/src/crt-royale-brightpass.slang" shader10 = "../crt/shaders/crt-royale/src/crt-royale-brightpass.slang"
alias10 = "BRIGHTPASS" alias10 = "BRIGHTPASS"
filter_linear10 = "true" # This could just as easily be nearest neighbor. filter_linear10 = "true" # This could just as easily be nearest neighbor.
scale_type10 = "viewport" scale_type10 = "viewport"
@ -202,26 +202,26 @@ scale10 = "1.0"
srgb_framebuffer10 = "true" srgb_framebuffer10 = "true"
# Pass 11: Blur the brightpass vertically # Pass 11: Blur the brightpass vertically
shader11 = "shaders/crt-royale/src/crt-royale-bloom-vertical.slang" shader11 = "../crt/shaders/crt-royale/src/crt-royale-bloom-vertical.slang"
filter_linear11 = "true" # This could just as easily be nearest neighbor. filter_linear11 = "true" # This could just as easily be nearest neighbor.
scale_type11 = "source" scale_type11 = "source"
scale11 = "1.0" scale11 = "1.0"
srgb_framebuffer11 = "true" srgb_framebuffer11 = "true"
# Pass 12: Blur the brightpass horizontally and combine it with the dimpass: # Pass 12: Blur the brightpass horizontally and combine it with the dimpass:
shader12 = "shaders/crt-royale/src/crt-royale-bloom-horizontal-reconstitute.slang" shader12 = "../crt/shaders/crt-royale/src/crt-royale-bloom-horizontal-reconstitute.slang"
filter_linear12 = "true" filter_linear12 = "true"
scale_type12 = "source" scale_type12 = "source"
scale12 = "1.0" scale12 = "1.0"
srgb_framebuffer12 = "true" srgb_framebuffer12 = "true"
# Pass 13: Compute curvature/AA: # Pass 13: Compute curvature/AA:
shader13 = "shaders/crt-royale/src/crt-royale-geometry-aa-last-pass.slang" shader13 = "../crt/shaders/crt-royale/src/crt-royale-geometry-aa-last-pass.slang"
filter_linear13 = "true" filter_linear13 = "true"
scale_type13 = "viewport" scale_type13 = "viewport"
mipmap_input13 = "true" mipmap_input13 = "true"
texture_wrap_mode13 = "clamp_to_edge" texture_wrap_mode13 = "clamp_to_edge"
parameters = "quality" parameters = "quality"
quality = 1.0 quality = 0.0

View file

@ -37,12 +37,12 @@ frame_count_mod0 = 2
# non-mipmapped version and a large mipmapped version. # non-mipmapped version and a large mipmapped version.
# TODO: Test masks in other directories. # TODO: Test masks in other directories.
textures = "nes_lut;mask_grille_texture_small;mask_grille_texture_large;mask_slot_texture_small;mask_slot_texture_large;mask_shadow_texture_small;mask_shadow_texture_large" textures = "nes_lut;mask_grille_texture_small;mask_grille_texture_large;mask_slot_texture_small;mask_slot_texture_large;mask_shadow_texture_small;mask_shadow_texture_large"
mask_grille_texture_small = "shaders/crt-royale/TileableLinearApertureGrille15Wide8And5d5SpacingResizeTo64.png" mask_grille_texture_small = "../crt/shaders/crt-royale/TileableLinearApertureGrille15Wide8And5d5SpacingResizeTo64.png"
mask_grille_texture_large = "shaders/crt-royale/TileableLinearApertureGrille15Wide8And5d5Spacing.png" mask_grille_texture_large = "../crt/shaders/crt-royale/TileableLinearApertureGrille15Wide8And5d5Spacing.png"
mask_slot_texture_small = "shaders/crt-royale/TileableLinearSlotMaskTall15Wide9And4d5Horizontal9d14VerticalSpacingResizeTo64.png" mask_slot_texture_small = "../crt/shaders/crt-royale/TileableLinearSlotMaskTall15Wide9And4d5Horizontal9d14VerticalSpacingResizeTo64.png"
mask_slot_texture_large = "shaders/crt-royale/TileableLinearSlotMaskTall15Wide9And4d5Horizontal9d14VerticalSpacing.png" mask_slot_texture_large = "../crt/shaders/crt-royale/TileableLinearSlotMaskTall15Wide9And4d5Horizontal9d14VerticalSpacing.png"
mask_shadow_texture_small = "shaders/crt-royale/TileableLinearShadowMaskEDPResizeTo64.png" mask_shadow_texture_small = "../crt/shaders/crt-royale/TileableLinearShadowMaskEDPResizeTo64.png"
mask_shadow_texture_large = "shaders/crt-royale/TileableLinearShadowMaskEDP.png" mask_shadow_texture_large = "../crt/shaders/crt-royale/TileableLinearShadowMaskEDP.png"
mask_grille_texture_small_wrap_mode = "repeat" mask_grille_texture_small_wrap_mode = "repeat"
mask_grille_texture_large_wrap_mode = "repeat" mask_grille_texture_large_wrap_mode = "repeat"
mask_slot_texture_small_wrap_mode = "repeat" mask_slot_texture_small_wrap_mode = "repeat"
@ -65,7 +65,7 @@ mask_shadow_texture_large_mipmap = "true" # Essential for hardware-resized mas
# Pass1: Linearize the input based on CRT gamma and bob interlaced fields. # Pass1: Linearize the input based on CRT gamma and bob interlaced fields.
# (Bobbing ensures we can immediately blur without getting artifacts.) # (Bobbing ensures we can immediately blur without getting artifacts.)
shader1 = "shaders/crt-royale/src/crt-royale-first-pass-linearize-crt-gamma-bob-fields.slang" shader1 = "../crt/shaders/crt-royale/src/crt-royale-first-pass-linearize-crt-gamma-bob-fields.slang"
alias1 = "ORIG_LINEARIZED" alias1 = "ORIG_LINEARIZED"
filter_linear1 = "false" filter_linear1 = "false"
scale_type1 = "source" scale_type1 = "source"
@ -78,7 +78,7 @@ srgb_framebuffer1 = "true"
# it reduces our samples from vertical*horizontal to vertical+horizontal. # it reduces our samples from vertical*horizontal to vertical+horizontal.
# This has to come right after ORIG_LINEARIZED, because there's no # This has to come right after ORIG_LINEARIZED, because there's no
# "original_source" scale_type we can use later. # "original_source" scale_type we can use later.
shader2 = "shaders/crt-royale/src/crt-royale-scanlines-vertical-interlacing.slang" shader2 = "../crt/shaders/crt-royale/src/crt-royale-scanlines-vertical-interlacing.slang"
alias2 = "VERTICAL_SCANLINES" alias2 = "VERTICAL_SCANLINES"
filter_linear2 = "true" filter_linear2 = "true"
scale_type_x2 = "source" scale_type_x2 = "source"
@ -100,7 +100,7 @@ srgb_framebuffer2 = "true"
# may be a good thing for people who like to crank it up). # may be a good thing for people who like to crank it up).
# Note the 4:3 aspect ratio assumes the input has cropped geom_overscan (so it's # Note the 4:3 aspect ratio assumes the input has cropped geom_overscan (so it's
# *intended* for an ~4:3 aspect ratio). # *intended* for an ~4:3 aspect ratio).
shader3 = "shaders/crt-royale/src/crt-royale-bloom-approx.slang" shader3 = "../crt/shaders/crt-royale/src/crt-royale-bloom-approx.slang"
alias3 = "BLOOM_APPROX" alias3 = "BLOOM_APPROX"
filter_linear3 = "true" filter_linear3 = "true"
scale_type3 = "absolute" scale_type3 = "absolute"
@ -160,7 +160,7 @@ srgb_framebuffer5 = "true"
# scale_y6 = 4.0/3.0 * 2.0/(341.33333 / 8.0) = 0.0625 # scale_y6 = 4.0/3.0 * 2.0/(341.33333 / 8.0) = 0.0625
# IMPORTANT: The scales MUST be calculated in this way. If you wish to change # IMPORTANT: The scales MUST be calculated in this way. If you wish to change
# geom_max_aspect_ratio, update that constant in user-cgp-constants.h! # geom_max_aspect_ratio, update that constant in user-cgp-constants.h!
shader6 = "shaders/crt-royale/src/crt-royale-mask-resize-vertical.slang" shader6 = "../crt/shaders/crt-royale/src/crt-royale-mask-resize-vertical.slang"
filter_linear6 = "true" filter_linear6 = "true"
scale_type_x6 = "absolute" scale_type_x6 = "absolute"
scale_x6 = "64" scale_x6 = "64"
@ -170,7 +170,7 @@ scale_y6 = "0.0625" # Safe for >= 341.333 horizontal triads at viewport size
# Pass7: Lanczos-resize the phosphor mask horizontally. scale_x7 = scale_y6. # Pass7: Lanczos-resize the phosphor mask horizontally. scale_x7 = scale_y6.
# TODO: Check again if the shaders actually require equal scales. # TODO: Check again if the shaders actually require equal scales.
shader7 = "shaders/crt-royale/src/crt-royale-mask-resize-horizontal.slang" shader7 = "../crt/shaders/crt-royale/src/crt-royale-mask-resize-horizontal.slang"
alias7 = "MASK_RESIZE" alias7 = "MASK_RESIZE"
filter_linear7 = "false" filter_linear7 = "false"
scale_type_x7 = "viewport" scale_type_x7 = "viewport"
@ -181,7 +181,7 @@ scale_y7 = "1.0"
# Pass8: Resample (misconverged) scanlines horizontally, apply halation, and # Pass8: Resample (misconverged) scanlines horizontally, apply halation, and
# apply the phosphor mask. # apply the phosphor mask.
shader8 = "shaders/crt-royale/src/crt-royale-scanlines-horizontal-apply-mask.slang" shader8 = "../crt/shaders/crt-royale/src/crt-royale-scanlines-horizontal-apply-mask.slang"
alias8 = "MASKED_SCANLINES" alias8 = "MASKED_SCANLINES"
filter_linear8 = "true" # This could just as easily be nearest neighbor. filter_linear8 = "true" # This could just as easily be nearest neighbor.
scale_type8 = "viewport" scale_type8 = "viewport"
@ -190,7 +190,7 @@ scale8 = "1.0"
srgb_framebuffer8 = "true" srgb_framebuffer8 = "true"
# Pass 9: Compute a brightpass. This will require reading the final mask. # Pass 9: Compute a brightpass. This will require reading the final mask.
shader9 = "shaders/crt-royale/src/crt-royale-brightpass.slang" shader9 = "../crt/shaders/crt-royale/src/crt-royale-brightpass.slang"
alias9 = "BRIGHTPASS" alias9 = "BRIGHTPASS"
filter_linear9 = "true" # This could just as easily be nearest neighbor. filter_linear9 = "true" # This could just as easily be nearest neighbor.
scale_type9 = "viewport" scale_type9 = "viewport"
@ -198,21 +198,21 @@ scale9 = "1.0"
srgb_framebuffer9 = "true" srgb_framebuffer9 = "true"
# Pass 10: Blur the brightpass vertically # Pass 10: Blur the brightpass vertically
shader10 = "shaders/crt-royale/src/crt-royale-bloom-vertical.slang" shader10 = "../crt/shaders/crt-royale/src/crt-royale-bloom-vertical.slang"
filter_linear10 = "true" # This could just as easily be nearest neighbor. filter_linear10 = "true" # This could just as easily be nearest neighbor.
scale_type10 = "source" scale_type10 = "source"
scale10 = "1.0" scale10 = "1.0"
srgb_framebuffer10 = "true" srgb_framebuffer10 = "true"
# Pass 11: Blur the brightpass horizontally and combine it with the dimpass: # Pass 11: Blur the brightpass horizontally and combine it with the dimpass:
shader11 = "shaders/crt-royale/src/crt-royale-bloom-horizontal-reconstitute.slang" shader11 = "../crt/shaders/crt-royale/src/crt-royale-bloom-horizontal-reconstitute.slang"
filter_linear11 = "true" filter_linear11 = "true"
scale_type11 = "source" scale_type11 = "source"
scale11 = "1.0" scale11 = "1.0"
srgb_framebuffer11 = "true" srgb_framebuffer11 = "true"
# Pass 12: Compute curvature/AA: # Pass 12: Compute curvature/AA:
shader12 = "shaders/crt-royale/src/crt-royale-geometry-aa-last-pass.slang" shader12 = "../crt/shaders/crt-royale/src/crt-royale-geometry-aa-last-pass.slang"
filter_linear12 = "true" filter_linear12 = "true"
scale_type12 = "viewport" scale_type12 = "viewport"
mipmap_input12 = "true" mipmap_input12 = "true"

View file

@ -15,7 +15,7 @@ scale_y1 = 1.0
filter_linear1 = false filter_linear1 = false
srgb_framebuffer1 = true srgb_framebuffer1 = true
shader2 = shaders/glow/gauss_horiz.slang shader2 = ../crt/shaders/glow/gauss_horiz.slang
filter_linear2 = false filter_linear2 = false
scale_type_x2 = viewport scale_type_x2 = viewport
scale_type_y2 = source scale_type_y2 = source
@ -23,28 +23,31 @@ scale_x2 = 1.0
scale_y2 = 1.0 scale_y2 = 1.0
srgb_framebuffer2 = true srgb_framebuffer2 = true
shader3 = shaders/glow/gauss_vert.slang shader3 = ../crt/shaders/glow/gauss_vert.slang
filter_linear3 = false filter_linear3 = false
scale_type3 = viewport scale_type3 = viewport
scale3 = 1.0 scale3 = 1.0
srgb_framebuffer3 = true srgb_framebuffer3 = true
alias3 = "CRTPass" alias3 = "CRTPass"
shader4 = shaders/glow/threshold.slang shader4 = ../crt/shaders/glow/threshold.slang
filter_linear4 = false filter_linear4 = false
srgb_framebuffer4 = true srgb_framebuffer4 = true
shader5 = shaders/glow/blur_horiz.slang shader5 = ../crt/shaders/glow/blur_horiz.slang
mipmap_input5 = true mipmap_input5 = true
filter_linear5 = true filter_linear5 = true
scale_type5 = source scale_type5 = source
scale5 = 0.25 scale5 = 0.25
srgb_framebuffer5 = true srgb_framebuffer5 = true
shader6 = shaders/glow/blur_vert.slang shader6 = ../crt/shaders/glow/blur_vert.slang
filter_linear6 = true filter_linear6 = true
srgb_framebuffer6 = true srgb_framebuffer6 = true
shader7 = shaders/glow/resolve.slang shader7 = ../crt/shaders/glow/resolve.slang
filter_linear7 = true filter_linear7 = true
parameters = "quality"
quality = 1.0

View file

@ -1,6 +1,6 @@
shaders = 7 shaders = 7
shader0 = ../ntsc/shaders/ntsc-pass1-composite-3phase.slang shader0 = ../ntsc/shaders/ntsc-adaptive/ntsc-pass1.slang
scale_type0 = source scale_type0 = source
filter_linear0 = false filter_linear0 = false
scale_x0 = 4.0 scale_x0 = 4.0
@ -8,7 +8,7 @@ scale_y0 = 1.0
frame_count_mod0 = 2 frame_count_mod0 = 2
float_framebuffer0 = true float_framebuffer0 = true
shader1 = ../ntsc/shaders/ntsc-pass2-3phase.slang shader1 = ../ntsc/shaders/ntsc-adaptive/ntsc-pass2.slang
filter_linear1 = false filter_linear1 = false
scale_type1 = source scale_type1 = source
scale_x1 = 0.5 scale_x1 = 0.5
@ -49,6 +49,7 @@ filter_linear6 = true
parameters = "diffusion;PHOSPHOR_SCALE_X" parameters = "diffusion;PHOSPHOR_SCALE_X"
diffusion = 0.6 diffusion = 0.6
PHOSPHOR_SCALE_X = 4.0 PHOSPHOR_SCALE_X = 4.0
quality = 1.0
textures = "shadow;aperture;slot" textures = "shadow;aperture;slot"
shadow = ../crt/shaders/phosphorlut/luts/shadowmask.png shadow = ../crt/shaders/phosphorlut/luts/shadowmask.png