Soccer Games - Flicker - NTSC Shader

With ntsc-256 or ntsc-320 shader the field flickers a lot in some soccer games (16-bit).

Is there a solution even while maintaining the same shader?

With gtuv50 this doesn’t happen.

How I setup gtuv50 for 256 and 320 composite output?

Thanks!

I think gtuv50 defaults to 256, but you could turn it up to 320. For composite there should be a toggle. Then you just have to dial the color levels. I’m interested in what the ideal color levels are though. I think the default levels are pretty dimmed.

This is just my impression from playing around with the settings though. I’m still unsure of the finer points like its vertical resolution setting.

I’m still trying to understand how to replicate composite myself.

1 Like

Unfortunately, gtuv50 can’t be used with crt-geom… :pensive:

@lfan

No, just replace pass3 of gtuv50 with crt-geom. That’s what I do. Better yet go to shader directory “presets” or “cgp” and look for “tv out + interlacing” and find the gtuv50 + interlacing and replace interlacing with geom since that presets also adds image-adjustment shader for extra tweaking.

Sure you lose some of gtuv50’s settings like “vertical resolution” and the scanline toggle but you don’t care about any of that since you will use geom. You just want the blending and maybe color.

For a composite look I turn on the color toggle and adjust the horizontal (bandwidth) blending down to 176 or 192 or 208 depending on how much blur I’m willing to tolerate vs how much dithering or flickering I’m trying to hide.

2 Likes

I have to ask; what’s the name of that game? :slight_smile:

@hackneyed

Tested and approved, but… I prefer the ntsc-256 and 320.

gtuv50 + image-adjustment + crt-geom

Shader Passes: 4

gtuv50

Shader #0: pass1.glsl
Shader #0 Filter: Don't care
Shader #0 Scale: 1x
Shader #1: pass2.glsl
Shader #1 Filter: Nearest
Shader #1 Scale: 1x

image-adjustment

Shader #2: image-adjustment.glsl
Shader #2 Filter: Don't care
Shader #2 Scale: Don't care

crt-geom

Shader #3: crt-geom.glsl
Shader #3 Filter: Don't care
Shader #3 Scale: Don't care

Shader Parameters

gtuv50

Composite Connection Enable: 1.00
Signal Resolution Y: 320

image-adjustment

Black Level: -0.02

crt-geom

CRTGeom Monitor Gamma: 2.40
CRTGeom Corner Size: 0.00

Thanks!

:grinning:

@Kondorito

World Championship Soccer II for Sega Genesis. The game isn’t so good. Fifa and Head-On Soccer are much better.

2 Likes

Does this shadow effect seems correct???

Mortal%20Kombat

@lfan

I’m no expert but I find gtuv50’s color smear consistent with ntsc-320px. If you want a lesser color smear similar to ntsc-256px you can adjust signal resolution Q up from 25 to about 63.

If you want to try ntsc-256px/320px again you can load it’s preset and keep the first two passes replacing the rest with image-adjustment and crt-geom. I’ve experimented with adding gtuv50 pass2 (the one that dose the blending) after the two ntsc passes but before image-adjustment etc. It might help with the flickering without adding too much blurring if you keep the blending set to 256 or higher. Without pass1 gtuv50’s color smear is broken so leave it off and let ntsc shader do the work.

EDIT. Nevermind I had a moment to test the game and I see what you mean about the flickering. It’s really bad. Even though the game runs at 320px it looks better using ntsc-256px but still not great. I like the ntsc shader without the numbers since it adds some noise but things don’t seem to flicker or look too odd. Unfortunately the regular ntsc shader without the numbers doesn’t blend dithering and things.

This is why I started to settle on gtuv50. It’s blurry but still looks good and works regardless of game and resolution as far as I’ve tested.

EDIT2 I dug in my backup testing folder and found these presets you could try. Sorry the text is all in alphabetical order but Retroarch started saving shader presets this way after 1.7.5. For ntsc-320px just change scale_x0 from 1024 to 1280 and shader0 and shader1 from 3phase to 2phase. I’m using crt-aperture but you can experiment. I think I cleaned up the paths well enough.

This one uses ntsc-256 for blending along with ntsc-colors and bob-and-ghost-deinterlacing for 480i content.

ztv-ntsc-256px.glslp

alias0 = ""
alias1 = ""
alias2 = ""
alias3 = ""
alias4 = ""
alias5 = ""
alias6 = ""
alias7 = ""
BRIGHTNESS = "1.500000"
compositeConnection = "1.000000"
filter_linear0 = "false"
filter_linear1 = "false"
filter_linear2 = "false"
filter_linear6 = "true"
filter_linear7 = "false"
float_framebuffer0 = "true"
float_framebuffer1 = "false"
float_framebuffer2 = "false"
float_framebuffer3 = "false"
float_framebuffer4 = "false"
float_framebuffer5 = "false"
float_framebuffer6 = "false"
float_framebuffer7 = "false"
frame_count_mod0 = "2"
GAMMA_INPUT = "2.400000"
GAMMA_OUTPUT = "2.400000"
GLOW_DIFFUSION = "0.250000"
GLOW_HALATION = "0.100000"
GLOW_HEIGHT = "0.500000"
GLOW_WIDTH = "0.500000"
ia_B = "1.000000"
ia_black_level = "0.000000"
ia_BOTMASK = "0.000000"
ia_bright_boost = "0.000000"
ia_contrast = "1.000000"
ia_FLIP_HORZ = "0.000000"
ia_FLIP_VERT = "0.000000"
ia_G = "1.000000"
ia_GRAIN_STR = "0.000000"
ia_LMASK = "0.000000"
ia_luminance = "1.000000"
ia_monitor_gamma = "2.200000"
ia_overscan_percent_x = "0.000000"
ia_overscan_percent_y = "0.000000"
ia_R = "1.000000"
ia_RMASK = "0.000000"
ia_saturation = "1.000000"
ia_SHARPEN = "0.000000"
ia_target_gamma = "2.200000"
ia_TOPMASK = "0.000000"
ia_XPOS = "0.000000"
ia_YPOS = "0.000000"
ia_ZOOM = "1.000000"
intensity = "1.000000"
MASK_COLORS = "2.000000"
MASK_SIZE = "1.000000"
MASK_STRENGTH = "0.500000"
mipmap_input0 = "false"
mipmap_input1 = "false"
mipmap_input2 = "false"
mipmap_input3 = "false"
mipmap_input4 = "false"
mipmap_input5 = "false"
mipmap_input6 = "false"
mipmap_input7 = "false"
parameters = "compositeConnection;signalResolution;signalResolutionI;signalResolutionQ;intensity;ia_target_gamma;ia_monitor_gamma;ia_overscan_percent_x;ia_overscan_percent_y;ia_saturation;ia_contrast;ia_luminance;ia_black_level;ia_bright_boost;ia_R;ia_G;ia_B;ia_ZOOM;ia_XPOS;ia_YPOS;ia_TOPMASK;ia_BOTMASK;ia_LMASK;ia_RMASK;ia_GRAIN_STR;ia_SHARPEN;ia_FLIP_HORZ;ia_FLIP_VERT;SHARPNESS_IMAGE;SHARPNESS_EDGES;GLOW_WIDTH;GLOW_HEIGHT;GLOW_HALATION;GLOW_DIFFUSION;MASK_COLORS;MASK_STRENGTH;MASK_SIZE;SCANLINE_SIZE_MIN;SCANLINE_SIZE_MAX;GAMMA_INPUT;GAMMA_OUTPUT;BRIGHTNESS"
scale_type_x0 = "absolute"
scale_type_x1 = "source"
scale_type_x3 = "source"
scale_type_x4 = "source"
scale_type_y0 = "source"
scale_type_y1 = "source"
scale_type_y3 = "source"
scale_type_y4 = "source"
scale_x0 = "1024"
scale_x1 = "0.500000"
scale_x3 = "1.000000"
scale_x4 = "1.000000"
scale_y0 = "1.000000"
scale_y1 = "1.000000"
scale_y3 = "1.000000"
scale_y4 = "1.000000"
SCANLINE_SIZE_MAX = "1.000000"
SCANLINE_SIZE_MIN = "1.000000"
shader0 = "./shaders_glsl/ntsc/shaders/ntsc-pass1-composite-3phase.glsl"
shader1 = "./shaders_glsl/ntsc/shaders/ntsc-pass2-3phase.glsl"
shader2 = "./shaders_glsl/misc/bob-and-ghost-deinterlacing.glsl"
shader3 = "./shaders_glsl/misc/ntsc-colors.glsl"
shader4 = "./shaders_glsl/misc/image-adjustment.glsl"
shader5 = "./shaders_glsl/crt/shaders/crt-aperture.glsl"
shaders = "6"
SHARPNESS_EDGES = "1.000000"
SHARPNESS_IMAGE = "1.000000"
signalResolution = "176.000000"
signalResolutionI = "83.000000"
signalResolutionQ = "63.000000"
srgb_framebuffer0 = "false"
srgb_framebuffer1 = "false"
srgb_framebuffer2 = "false"
srgb_framebuffer3 = "false"
srgb_framebuffer4 = "false"
srgb_framebuffer5 = "false"
srgb_framebuffer6 = "false"
srgb_framebuffer7 = "false"
wrap_mode0 = "clamp_to_border"
wrap_mode1 = "clamp_to_border"
wrap_mode2 = "clamp_to_border"
wrap_mode3 = "clamp_to_border"
wrap_mode4 = "clamp_to_border"
wrap_mode5 = "clamp_to_border"
wrap_mode6 = "clamp_to_border"
wrap_mode7 = "clamp_to_border"

Also you could try this one. It uses some of crt-sim for a bit of noise and gtuv50 for blending along with ntsc-colors and bob-and-ghost-deinterlacing for 480i content. It kinda passes the NES ntsc-crosstalk.nes rom and runs well on my system and works for the few games and resolutions i’ve tested where as ntsc-256px/320px had odd errors.

ztv-sim-cart40.glslp

alias0 = ""
alias1 = "CRTPASS"
alias10 = ""
alias2 = ""
alias3 = ""
alias4 = ""
alias5 = ""
alias6 = ""
alias7 = ""
alias8 = ""
alias9 = ""
animate_artifacts = "1.000000"
bloom_scale_down = "0.004000"
bloom_scale_up = "0.004000"
BloomPower = "1.000000"
BloomScalar = "0.050000"
BRIGHTNESS = "1.500000"
compositeConnection = "1.000000"
CRTMask_Scale = "0.250000"
filter_linear0 = "false"
filter_linear2 = "true"
filter_linear3 = "true"
filter_linear4 = "true"
float_framebuffer0 = "false"
float_framebuffer1 = "false"
float_framebuffer10 = "false"
float_framebuffer2 = "false"
float_framebuffer3 = "false"
float_framebuffer4 = "false"
float_framebuffer5 = "true"
float_framebuffer6 = "false"
float_framebuffer7 = "false"
float_framebuffer8 = "false"
float_framebuffer9 = "false"
GAMMA_INPUT = "2.400000"
GAMMA_OUTPUT = "2.400000"
GLOW_DIFFUSION = "0.250000"
GLOW_HALATION = "0.100000"
GLOW_HEIGHT = "0.500000"
GLOW_WIDTH = "0.500000"
ia_B = "1.000000"
ia_black_level = "0.000000"
ia_BOTMASK = "0.000000"
ia_bright_boost = "0.000000"
ia_contrast = "1.000000"
ia_FLIP_HORZ = "0.000000"
ia_FLIP_VERT = "0.000000"
ia_G = "1.000000"
ia_GRAIN_STR = "0.000000"
ia_LMASK = "0.000000"
ia_luminance = "1.000000"
ia_monitor_gamma = "2.200000"
ia_overscan_percent_x = "0.000000"
ia_overscan_percent_y = "0.000000"
ia_R = "1.000000"
ia_RMASK = "0.000000"
ia_saturation = "1.000000"
ia_SHARPEN = "0.000000"
ia_target_gamma = "2.200000"
ia_TOPMASK = "0.000000"
ia_XPOS = "0.000000"
ia_YPOS = "0.000000"
ia_ZOOM = "1.000000"
intensity = "1.000000"
MASK_COLORS = "2.000000"
MASK_SIZE = "1.000000"
MASK_STRENGTH = "0.500000"
mask_toggle = "0.000000"
mipmap_input0 = "false"
mipmap_input1 = "false"
mipmap_input10 = "false"
mipmap_input2 = "false"
mipmap_input3 = "false"
mipmap_input4 = "false"
mipmap_input5 = "false"
mipmap_input6 = "false"
mipmap_input7 = "false"
mipmap_input8 = "false"
mipmap_input9 = "false"
NTSCArtifactSampler = "./shaders_glsl/crt/shaders/crtsim/artifacts.png"
NTSCArtifactSampler_linear = "true"
NTSCArtifactSampler_mipmap = "false"
NTSCArtifactSampler_wrap_mode = "clamp_to_border"
NTSCArtifactScale = "255.000000"
NTSCLerp = "1.000000"
parameters = "Tuning_Sharp;Tuning_Persistence_R;Tuning_Persistence_G;Tuning_Persistence_B;Tuning_Bleed;Tuning_Artifacts;NTSCLerp;NTSCArtifactScale;animate_artifacts;bloom_scale_down;bloom_scale_up;BloomPower;BloomScalar;CRTMask_Scale;Tuning_Satur;Tuning_Mask_Brightness;Tuning_Mask_Opacity;mask_toggle;compositeConnection;signalResolution;signalResolutionI;signalResolutionQ;intensity;ia_target_gamma;ia_monitor_gamma;ia_overscan_percent_x;ia_overscan_percent_y;ia_saturation;ia_contrast;ia_luminance;ia_black_level;ia_bright_boost;ia_R;ia_G;ia_B;ia_ZOOM;ia_XPOS;ia_YPOS;ia_TOPMASK;ia_BOTMASK;ia_LMASK;ia_RMASK;ia_GRAIN_STR;ia_SHARPEN;ia_FLIP_HORZ;ia_FLIP_VERT;SHARPNESS_IMAGE;SHARPNESS_EDGES;GLOW_WIDTH;GLOW_HEIGHT;GLOW_HALATION;GLOW_DIFFUSION;MASK_COLORS;MASK_STRENGTH;MASK_SIZE;SCANLINE_SIZE_MIN;SCANLINE_SIZE_MAX;GAMMA_INPUT;GAMMA_OUTPUT;BRIGHTNESS"
scale_type_x5 = "source"
scale_type_x6 = "viewport"
scale_type_y5 = "source"
scale_type_y6 = "source"
scale_x5 = "1.000000"
scale_x6 = "1.000000"
scale_y5 = "1.000000"
scale_y6 = "1.000000"
SCANLINE_SIZE_MAX = "1.500000"
SCANLINE_SIZE_MIN = "1.000000"
shader0 = "./shaders_glsl/crt/shaders/crtsim/composite.glsl"
shader1 = "./shaders_glsl/stock.glsl"
shader10 = "./shaders_glsl/crt/shaders/crt-aperture.glsl"
shader2 = "./shaders_glsl/crt/shaders/crtsim/post-downsample.glsl"
shader3 = "./shaders_glsl/crt/shaders/crtsim/post-upsample.glsl"
shader4 = "./shaders_glsl/crt/shaders/crtsim/present.glsl"
shader5 = "./shaders_glsl/crt/shaders/gtu-v050/pass1.glsl"
shader6 = "./shaders_glsl/crt/shaders/gtu-v050/pass2.glsl"
shader7 = "./shaders_glsl/misc/bob-and-ghost-deinterlacing.glsl"
shader8 = "./shaders_glsl/misc/ntsc-colors.glsl"
shader9 = "./shaders_glsl/misc/image-adjustment.glsl"
shaders = "11"
shadowMaskSampler = "./shaders_glsl/crt/shaders/crtsim/mask.png"
shadowMaskSampler_linear = "true"
shadowMaskSampler_mipmap = "false"
shadowMaskSampler_wrap_mode = "clamp_to_border"
SHARPNESS_EDGES = "3.000000"
SHARPNESS_IMAGE = "1.000000"
signalResolution = "192.000000"
signalResolutionI = "83.000000"
signalResolutionQ = "63.000000"
srgb_framebuffer0 = "false"
srgb_framebuffer1 = "false"
srgb_framebuffer10 = "false"
srgb_framebuffer2 = "false"
srgb_framebuffer3 = "false"
srgb_framebuffer4 = "false"
srgb_framebuffer5 = "false"
srgb_framebuffer6 = "false"
srgb_framebuffer7 = "false"
srgb_framebuffer8 = "false"
srgb_framebuffer9 = "false"
textures = "NTSCArtifactSampler;shadowMaskSampler"
Tuning_Artifacts = "0.400000"
Tuning_Bleed = "0.500000"
Tuning_Mask_Brightness = "0.500000"
Tuning_Mask_Opacity = "0.300000"
Tuning_Persistence_B = "0.000000"
Tuning_Persistence_G = "0.000000"
Tuning_Persistence_R = "0.000000"
Tuning_Satur = "1.000000"
Tuning_Sharp = "0.000000"
wrap_mode0 = "clamp_to_border"
wrap_mode1 = "clamp_to_border"
wrap_mode10 = "clamp_to_border"
wrap_mode2 = "clamp_to_border"
wrap_mode3 = "clamp_to_border"
wrap_mode4 = "clamp_to_border"
wrap_mode5 = "clamp_to_border"
wrap_mode6 = "clamp_to_border"
wrap_mode7 = "clamp_to_border"
wrap_mode8 = "clamp_to_border"
wrap_mode9 = "clamp_to_border"

EDIT3 I’m on linux so if you are on Windows you might have to change / in the path to \ and of course anything else related to your shader directory.

@hackneyed

Thanks for your detailed answer!

I’ll do some testing and then I’ll post my preference.

What is the benefit of using the bob-and-ghost-deinterlacing shader?

@lfan

I use bob-and-ghost-deinterlacing to handle the occasional 480i content. Most crt shaders don’t handle de-interlacing by themselves so I added that for those shaders.

Play some Tekken 3 on beetle psx software core without a shader or with crt-aperture and you’ll see ugly “saw tooth” interlacing when characters move. Pause emulation by pressing p on your keyboard mid kick for a good look.

Crt-geom and bob-deinterlacing shaders fix it by alternating each line (and blank line) every frame like a crt tv would but without the persistent phosphorus glow from a real crt it creates a strong flickering effect on my Panasonic plasma tv. Check with the p key again running bob-deinterlacing in the misc folder or crt-geom.

bob-and-ghost-deinterlacing basically blends each frame instead of alternating each line so it creates a stable non-flickering image with a slightly transparent ghost of the previous frame every frame. Hardly noticeable in motion but you can see it by pausing emulation again with the p key.

I apologise if you already knew most of this just I’ve spent a while learning all this while looking for a shader or combination that blends dithering, has glow and handles interlacing. Unfortunately most shaders with glow use some blurring passes to create the glow and the horizontal glow gets destroyed when I throw gtuv50’s horizontal blending into the mix. I’ve settled on crt-aperture since it has a bit of glow to brighten up the image without being affected by gtuv50.

All that was left for me was some de-interlacing plus ntsc color and from crt-sim some ntsc crosstalk artifacts and I’m pretty happy with the results in all the games I’ve tested.

@hackneyed

With your excellent explanation, now I know the good use for bob-and-ghost-deinterlacing.

I saw yours shaders presets and did mine.

Mesen with bisqwit custom palette:

ntsc-256px + pass2 (gtuv50)

ntsc-256px + pass2 (gtuv50) + ntsc-colors + image-adjustment

Shader Parameters

Signal Resolution Y: 256
NTSC Intensity: 0.50
Saturation: 0.90
Black Level: -0.02

ntsc-256px + pass2 (gtuv50) + ntsc-colors + image-adjustment + crt-geom

Shader Parameters

Signal Resolution Y: 256
NTSC Intensity: 0.50
Saturation: 0.90
Black Level: -0.02
CRTGeom Monitor Gamma: 2.40
CRTGeom Corner Size: 0.00

Thanks.

1 Like

@lfan

Nice! You’re welcome. I spend a lot of time tinkering so I’m happy to share.

Just a final note about pass2.glsl. I was recommending it to try and remove the flicker because I had used it with the non numbers ntsc shader to try and get some blending back. Although ntsc-256px already does blending I think pass2 will help the pipes in Sonic 2 Chemical Plant Zone look less odd using 256px blending.

1 Like