Koko-aio shader discussions and updates

I may have one of the oldest equipments from whole crew around here :unamused:

i5-2400 3.1GHZ from 2011

GTX 1050 2gb mini from 2017.

20" VGA monitor 1600x900

win10 64 bits.

yeah, GLcore works now. Thank you. Not sure if may be old equipment or just Vulkan driver. It works on 70fps.

Is the lights from right side the only ones that are supposed to change? At least the game I’m looking at.

Always cool to see something new around.

nope koko aio is supposed to work on igps too, but maybe higres input and 70hz are too much.

1050 should be enough tho, check how much is the gpu usage if you can.

the lights should be all around the screen lol.

24% gpu usage on vulkan and 26-28% on glcore. Issue came back to happen again when switching back to vulkan.

yeah, the image is turning on or off depending of the amount of light around the screen. Looks interesting to be honest.

I dont know if may be your creation or from the Mega Bezel project about reflections but this feature alone I like it so much. It gives so much realism to whole experience.

2 Likes

Can’t wait to try it on the MiniPC too - thank you very much, this for shaders it’s a lot of stuff !

6 Likes

Similar to Guest.r guru changelog, dev code has a new option called “Dedot.”

I was working on that in the past but for performances and complexity reasons abandoned the idea, now it is finally done, found a simpler way.

That disturbing pattern is the rgb mask you can barely see under the fat scanline: image

Now you can clear it:

image

Ah, watch out for moiree, your eyes are not so good in spotting moiree with dot patterns, but as soon as you mute it into straight lines, it will be evident.

8 Likes

Not yet merged, but i’m experimenting with lanczos horizontal filtering rather than gauss.

I think i’ll take both implementations, because i think gauss is better for emulating blurry television like signals.

Smooth:

Sharp:

/thanks Hyllian

7 Likes

Loving that sharper version. Seems more accurate to me.

Anyway to post a smooth and sharp from the same game. In addition, that red square in the zoomed out image really helped to identify what the improvement was.

1 Like

Sorry pal, for some reason (well, holidays) I totally missed your request.

Unfortunately i’m still experimenting different smoothing methods to find one that satisfies me in achieving roundness without sacrificing sharpness and those settings posted above are gone by now.

1 Like

To anyone tinkering with dev code, the halo sharp parameter has changed from x+y to a single parameter and is blurrier for the same values.

So if previously you used halo x (or y) sharpness to, say, 3.0, you’ll probably need to push it higher to 6.0 now.

1 Like

I’m glad you mentioned the sharpness thing , I’ve been adjusting your "low level phosphor grid " preset for a while now , here are some of my tweeks

  • fxaa is enabled in the parameters but the fxaa pass is set to nearest ( it has less effect this way)

  • I disabled the aspect ratio setting from the preset and would adjust it from retroarch scaling section

  • I have opted to adjust gamma from glow section and bloom and left halo and color correction on default values

  • I have decided that I have no morals and added 3 sharpening presets

    a- anime 4k , the “luminous strength” parameter effect the bright area making their edges bigger

    b- as sharpness

    c- RCA

The preset generally works on high nits/contrast , I use it on sony X90j 50 inch

any tips on improving contrast , brightness and gamma ?

https://mega.nz/file/RdIR2T4b#HCs2oKn-KZx69cgNfw4pXNIRNqJqwF2yAss-9N1df6M

3 Likes

Uh!

I didn’t even ever tried anything similar to that, great job!

I’ll take a deeper look tomorrow to better understand how you achieved that lol, but meanwhile colors look well balanced to me.

Generally speaking, lights look better when you set the gamma in (previously in glow section, now in color correction section), to something around 2.2, then you set the gamma out to 1/gamma in, so around 0.45.

2 Likes

Just another service update:

Input signal strength, previously tied to the glow section, now has been moved into color correction section and works even when glow is disabled.

Parameter name stays the same, so existing presets do not need any manual intervention, just look for this now:
image

3 Likes

Ok, definitely like the idea, but it is a bit overkill!

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?

Btw, the following is koko-aio, vanilla, no extra passes appended:

image

While this is with a small addition to the code, that kinda posterizes and pushes the mask levels in a brute way to achieve sharper mask and absolutely requires a lot of pixels to paint to (i like the former more, tho):

mask = floor(mask*16.0)/16.0; mask = pow(mask, vec3(0.5));

image

Shader preset here
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"
6 Likes

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