Koko-aio shader discussions and updates

Hi @kokoko3k ! I love your shaders, especially Tv-NTSC_Generic-FXAA_sharp-Selective for N64. It makes the low-res HUDs look quite nice. And ParallelRDP with 2x upscale and 1/2 downsampling takes care of the 3d polygons and jagged edges. This combination results in a very good experience overall, at least to my eyes :slight_smile:

Just one question. Are your presets overall tuned to 1080p or 4k? Is there anything I should change in Tv-NTSC_Generic-FXAA_sharp-Selective when using a 4k display? Not sure if it’s just my brain playing tricks on me, but I wonder if scanlines should be ever so slightly more pronounced when using a 4k display.

Oh, and a final question: are planning to release a new version? I saw you pushed several commits since last version already. Thanks!!!

Thank you!

1 Like

Hi there,
glad to hear you’re satisfied with that preset; I test my preset on a 1080p display, so they are optimized for that size, as per the scanline look, they should look better on 4k without touching anything.
However, if you want they to look more pronunced, you can try to set the parameter:
"Scanlines (0 to disable)" from 1.0 to 1.25.

If it is not enough, another parameter you can play with, since you’re on a 4k display (on 1080p it is likely to produce moire) is:
"Overmask (1.0 = neutral)" to something greater than 1.0; whatch out for moire anyway for higher values.

Overmask Examples (open in a new window at 100%)

Overmask = 1.0:

Overmask = 1.5:

You may want to lower the halo strength as overmask is pushed higher by the scaled amount to keep the brightness as the same level, eg: since we pushed overmask by 1.5, i reduce the halo by that amount (0.5/1.5 = 0.333), the same probably applies to bloom mix, but i’ve not touched it in the next example:

Overmask = 1.5; halo = 0.33:

New version is certainly coming, but i cannot tell you when, since i’m a bit busy atm; however you can try the development releases from the main repository linked in the first post.

3 Likes

Updated my install with the latest dev repo - nice!

6 Likes

Snake preview of more work on scanline look.
Finally I managed to find a way to let them vertically grow much much more than before.

My previous attempts with the canonical way always led to absymal performance, and they were all not compatible with other shader features (staggering, moire mitigation and so on)

but finally I found a way that is almost free:
Warping coords and keep using my beloved sin(), yay!

I’m still working on it (nothing released yet), but the results are promising, rounder and yet sharp look:

16 Likes

Love the contrast and the edges man!

1 Like

Just pushed a bunch of changes/fixes, including the new scanline function.

If you want to test, this is the new parameter, inflation strength, under scanline section:

Screenshot_20240510_154614

It has been set to 0.5 for all of the presets, but the handhelds ones, so every preset should look a bit better now.

0.5 is a bit conservative, you may want to try higher values, by keeping in mind that going over 1.0 is only adviced when you set “Phosphors height MAX” to a low value; very particular cases i’ve yet to experiment with.

8 Likes

I cried, so beautiful

1 Like

Works great - well done.

4 Likes

Still tweaking…or should I say playing…

2 Likes

By combining scanline inflation with a lower glow light sharpness, the picture rounds more and seems to mantain an acceptable sharpness:

Params
DO_CCORRECTION = "1.000000"
IN_GLOW_POWER = "1.600000"
TEMPERATURE = "7200.000000"
IN_GLOW_GAMMA = "2.000000"
GAMMA_OUT = "0.500000"
DO_SHIFT_RGB = "1.000000"
OFFSET_STRENGTH = "0.250000"
SHIFT_R = "-20.000000"
SHIFT_G = "1.000000"
SHIFT_B = "20.000000"
DO_IN_GLOW = "1.000000"
IN_GLOW_BIAS = "0.000000"
IN_GLOW_SPREAD = "1.999999"
IN_GLOW_SPREAD_SHARPNESS = "1.149999"
IN_GLOW_W = "1.999999"
IN_GLOW_H = "2.999998"
RESSWITCH_GLITCH_SIZE = "0.000000"
DO_PIXELGRID = "1.000000"
PIXELGRID_MIN_H = "0.300000"
PIXELGRID_MAX_H = "0.700000"
PIXELGRID_INFLATION = "1.500000"
PIXELGRID_GAMMA_H = "5.199998"
PIXELGRID_DECON_R_H = "-0.600000"
PIXELGRID_DECON_B_H = "0.600000"
PIXELGRID_H_PRST = "5.000000"
PIXELGRID_MAX_W = "0.400000"
PIXELGRID_GAMMA_W = "1.500000"
PIXELGRID_BASAL_GRID = "0.020000"
PIXELGRID_Y_MASK = "0.300000"
PIXELGRID_Y_MASK_HEIGHT = "-2.000000"
PIXELGRID_Y_MASK_STEEP = "4.000000"
DO_HALO = "1.000000"
HALO_NO_PREGAIN = "1.000000"
HALO_POWER = "0.600000"
HALO_SHARPNESS = "7.000000"
HALO_GAMMA = "1.000000"
HALO_GAMMA_OUT = "1.300000"
HALO_VS_SCAN = "1.000000"
DO_BLOOM = "1.000000"
BLOOM_MIX = "0.300001"
BLOOM_GAMMA = "3.000000"
BLOOM_GAMMA_OUT = "2.200000"
BLOOM_POWER = "3.899997"
BLOOM_EYE_ADPT_SRT = "0.600000"
BLOOM_EYE_INERTIA = "10.000000"
BLOOM_OVER_WHITE = "0.000000"
DO_CURVATURE = "1.000000"
GEOM_CORNER_SMOOTH = "150.000000"
DO_BEZEL = "1.000000"
BEZEL_INNER_ZOOM = "-0.011000"
BEZEL_FRAME_ZOOM = "0.170000"
DO_VIGNETTE = "1.000000"
V_SIZE = "1.080000"
DO_SPOT = "1.000000"
S_POWER = "0.060000"
DO_DYNZOOM = "0.000000"
7 Likes

NG-1.9.20 Is up on Github and should be available via online update soon.

NEWS:

  • Allow to set glow light sharpness.
  • Allow to modulate reflected and diffused light fadeout.
  • New Monitor-Screen_Hmask-Screen_SlotMask-Chameleon preset.
  • New Monitor-Screen_Hmask-Screen_SlotMask_Taller_Brighter preset.
  • Real-time autocrop.
  • Add Gameboy Color Presets.
  • Scanlines inflation (rounder image)

FIXES:

  • Tate: Fake scanline size compuration was using the wrong dimension.
  • Little border between the bezel and the content will be visible even when using geometry overrides or luminosity tied zoom.
  • Keep ambient leds in place when using bezel and geometry override zoom.
  • Adapt ambientlight sampling point to geometry override zoom/aspect.
  • Fixed Deltarender (not sure when it broke).

CHANGES:

  • Better bezel reflections.
  • Tuned ambientlight stretching for vertical games.
  • Auto fake integer scanlines will kick in with lower screen resolutions.

MISC:

  • Code cleanup.
  • Several performance improvements, we’re almost back to 4.1 levels.
  • Several presets updates.
16 Likes

Fantastic work - thank you so much!

7 Likes

Yep, looking good.

5 Likes

So many shaders, so little time…

Greetings @kokoko3k, I’m not sure if this has been asked already but seeing that this is such an efficient shader when it comes to quality/performance cost, is it possible to further push the efficiency envelope by doing away with the Bezel and ambient lighting if a user wanted to do so?

2 Likes

I’m not that awake rn, but have you looked through the documentation, iirc there’s something about commenting out parameters to hardcode the values for a performance boost (I’m unsure how relavent it is to this tho, I do understand this is different from outright removing the code completely, but speed boost is speed boost)

2 Likes

It would surely go up, but not that much.

By pure gut feeling, it would go from about 100fps on my haswell at 1080p and 240p content to 110-120.

This is because I’ve put to about 100fps the target speed and a certain set of features while developing, so the shader has the maximum performance/cost with those features enabled.

If you disable everything, it will not fly, but will reveal a quite high basal consumption.

To simplify, setting the params to statics will lower it because the shader have not to check for every single pixel if it has or not to do that or the other feature, but the basal cost due to the multiple passes (which in turn are good when they work in sinergy to provide all the features) will stay still.

However It is possible to reuse the existing code to create a new shader without all the bells and whistles (just mask,glow,bloom) and there it would be much faster.

Can I ask you why you’re asking?

3 Likes

Just wondering how fast it can go because not everyone needs the Bezel, reflections and lighting effects.

The faster it can go, the lower the performance requirements and the wider the range of hardware it can run on.

2 Likes

Wondering if anyone has realistic FPS targets for content greater then 240p on Haswell? I’m running an i5-4200m in Windows, so using GLCore, at 1080p. I’ve been testing against Championship Sprint, which is 512x384 @60.09Hz, using the Mame core. I’m having a hard time maintaining 60FPS using the Monitor-Balanced preset and also taking advantage of config-user.txt. Seemed like using config-user.txt only gave me a few FPS boost.

Considering that final fight (384x224) reaches about 100fps with that preset here (i5-4590), yeah, it seems we are 20% under for championship sprint, at least on paper. Roughly.

However I think i tried to play hires games that don’t use hardware renderers (so mame) and they were ok; I’ll tryn) asap.

Btw, you’ve several options you can mix and I’ve read tou already tried config-user.txt, but still:

  1. config-user.txt turn parameters static, used fully, gave me 25% boost, it should suffice, but not that handy.

  2. again, config.txt, have you already used:
    #define HALVE_BORDER_UPDATE 1.0
    #define SKIP_RANDOM 1.0

  3. still config.txt:
    #define DELTA_RENDER 1.0
    then tune the relative parameters: (I use the following on my s10 to save battery, limit throttling and gain fps):
    #define DELTA_RENDER_FORCE_REFRESH 7.0 #define DELTA_RENDER_CHECK_AREA 3.0

Delta render works very well for static content like Championship Sprint.

  1. This would easilly double ypur fps allowing me to play Flycast 640x480 (which taxes the gpu by its own (being hardware redndered) at 1080p with shader on:
    In shader menu, turn the pass named flick_and_noise from 2x to 1x scaling and apply the changes.

After that some effects will cease to work like fxaa, other will behave different (glow blur pass may need sharpness adjust), but that is not that important for hires content.

This is what Batpcera uses for hires content. maybe I should release some 1x presets.

I’ll update this post as soon as I’ll test CS on my intel rig.

EDIT- Just checked, and without any mod on my side, I can reach 70+ fps without any special setting.
Don’t pay attention to the scanline size, it is so because the shader is interlacing it:

This is on Archlinux with GLCore, with an Intel® Core™ i5-4590 CPU @ 3.30GHz

3 Likes

Hmm, thank you for the ideas and for testing! I am pretty new to going any deeper with shaders than switching presets, so will try your ideas out. I’ve got another machine running Batocera on an i5-4670s, and I see the same low FPS there. I’m using Vulkan on the Batocera machine, though, and was trying the various Duimon presets it includes. I see the FPS drop for other games with the same res like Super Sprint and APB. I don’t know what the right term is, but the screen shakes and hops on those games, too. Arch Rivals is another game that shakes and hops really bad, but it’s at a different res and runs at 30hz. Seems likes maybe there are some RA settings I need to tweak rather than tweaking the shader settings.