SGENPT-MIX - Sega Genesis Pseudo Transparency Mixer shader

I kinda of thought it would be impossible to be perfect without adding far more complexity than is desired. My general use case scenario is to turn everything on because I need those sonic waterfalls blended! In the end I’m ok with a little odd blending if I’m using something like your shader in the first place.

New release: sgenpt-mix-v4 (cg, glsl, slang)

What’s new:

  • Added an option to turn everything OFF or Use Transparencies or Just blend Checkerboard Dithering;
  • More optimizations (20% faster)

Transparencies is the default. Though most games on other systems (SNES, CPS2) just use checkerboard dithering, I recommend using it with those systems. Only use Transparencies options if the game need it.

8 Likes

Wow this is a great shader!! Congratulations for such an awesome work!

Can I ask something? Is it possible to add some kind of filter when the shader applies the effect. Means for example if the checkboard or vertical line pattern is at least 4 pixels high and 4 pixels wide then the effect should take place. Every pattern below the limits should be ignored. I saw some wrong detections which could be avoided if the shader would ignore patters with 2 pixels hight and wide. (mainly in fonts).

Another question would be if the shader can only be applied on vertical lines ( kirby dreamland 3 on snes uses just this pattern) this is why it comes to my mind to add this option.

2 Likes

It probably will break other things elsewhere.

I’m testing exceptions to the shader, though until now I couldn’t find a fix that doesn’t break something elsewhere. I’ll only insert some exception if it doesn’t break other things. It’s a really hard cat and mouse game.

6 Likes

Really fantastic what you did. Compared the shader with mdapt and gdapt. The detection is much better and the transparency is also awesome.

Looking really forward what else you gonna make. Keep on rocking!

2 Likes

Amazing job here. You need to make this shader official for the system.

It even works for Saturn Games (here I have some before/after photos of SEGA Rally Championship):

I set the sharpness to 1.00, and the Chequerboard to 1.00

2 Likes

Good to know it works on Saturn checkerboard dithering.

2 Likes

@Hyllian

Works great on a Raspberry Pi 3 with crt tv!

3 Likes

Just amaizing work! :+1: Thanks Hyllian for this shader! Now I need to implement this to all my favorite shaders :grin:

I test it and some bugs can noticable on text and Sonic icon on the bottom left. But anyway it is crisp and onepass!!!

My Custom old preset (9pass - GTU+MDAP+YEE64)

New one with 2 pass only

1 Like

Unfortunately, some dithering patterns are identified in some huds, like those. If I try to fix this, some stray pixels will appear on other places. So, there’s some ambiguity here and there. The algorithm is very simple and I don’t wanna insert complex rules to fix things like that. If I find an easy and simple solution I’ll add, otherwise, I prefer it simple and fast as is.

4 Likes

Anyway, this is well done shader, thanks for share it! And hope you find solution for fix huds :innocent:

Is there somewhere a tutorial how to write slang shaders? I have an idea how to optimize but i would try it myself.

I’ve never seen one.

I’ve learned just by looking at existing shaders when there was only .cg ones and reading ancient cleaver shaders written by guest, our Grandfather of shader writers, :stuck_out_tongue: . The languages are very similar (cg, glsl and slang), if you understand one, you understand all. The differences are easy to grasp.

You start by choosing the simplest shader you can understand. Then you begin to tweak it a bit and see what happens on screen. Step by step you’ll figure out what’s happening.

Anyway, if you want to share your ideas, I can see if its easy to implement.

5 Likes

This was my life, on top of bugging hunterk and guest lmfao.

I think it’s time to release something I was working. For now on I’ll release only in slang. I’ll only release in other languages if someone really need it.

Version 5 released: sgenpt-mix (slang)

Whatsnew:

  • Figured out how to soft the blending level so that some artifacts can be mitigated through a new param;
  • New param called BLEND_LEVEL so that the blend level can be modulated.

At level 1.0, it blends the same way as before. At level 0.0 it blends the minimum. Minimum is different from doing nothing. On reality, on minimum level it’ll blend very soft dithering, like a very high pass filtering. I think that at level 0.0 the Genesis games look great even if they don’t have any dithering. Look at the comparison screens below:

sgenpt-mix OFF:

sgenpt-mix ON with Blend Level at 0.0:

6 Likes

I was testing some Genesis games with Blend Level at 0.0 and they look really great. It works as a very soft smart low pass filter.

Try Adventures of Batman and Robin and see the cloud at the first chapter. What’s more interesting, you can see the cloud dithering paused (still), but can’t see it when in movement. if you turn off sgenpt-mix, the dithering can be seen in movement.

With this, the genesis games looks like snes games. The excess of dithering is mitigated without creating visible artifacts. I love the results of Blend Level 0.0.

6 Likes

I’d have to agree! This is really looking great!

2 Likes

Now Mortal Kombat II is playable on genesis. :stuck_out_tongue: Looks like the snes version.

2 Likes

Hello everyone! I’m here to thank Hyllian for this shader, as I was combing through various topics on antidithers and other ways to simulate composite blending, and I came across this incredible shader!

This new addition is like a fade, it is much more like the TV mix, only very clear and so, in my opinion, it avoids some false positives in a more accurate way.

Tested on the Sonic 3D Blast DX 2017, It was wonderful! Thanks!

2 Likes

It removed as much dither as possible without ruining the small texts like the “Sega 1996” in the title, and preserved the letter M in the game menu. With mdapt and gdapt the sonic shadows were left with undetected pieces of dither, as I had to decrease the detection to save the texts, now with this shader, they are perfect as they were on TV!

I’m almost sure that I’ll be able to make just one preset for my entire Sega Genssis library!

2 Likes