Koko-aio shader discussions and updates

My gpu couldn’t stand it, a poor haswell struggled at about 3fps even at 1080p, what kind of monster do you run it on?

That would be my pride and joy RTX3080 / i7-11700K setup :face_with_hand_over_mouth:

could you post that second variation whole shader instead of simple preset ? it fail to load , I even tried updating to latest from your github

With that being said judging from photos alone they seem to have thick grid , I tried to make the grid as thin as possible to preserve brightness/gamma .

From what I tried ,even if you have high nits display , having thick grid or thick crt scanlines (black lines) will destroy the gamma or if you force brightness on it , it will start clipping and generally it would be unpleasant to look at in bright scenes . Not to mention the thick grid/scanlines can be distracting from the image

Think about the clean look you get from a simple bilinear. Or if you wanna factor in color vibrance and sharpness : scalefx / xbr

Ultimately , I would like a crt/grid shader that can preserve brightness , gamma , contrast , white balance ,sharpness and color vibrance from raw image .

I feel that any mask implementation that can preserve all of that will not be possible from the display hardware alone.

It was not a simple preset, I just posted you the new parameter values, you were supposed to edit the 00.slangp you posted before and replacing them, they are in the middle, quite easy to spot ant cut in block. Btw, here is the full one, it is supposed to live in the same place as the 00.slangp you posted before, it should work.

preset here
shaders = "17"
feedback_pass = "0"
shader0 = "shaders_slang/koko-aio-slang-main_2/koko-aio-slang-main/shaders-ng/colortools_and_ntsc_pass.slang"
filter_linear0 = "false"
wrap_mode0 = "mirrored_repeat"
mipmap_input0 = "false"
alias0 = "colortools_and_ntsc_pass"
float_framebuffer0 = "false"
srgb_framebuffer0 = "false"
scale_type_x0 = "source"
scale_x0 = "1.000000"
scale_type_y0 = "source"
scale_y0 = "1.000000"
shader1 = "shaders_slang/koko-aio-slang-main_2/koko-aio-slang-main/shaders-ng/flick_and_noise.slang"
filter_linear1 = "false"
wrap_mode1 = "mirrored_repeat"
mipmap_input1 = "false"
alias1 = "flick_and_noise_pass"
float_framebuffer1 = "false"
srgb_framebuffer1 = "false"
scale_type_x1 = "source"
scale_x1 = "2.000000"
scale_type_y1 = "source"
scale_y1 = "2.000000"
shader2 = "shaders_slang/koko-aio-slang-main_2/koko-aio-slang-main/shaders-ng/fxaa.slang"
filter_linear2 = "false"
wrap_mode2 = "mirrored_repeat"
mipmap_input2 = "true"
alias2 = "FXAA_pass"
float_framebuffer2 = "false"
srgb_framebuffer2 = "false"
scale_type_x2 = "source"
scale_x2 = "1.000000"
scale_type_y2 = "source"
scale_y2 = "1.000000"
shader3 = "shaders_slang/koko-aio-slang-main_2/koko-aio-slang-main/shaders-ng/shift_and_bleed.slang"
filter_linear3 = "true"
wrap_mode3 = "mirrored_repeat"
mipmap_input3 = "false"
alias3 = "shift_and_bleed_pass"
float_framebuffer3 = "true"
srgb_framebuffer3 = "false"
scale_type_x3 = "source"
scale_x3 = "1.000000"
scale_type_y3 = "source"
scale_y3 = "1.000000"
shader4 = "shaders_slang/koko-aio-slang-main_2/koko-aio-slang-main/shaders-ng/in_glow_x.slang"
filter_linear4 = "true"
wrap_mode4 = "mirrored_repeat"
mipmap_input4 = "true"
alias4 = "in_glow_pass_x"
float_framebuffer4 = "true"
srgb_framebuffer4 = "false"
scale_type_x4 = "source"
scale_x4 = "1.000000"
scale_type_y4 = "source"
scale_y4 = "1.000000"
shader5 = "shaders_slang/koko-aio-slang-main_2/koko-aio-slang-main/shaders-ng/in_glow_y.slang"
filter_linear5 = "true"
wrap_mode5 = "mirrored_repeat"
mipmap_input5 = "false"
alias5 = "in_glow_pass"
float_framebuffer5 = "true"
srgb_framebuffer5 = "false"
scale_type_x5 = "source"
scale_x5 = "1.000000"
scale_type_y5 = "source"
scale_y5 = "1.000000"
shader6 = "shaders_slang/koko-aio-slang-main_2/koko-aio-slang-main/shaders-ng/halo_pre_gamma.slang"
filter_linear6 = "true"
wrap_mode6 = "clamp_to_edge"
mipmap_input6 = "false"
alias6 = "halo_pass_x"
float_framebuffer6 = "true"
srgb_framebuffer6 = "false"
scale_type_x6 = "source"
scale_x6 = "1.000000"
scale_type_y6 = "source"
scale_y6 = "1.000000"
shader7 = "shaders_slang/koko-aio-slang-main_2/koko-aio-slang-main/shaders-ng/halo.slang"
filter_linear7 = "true"
wrap_mode7 = "clamp_to_edge"
mipmap_input7 = "false"
alias7 = "halo_pass"
float_framebuffer7 = "true"
srgb_framebuffer7 = "false"
scale_type_x7 = "source"
scale_x7 = "1.000000"
scale_type_y7 = "source"
scale_y7 = "1.000000"
shader8 = "shaders_slang/koko-aio-slang-main_2/koko-aio-slang-main/shaders-ng/avglum_pass.slang"
filter_linear8 = "true"
wrap_mode8 = "mirrored_repeat"
mipmap_input8 = "false"
alias8 = "avglum_pass"
float_framebuffer8 = "false"
srgb_framebuffer8 = "false"
scale_type_x8 = "source"
scale_x8 = "0.500000"
scale_type_y8 = "source"
scale_y8 = "0.500000"
shader9 = "shaders_slang/koko-aio-slang-main_2/koko-aio-slang-main/shaders-ng/reflection_blur_pre.slang"
filter_linear9 = "true"
wrap_mode9 = "clamp_to_border"
mipmap_input9 = "false"
alias9 = "reflected_blurred_pass_pre"
float_framebuffer9 = "false"
srgb_framebuffer9 = "false"
scale_type_x9 = "source"
scale_x9 = "1.000000"
scale_type_y9 = "source"
scale_y9 = "1.000000"
shader10 = "shaders_slang/koko-aio-slang-main_2/koko-aio-slang-main/shaders-ng/reflection_blur.slang"
filter_linear10 = "true"
wrap_mode10 = "mirrored_repeat"
mipmap_input10 = "false"
alias10 = "reflected_blurred_pass"
float_framebuffer10 = "false"
srgb_framebuffer10 = "false"
scale_type_x10 = "source"
scale_x10 = "1.000000"
scale_type_y10 = "source"
scale_y10 = "1.000000"
shader11 = "shaders_slang/koko-aio-slang-main_2/koko-aio-slang-main/shaders-ng/bloom_pass_1.slang"
filter_linear11 = "true"
wrap_mode11 = "mirrored_repeat"
mipmap_input11 = "false"
alias11 = "bloom_pass_1"
float_framebuffer11 = "false"
srgb_framebuffer11 = "false"
scale_type_x11 = "source"
scale_x11 = "1.000000"
scale_type_y11 = "source"
scale_y11 = "1.000000"
shader12 = "shaders_slang/koko-aio-slang-main_2/koko-aio-slang-main/shaders-ng/bloom_pass_2.slang"
filter_linear12 = "true"
wrap_mode12 = "clamp_to_edge"
mipmap_input12 = "false"
alias12 = "bloom_pass_2"
float_framebuffer12 = "false"
srgb_framebuffer12 = "false"
scale_type_x12 = "source"
scale_x12 = "0.500000"
scale_type_y12 = "source"
scale_y12 = "0.500000"
shader13 = "shaders_slang/koko-aio-slang-main_2/koko-aio-slang-main/shaders-ng/bloom_pass_3.slang"
filter_linear13 = "true"
wrap_mode13 = "clamp_to_edge"
mipmap_input13 = "false"
alias13 = "bloom_pass_3"
float_framebuffer13 = "false"
srgb_framebuffer13 = "false"
scale_type_x13 = "source"
scale_x13 = "1.000000"
scale_type_y13 = "source"
scale_y13 = "1.000000"
shader14 = "shaders_slang/koko-aio-slang-main_2/koko-aio-slang-main/shaders-ng/bloom_pass_4.slang"
filter_linear14 = "true"
wrap_mode14 = "mirrored_repeat"
mipmap_input14 = "false"
alias14 = "bloom_pass_final"
float_framebuffer14 = "true"
srgb_framebuffer14 = "false"
scale_type_x14 = "source"
scale_x14 = "1.000000"
scale_type_y14 = "source"
scale_y14 = "1.000000"
shader15 = "shaders_slang/koko-aio-slang-main_2/koko-aio-slang-main/shaders-ng/ambi_temporal_pass.slang"
filter_linear15 = "true"
wrap_mode15 = "clamp_to_border"
mipmap_input15 = "false"
alias15 = "ambi_temporal_pass"
float_framebuffer15 = "true"
srgb_framebuffer15 = "false"
scale_type_x15 = "viewport"
scale_x15 = "0.050000"
scale_type_y15 = "viewport"
scale_y15 = "0.050000"
shader16 = "shaders_slang/koko-aio-slang-main_2/koko-aio-slang-main/shaders-ng/final_pass.slang"
filter_linear16 = "true"
wrap_mode16 = "mirrored_repeat"
mipmap_input16 = "false"
alias16 = "final_pass"
float_framebuffer16 = "false"
srgb_framebuffer16 = "false"
scale_type_x16 = "viewport"
scale_x16 = "1.000000"
scale_type_y16 = "viewport"
scale_y16 = "1.000000"
filter_linear22 = "false"
wrap_mode22 = "clamp_to_border"
mipmap_input22 = "false"
alias22 = ""
float_framebuffer22 = "false"
srgb_framebuffer22 = "false"
scale_type_x22 = "source"
scale_x22 = "1.000000"
scale_type_y22 = "source"
scale_y22 = "1.000000"
DO_CCORRECTION = "1.000000"
IN_GLOW_POWER = "2.499999"
LUMINANCE = "0.250000"
CONTRAST = "0.020000"
TEMPERATURE = "7000.000000"
IN_GLOW_GAMMA = "2.000000"
GAMMA_OUT = "0.500000"
OFFSET_STRENGTH = "0.300000"
SHIFT_R = "-20.000000"
SHIFT_B = "20.000000"
IN_GLOW_SPREAD = "0.000000"
IN_GLOW_W = "7.000000"
IN_GLOW_H = "7.000000"
DO_PIXELGRID = "1.000000"
PIXELGRID_SIZE_W = "0.000000"
PIXELGRID_H_PRST = "0.000000"
PIXELGRID_R_SHIFT = "1.500000"
PIXELGRID_G_SHIFT = "1.500000"
PIXELGRID_B_SHIFT = "1.500000"
PIXELGRID_MIN_W = "0.400000"
PIXELGRID_MAX_W = "0.500000"
PIXELGRID_MIN_H = "0.400000"
PIXELGRID_MAX_H = "0.500000"
PIXELGRID_Y_MASK = "0.000000"
PIXELGRID_Y_MASK_COORDS = "0.000000"
PIXELGRID_Y_MASK_HEIGHT = "1.000000"
PIXELGRID_Y_MASK_OFFSET = "0.000000"
PIXELGRID_Y_MASK_STEEP = "4.000000"
DOT_M_G_SHARP = "20.000000"
DOT_M_MBLUR_STR = "0.000000"
DO_HALO = "1.000000"
HALO_POWER = "0.099998"
HALO_SHARPNESS = "3.599989"
HALO_GAMMA = "1.400001"
HALO_VS_SCAN = "1.000000"
DO_BLOOM = "1.000000"
BLOOM_MIX = "0.150000"
BLOOM_SIZE = "0.500000"
BLOOM_QUALITY = "2.000000"
BLOOM_GAMMA = "5.000000"
BLOOM_GAMMA_OUT = "1.200000"
BLOOM_POWER = "2.350000"
BLOOM_EYE_ADPT_SRT = "1.700000"
BLOOM_EYE_INERTIA = "2700.000000"
BLOOM_OVER_WHITE = "0.350000"
DO_CURVATURE = "1.000000"
GEOM_WARP_X = "0.000000"
GEOM_WARP_Y = "0.000000"
GEOM_CORNER_SIZE = "0.010000"
AMBI_STRETCH = "0.200000"
DO_DYNZOOM = "0.000000"
V_SIZE = "3.049999"
V_POWER = "1.000001"
GLOBAL_ZOOM = "3.000000"
ASPECT_X = "-4.000000"
ASPECT_Y = "0.000000"
GAME_GEOM_INT_SCALE_MAX = "5.000000"
GAME_GEOM_ZOOM = "2.000000"
GAME_GEOM_OFF_FIX = "4.000000"
TILT_X = "-0.500000"
TILT_Y = "-0.500000"
TILT_FOV = "1.500000"
DELTA_RENDER_FORCE_REFRESH = "1.000000"
textures = "monitor_body_curved;monitor_body_straight;bg_under;bg_over;backdrop"
monitor_body_curved = "shaders_slang/koko-aio-slang-main_2/koko-aio-slang-main/textures/monitor_body_curved.png"
monitor_body_curved_wrap_mode = "clamp_to_border"
monitor_body_curved_mipmap = "false"
monitor_body_straight = "shaders_slang/koko-aio-slang-main_2/koko-aio-slang-main/textures/monitor_body_straight.png"
monitor_body_straight_wrap_mode = "clamp_to_border"
monitor_body_straight_mipmap = "false"
bg_under = "shaders_slang/koko-aio-slang-main_2/koko-aio-slang-main/textures/background_under.png"
bg_under_wrap_mode = "clamp_to_border"
bg_under_mipmap = "false"
bg_over = "shaders_slang/koko-aio-slang-main_2/koko-aio-slang-main/textures/background_over.png"
bg_over_wrap_mode = "clamp_to_border"
bg_over_mipmap = "false"
backdrop = "shaders_slang/koko-aio-slang-main_2/koko-aio-slang-main/textures/boothill.jpg"
backdrop_wrap_mode = "clamp_to_border"
backdrop_mipmap = "false"

The first and the second variation are the same preset, but the code is a bit different and it is not in the main git repo, because it is a borderline case and i don’t plan to add it.

But if you download the latest code you can easilly unlock and experiment with that feature, open shaders-ng/final_pass.slang and look for “//mask posterization experiment” then uncomment the code by replacing:

//mask = floor(mask*16.0)/16.0;

//mask = pow(mask, vec3(0.5));

with:

mask = floor(mask*16.0)/16.0;

mask = pow(mask, vec3(0.5));

(so strip the leading //)

Save and try again, by altering the value in vec3(0.5), so like vec3(0.2) you will alter the flatness of the response.

It you’re looking for a steep grid, ditch low level phosphorgrid all together and try with dot matrix emulation, but it will give you a square grid.

As a final resort, you can still make use of the full power of your monster :slight_smile:

Currently working on a way to transfer the energy from the whole mask (scanlines, triads and level 2 y mask) to the input color, the result is quie good imho, mask is very steep and the picture remains quite bright, input gain is at 1.0, there’s a bit help grom tight halo and bloom tho.

Ultramask? :smile:

There is a lot of moiree on solid colors when using curvature and level 2 y mask’s sparkling look punch or even the dedot feature,i guess one can’t have everything, so the fake slotmask (at core level) may be mandatory because somehow it mitigates it:

Outrun is “the” mercilessly moiree test:

Well, actually there is a brightness loss, but consider that the source image has a brighter gamma than a real crt anyway and that the mask fades to deep black, I think the result is promising:

Nothing git-pushed (yet).

10 Likes

I’m currently going throw the same issue right now moire wise putting together my presets, it’s like the one thing that can prevent a preset from being perfect. With the guest shader one of the tricks is pushing the scanline gamma past it’s value limit. I previously had it at 9.00, putting together aperture grille presets really brings out moire in curvature presets, had to raise that setting up to about 16.000 to even slightly reduce moire. Deconvergence has been helping to reduce it as well, surprisingly the green deconvergence helped the most out of the red and blue one.

By the way those shots look sexy as he’ll. I like how gritty the mask looks.

1 Like

It makes sense, human brain spots moiree when it is able to identify straight lines.

Staggering them via y deconvergence could trick it to a certain extent, doing with green ‘alone’ is better because the eye is more sensible to green itself.

Btw i already use that, it is just not enough, that’s why I resort to an additional scanline-based slotmask.

1 Like

Never tried it with just green, I’ll try giving that a test later thanks.

Nothing is ever enough when it comes to moire lol. I’ve come to terms with it already but every now and then I’ll try to find a way to reduce it even if by 5 percent more.

1 Like

I think these images posted here are beautiful, and I also think they always look better when they are in a “screenshot”. Whenever I try to reproduce one, using some filter shown (be it in any forum post), I always think that on my screen, it’s always too dark and I have to decrease many times the gamma or brightness of the shader. I have a Samsung UHD UR55 28.

1 Like

Maybe you can increase the gamma, brightness, backlight or adjust the colour temperature or profile of your screen?

Also a typical brightness of 300 nits might be a bit on the low side for stuff like this.

It may not be so bad if you’re playing in a darker environment from a bit closer to the screen, but then you’ll have to contend with more IPS glow.

There’s always the option of compromising on the Mask Strength, adding things like Bloom, Mask Bloom and Halation, reducing scanline gap darkness or thickness or trying a shader presets pack that focuses more on brightness or even one of the HDR shaders.

1 Like

Pratice makes perfect!
The more you pratice, the higher the chance you get something good; it is up to you understand why :slight_smile:

Koko-aio comes with tons of presets and an extensive documentation about every single parameter, taking a preset you like and tinkering with its parameters is a good way to extrapolate the meaning they have to you.

If you don’t already do tis, setting the retroarch background to almost transparent or using the external qt interface is highly suggested!

2 Likes

These new core masks look really good with gba games on a bigger screen

And this new Kakashi shader looks really nice too

10 Likes

One of my favorite things about these new pixel killer shaders… They look great with GBA games!

1 Like

:star_struck: :star_struck: SFII, WoW

They are beautiful, with fantastic colors and shadows…

2 Likes

Was that used in gba a vanilla preset or ypu made some tweaks? Asking because I don’t remember one with core-sized green magenta phosphors, (but that means nothing :))

Looking good, btw!

Kakashi preset seems to need some love on the sharp side; do you agree? I could just tweak it in place or make a sharp variation.

So it’s not just me!

Indeed, I found the colors to be very balanced too.

Somehow pushing the mask to a deeper level and balancing that with an input gain did some magic i need to investigate, unfortunately moire on curvature still plagues it (sf2 is unaffected by nature, lol)

Yesterday I merged that new ultramask parameter amd that preset to:
presets-ng/Safe-to-use/Monitor-ScreenLevel_Hmask-Corelevel_SlotMask-Overmask.slangp

1 Like

Four things I learned about dealing with moire patterns:

  1. Lighten Scanlines or Lighten Mask until it goes away.

  2. Increase TVL (lower Mask Size) until it goes away.

  3. Having more pixels can help too. So the lower the resolution, the higher the TVL/lower the Mask size needed to be rendered properly without moire.

  4. Scaling - Integer Scaling helps. If using non-Integer Scaling, then there would be a sweetspot probably equivalent to or close to the Integer Scale value where the moire patterns will be least visible or invisible.

1 Like

I know about those tricks, but they all imply compromises and tradeoffs, so I want to think to new approaches to the problem.

ultramask preset has no visibe moire, but just because it carries the even/odd staggering workaround on the whole picture; moire plagues it in that sense.

Wanna try at least to get a moire map/mask to be used to apply mitigations (lighter mask, veftical staggering) locally/where needed so that at least the big part of the look is preserved.

That, along the other gazillion things piling up :slight_smile:

1 Like

We can always count on you to think outside the box.

2 Likes

I think it was pgrid-naked-slotmask-for-1080p-Hinnits-experimental. I changed the mask to 2 or 3.

Kakashi is sharp enough for me. I made it unsharp on purpose to see dracula’s eyes blend together. :sweat_smile:

1 Like

Ah got it, if I remember right, it uses screen coords, zoomed; you can have perfect match by zooming it to 1 and switch from screen to core coords.

2 Likes

Some explainations on the latest commits:

  • In the glow section there was once a logic that for sharp values near 0.0 would automatically set the sharpening/blur radius according to the parameter of the glow spread amount.
    Sounds complicated? I agree, ditched. If you ever used that feature, now you need to set the blur radius, I think it is not a big deal, code and workflow are simpler.

  • Since the halo is applied later in the chain, it depends on the input signal gain you set earlier, this was the default behaviour, but now there is an option in the halo section, named Pre-attenuate input signal gain to 1x that does exactly that, it applies the halo to the un-gained image; you may want to prefer that to avoid cascading effects, so that halo power stay the same and does not depend on the input gain anymore.

  • Halo itself gained an output gamma control, leave it to 1.0 to get the old behaviour.

Edit-

Also, i would like to share this little trick i just found:

The mask used is green magenta, this gives higher TVL, but since the phosphor are staggered by deconvergence, you can actually still see r,g and b, neat!

rgb overlapped to position x=0, staggering r and b to the opposite position y +/- 0.60, mask done with 2 slots, second empty, so rgb are vertically aligned lol:

image

7 Likes