Koko-aio shader discussions and updates

What do you mean? I calibrated my monitor manually and I think it has a pretty neutral white point.

There is a chance that your monitor goes crazy when it shows some mask patterns tho, I spent an afternoon trying to understand why a mask looked green, then I realized it was the screen itself.

As per the smoothing, I’ll verify this, but if I remember well, jinc upscalers use lanczos weights, and you can achieve that by playing with the blur/sharpen settings in koko-aio (not properly lanczos, but quite similar for negative sharpen values around -0,7)

Excellent, I am going to try it.
But don’t worry, it was just a suggestion if it was something very simple to implement, your shaders are well complete.

I was just going to ask you if you had calibrated the monitor in the gamma post, if you don’t know these pages, they can be useful for extra adjustments.: Eizo, Lagom.

I am referring exactly to the ICC color profile that is assigned to the monitor in system settings. you use KDE? it should be in Configuration -> Color.

You probably have the default of the monitor. For creating digital content, it is recommended to use sRGB IEC61966-2.1 and then calibrate the monitor.

Yeah,I know and use those pages, I even developed a tool to visually calibrate/correct monitor color casting or slight imperfections without special hardware, it is called “caled” and it uses dispwin to loat gamma ramps into the Xorg video Lut.

from my personal likings, I intentionally use a slight darker gamma, but my eyes are well “calibrated” to it, so the resulting presets should appear as intended; do you think gamma is wrong?

The tool looks interesting, I’ll try it when I can.

On your monitor you will see fine, but if you adjust the colors of a shader with your monitorX.icc profile, when someone else uses the shader with a standard sRGB profile, the color tones will change. For personal use it is fine, if you produce digital it is better to have a standard RGB.

Edit. but it’s a bit excessive, if you have the gamma calibrated that’s the important thing, I don’t think anyone will notice, or care about a slight variation in tones. Only lunatics like me. :sweat_smile:

1 Like

By my tests (patterns and a couple of games), dedithering implementation seems ready.

The implementation is far more aggressive than any other algorithms i’ve seen in the retroarch repo, so it is able to smooth out straight repeating lines like the copperlist in lot of Amiga games to say one (see the sky in the previous screenshot), but it will pick up even “legit” cases like jail cell bars repeating with a xoxox pattern.

  • Strenght parameter simply modulates the mix between the dithered image and undithered one
  • Treshold allow to skip dedither steep variations like black/white.

Last thing to say is that it is mutually exclusive with ntsc artifacts generation.

Please, test it and report back, if you think it is good, it could become a standalone shader, since it is very simple it requires just a pass.

7 Likes

And just when I thought it coundn’t get any better…

I can now actually play a Sega CD game without my eyes bleeding and falling out!

Great work.

Update - in fact, it seems to work it’s magic across a wide range of content/systems - defo a keeper for me.

2 Likes

are or can your presets be 4k?

The shader itself is 4k ready, but I’ve no 4k display handy to try. I just did one when i hooked my pc to the oled tv and is this: Presets-ng/Monitor-for_1440pMin_HiNits.slangp

Other may work well too (eg. the ones with “wide” in the name) and others can be adapted by operating on the horizontal mask zoom or type.

1 Like

I’ve added the dedither to all FXAA sharp presets:

Also, the dithering code has been changed to be less aggressive, it used to act as a posterization filter for wide dithered areas:

Naked:

Old dedithering:

Now it is more like this, less posterization, but still good on not so wide areas:

And as a side bonus, it is a bit faster.

5 Likes

That’s sexy. I like the way you make use of fxaa with the smoothing, I never could tweak that shader in that way.

1 Like

Fxaa is a mistreated algorithm, but does a good job with 2xcore res->fxaa->2xcore res :slight_smile:

2 Likes

Maybe I’ll give it another shot sometime in the future. I tried with scalefx which seems to be the most popular of the “pixel smoothing” shaders but I don’t like how it “alters” pixels in certain small areas sometimes turning sharp corner edges to circles, I’d have to post a pic to show you what I mean. Your fxaa smoothing from what I see keeps pixels in their original form but still manages to smooth everything over. I don’t know what black magic you use but your presets are the best I’ve seen when it comes to pixel smoothing so far.

1 Like

Thanks!

I know well what you mean, and fxaa is not perfect by any mean, at all; they are just “dumb” routines that will never catch all the possible cases.

Who said that point is part of a dither and not some dust floating around? And what if Sonic had a blocky face? why on earth you wanna smooth it? :slight_smile:

1 Like

Yeah you know exactly what I mean lol. I guess it’s good fxaa isn’t “perfected” that way it can miss certain algorithms on purpose in areas that really don’t need the effect.

The dithering doesn’t blend as well but the overall image is sharper.

Yes, tracking so wide areas (the green sky) full of dithering patterns that keep changing is something i’m just unable to do well, at least not without taxing the gpu way too much, so opted for what I think is more balanced. At least checkerboards, vertical and horizontal stripes should be well covered, (take a look to the earthworm jim headshot).

Tbh,I prefer the old algo. Is there a chance to have both algo’s and use a paramater to select one or the other…a bit like what you have done with sharpening (negative values uses box etc)?

Just a thought…

previous code was also prone to false positives and in some cases it also added dithering (rare cases), but sure, let me see if i can make it a runtime option that doesn’t take much gpu use. If not, i’ll make it static by default and you have ti enable it by editing a text file.

1 Like

Hi there. I have discovered Koko AIO recently and I am currently experimenting with it, and I have obtained very good results, in particular with the preset Monitor-FXAA_sharp-Core_SlotMask. I am using a 1080p screen. Nevertheless there is one thing I am missing from MAME HLSL is phosphore persistance that can appear when a bright sprite is replaced by a black background. This is also called ghosting or afterglow and is managed by the phosphor_life parameter under MAME. The equivalent seem to be “afterglow” in slag shaders. I can’t find this feature in current Koko AIO. There is something that I am missing? Or maybe this could be added in the shader chain? Actually I am missing the effect of ghosting in older games like Donkey Kong, where the orange barrels leave a trail behind them. Thanks for your help.

1 Like

@oldpainless Please, observe a minute of silence as our beloved Intel Haswell has lost another FPS.

When enabling the dithering i can observe a very slight performance degradation (<1fps), but since basal gpu consumption is the same, I decided to leave it as a runtime parameter.

Since I was there, you can now change the basic search strength ( | , – ) and the extensive one ( \ , / ), maybe there are unexplored solutions.

1 Like