Koko-aio shader discussions and updates

IRRELEVANT

So I downloaded my own fork from scratch again and used the 1943 preset - changed to Presets-ng/Monitor-Ambilight-immersive.slangp Both FBNeo and MAME2003plus have the same result as enclosed. Means that I have to double check with Windows. I truly hope that this is not MacOS specific.

Third edit after thorough testing: It’s also in the 4.1 presets, so the ambilights pass over. So both generations are affected if the ambilight is strong enough to pass over the background image.

Success! Here is the solution: I put a 1pixel black frame around the artwork and set both the background_over and the background_under to clamp_to_edge, et voila, the ambilight no longer shines through! Let’s close this, that’s actually perfect. So my previous post from some 40 min ago is irrelevant.

2 Likes

I was bored and played around with the clean scanline shader on my phone. These are meant to be for my retroid pocket 3+. That’s why the image is so small (1334x750). I must say I’m really impressed how good it looks on a 720p screen. The jpg’s lost a little bit of quality due compression.

2 Likes

Ahah, I was just trying the same thing on a boring sunday afternoon :laughing:

Did you forced tate mode? smart!

my phone can’t handle this, even after switching flick_and_noise_pass frpm 2x to 1x scale

1 Like

Tate mode could work too with vertical scanlines I didn’t tried that yet. I was using the clean scanlines classic take shader and changed the scanline phosphor gamma from 4.2 to 2.2. This makes the scanlines look normal on a 720p screen. I also added some gamma to compensate for the brigthess. I also added a phosphor grid with mask type 4 and fxaa.:sweat_smile: I think it looks quite good

2 Likes

“Good (?)” news Xbox / Direct3D users:

I’ve read comments about koko-aio not working on Xbox series, so i tested it on a Windows OS with d3d output driver and indeed there were problems (crash on d3d12, heavy flickering on d3d11).

The good news is that I tracked down what the issue is.

The bad ones are:

  • to workaround it, some features cannot be used (ambient light scene detection, luminosity tied zoom), some optimizations cannot be used (delta render, border rendering performance optimization)
  • The shader has no access to the output driver in use, so those workarounds need to be manually enabled.

If you absolutely need to use one of those output drivers, then you need to use the development code (see first post), open the file located in config\config-static.inc with a text editor:

Turn the line:
// #define D3D_WORKAROUND
into:
#define D3D_WORKAROUND

You just strip the leading “//” and save it; then reload the shader, and it should work.

I also opened a bug report here, if you want to track the issue:

6 Likes

From this:

Through this:

To this:

Because of this:
image

If screenshots do not speak for themselves, it seems we won a match against Mr.Moire!
The trick is to stagger odd/even phosphors by a small margin till the beloved moire pattern fades away.

Pro: It is not yet clear to me how the new parameter “Anti-moiree sweet spot” is related (but it is and I’ve yet something to try) to the output size and the core resolution, but a value of 0.17 seems to do a damn good job at 1080p for low resolution content.

Cons: Since it staggers phosphors, it is not compatible with y deconvergence settings, which is auto-disabled when using anything > 0.0 for Moire mitigation.

9 Likes

Innovative. I admit the mask now looks a bit weird staggered like that but the end result is worth it from what I see.

1 Like

Indeed, if you (like me!) like to watch the phosphors one by one from near, it could be disappointing, but 1 meter away it does look like a normal deconvergence to me.

3 Likes

First thing I did was zoom in to see how the mask looked lol. But yeah from gaming distances it definitely works especially for a game like OutRun.

2 Likes

This is really awesome!

9 Likes

Just for fun. Monitor-Screen-hmask-aperturegrille shader on a t618 Android device. 1336x752 resolution. I just enabled fake integer scanlines. I still can’t belive that it runs smooth :sweat_smile:

Another one. Sharp-fxaa-core-slotmask This one lags a little

2 Likes

Since the lastet in develompent shader pack fake integer scanlines don’t work for me anymore. If I active them it gives me a blurry picture with vertical scanlines.

1 Like

Thanks! It is nice to have such speedy bug reports, so it is easier to spot where the regression is.

Lately i was trying to squeeze the remaining squeezable performance juice, but something went wrong.

Will fix by monday or before.

-edit-

@ComfyTsu: it was a matter of minutes, just a stupid typo, fixed.

1 Like

Are you telling me, you were able to eliminate moire pattern from fill up screen shaders at 1080p?

There are tons of shaders that are moire free at 1080p; it is “just” a matter of not using “too much ®” scanlines gaps.

What I’ve discovered is that when the image is whole odd/even staggered, you can use deeper/darker gaps because you’re effectively getting rid of straight lines.

The idea seems to work, but it is not perfect nor fully explored; by now, if you see moire, you can play with that parameter and hopefully mitigate the moire.

8 Likes

nice, so which is the name of this preset?

also for your presets i’d like to know if there is a way to configurate mask layout to be for bgr

1 Like

There is no such preset (yet)

koko-aio supports RBG with preset mask 5.

This, with aperturegrille setups gives you BGR by repeating itself:
-RBGRBGRBGRBGRBG-
However, this is not enough for slotmasks when they are staggered/splitted in the wrong position: RBG|RBG|RBG, but you can draft whatever layout you want anyway (if you read the docs-ng.md text file, it is all explained).

2 Likes

I just updated overmask presets in the main repo with moire mitigation; this is with “perceptual ®” slotmask :slight_smile:
Monitor-Screen_Hmask-Core_SlotMask-Overmask.slangp

While this is without slotmask:
Monitor-Screen_Hmask-Aperturegrille-Overmask.slangp

4 Likes

koko-aio NG-1.4 has been released and submitted for merging into retroarch official repo, should be available soon via online updater.

Note on updating
Before running the shader online updater, I suggest you to delete bezel/koko-aio.
This ensures that no stale shaders/presets/files will pollute the folder.

Changelog:

Misc

  • Xbox/d3d compatibility: add specific workarounds, enable them by editing config/config-static.inc
  • New config/config-static.inc and config/config-user.txt files. Use them to change static parameters or tu turn runtime parameters into static ones and gain performance. Keep a backup before updating, ofc.

Presets

  • Mitigate glitch patterns in Generic-Handheld-RGB.slangp
  • Add two handhelds dotmatrix presets “dots” in uncorrected aspect and 4:3 aspect
  • Wider ambientlight in generic handhelds rgb preset
  • Tweaked ambientlight on gba night preset
  • GBA preset: Switched from dotmatrix to pixelgrid
  • Reduce spot power on immersive preset
  • Add a simple immersive fxaa preset in the old 4.1 folder
  • Updated overmask presets to include unsharp-mask+FXAA and moire mitigation
  • New preset Monitor-Screen_Hmask_WideR-Screen_SlotMask

Parameters

  • Removed GEOM_CUT_EARS parameter, useless since using my curvature now
  • Add moire mitigation option
  • Allow to define ambientlight wideness for rotated games
  • Allow to switch to fake integer scanlines, always or only on interlaced screens (see docs)
  • Haloing can happen on an already “scanlined” image if a new static parameter: HALO_PRE_SCANLINE_GAP
  • Remove Inter-cell extra steepness parameter; it has been never used and has very little effect
  • Vertical cell Mask->Vertical shift: negative values will select the sharpest line when using screen coords

Fixes/Changes

  • Bloom strength on white area was broken when using content geometry override, fixed
  • Mitigate clipping on bright background images when mixing ambilight over them
  • Disable ambientlight debanding grain/noise when using a background image
  • Recentered wx mask so that phosphor falls at the center
  • Fixed textures paths in handhelds presets
  • Give halo a slight (very slight) rounder look
  • Slightly optimized pixel_blank_alternate (still statically disabled)
  • Dedot: use green as main channel
  • Move DYNZOOM_FACTOR in the static config file
  • Switch TATE mode to Auto by default, should affect all the presets

Performance

  • Modified debanding code, should be a bit faster now
  • Found a bottleneck in the vignette/spot code; small speedup
  • Since we gained some fps, switch HALVE_BORDER_UPDATE to 0.0 by default
  • small optimization to ntscdec()
12 Likes