Koko-aio shader discussions and updates

Right then, so I need to rethink some other downscaling passes made for (big blurs) bloom and ambient lights itself. Thank you

edit: also, I wonder if downscaling this way is the correct behaviour of retroarch; since specifying bilinear filtering doesn’t change a thing; same very bad quality; It’s more like a decimation filter than a down scaler.

If you set mipmap_input on for a pass it automatically takes a mipmapped version, so smoothed together if the resolution is lower.

I do this in a few passes in the Mega Bezel, an example is below, the first pass is really almost like the stock shader, but it linearize it so the blurs work properly and blend in linear space.

// Reduce Resolution  ----------------------------------------------------------------
//      Reduce the resolution to a small static size regardless of final resolution
//      Allows consistent look and faster at different final resolutions for blur
//      Mipmap option allows downscaling without artifacts
shader17 = ../../shaders/HyperspaceMadness/hsm/hsm-linearize-crt.slang
mipmap_input17 = true
filter_linear17 = true
scale_type17 = absolute
// scale_x17 = 480
// scale_y17 = 270
// scale_x17 = 960
// scale_y17 = 540
scale_x17 = 800
scale_y17 = 600
alias17 = "BR_MirrorLowResPass"

// Add Blur for the Reflection (Horizontal) ----------------------------------------------------------------
shader18 = ../../shaders/HyperspaceMadness/hsm/hsm-blur-outside-screen-horiz.slang
mipmap_input18 = true
filter_linear18 = true

// Add Blur for the Reflection (Vertical) ----------------------------------------------------------------
shader19 = ../../shaders/HyperspaceMadness/hsm/hsm-blur-outside-screen-vert.slang
filter_linear19 = true
alias19 = "BR_MirrorBlurredPass"

// Reduce resolution ----------------------------------------------------------------
// Reduced to a very small amount so we can create a blur which will create a glow from the screen
//      Mipmap option allows smoother downscaling
shader20 = ../../../../blurs/blur9x9.slang
mipmap_input20 = true
filter_linear20 = true
scale_type20 = absolute
scale_x20 = 128
scale_y20 = 128
alias20 = "BR_MirrorReflectionDiffusedPass"

// Add Diffused glow all around the screen ----------------------------------------------------------------
//      Blurred so much that it's non directional
//      Mipmap option allows downscaling without artifacts
shader21 = ../../../../blurs/blur9x9.slang
mipmap_input21 = true
filter_linear21 = true
scale_type21 = absolute
scale_x21 = 12
scale_y21 = 12
alias21 = "BR_MirrorFullscreenGlowPass"
3 Likes

So If i understood properly, this means i just need to set mipmap_input in the slangp preset and then normally use its scaling parameter and normal texture() lookup instead of textureLod() to get the mipmapped texture?

That would be handy!

1 Like

Yeah that’s what it seems to do, as if it was doing textureLod() and giving the correct mipmap level

4 Likes

Hi there, I just released 3.0 version.

The shader is faster (its gpu usage is under 65% with all of the features enabled on my poor Haswell igpu) and also looks better than ever to me.

The biggest addition is the bezel emulation for which I have to say a big thank you to HSM for allowing me to rip his automagically generated monitor frame to a simple png file.

However, the code implementation is very different from Mega Bezel, because koko-aio needs transparent areas for tube.
Adapting Mega Bezel backgrounds should still be possible with little work.
That said, standard/classic overlays works just fine, you just need to replace background.png and adapt zoom levels, curvature and image border right from the shader options. (see screenshot)

One thing still missing are presets for HiDPI screens.
If you like how the shader looks @1080p and have some free time, there are several options in the Mask area to hopefully make a preset that looks good with higher resolutions.

Yes, screenshot or it didn’t happen, ofc.

Fake, but cheap ntsc emulation:

Running with all bells and whistles and zoomed-in monitor frame

Zoomed out and with a background image reacting to ambient light,
cold color temperature

A standard Overlay, I just elarged “the hole”
with Gimp to allow the reflections to pass through too,
aperturegrille, shamelessly over-bloomed, because why not?

Some relevant changes from the latest releases:

  • Better denoise function
  • Allow to zoom out the output
  • Bezel and reflections
  • Interlace flickering emulation (you should see it live)
  • Several performance improvements (about 5% faster now)
  • Tweaked ambient light leds parameters
  • Better Bezel hilights and reflections
  • Whole image zooming depending on the content brightness
  • Improved scene detection logic for Ambient led lights
  • Bloom: allow to choose how much it affects bright colors
  • Allow to set an RGB Mask size for HiDPI screens
  • Allow to draw a gap between rgb mask triads
  • Presets tweaking
  • VMASK: implemented green-magenta to rgb subpixel layout
  • Add support for RGB offset
  • Add Contrast, brightness and color temperature controls
  • Add support for background or alpha driven foreground images
  • Add new “vibrant tv” and “fake ntsc” presets
  • Improved bloom look
  • Add simple chroma bleed option
  • Code cleanup

Comments always appreciated, critics needed, have fun!

12 Likes

Hi there.

I just saw the new version of the shader. I tested out the NTSC profile of the shader. Do you know how to get a more accurate NTSC effect so that dither patterns and vertical lines like those you see on Genesis games get blended better? Or do I have to mess around with the bandwidth limited chroma bleeding option? Nice shader by the way!

Hi, full NTSC encoding/decoding is just not implemented (yet), so the specific “patterns to color” feature is something you cannot achieve. All of my systems was PAL, so I wasn’t interested in implementing it and by now the only thing you can do is to play with chroma bleeding, blur (input glow) and RGB shifting, but it will trick only untrained, naked eyes :slight_smile:

1 Like

Ah ok, that’s a shame. I really like the “blurry composite” feel of the shader though.

Hello, first of all I want to thank you very much for your splendid work, which has allowed people like me, not equipped with particularly performing PCs, to have truly excellent visual results with Retroarch. I mainly use your monitor shader, but I noticed that I have a strong reddish tint when using it, and it gives me the perception of offsetting the general colors a bit. Where can I adjust the shader settings to dim it? I hope you will follow the project and make other updates, in the meantime thank you very much for your attention and your precious work.

Hi there,

thanks for your kind words; trying to make koko-aio lighter enough to run on integrated consumer igp was one of the main goals, so I’m glad to hear it is working fine on your system too.

Can you post a screenshot to better show what is the issue you’re referring to?

Sorry if I’m replying late. I’ll give you some screenshots I just took :

Definitely weird, I’m unable to replicate the issue; since is evident in the PSX bios Logo, I installed Beetle PSX HW and bioses, then started a a test program and stopped at the bios logo, but my screen is fine, no reddish tint. What koko-aio version are you using?

Since some time it is available in retroarch under shaders/bezels. Please, update shaders and try from there too and let me know!

I use the version present in Retroarch, all updated to the latest version. I use the swanstation core for Playstation emulation, but trying other cores the problem remains. I also tried using GL Core video drivers instead of Vulkan, but again nothing. I also downloaded your package from Github as a last try, but nothing. Of course, the video card drivers are also up to date.

So we need to isolate the issue,

If you enter in the shader settings while a reddish screen is displayed, you can selectively disable or enable the shader features (0=disable, 1=enable).

The switches are marked by a star symbol, eg:

image

Please, try disabling one by one and see if the problem goes away.

Done, I modified an item, saw the result, then reloaded the shader and tried another item. I also tried turning off the color correction. All useless, even if this reddish halo remained in the background of varying intensity. I’m starting to think it’s an ATI driver problem.

You can just disable all of the items and see if the reddish tone remains, it is faster. However, if you did it one by one without success, unfortunately I think that the issue lies in the driver. Being myself on Linux, I fear I can’t help you much more. But even if it is not a perfect solution, you could try to tweak the color temperature setting to a more cold value (try around 7200k). This will lower the red tone more and probably a bit of green, but maybe it will be still an improvement.

Out of curiosity, what’s your hardware?

1 Like

I have a mini PC AMD Ryzen 7 2700U with Radeon Vega Mobile Gfx and 16 GB of Ram, and I use Windows 11 as an operating system. However the situation has improved slightly following your advice, even if I am convinced there is some driver problem with the Ati. Anyway thank you so much for your help and please continue this project which is great. Thank you

2 Likes

Hello, I wanted to let you know that I have located the problem at the root of my reddish color. Under “RGB Masks and/or Darklines enable?”, if I deactivate the “(LoDPI) Green, Magenta - BGR” option by setting it to 0, the problem disappears as if by magic :slight_smile:

Ahah!

So you didn’t really deactivated all of the switches :slight_smile:

Also, this does not explain why I see the same reddish tone in the psx logo screenshot you posted.

My bet is that your screen is running a scaled resolution somehow… I’m on mobile right now, tomorrow i’ll check better.

Anyway, being you on 1080p, if you disable that green/magenta trick, i suggest you to disable the gap between the triads too to keep more brightness.

2 Likes