SGENPT-MIX - Sega Genesis Pseudo Transparency Mixer shader

Well, my problem with your shader was in relation to checkerboards, because when I reduced the blend in PT mode, the checkerboards that are used for transparencies were very evident. In the tests I did, I left the PT blend with greater intensity than the checkerboard blend, leaving only what was left of PT for this second pass.

Screenshots with one pass ver. before, two passes ver. after:

sgenpt-mix PT BL 0.8:

sgenpt-mix PT BL 0.8, checkerboards at 0.0:

PT BL 0.8, just for the record! :stuck_out_tongue: :

PT BL 0.5:

PT BL 0.5, checkerboards in 0.5:

PT BL 0.5:

PT BL 0.5, checkerboards in 0.5:

PT BL 0.8:

PT BL 0.8, checkerboards in 0.0:

PT BL 0.8:

PT BL 0.8, checkerboards in 0.0:

PT BL 0.8:

PT BL 0.8, checkerboards in 0.0:

It seems an improvement. Next version will incorporate it.

2 Likes

Looks nice , what’s the preset?

Version 6 released: sgenpt-mix-v6 (slang and glsl)

What’s new:

  • Added a new preset multipass (only use it if you need to separate vertical lines detection from checkerboard;
  • Added option to Adjust View (monocromatic);
  • Added a third blend option which filter only vertical lines (not so good as the default).

OBS: second pass is exactly like the first one. Not a true multipass option.

3 Likes

I am already noticing the result of filtering this shader very similar to that of ntsc-svideo, ntsc-svideo-adaptive or composite in terms of dither removal. It is very accurate in bl 80, and reinforcing the blending checkerboards it is even better, for not bringing artifacts like blurs, rainbow effect, not destroying small texts and maintaining sharpness. Now I will check this version for vulkan to see how it turned out.

This shader has a very high potential, perhaps implementing some error detection. I’m hoping that this shader will be updated, even if it takes time, because I imagine it must be very complicated. I imagine that Sp00kyFox should no longer add anything to mdapt and gdapt, it is a pity.

1 Like

Can I ask what other shaders you are using here? Everything looks so smooth and wonderful in this picture.

1 Like

In this test I used the sgenpt-mix with scalefx. In gl it is easy to combine through RetroArch’s own interface, but in vulkan you will have to mount the preset via notepad to place the aliases. At the end of the scalefx passes I put 2x xbrz with 1x ‘’ linear ‘’ and then reverse-aa in ‘’ linear ‘’ & ‘’ don’t care ‘’.

This Sonic shadow in this game was difficult to merge, as these loose pixels that are marked are detected as vertical lines, so I needed to abandon the legibility of small texts with mdapt to obtain this complete shadow, using ntsc composite or ntsc svideo.

Here I am using the sgenpt-mix V6 multipass. The shadow is complete, and the small texts are very readable!

Parameters: pass1 both blend 0.5, pass2 checkerboards blend 0.5

V6 off:

V6 on:

V6 on too:

1 Like

V6 off:

V6 on:

off:

pass1 both blend 0.0:

pass1 both blend 0.0, checkerboards blend 1.0:

2 Likes

I haven’t tried out v6 yet, but I thought you might be interested in this modification to v5 I added based on the “Use Linear Gamma” option from GDAPT

These screens aren’t via SGENPT, but the shader was giving me results similar to this while I was aiming for this instead

2 Likes

Is there a reason why the blending should be made in linear light? Is it more accurate?

I really don’t know, that’s why I’m asking.

The other question is, why not using gamma 2.4 as gamma in?

blending in curved gamma favors darker pixels. Doing it in linear gamma is more balanced. As with most things related to dithering, the classic test is the Sonic waterfall. Here’s your shader with curved gamma:

and here it is with linear:

4 Likes

Thanks! I’ll add this option on next version. Do you know about the 2.4 value?

1 Like

I’m not an expert on gamma stuff, so I don’t really have an answer on the 2.4 thing. All I know is most APIs expect 2.2, so that’s what people tend to use. As long as you use the same value on both ends, it honestly doesn’t matter much. Even 2.2 is just an approximation.

In those shots, I just used the linearize/linearize.slang shader, which just does color*color and then I added FragColor = sqrt(FragColor); to the end of your shader.

2 Likes

@hunterk got it.

I can’t speak to the 2.4 really, again I just pulled the logic from GDAPT. But some info (and the gifs I linked to) were from this random reddit comment. Not the best source of information, but hey.

1 Like

This will be helpful. I’ve noticed this whenever working with blur, if you don’t put it in linear space before you blend all the samples the colors end up shifted darker, so the glow falls off more quickly than it should and doesn’t affect darker and brighter colors evenly.

1 Like

Here’s a wip of V7: sgenpt-mix-v7-wip (glsl)

I’ll release tomorrow slang and multipass.

What’s new:

  • Blend now is done in Linear Gamma (2.2). It gets rid of strange dark pixels (like mario’s cross(x) lives hud);
  • Added a new checkerboard option. It’s called Checkerboard Soft. It blends a bit more than regular checkerboard option. It mitigates sawtooth effect on dithering edges.

Regular Checkerboard:

New Soft Checkerboard:

5 Likes

oh dang, that sawtooth fix is hot :open_mouth:

That’s really hard to catch safely. Good stuff man.

1 Like

Version 7 released: sgenpt-mix-v7 (glsl and slang)

What’s new:

  • New checkerboard option (fix for sawtooth effect);
  • Blend now is done in linear gamma.
3 Likes

I’ve managed to figured out how to mitigate sawtooth effect on Option 4.0 (Both vertical lines and checkerboard).

The results are very good, so I’m releasing version 7b: sgenpt-mix-v7b (glsl and slang)

I think using option 4.0 and BL=0.9 takes care of any genesis game now.

8 Likes