So when using this shader-set, is there going to be a noticeable difference if you use the width that doesn’t correspond to the games native horizontal res? All my widths are being stretched to 1920 for super-res, for example. Or would the visual distinctions between the two versions only be significant if you were doing true native resolutions on 15Khz?
I’m not an expert, but here’s my experience. Water in Super Mario World has diagonal lines in 240, which is how I remember it as a kid, And the Sonic waterfall effect only happens for 320. From my understanding that’s because these two systems put out video in these respective parameters, with the exception of a few games. Apparently most systems are 240, but some people seem to prefer the 320 shader on just about everything.
Are there any shaders which emulate color banding/dithering? I’ve tried the dither shaders but it’s not quite what I’m looking for. I’m trying to recreate the blockiness/dithering that happens in the VI filter in Parallel N64.
Here’s a slang shader for dithering, based on a nice shadertoy:
#version 450
// based on Jodie's "analytical bayer matrix dither" shadertoy
// https://www.shadertoy.com/view/4ssfWM
layout(push_constant) uniform Push
{
vec4 SourceSize;
vec4 OriginalSize;
vec4 OutputSize;
uint FrameCount;
float color_depth, dither_factor;
} params;
#pragma parameter color_depth "Color Depth (2/4/8/16/32/64/128)" 4.0 1.0 7.0 1.0
#pragma parameter dither_factor "Dither Strength" 0.05 0.0 1.0 0.01
float bayer2(vec2 a){
a = floor(a);
return fract(dot(a,vec2(.5, a.y*.75)));
}
float bayer4(vec2 a) {return bayer2( .5*a) * .25 + bayer2(a); }
float bayer8(vec2 a) {return bayer4( .5*a) * .25 + bayer2(a); }
float bayer16(vec2 a) {return bayer4( .25*a) * .0625 + bayer4(a); }
float bayer32(vec2 a) {return bayer8( .25*a) * .0625 + bayer4(a); }
float bayer64(vec2 a) {return bayer8( .125*a) * .015625 + bayer8(a); }
float bayer128(vec2 a) {return bayer16(.125*a) * .015625 + bayer8(a); }
#define dither2(p) (bayer2( p)-.375 )
#define dither4(p) (bayer4( p)-.46875 )
#define dither8(p) (bayer8( p)-.4921875 )
#define dither16(p) (bayer16( p)-.498046875)
#define dither32(p) (bayer32( p)-.499511719)
#define dither64(p) (bayer64( p)-.49987793 )
#define dither128(p) (bayer128(p)-.499969482)
layout(std140, set = 0, binding = 0) uniform UBO
{
mat4 MVP;
} global;
#pragma stage vertex
layout(location = 0) in vec4 Position;
layout(location = 1) in vec2 TexCoord;
layout(location = 0) out vec2 vTexCoord;
layout(location = 1) out vec2 coord;
void main()
{
gl_Position = global.MVP * Position;
vTexCoord = TexCoord;
coord = vTexCoord * params.SourceSize.xy;
}
#pragma stage fragment
layout(location = 0) in vec2 vTexCoord;
layout(location = 1) in vec2 coord;
layout(location = 0) out vec4 FragColor;
layout(set = 0, binding = 2) uniform sampler2D Source;
void main()
{
int depth = int(params.color_depth);
vec4 dithered;
vec4 res = texture(Source, vTexCoord);
if(depth == 1) dithered.rgb = floor((res.rgb + dither2(coord)) + 0.5);
else if(depth == 2) dithered.rgb = floor((res.rgb + dither4(coord)) + 0.5);
else if(depth == 3) dithered.rgb = floor((res.rgb + dither8(coord)) + 0.5);
else if(depth == 4) dithered.rgb = floor((res.rgb + dither16(coord)) + 0.5);
else if(depth == 5) dithered.rgb = floor((res.rgb + dither32(coord)) + 0.5);
else if(depth == 6) dithered.rgb = floor((res.rgb + dither64(coord)) + 0.5);
else dithered.rgb = floor((res.rgb + dither128(coord)) + 0.5);
FragColor = mix(res, dithered, params.dither_factor);
}
Dunno how accurate it is to N64/PS1 dithering, but it seems fairly close to me. It looks good with NTSC effects on top, IMO.
Thanks to this thread, I found very good shaders for myself - this is S-video Slotmask Sharp preset from @solid12345 Analog Shader Pack 3.
But there is one thing that I would like to remove - this is a simulation of moire or something like that. In PlayStation games, it doesn’t bother much, but for the NES, it directly cuts my eyes.
Can anyone tell me how to remove this effect? I tried to change the settings for this preset, but with no result. Perhaps this is a separate shader without settings, but which one?
I’m pretty sure you have to either turn off the curvature or add some kind of noise to it.
If I set the curvature to 0 in the parameters, then the strips remain, but just become vertically even. And about the noise, I did not understand, I’m sorry. I do not really understand these shaders, I can only change something in the settings.
They look amazing. Can you share shader settings please?
Thanks. It’s interesting how good CBOD deals with deathering. I had to lower “Mask triad side” to 4 as 6 is just to high for 1080p screen.
Also I like the idea of Halation and Diffusion to make color to bleed. But it seems it doesn’t work well in this shaders chain as the aura you got from those settings is just to visible and harsh even with lowest values.
I managed to make diffusion and halation work with CBOD! Look at this https://pasteboard.co/IpREq4r.png
Do not hesitate to reduce the size of the mask according to your screen.
New version link : https://filebin.net/mq88mghb9qmieddo
Edit: new version black levels fixed
I used mdapt instead of cbod because I could not configure user-settings.h as my slang version, but in the end it’s even better than my old version!
Screenshot: https://pasteboard.co/Iq0HJFl.png
shaders = "17"
shader0 = "shaders_glsl\dithering\shaders\mdapt\passes\mdapt-pass0.glsl"
filter_linear0 = "false"
wrap_mode0 = "clamp_to_border"
mipmap_input0 = "false"
alias0 = ""
float_framebuffer0 = "false"
srgb_framebuffer0 = "false"
scale_type_x0 = "source"
scale_x0 = "1.000000"
scale_type_y0 = "source"
scale_y0 = "1.000000"
shader1 = "shaders_glsl\dithering\shaders\mdapt\passes\mdapt-pass1.glsl"
filter_linear1 = "false"
wrap_mode1 = "clamp_to_border"
mipmap_input1 = "false"
alias1 = ""
float_framebuffer1 = "false"
srgb_framebuffer1 = "false"
scale_type_x1 = "source"
scale_x1 = "1.000000"
scale_type_y1 = "source"
scale_y1 = "1.000000"
shader2 = "shaders_glsl\dithering\shaders\mdapt\passes\mdapt-pass2.glsl"
filter_linear2 = "false"
wrap_mode2 = "clamp_to_border"
mipmap_input2 = "false"
alias2 = ""
float_framebuffer2 = "false"
srgb_framebuffer2 = "false"
scale_type_x2 = "source"
scale_x2 = "1.000000"
scale_type_y2 = "source"
scale_y2 = "1.000000"
shader3 = "shaders_glsl\dithering\shaders\mdapt\passes\mdapt-pass3.glsl"
filter_linear3 = "false"
wrap_mode3 = "clamp_to_border"
mipmap_input3 = "false"
alias3 = ""
float_framebuffer3 = "false"
srgb_framebuffer3 = "false"
scale_type_x3 = "source"
scale_x3 = "1.000000"
scale_type_y3 = "source"
scale_y3 = "1.000000"
shader4 = "shaders_glsl\dithering\shaders\mdapt\passes\mdapt-pass4.glsl"
filter_linear4 = "false"
wrap_mode4 = "clamp_to_border"
mipmap_input4 = "false"
alias4 = ""
float_framebuffer4 = "false"
srgb_framebuffer4 = "false"
scale_type_x4 = "source"
scale_x4 = "1.000000"
scale_type_y4 = "source"
scale_y4 = "1.000000"
shader5 = "shaders_glsl\crt\shaders\crt-royale\src\crt-royale-first-pass-linearize-crt-gamma-bob-fields.glsl"
filter_linear5 = "false"
wrap_mode5 = "clamp_to_border"
mipmap_input5 = "false"
alias5 = "ORIG_LINEARIZED"
float_framebuffer5 = "false"
srgb_framebuffer5 = "true"
scale_type_x5 = "source"
scale_x5 = "1.000000"
scale_type_y5 = "source"
scale_y5 = "1.000000"
shader6 = "shaders_glsl\crt\shaders\crt-royale\src\crt-royale-scanlines-vertical-interlacing.glsl"
filter_linear6 = "true"
wrap_mode6 = "clamp_to_border"
mipmap_input6 = "false"
alias6 = "VERTICAL_SCANLINES"
float_framebuffer6 = "false"
srgb_framebuffer6 = "true"
scale_type_x6 = "source"
scale_x6 = "1.000000"
scale_type_y6 = "viewport"
scale_y6 = "1.000000"
shader7 = "shaders_glsl\crt\shaders\crt-royale\src\crt-royale-bloom-approx.glsl"
filter_linear7 = "true"
wrap_mode7 = "clamp_to_border"
mipmap_input7 = "false"
alias7 = "BLOOM_APPROX"
float_framebuffer7 = "false"
srgb_framebuffer7 = "true"
scale_type_x7 = "absolute"
scale_x7 = "320"
scale_type_y7 = "absolute"
scale_y7 = "240"
shader8 = "shaders_glsl\blurs\blur5fast-vertical.glsl"
filter_linear8 = "true"
wrap_mode8 = "clamp_to_border"
mipmap_input8 = "false"
alias8 = ""
float_framebuffer8 = "false"
srgb_framebuffer8 = "true"
scale_type_x8 = "source"
scale_x8 = "1.000000"
scale_type_y8 = "source"
scale_y8 = "1.000000"
shader9 = "shaders_glsl\blurs\blur5fast-horizontal.glsl"
filter_linear9 = "true"
wrap_mode9 = "clamp_to_border"
mipmap_input9 = "false"
alias9 = "HALATION_BLUR"
float_framebuffer9 = "false"
srgb_framebuffer9 = "true"
scale_type_x9 = "source"
scale_x9 = "1.000000"
scale_type_y9 = "source"
scale_y9 = "1.000000"
shader10 = "shaders_glsl\crt\shaders\crt-royale\src\crt-royale-mask-resize-vertical.glsl"
filter_linear10 = "true"
wrap_mode10 = "clamp_to_border"
mipmap_input10 = "false"
alias10 = ""
float_framebuffer10 = "false"
srgb_framebuffer10 = "false"
scale_type_x10 = "absolute"
scale_x10 = "64"
scale_type_y10 = "viewport"
scale_y10 = "0.062500"
shader11 = "shaders_glsl\crt\shaders\crt-royale\src\crt-royale-mask-resize-horizontal.glsl"
filter_linear11 = "false"
wrap_mode11 = "clamp_to_border"
mipmap_input11 = "false"
alias11 = "MASK_RESIZE"
float_framebuffer11 = "false"
srgb_framebuffer11 = "false"
scale_type_x11 = "viewport"
scale_x11 = "0.062500"
scale_type_y11 = "source"
scale_y11 = "1.000000"
shader12 = "shaders_glsl\crt\shaders\crt-royale\src\crt-royale-scanlines-horizontal-apply-mask.glsl"
filter_linear12 = "true"
wrap_mode12 = "clamp_to_border"
mipmap_input12 = "false"
alias12 = "MASKED_SCANLINES"
float_framebuffer12 = "false"
srgb_framebuffer12 = "true"
scale_type_x12 = "viewport"
scale_x12 = "1.000000"
scale_type_y12 = "viewport"
scale_y12 = "1.000000"
shader13 = "shaders_glsl\crt\shaders\crt-royale\src\crt-royale-brightpass.glsl"
filter_linear13 = "true"
wrap_mode13 = "clamp_to_border"
mipmap_input13 = "false"
alias13 = "BRIGHTPASS"
float_framebuffer13 = "false"
srgb_framebuffer13 = "true"
scale_type_x13 = "viewport"
scale_x13 = "1.000000"
scale_type_y13 = "viewport"
scale_y13 = "1.000000"
shader14 = "shaders_glsl\crt\shaders\crt-royale\src\crt-royale-bloom-vertical.glsl"
filter_linear14 = "true"
wrap_mode14 = "clamp_to_border"
mipmap_input14 = "false"
alias14 = ""
float_framebuffer14 = "false"
srgb_framebuffer14 = "true"
scale_type_x14 = "source"
scale_x14 = "1.000000"
scale_type_y14 = "source"
scale_y14 = "1.000000"
shader15 = "shaders_glsl\crt\shaders\crt-royale\src\crt-royale-bloom-horizontal-reconstitute.glsl"
filter_linear15 = "true"
wrap_mode15 = "clamp_to_border"
mipmap_input15 = "false"
alias15 = ""
float_framebuffer15 = "false"
srgb_framebuffer15 = "true"
scale_type_x15 = "source"
scale_x15 = "1.000000"
scale_type_y15 = "source"
scale_y15 = "1.000000"
shader16 = "shaders_glsl\crt\shaders\crt-royale\src\crt-royale-geometry-aa-last-pass.glsl"
filter_linear16 = "true"
wrap_mode16 = "clamp_to_border"
mipmap_input16 = "true"
alias16 = ""
float_framebuffer16 = "false"
srgb_framebuffer16 = "false"
scale_type_x16 = "viewport"
scale_x16 = "1.000000"
scale_type_y16 = "viewport"
scale_y16 = "1.000000"
parameters = "MODE;PWR;VL_LO;VL_HI;CB_LO;CB_HI;VL;CB;DEBUG;linear_gamma;crt_gamma;lcd_gamma;levels_contrast;halation_weight;diffusion_weight;bloom_underestimate_levels;bloom_excess;beam_min_sigma;beam_max_sigma;beam_spot_power;beam_min_shape;beam_max_shape;beam_shape_power;beam_horiz_filter;beam_horiz_sigma;beam_horiz_linear_rgb_weight;convergence_offset_x_r;convergence_offset_x_g;convergence_offset_x_b;convergence_offset_y_r;convergence_offset_y_g;convergence_offset_y_b;mask_type;mask_sample_mode_desired;mask_specify_num_triads;mask_triad_size_desired;mask_num_triads_desired;aa_subpixel_r_offset_y_runtime;aa_cubic_c;aa_gauss_sigma;geom_mode_runtime;geom_radius;geom_view_dist;geom_tilt_angle_x;geom_tilt_angle_y;geom_aspect_ratio_x;geom_aspect_ratio_y;geom_overscan_x;geom_overscan_y;border_size;border_darkness;border_compress;interlace_bff;interlace_1080i"
MODE = "0.000000"
PWR = "2.000000"
VL_LO = "6.749987"
VL_HI = "6.749989"
CB_LO = "15.100134"
CB_HI = "15.100134"
VL = "1.000000"
CB = "1.000000"
DEBUG = "0.000000"
linear_gamma = "0.000000"
crt_gamma = "2.475000"
lcd_gamma = "2.200000"
levels_contrast = "1.000000"
halation_weight = "0.000000"
diffusion_weight = "0.000000"
bloom_underestimate_levels = "0.800000"
bloom_excess = "0.000000"
beam_min_sigma = "0.005000"
beam_max_sigma = "0.300000"
beam_spot_power = "0.230000"
beam_min_shape = "2.000000"
beam_max_shape = "2.000000"
beam_shape_power = "0.010000"
beam_horiz_filter = "1.000000"
beam_horiz_sigma = "0.450000"
beam_horiz_linear_rgb_weight = "1.000000"
convergence_offset_x_r = "0.000000"
convergence_offset_x_g = "0.000000"
convergence_offset_x_b = "0.000000"
convergence_offset_y_r = "0.000000"
convergence_offset_y_g = "0.000000"
convergence_offset_y_b = "0.000000"
mask_type = "0.000000"
mask_sample_mode_desired = "0.000000"
mask_specify_num_triads = "0.000000"
mask_triad_size_desired = "3.000000"
mask_num_triads_desired = "480.000000"
aa_subpixel_r_offset_y_runtime = "0.000000"
aa_cubic_c = "0.500000"
aa_gauss_sigma = "0.500000"
geom_mode_runtime = "0.000000"
geom_radius = "2.000000"
geom_view_dist = "2.000000"
geom_tilt_angle_x = "0.000000"
geom_tilt_angle_y = "0.000000"
geom_aspect_ratio_x = "432.000000"
geom_aspect_ratio_y = "329.000000"
geom_overscan_x = "1.000000"
geom_overscan_y = "1.000000"
border_size = "0.015000"
border_darkness = "0.000000"
border_compress = "1.000000"
interlace_bff = "0.000000"
interlace_1080i = "0.000000"
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 = "D:\RetroArch\shaders\shaders_glsl\crt\shaders\crt-royale\TileableLinearApertureGrille15Wide8And5d5SpacingResizeTo64.png"
mask_grille_texture_small_linear = "true"
mask_grille_texture_small_wrap_mode = "repeat"
mask_grille_texture_small_mipmap = "false"
mask_grille_texture_large = "D:\RetroArch\shaders\shaders_glsl\crt\shaders\crt-royale\TileableLinearApertureGrille15Wide8And5d5Spacing.png"
mask_grille_texture_large_linear = "true"
mask_grille_texture_large_wrap_mode = "repeat"
mask_grille_texture_large_mipmap = "true"
mask_slot_texture_small = "D:\RetroArch\shaders\shaders_glsl\crt\shaders\crt-royale\TileableLinearSlotMaskTall15Wide9And4d5Horizontal9d14VerticalSpacingResizeTo64.png"
mask_slot_texture_small_linear = "true"
mask_slot_texture_small_wrap_mode = "repeat"
mask_slot_texture_small_mipmap = "false"
mask_slot_texture_large = "D:\RetroArch\shaders\shaders_glsl\crt\shaders\crt-royale\TileableLinearSlotMaskTall15Wide9And4d5Horizontal9d14VerticalSpacing.png"
mask_slot_texture_large_linear = "true"
mask_slot_texture_large_wrap_mode = "repeat"
mask_slot_texture_large_mipmap = "true"
mask_shadow_texture_small = "D:\RetroArch\shaders\shaders_glsl\crt\shaders\crt-royale\TileableLinearShadowMaskEDPResizeTo64.png"
mask_shadow_texture_small_linear = "true"
mask_shadow_texture_small_wrap_mode = "repeat"
mask_shadow_texture_small_mipmap = "false"
mask_shadow_texture_large = "D:\RetroArch\shaders\shaders_glsl\crt\shaders\crt-royale\TileableLinearShadowMaskEDP.png"
mask_shadow_texture_large_linear = "true"
mask_shadow_texture_large_wrap_mode = "repeat"
mask_shadow_texture_large_mipmap = "true"
colors in CBOD shader are too off. The picture looks dull and desaturated coprate to the others.
Unfortunately we cannot configure the settings of cbod but I realized that mdapt does a better job and there are a lot of useful parameters. I made this preset in slang, tell me if it’s better on your 1080p screen. If it’s too blurry reduce horiz_sigma. Transparency effects are intact on genesis games but without using composite!
Screen: https://pasteboard.co/Iqfgdlc.png
Presets: https://gofile.io/?c=w1RNtv
Hi guys, there are crt shaders that looks good at 1366x768? I tried some but they look awful on my laptop screen. Are they for 1080p only?
most mask effects look pretty poor at less than 1080p. I think your best bet would be to use bare scanlines or just turn off the mask of a normal CRT shader.
You need to tweak them (no problem from the gui), I’ve used some simple shaders like zfast with a weak 1280x800 laptop. I’ve also used more advanced shaders on 1360x768 TVs, and to me they can look very good. Each display is a little different though, viewing distance, size, whatever matter also.
Been trying out the crt-potato shader that was recommended a while back on this thread; it runs like a charm, but looks distinctly artificial compared to the other shaders I’ve seen here. I’m kinda wondering if there’s a shader preset that’s both light on power and visually accurate (or if it’s even possible for one to exist at all), given that the most accurate presets here don’t agree very well with my Surface Pro.
There’s definitely a tradeoff between complexity and requirements. Crt-potato, crt-pi and zfast-crt are the best-looking lightweight CRT shaders.