Koko-aio shader discussions and updates

Hi there, I’m glad you’re enjoying it.

As for integer scaling, it is something i’m considering to add, but still thinking how.
Since I’ve no use for it, I need to know more specifically what it would be required to do.
Would be ok if I add something like ā€œsnap to integer scalingā€ into an already in place zoom parameter?
So that if one set, say, a zoom of 0.47, it will stay at 1x till the zoom parameter reaches a value that allow for a 2x integer scale and so on, or there is more, maybe?

Black level adjustment: can you elaborate?
The shader already provides brightness, gamma in and out and contrast adjustments, so I fail to understand what would be the use case.

As for more background images, have you seen the repo containing external overlays linked in the first post or maybe do you refer specifically to simple repeating patterns?

Deconvergence already allows for vertical and horizontal adjustments. It is just that, to spare some parameter, it works in a particular way:
it moves over the x and when it reaches the end of the row it goes one row down and start to walk on that row and so on. More or less like a text editor with auto CR when you reaches the end of a line. Not intuitive, i know.

1 Like

Integer scaling. Mega Bezel has this feature, and it seems to work fine. Perhaps you can play with it and see if you can come up with an idea to implement this into your shader.

Black level… I can’t explain this very well. If you raise the black level, true blacks will become brighter and less black (between grays and blacks) so you’ll see scanlines and mask details in the otherwise all black areas. This is used to emulate CRT monitors with non-perfect blacks. Many real CRTs (without calibration) are like that. You can also lower the black level to make colors that are not that black into true blacks. This feature can be found in grade, image adjustment, guest’s shader and probably some other shaders.

And yes I mean repeatable background patterns. :smile:

I’m not a gfx artist so make a pattern takes me too much time, but if you find other royality free or licensable patterns that can be included, I’ll be glad to add them.

What I was asking about black level is why the same cannot be achieved with brightness and contrast options.
Since brightness can translates everything up and contrast modulates the difference between pure black and pure white, you can make black=gray by highering the brightness and lowering the contrast to avoid clipping white.
Trivially, you can crush blacks, if wanted, by lowering the brightness and highering the contrast to keep white.

I’ll add this to the things that can be done, but meanwhile you have an alternative, at least. :slightly_smiling_face:

1 Like

Thanks for the reply :grinning:

Adjusting contrast and brightness usually cannot achieve the same effect as the other colors will be greatly affected (more washed-out look). I suppose that’s why we need this feature as a dedicated option.

EDIT: I guess I can just put grade.slang as the 1st pass to adjust black level the way I wanted. Let me try and see if it works. :nerd_face:

The only way to not affect other colors, is to clamp/clip the black or the white, but i doubt this was what happened on uncalibrated crts.

Here you go, in grade.slang, i see:

> #pragma parameter g_lift         "Black Level"          0.0 -0.5 0.5 0.01
> #define lift            params.g_lift
> contrast += (lift / 20.0) * (1.0 - contrast);

It is understandable what it does, Black level is g_lift, g_lift is lift and lift seems to be just a contrast modifier.

So in the end it seems just a shortcut for the contrast.

The other colors will be affected to some degree. But not linearly/proportionally I suppose. Visually the blacks and near-blacks are affected a lot more.

Thanks for taking your time explaining this. I’ll try to experiment with the options available. :grinning:

Grade didn’t worked for me complaining a missing LUT, so i tried guest and pushed the black level to max, confirming my expectations: lower contrast higher brightness :wink:

-EDIT-
Oh wait, it seems that when it lowers the black level, it acts like i said, but when it pushes the black level it literally pushes just the deepest black level, the following is a closeup of the left side of a purple gradient after raising the black level to the max via guest shader:

image

If you watch closely, you see that only the deepest black is raised, I find it odd.

@guest.r: why is that way? I inspected the code and it seems made on purpose.

2 Likes

I believe guest did this on purpose to affect only the ā€œblack blacksā€ so the other colors remain vivid and colorful.

2 Likes

Yes, but you end up with the deepest black being brighter than the less deep black…

edit

Maybe a clamp to the lowest wanted black is better, can’t say, waiting for @guest.r opinion on this.

I’d still go for the classic analogue/like approach thoug :slight_smile:

2 Likes

Yes, it’s a simple implementation to raise black levels only. Most emulated games don’t have a dense distribution of colors at any brightness so i don’t see it as a major issue. If i would just add a grayscale color value to all colors evenly then darker colors would get heavily desaturated.

I didn’t get negative feedback on the feature since it exsisted so i’ll probably best leave it this way although more fuzzy logic implementations are possible, for example by adding color + bl*color if color isn’t black…including a proper mitigation to prevent clipping.

2 Likes

Crystal clear, thanks. I don’t know how i feel on this.

Simple things can gets complicated sometimes :thinking:

…edit

Well, if the target is emulating the real thing, then you can see phosphors/grille/mask on black pixels only when there is an external light reflected by the tube. And if an external light brightens the tube, then the colors on it will actually be desaturated. This effect is less visible as the image is brighter ofc.

In the end, i still think every needed tool is already in place, adding gamma to the mix, one can:

Push brightness (to raise black level and everything), lower contrast (to avoid white clip), higher the gamma (to restore some lost saturation).
I could add a shortcut for that trio in the future.

2 Likes

Hi there, I did a 0.2 release of my dedicated Arcade presets.
Forked from the most recent koko-aio Github code:


Here are some eye candies, enjoy (screenshots in MacOS RetroArch with HDR enabled)! Feedback of course much appreciated.

Space Invaders Deluxe (Backdrop)

Discs Of Tron (Backdrop)

5 Likes

Backdrop presets are so sexy!

2 Likes

Hey @kokoko3k do you know why this thin white edge appears on every bg_over.png that I edit for koko-aio ?

Screenshot_2

It looks correct when viewed in Photoshop and elsewhere:

It’s extremely annoying, and doesn’t let the bg_over blend seamlessly with the shader’s bezel.

1 Like

I think this is a result of the matte used for the alpha. @HyperspaceMadness introduced a parameter in the Mega Bezel to mitigate this, by letting the user choose between a black, white, or no matte.

A Photoshop trick is to use a 1% opacity bottom layer that is white or black. This guarantees a white or black matte respectively.

You can try each to see if either fixes the issue.

Alternatively you can try to change or remove the matte color in Photoshop>Layer>Matting but I haven’t had much luck.

3 Likes

It is probably as @Duimon say, but still i never found it to be a problem when overlaying over, so maybe there is more to understand.

Can you send me a test preset for me to check?

@kokoko3k FYI, following this report that apparently did concern your work, it is now possible for a shader to retrieve libretro’s rotation index.

3 Likes

Uhuh, great news, thank you very much!

Waiting for stable release to add support the proper way and ditch the hacky way i’m using till now.

1 Like

Intger scaling is avaliable in git repo, enable it via:
ā€œOverride content geometry -> Integer scale.ā€

A few notes on it:

  • It scales by taking height into account
  • Luminosity dependant zoom must be turned off
  • Inner zoom (in bezel group) is ignored
  • Options in Override content geometry override integer scaling
  • Bezel Frame zoom has to be set again (once) when enabling integer scaling:

Please, test and report if it works of for you!

2 Likes

Is this supported 8n all the graphics drivers?