SGENPT-MIX - Sega Genesis Pseudo Transparency Mixer shader

Hello retrogamers,

I’ve been working on a shader to specifically process those strange vertical lines (sometimes checkerboard patterns) used in sega genesis games to produce what’s called “pseudo transparencies”.

As you know, there are already many solutions available, from ntsc composite and GTU shaders to advanced ones like gdapt/mdapt. It’s very hard to produce a perfect solution, so it’s good to have options. Each one of the solutions have its pros and cons. Some of them can degrade or blurry the image too much and others can be sharp as you want, though it may present stray pixels more easily.

Then, what’s new in SGENPT-MIX? It was firstly based on jinc shaders, then it took its own path. It performs a non-linear operation over the image and cancels those vertical lines without destructing too much the rest of the frame. I think it’s a good balance between sharpness and overall image consistency (I define it as the seamless transition between pixel areas, from transparency to non-transparency regions). I’m still making tests, but I think the results are already good enough for a first release. So you can test and point its flaws. It’s not perfect, BTW, though I think it gives a consistent result and stray pixels are hard to spot.

It’s intended only for games that use this effect as you pay some IQ price for the transparency effect. Most genesis games benefit from it. And even other platforms like arcade games that use dithering (SNK and Capcom arcade games, for example.)

Sgenpt-mix is a very fast shader and must run at 1x scale as the first pass. It’s very easy to use, for now it has only three parameters where you can choose sharpness (0.0 to 1.0), blend mode options (OFF=0.0, VL+CB=1.0 (default), Only VL=2.0 and Only CB=3.0) and Blend Level (BL), where you adjust the level of dithering/pseudo transparencies blending. After that first pass, you can add any other shader you like to upscale the image (I recommend some crt shader of your preference) to your screen size.

At Blend Level 1.0, it blends all transparencies 100%. At level 0.0 it blends the minimum. Minimum is different from doing nothing. On reality, on minimum level it’ll blend 100% very soft dithering (low contrast). I think that at level 0.0 the Genesis games look great even if they don’t have any dithering. I recommend using BL=0.0 for most games and for the ones with high contrast dithering, use BL=0.8~1.0.

Unzip and put the contents inside your dithering folder.

New release: sgenpt-mix-v10

  • Added negative lobe to get a sharper visual while keeping transparencies.
  • New param to Fine Tunning the blending.

Here’s a preset I made combining this later sgenpt-mix with my latest crt-hyllian-sinc:

shaders = "4"
feedback_pass = "0"
shader0 = "shaders_slang/dithering/shaders/sgenpt-mix.slang"
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_slang/0-hspack/1080p/aperture-grille/hyllian/shaders/support/multiLUT-modified.slang"
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_slang/0-hspack/1080p/aperture-grille/hyllian/shaders/crt-hyllian-sinc-pass0.slang"
filter_linear2 = "false"
wrap_mode2 = "clamp_to_border"
mipmap_input2 = "false"
alias2 = ""
float_framebuffer2 = "false"
srgb_framebuffer2 = "true"
scale_type_x2 = "viewport"
scale_x2 = "1.000000"
scale_type_y2 = "source"
scale_y2 = "1.000000"
shader3 = "shaders_slang/0-hspack/1080p/aperture-grille/hyllian/shaders/crt-hyllian-pass1.slang"
filter_linear3 = "false"
wrap_mode3 = "clamp_to_edge"
mipmap_input3 = "false"
alias3 = ""
float_framebuffer3 = "false"
srgb_framebuffer3 = "true"
scale_type_x3 = "source"
scale_x3 = "1.000000"
scale_type_y3 = "viewport"
scale_y3 = "1.000000"
SGPT_BLEND_LEVEL = "1.000000"
LUT_selector_param = "2.000000"
PHOSPHOR_LAYOUT = "2.000000"
BRIGHTBOOST = "1.500000"
CURVATURE = "1.000000"
textures = "SamplerLUT1;SamplerLUT2"
SamplerLUT1 = "shaders_slang/crt/shaders/guest/advanced/lut/ntsc-lut.png"
SamplerLUT1_wrap_mode = "clamp_to_border"
SamplerLUT1_mipmap = "false"
SamplerLUT2 = "shaders_slang/0-hspack/1080p/aperture-grille/hyllian/shaders/support/LUT/some-grade.png"
SamplerLUT2_wrap_mode = "clamp_to_border"
SamplerLUT2_mipmap = "false"

If you don’t know where to get those crt shaders, see this thread. Or just open any crt shader and prepend this sgenpt-mix to see immediate results in dithering.

15 Likes

Other screens:

2 Likes

At last, converted to slang:

4 Likes

This might be a real game changer.

1 Like

Looks nice with guest dr venom crt shader and reducing the sampling to get back to the core res!

I just loaded your image into the image display core and adjusted the sample multipliers to 0.5 on the mega bezel

2 Likes

Nice!

Just wait some minutes until I release version 2. I’ve found some ‘Eureka’ way to improve sharpness to unbelievable quality! This is really a game changing! I’m very happy with results of v2. Just wait some minutes.

3 Likes

Ok, it’s here in cg, glsl and slang:

Test SFA3 in FBA and tell me what you think about the transparencies!

3 Likes

Is there any way to download this without the extension it is trying to get me to install?

Edit: I turned my ad blocker back on and it worked

I use AdBlock, so the link appears normally here. Don’t install any extensions!

Anyway, try this other link:

2 Likes

Wow this really looks great, you got almost all the sharpness back! It really does create a great transparency and keeps almost 100% of the detail, it also blends most dithering in general. And all in one pass, wow you’ve outdone yourself! :exploding_head:

I haven’t played with it in motion but man this is looking killer! :star_struck:

turns this:

Into this

and even turns this monstrosity

into something reasonable

2 Likes

Yes, I wasn’t overreacting! I was mesmerized by the results! This is a great day! I’m very happy with the results!

CPS2 looks great now too:

In motion it’s even seamlessly!

Use Sharpness parameter in 0.0 (Soft), no need for other.

4 Likes

Some screens with v2:

4 Likes

Version 3 released:

  • 2x faster;
  • Simpler to use (only one parameter now);
  • Sharpness control more effetive.

Running Retroarch on mega drive mini:

8 Likes

Hey @Hyllian

This is working really well! I really enjoy the simplicity of it.

I was playing with the sharpness and I was wondering if there was a way to reduce the ringing on Sharpness 2?

Here’s some screenshots

Off

Sharpness 1

Sharpness 2

1 Like

Use version v3 instead.

1 Like

I agree, this is a nice simple shader and works great. I’d be curious if any kid of intensity settings for the anti-dithering is possible. In @HyperspaceMadness screenshots you can see MegaMan’s eyes get blurred out. The same thing happens in Super Mario World with his eyes.

Overall this is way simpler and 99% as effective as Madapt. Nice job.

2 Likes

Actually these shots are from V3 :slight_smile:

I’ll release v4 soon and it will include option to just blend checkerboard dithering instead pseudo transparencies (this is only needed if the game has it). Checkerboard blend is very subtle and result in less artifacts.

2 Likes

There’s no Sharpness 2.0 on V3. You must be using an old preset. Just update it.

1 Like

For now, to produce transparencies from vertical lines, it’s necessary to do a harsh blend on pixels. Unfortunately some small details are captured by the algorithm. On v4 I’ll offer an option to just blend checkerboard dithering (most games only use this). And the transparency blend will only be necessary if the game need it.

1 Like