Koko-aio shader discussions and updates

Ops, wait i misread your message, yes, indeed, it has to be a rounding ‘error’ due to pixels being not 1:1 as in gameboy.

Not a big deal, since the intended ‘audience’ are handheld 1:1 games, that was just a nintendo vs sega joke.

Meantime i found a solution for the problem i originally thought you were referring to, that the grid itself is not colored has the background, and i was just answering to that.

For that, it would be enough to colorize the grid as the rest of the content, quite cheap.

[EDIT]: Fixed in the latest dev code

3 Likes

No problem. I was refering the horizontal lines of the grid.

1 Like

Exactly the Gameboy shader I have been waiting for, as it is also very performant. Tons of thanks again!!!

3 Likes

While i was trying to do something that could look similar to the screen to handheld devices, i ended up with something other.
With this new “Low level Phosphor grid”, one can shape single r,g,b phosphors, by deciding how they grow in width and height.
This function superseeds and is NOT compatible with any other mask option already in place like rgb masks, aperture grille, slot mask or scanlines, but, being able to draw phosphors on core coordinates (to emulate handheld devices screens) or screen coordinates, you can effectively emulate scanlines and aperture grille screens with good, if not better, results.

This is an handleld screen that looks like a dot matrix screen because you can choose how “tight” the phosphors are, and in the following screen there is maximum tightness, which results in them to blend each other and gice a rounded look.

pgrid1.slangp

In the following image, i lowered the “tightness” of the phosphors and removed any luminosity boost feature; you should be able to see how phosphors morph, and probably it would even look good if you burn your oled screen:

pgrid2.slangp

When drawing phosphors on core coordinates, they have the size of the source pixel, not the size of the screen one.
I thought it would come handy a function to multiply and divide the phosphor size by an integer value, and in the next screen you can see how it looks when dividing the X size by 2.
I suspect that it would look on 4k display, but i couldn’t tried that.

pgrid2.slangp
(with size divider)

In this picture, the phosphors are still at core resolution, and to my surprise they look good even when emulating arcade games.
Note that no scanline function has been used, just the new pixelgrid function. the scanline gaps are not drawn at all. you see them because the phosphors shape changes depending on the pixel luminosity.

pgrid3.slangp

This is what happens when leaving the y resolution at core size (you see scanlines), but you set the x resolution to screen size (you see something like aperture grille):

pgrid4.slangp

…finally the final result i was working for, handhelds screen emulation; in the following shot the integer scaling has been set to 5x:

pgrid7.slangp

…there are other presets i added to the development repo, all named pgrid*.slangp for you to try and for which i forgot to take a screenshot.

What do you think?

12 Likes

:exploding_head:

Wow! Great job! Nice out of the box thinking! All of these look awesome! Loving the clarity and sharpness as well!

How’s the performance with this different approach?

2 Likes

I think it’s great to try to have more flexible LCD-based shaders. I’ve also observed with the current ones, that if you increase the resolution (e.g. by using the normalx2) filter it can make a better image for high-res displays. The “LCD Shader” also has a variable cell scale parameter, but in practice I’ve only found the default useful, anything else looks to rough.

I also have a 20" 480p LCD with VGA input. The grid is very visible, it does comes off somewhat aperture like once you put scanlines on there

4 Likes

Well considering that it can superseed scanlines and mask emulation, pretty good.

I’ve not made any precise measuerement, but i expect no more than a 5% gpu use penalty on my haswell if compared to scanline+aperturegrille+rgb mask.

Also, being the phosphors able to grow in width, there should be less need to ‘brightness push’ workarounds.

I’ve to explore the possibility to offset the phosphors to do slotmask too, and i expect this new method to be more robust versus artifacts that may be visible with slotmask+curvature, let’s see how it goes.

3 Likes

I prefer this one for GBA IMO. Looks really good.

2 Likes

Those look so amazing!

1 Like

Wow! This is looking fantastic! :star_struck: I’m really excited about a more flexible matrixish shader like this!

@Duimon, you might be interested too :slight_smile:

6 Likes

Yes, I certainly am. :star_struck:

I was also wondering if it was possible to come up with a Color LCD shader that has the blending and drop shadow the Game Boy shader has.

I’ve seen screenshots of a legacy shader that did, but have never seen one available.

1 Like

@Duimon I think you can achieve that in koko-aio by mixing the shadow feature under ‘dot matrix’ emulation with the blending of the ‘phosphor grid’.

I’ve to check out if they are in the correct order.

But what console had this, Gameboy color?

1 Like

I just tried your dev repo, and all shaders load, except any of the pgrid ones (using Vulkan)…is it working for others?

I think i made some mistake compiling them, probably wrong reference path. I’ll take a look asap.

EDIT Indeed, there were broken references, please try again.

2 Likes

I can confirm that they are now working. Thanks.

2 Likes

Glad to hear that. Keep in mind that i made them in a matter of minutes in a rush yesterday; something like “load a random game”, tune parameters till it looks ok, take screenshot, save preset, make another preset, so if you find something weird, it could be expected :slight_smile:

2 Likes

Just drafted 4.1 release on the repo with changes till gameboy mono emulation (phosphor grid left out), it sohuld be availablle on retroarch online update shortly.

  • Add a standalone/stripped down version for gameboy mono emulation only in misc folder
  • Dot matrix emulation with grid shadow and motion blur
  • Allow to emulate monochrome display colorization
  • Add gameboy mono preset
  • Apply curvature later in the chain so that it is consistent whan inner zoom changes.
  • Allow to ignore aspect when doing integer scaling -> integer scale along both axes.
  • Allow wrap mode in shader again
  • Use mimpaps again to sample bezel lut as it gives rounding errors on amd side
  • Add TATE mode
4 Likes

None. I just think it looks cool. :wink:

2 Likes

Added basic slotmask functionality to the low phosphor grid emulation function: image

still playing with it; parameters ar a bit messy atm because i’ve still to figure out where this thing has to go, btw:

You can emulate slotmask at screen resolution:

Or at core resolution:

And @Cyber: basal performance hit on my haswell is about 2% just because there is another function living in the code, but actually, the new code proves to be faster (3%) than the old if it replaces masks and scanlines, there are still missing features tho.

6 Likes

I’m really enjoying this direction of being able to morph the phosphors / dots in so many ways :exploding_head: :star_struck:

6 Likes