Koko-aio shader discussions and updates

Hi Koko, I have everything updated and Game Boy is giving me an error when loading this.

Screenshot 2023-10-12 10-13-37

GameBoyMono-Overlay-Taller if it works for me but GameBoyMono-Overlay no

1 Like

Thanks for reporting. Does this happen with presets from retroarch or from the github repo?

From Github repo,from Retroarch if it works

Right, there was a typo in the preset, now fixed.

Hi Koko, your shaders are incredible and they are the ones I always use. Personally, the one I like the most is the fxxa-bloom, which rounds the pixels a bit, but I would like to use the magic of immersive ambilight. Would there be any possibility in the parameters of the fxxaa-bloom shader to make the lights look like the ambilight immersive? Thank you for your work, you are the best. greetings

1 Like

Thanks, there you go:

  • copy/paste in a new text file
  • name it something like FXAA-bloom-immersive.slangp
  • save it in the same folder as FXAA-bloom.slangp
#reference "FXAA-bloom.slangp"
DO_BEZEL = "1.000000"
	BEZEL_INNER_ZOOM = "-0.391000"
	BEZEL_FRAME_ZOOM = "-0.140000"
	BEZEL_R = "0.070000"
	BEZEL_G = "0.050000"
	BEZEL_B = "0.035000"
	BEZEL_CON = "2.180000"
	BEZEL_REFL_STRENGTH = "1.5"
	BEZEL_DIFFUSION_STR = "0.5"
	BEZEL_CORNER_DARK = "0.400000"

DO_BG_IMAGE = "1.000000"
	BG_IMAGE_OVER = "1.000000"
	BG_IMAGE_OFFX = "0.001000"
	BG_IMAGE_OFFY = "0.001000"
	BG_IMAGE_ZOOM = "1.110503"
	BG_IMAGE_NIGHTIFY = "0.900000"
	
DO_AMBILIGHT = "1.0"
	AMBI_STEPS = "5.000000"
	AMBI_INT_OFFSET = "-0.300000"
	AMBI_POWER = "1.000000"
	AMBI_FALLOFF = "0.35"
	AMBI_STRETCH = "0.800000"
	AMBI_GAMMA = "1.300000"
	AMBI_OVER_BEZEL = "2.049999"
	AMBI_OVER_BEZEL_SIZE = "0.223000"
	AMBI_BG_IMAGE_BLEND_MODE = "1.000000"
	AMBI_ADD_ON_BLACK = "0.000000"
	AMBI_BG_IMAGE_FORCE = "1.000000"

	
DO_GLOBAL_SHZO = "1.000000"
	GLOBAL_OFFX = "-0.001000"
	GLOBAL_OFFY = "0.006000"
	GLOBAL_ZOOM = "1.000000"

3 Likes

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.