Koko-aio shader discussions and updates

I’ve just pushed an initial implementation of autocrop feature. I tried hard to make it as light as possible, and finally I decided to make it run via small steps spreaded over frames.

To better explain you how it works, here’s a little video:
https://mega.nz/file/gOkgWQhZ#6-ODLxxMP52PCTN8D3y5eW06ausJvJi2NU3RTBl5oVc

So, there are new parameters:

Autocrop maximum amount:
    The higher, the more solid borders wil be cropped around the image.

Samples per frame:
    Higher values makes the shader search more in a single frame for solid areas.
    This leads to more accurate result in less time, however it will also stress the gpu more.
    Fortunately even low/lighter values like 10 will work good if you're ok
    in waiting 2..3 seconds for the final crop value to be found.
    
Scene change treshold
    When autocrop finds a maximum crop value, it only tries to crop more when the scene changes.
    By lowering this value, you tell the shader to try higher the crop more often.
    
Transition speed
    This modulates the smoothness of the animation between various crop values.

The good news is that even for low values like 10, in a matter of 2…3 seconds it is able to reach almost full precision.

Also, if you plan to use it with games that have well defined solid areas (C64, Amiga), even 1…2 samples per frame are enough.

With default values of 20% autocrop and 10 steps per frame, the performance hit is about 4fps/100 on my Haswell, while the basal hit is about 1fps/110.

Caveats:

  • For performance reasons the function that decides if fake integer scanlines are needed does not take autocrop into account.
  • As soon as autocrop is activated, you’ve to wait for a scene change to see it in action.

Also, a big thanks to fishku from Discord for hints on low discrepancy sequences

There may be bugs and the need to test how parameters interacts each other to find good defaults.

Just pushed some good default (to me), but your mileage may vary and I’ve not tried many games so please, report!

@salty101

6 Likes

2 Likes

I tried to copy megatron in koko😅 and experimente with hdr in retroarch. The deck has a peak brightness of 1000nits. I made a short video here, it looks really close like this in person.

Video in full resolution

https://www.mediafire.com/file/djqzqsceuj4w677/VideoPro_20240414_231033.mp4/file?dkey=42yyl985vqv&r=735

But it seems that I can’t take screenshots in retroarch with hdr enabled

3 Likes

A preset for Game Boy Color would be great ;.)

Already requested, but I’ve still no clue how the display is supposed to look.

I don’t know if this will help, but I found this:

At last, here are Gameboy Color presets.

@Elessar84, @Noromu

Screen has rgb layout, low contrast with big vignette and spots to simulate world light over a passive display and high basal grid level.
No colorization applied, it relies on the default one done by Gambatte core.


Base one is: GameboyColor.slangp

Overlay variants, closeup and taller:

GameboyColor-Overlay.slangp

GameboyColor-Overlay-Taller.slangp

Last, the ones that emulate a IPS modded GBC, so with backlit/brighter colorful display.
There, ambient lights are meant to be inside the transulcent case; closeup and taller versions:

GameboyColor-Overlay-IPS.slangp

GameboyColor-Overlay-Taller-IPS.slangp

13 Likes

looking awesome! can’t wait to try 'em out! :+1:

Are those presets already available?

2 Likes

Yes, thank you! They are on the dev repo.

2 Likes

Cool,I will try,thanks

2 Likes

@ kokoko3k It looks great. Thank you very much.

2 Likes

Hi @kokoko3k ! I love your shaders, especially Tv-NTSC_Generic-FXAA_sharp-Selective for N64. It makes the low-res HUDs look quite nice. And ParallelRDP with 2x upscale and 1/2 downsampling takes care of the 3d polygons and jagged edges. This combination results in a very good experience overall, at least to my eyes :slight_smile:

Just one question. Are your presets overall tuned to 1080p or 4k? Is there anything I should change in Tv-NTSC_Generic-FXAA_sharp-Selective when using a 4k display? Not sure if it’s just my brain playing tricks on me, but I wonder if scanlines should be ever so slightly more pronounced when using a 4k display.

Oh, and a final question: are planning to release a new version? I saw you pushed several commits since last version already. Thanks!!!

Thank you!

1 Like

Hi there,
glad to hear you’re satisfied with that preset; I test my preset on a 1080p display, so they are optimized for that size, as per the scanline look, they should look better on 4k without touching anything.
However, if you want they to look more pronunced, you can try to set the parameter:
"Scanlines (0 to disable)" from 1.0 to 1.25.

If it is not enough, another parameter you can play with, since you’re on a 4k display (on 1080p it is likely to produce moire) is:
"Overmask (1.0 = neutral)" to something greater than 1.0; whatch out for moire anyway for higher values.

Overmask Examples (open in a new window at 100%)

Overmask = 1.0:

Overmask = 1.5:

You may want to lower the halo strength as overmask is pushed higher by the scaled amount to keep the brightness as the same level, eg: since we pushed overmask by 1.5, i reduce the halo by that amount (0.5/1.5 = 0.333), the same probably applies to bloom mix, but i’ve not touched it in the next example:

Overmask = 1.5; halo = 0.33:

New version is certainly coming, but i cannot tell you when, since i’m a bit busy atm; however you can try the development releases from the main repository linked in the first post.

3 Likes

Updated my install with the latest dev repo - nice!

6 Likes

Snake preview of more work on scanline look.
Finally I managed to find a way to let them vertically grow much much more than before.

My previous attempts with the canonical way always led to absymal performance, and they were all not compatible with other shader features (staggering, moire mitigation and so on)

but finally I found a way that is almost free:
Warping coords and keep using my beloved sin(), yay!

I’m still working on it (nothing released yet), but the results are promising, rounder and yet sharp look:

16 Likes

Love the contrast and the edges man!

1 Like

Just pushed a bunch of changes/fixes, including the new scanline function.

If you want to test, this is the new parameter, inflation strength, under scanline section:

Screenshot_20240510_154614

It has been set to 0.5 for all of the presets, but the handhelds ones, so every preset should look a bit better now.

0.5 is a bit conservative, you may want to try higher values, by keeping in mind that going over 1.0 is only adviced when you set “Phosphors height MAX” to a low value; very particular cases i’ve yet to experiment with.

8 Likes

I cried, so beautiful

1 Like

Works great - well done.

4 Likes

Still tweaking…or should I say playing…

2 Likes