Koko-aio shader discussions and updates

At the risk of not really understanding the big picture with RA and cores, I’d suggest swapping “cores” with “content” in the naming convention because if you’re a newb like me, you’d think it’s one-preset-fits-all for a core and that’s not always the case.

1 Like

Lol, Agreed! Indeed I just pushed just before reading your message.
I decided to go for Presets_HiresGames_Fast.

Also added a short readme.txt in that folder eaplaining as follows:

These presets match the upper folder’s options, but without internal upscaling.
This lowers GPU load and maintains similar quality,
assuming the game’s native resolution is sufficient.

2 Likes

Tried the new hires Monitor-Bloom preset on the 4200M Windows machine - FPS is solid at 60FPS on CSPRINT, but still getting major jitter. Again, not sure what I’m doing and maybe this piece isn’t relevant, but here’s what my flicker pass looks like in the stuff I hacked together yesterday, under which I don’t get any jitter:

       shader1 = shaders-ng/flick_and_noise.slang
        alias1 = "flick_and_noise_pass"
filter_linear1 = false
   scale_type1 = source
      scale_x1 = 1.0
      scale_y1 = 1.0  
    wrap_mode1 = "mirrored_repeat"

That’s right, it is scaling at 1x, it resambles what has been pushed to the dev repo today.

How would I have been able to eliminate the jitter using the version I created…probably something defined in config-user.txt?

Maybe lower flicker power if I understood properly. -edit- Or just turn interlacing emulation off, set the following to 0. Screenshot_20240614_170856

1 Like

Hi, is there any chance for a new handheld psp preset? :slight_smile:

I think GBA one can be used for Psp as well, provided one swaps the background picture.

It is just a matter of finding a licensed realistic picture.

3 Likes

It was not just a matter of finding the picture :slight_smile:

Indeed, I’ve faced several stoppers, finding the picture was easy, since there is a free CC licensed one in svg format from Tokyoship.

  1. koko-aio was unable to scale bg picture and content in a uniform manner when the picture was offsetted, that has been fixed in the dev repo.
  2. psp core can upscale the content, so i reverted to screen space rgb mask, instead of a core-resolution space one.
  3. How bad is psp core on retroarch?
    Slow like a crawl, ppsspp on my phone is faster(!) Also unstable: tried Gods of war: freeze, tried out run coast to coast: freeze

Btw Juiced 2 works:

Core set to 2x scaling: PSP.slangp

Core set to 2x scaling: PSP-Overlay-Night-Small.slangp

Core set to 1x scaling: PSP-Overlay-Night-Small.slangp

Core set to 2x scaling: PSP-Overlay-Night-Big.slangp

…is there some special recipe to make PSP Core to work reliably, I’m feeling like i’ve wasted time.

4 Likes

Hard to say. It seems that ppsspp core is compatible with upstream, although it has many bugs. Certainly also requiring a good PC. But never mind that. Your PSP presets look great as always! My favorite is small. Great job, it certainly wasn’t wasted :slight_smile:

2 Likes

Thanks, spent some time and learned the tools a little better. Even with interlacing totally off, I still got a couple weird rolling flickering lines in a 30hz game like Arch Rivals (on an old 1080p 60hz, non-VRR monitor w/ Vsync on). So I guess this is just an FYI that the 30hz hires games may sometimes need special treatment compared to 60hz hires. I went back to a tweaked set of Duglim’s N100 presets that avoid the couple flicker lines for the 30hz games, but I haven’t diff’d the presets to figure out the feature actually causing the rolling flicker.

It would be helpful to know, since I cannot reproduce myself!

Sorry, I must have gotten confused from the different versions I created. Setting Consider Hi-Res above… to 0 does work. In fact it’s the only thing that works for me…even if I set all the other interlacing options to 0, I still got that rolling flicker.

I noticed that when interlace emulation is enabled, the overral brightness is lower, so I’ve added another parameter named:
“Interlaced scanlines brighness push (less is more)”

it is here:

By lowering it from 1.0 to something around 0.9, the brightness is preserved here.

However, rethinking of it, it may be possible that the issue I’m trying to solve is not due to the shader itself, but to the slowness of the LCD panels to flip from close state to the open one.

So I’m asking to someone with a faster response display (OLED anyone?) to try the following:

  • Use a preset like presets-ng/Base.slangp
  • Load an hires game like a 640x480 one (flycast core is a good candidate)
  • pause the game via “p” key (not “k”)
  • Open the shader parameters and set “Interlaced scanlines brighness push (less is more)” to 1.0 to void its effect
  • Set the parameter: “Consider HI-Resolution above # lines” back and forth from/to 0/1

Do you see lower brightness when setting “Consider HI-Resolution above # lines” to 1.0 on your OLED?

Since we’re here, if you notice lower brightness, does “Interlaced scanlines brighness push (less is more) = 0.9” help?

Thanks!

-edit-

Ok, I managed to find a way to try on an OLED and indeed no brightness reduction can be observed there.

I think I will take the parameter as is, set to 0,9 with a small note beside.

Also, I think there are cheap TN panels with bad colors but good response times, maybe they are unaffected too.

4 Likes

Currently exploring the possibility of adapting the scanline inflation concept widely as a generic “Warp glow” feature (it would be named that way because it is based on the Warpsharp concept). Thet way, it would not be tied to the scanlines and it could be applied to the X dimension too:

New wannabe:

Old:

New wannabe:

Old:

With a different preset that toes no input smoothing, the image is still round near high contrasted edges.

New wannabe:

Old:

However, this would cost about 2-3fps on my haswell@1080p.

-EDIT-

Since it works by shrinking dark zones near bright ones, it greatly helps fxaa to stay sharp:

11 Likes

Please go for it ! :slight_smile: The Outrun example is clearly better.

2 Likes

The last 2 screens look indeed sharp. Nice work

2 Likes

Ok, just merged.


Commit:
Implemented Warpsharp like algorithm that superseedes scanlines inflation. Since it can be applied to X dimension too, it also helps FXAA to stay sharp.


So, Inflation is gone and the Warped glow appeared under Glow/Blur section:

    Warped glow (X,Y):
        Embolden bright pixels near dark ones using a warpsharp like algorithm.
        This is a cheap way to emulate phosphor glowing.
        The Y parameter will also allow scanlines to be higher.
        It will also help (if coupled with) FXAA to stay sharp.

    Warped Dynamics:
        Change the amount of warpsharp applied based on the contrast between 
        nearby pixels, thereby altering their "Warped" shape.
3 Likes

I’m trying and failing to get the dither/dedithering of checkerboard patterns heavily used on some DOS EGA games right. Here’s an example with Loom.

Loom EGA, Original image, no shaders:

Loom EGA, tv-NTSC-1-classic_take

The shader certainly improves things a lot, but there are still some noticeable checkerboard patterns on the rocks and houses. I tried messing with some parameters, specially “Dedither enable?”, but even after cranking the sensitivity to the max it didn’t make a difference. NTSC color artifacts also didn’t do anything in this case. Other presets gave me similar results.

However, with guest_r CRT shaders I was able to get the effect somewhat right, but with compromises. If I set the “NTSC Resolution Scale” parameter to 0.50 the dithering patterns will blend better. Of course, everything will be a little bit less sharp, since I’m halving the resolution.

Here’s an example with sonkun’s “10-1080p-crt-guest-advanced-ntsc-slot-mask-u-warm-composite-standard” preset, which is based on guest_r’s:

The “tvout+ntsc-320px-composite” also handles dithering well, but the final result is too blurry for my tastes:

Here’s another example, this time with Quest for Glory II:

Original:

Koko:

Sonkun:

Tvout:


I know koko-aio shaders can handle dither on most systems perfectly - they’re my shaders of choice when playing Sega Mega Drive games, which relied heavily on the technique. But for some reason I can’t get them to look right with DOS EGA games. Is there any parameter I can change to get better results?

2 Likes

Probably/Maybe :slight_smile:

The dedithering is mutually exclusive with NTSC artifacts, enabling the latter disables the former (docs are wrong, stating the opposite, will fix them asap).

So you can try to disable artifacts and see if dedithering works better (don’t expect miracles, it is a fast/dumb algorithm)

Btw, thanks for the detailed explaination, it will be certainly helpful, will check in a few days to tweak Ntsc artifacts parameters for EGA resolution.

Meanwhile, could you please post naked source resolution (1:1) EGA screens? I’ve no MsDos emulator setup nor games to try, so I’d rely on yours.

PS: Were EGA games supposed to be seen via NTSC composite signal at all?

1 Like