Koko-aio shader discussions and updates

wow thank you very much for your prompt response. greetings

2 Likes

When dealing with interlaced / hires content, scanline emulation can be really hard.
That’s because the number the interlacing lines, even if they have the period doubled (480p gets 240 scanlines), quickly alternates giving the effect of emulating 480 scanlines.

Among the effects there are moire when using curvature and weavy effects when not; exactly like when you try to use scanlines with a low resolution mame game on a 540p (1080/2) screen; a disaster.

Right now, one can choose to disable scanline emulation on interlaced content or maybe switch to integer scaling.

What I am trying here, is to fake scanline emulation; this means make them straight even on curved screens (no moire) and use a number of lines that fits exactly the screen ones.
The latter means that if the game wants to draw 480 scanlines, but we have just 1080 lines on the real screen, we will just pick pick 1080/ceil(1080/480) = 360lines.

That way, every emulated scanline will exactly fits an integer number of screen lines.

I was thinking that this can be used for interlaced screens, where scanlines kinda disappears because they alternates every frame, and indeed, it does look good.

What i wasn’t expecting, is that it looks okayish even on low resolution content; here you can see the effect on an heavy masked shader:

This is with fake integer screen/scanlines, you cannot spot moire nor scanline artifacts, but some elements may look weird:

This is with classic scanlines:

6 Likes

See, previous post, I just committed a change you may be interested in, the second change was free to add, so I did it, but you want to try the first one. from docs-ng

Interlaced Scanlines? (-1=faker, -1=fake, 0=yes, 1=no):
 0=yes:   Use interlaced scanlines, may need >1080p screen to avoid moire or weavy artifacts
 1=no:    You may want to avoid drawing scanlines gaps when interlaced content is found
-1=fake:  Use a number of scanlines that perfectly fits the screen, a good glitches free tradeoff.
-2=faker: Use a number of scanlines that perfectly fits the screen * 1.5, another good glitches free tradeoff.

[…]

   Scanlines (*4)
        Scanlines emulation, set the strength of the effect here.
        Use fake integer scanlines
            Use a number of scanlines that perfectly fits the lines on the screen, not accurate,
            but avoids moire and weavy artifacts.

By default i’ve set “Interlaced Scanlines” to “-3: faker”: that draws 1.5X integer straight screen/scanlines (I don’t know how to call it), and the result is this (looks better in movement when scanlines overlap):

5 Likes

just curious, what is ng stand for in these presets. is there a doc to where i can learn all of these jargon? iam really new to retroarch shader, so i dont think i have an idea to what it is.

also. thank you for these awesome work. i cant believe that having the black bar gone is really what i wanted all along lol.

1 Like

That’s interesting. With this method I can barely notice moire while still keeping a nice curvature look.

1 Like

Yeah, there are cases when moire still comes back through the door on the opposite side, eg: when there are straight lines from the game that are warped by curvature, while the fake scanlines are straight.

ng stands for next-gen/post 4.1 release, where mask and scanline code radically changed; but since it retained the ability to render exactly like 4.1 version, I converted all of the old presets to the new code, keeping the old names, and made new presets that make extensive use of new features with the ng suffix.

In the first post there is the link to read all of the online documentation relative to koko-aio:

but you should have it on your disk right now in the koko-aio folder, look for docs-ng.md, ypu can read it as a text file.

3 Likes

ahh i see, thank you

also, i just notice that the presets from “presets 4.1” folder that was from retroarch update that also available in “presets” folder from the NG-1.0 pack is now wont have the bezel disappear when fast forwarding when using vulkan. this is nice. i always hesitant to use vulkan because of this, but some console runs better on vulkan. is it always been like that since 4.1 and i am jjust not aware of some particular settings or is it something that is new to post 4.1/NG-1.0 pack?

This is new to me, never had this issue on amd/intel/nvidia with glcore or vulkan, (I only tested on Linux tho), so I can’t really answer, code changed a lot since 4.1.

Good to know it is working fine in fast forward mode!

For those of you who already used the trick to increase performances “for free”, and for those who didn’t knew about it, i’ve edited the post here, because the shader now has a new (simpler) text file called:

config/config-user.txt

As a recap, you just fill in them static parameters you will never change, eg: if you always use the bezel, you can write: “#define DO_BEZEL 1.0” and save it.

Be sure to backup that file, as it will be overwritten by any shader update.

1 Like

Just posting to thank you for those amazing shaders! I didn’t know them and I love how they look!

1 Like

Hi @kokoko3k - is there a way to avoid the LED lights passing the background/foreground image sideways? See schreenshot - it doesn’t look that realistic if I have the artwork limited by clamp_to_border, but the LED lights go beyond. So can the LED lights also end with the artwork? Thanks for your ideas! PS: Please ignore the oval in the middle, that’s by mistake.

Uhm, not right now.

What you can do is to “pad” the image with a black frame and adjust the zoom; then you could also set the repeat mode to mirrored to double the pad.

I’ll think to something else; it would require, code tweaking and maybe another oprion.

1 Like

Thank you and no worries, it‘s rather minor. I will try the black frames and whether this changes behavior, thanks!

Wait, it works fine here, tried GLCORE and Vulkan on intel and nvidia on mame 2003 plus, but i don’t think the core would make a difference here.

I tried the preset from your repo, just edited the references to point to your fork.

Ok will further dig into this, thanks!

1 Like

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