Koko-aio shader discussions and updates

So far I did not find out what makes the difference. Below is a very rough preset, starting with your magic code (only the bezel zooms adjusted), then my part for the artwork. The magic code part removes the moiree. I will try to find out step by step…

#reference “…/…/shaders/shaders_slang/bezel/koko-aio/koko-aio-ng.slangp”
DO_CCORRECTION = “1.000000”
LUMINANCE = “0.200000”
GAMMA_OUT = “0.500000”
OFFSET_STRENGTH = “0.500000”
DO_IN_GLOW = “1.000000”
IN_GLOW_POWER = “1.699999”
IN_GLOW_GAMMA = “2.000000”
IN_GLOW_W = “3.500000”
IN_GLOW_H = “7.000000”
DO_PIXELGRID = “1.000000”
PIXELGRID_MIN_W = “0.050000”
PIXELGRID_MAX_W = “0.800000”
PIXELGRID_H_PRST = “1.000000”
PIXELGRID_MIN_H = “0.250000”
PIXELGRID_MAX_H = “0.700000”
PIXELGRID_Y_MASK = “0.600000”
PIXELGRID_Y_MASK_COORDS = “0.000000”
PIXELGRID_Y_MASK_HEIGHT = “-2.000000”
PIXELGRID_Y_MASK_ON_WHITE = “0.100000”
PIXELGRID_Y_MASK_SHIFT = “0.230000”
PIXELGRID_Y_MASK_STEEP = “16.000000”
DO_HALO = “1.000000”
HALO_POWER = “0.430000”
HALO_W = “3.500000”
HALO_H = “3.500000”
HALO_GAMMA = “1.000000”
HALO_VS_SCAN = “0.250000”
DO_BLOOM = “1.000000”
BLOOM_MIX = “0.500000”
BLOOM_GAMMA_OUT = “0.999998”
BLOOM_POWER = “1.000000”
DO_CURVATURE = “1.000000”
GEOM_WARP_X = “0.480000”
GEOM_WARP_Y = “0.510000”
GEOM_CORNER_SIZE = “0.010000”
GEOM_CORNER_SMOOTH = “200.000000”
DO_BEZEL = “1.000000”
BEZEL_INNER_ZOOM = “-0.110000”
BEZEL_FRAME_ZOOM = “0.090000”
AMBI_FALLOFF = “0.400000”
AMBI_POWER = “1.000000”
DO_DYNZOOM = “0.000000”
V_SIZE = “2.500000”
V_POWER = “1.000000”
S_POSITION = “194.000000”
ALT_BLANK_STRENGTH = “0.000000”

GLOBAL_OFFX = “0.000500”
GLOBAL_OFFY = “-0.006500”
DO_BG_IMAGE = “1.000000”
BG_IMAGE_OFFY = “0.001000”
BG_IMAGE_ROTATION = “2.000000”
BG_IMAGE_NIGHTIFY = “0.400000”
bg_under = “…/…/shaders/shaders_slang/bezel/koko-aio/textures/arcade_textures/astrof.png”

And this is the original preset with moiree:


#reference “…/…/shaders/shaders_slang/bezel/koko-aio/monitor-slotmask-bloom-bezel.slangp”
DO_CCORRECTION = “0.000000”
LUMINANCE = “0.100000”
DO_BLOOM = “0.000000”
BEZEL_INNER_ZOOM = “-0.110000”
BEZEL_FRAME_ZOOM = “0.090000”
BEZEL_R = “-0.220000”
BEZEL_G = “-0.220000”
BEZEL_B = “-0.220000”
DO_BG_IMAGE = “1.000000”
BG_IMAGE_OFFY = “0.001000”
BG_IMAGE_ROTATION = “2.000000”
BG_IMAGE_NIGHTIFY = “0.400000”
DO_AMBILIGHT = “0.000000”
S_POWER = “0.250000”
GLOBAL_OFFX = “0.000500”
GLOBAL_OFFY = “-0.006500”
bg_under = “…/…/shaders/shaders_slang/bezel/koko-aio/textures/arcade_textures/astrof.png”

Yeah, I mean, what’s the name of the preset you started from.

Ops, got it.

I deleted the global offx and offy settings and the image offx setting, as it reintroduced some moiree… and the own bezel inner zoom and bezel frame zoom setting produce some decent moiree, but nothing as before … so could it be that I have to tweak other settings if I change the bezel inner zoom and bezel frame zoom setting?

The smaller the image, the more the moiree, zooming out is expected to make things worse.

As a general rule, lowering the scanlines strength helps. This could be done via DO_PIXELGRID_H < 1. 0 (check config.inc for reference) or by allowing halo to cancel the mask and highering the halo strength (HALO_VS_SCAN >0).

Other parameters that are trickier to setup but may help or make things worse: PIXELGRID_MIN_H/MAX_H

This last one proved also to trick my eyes by making moiree less visible: PIXELGRID_OFFSET_CORE around 0.12-0.3

Lot of things.

1 Like

ok, DO_PIXELGRID_ at 0.85 and HALO_VS_SCAN at 0.16 mitigates a lot, that’s just fine now :-). Still a lot to learn, many thanks!

2 Likes

@kokoko3k - is there a way to add/create a BGR layout for the phosphors? we have GM, RGB etc etc.

The preset RBG s the number 5. it gives BGR by repeating itself: RBGRBGRBGRBG

But if for whatever usecase you need it to start from B (eg, adding a gap and make BGRX), then you are free to draft your own mask by disabling presets (preset number 0) and then move the virtual r,g,b phosphor position inside the virtual triad slot space.

Is is explained in docs-ng.md text file:

Mask type preset:
        You can have the shader generate a preconfigured mask for you:
        1:gm 2:gmx 3:rgb 4:rgbx 5:rbg 6:rbgx
        (GreenMagenta, GreenMagentaGap, RedGreenBlue, RedGreenBlueGap, RedBlueGreen, RedBlueGreenGap)
        beware that due to limitations of the actual implementation, masks ending in "x"
        works reliable when emulating slotmasks only at screen coordinates with multiplier = 1.0
        ...or with 0, you can draft your own by using the following knobs:
            Phosphors+gap count (mask size):
                How much phosphors or blank spaces the final mask will have.
            R,G,B, Shift:
                The position of every phosphor.
            Example 1: Phosphors+gap count=4 and R=0 G=1 B=2
            ...will give you a mask with red,green,blue and a blank space.
            Example 2: Phosphors+gap count=2 and R=1 G=0 B=1
            ...will give a mask with green + a mix of blue and red (magenta)
            Example 3: Phosphors+gap count=3 and R=1 G=1 B=1
            ...will give a mask with a blank space, the neutral white color and another blank space
            Example 4: Phosphors+gap count=1 and R=0 G=0 B=0
            ...like the previous one, but without any blank spaces.

Cell size multiplier allows you to zoom the mask, so that is will be easier to see what’s going on as you shift the phosphors position

3 Likes

Many thanks again.

K

Taking a break from WIP presets and phosphorgrid, because I’ve had some ideas regarding selective ntsc artifacts blurring.

First is to revert the logic so that instead of pushing the blur power on artifacts, the shader now subtracts blur power from “unartifacted” zones; this does not change the final result, but allow for a more straightforward workflow; you first blur everything ensuring that
"The Damn Waterfall ™ ® ©"
Is well blended,
next , you tweak artifacts treshold and cancelling blur power.

The real improvement comes from the idea to cancel not only the common blur, but even the CVBS chroma bleed; this allows for (albeit less accurate emulation of the real thing), more sharp image:

All the ntsc related parameter have been moved to the artifacts sections.

11 Likes

Hi Kokoko3k, I really like what I see. I had been hoping for a long time to find an “NTSC” effect that was not too strong but still effective and functional. We didn’t have this format, but still many products of the 8Bit and 16Bit era were meant for the American and Japanese market. So this idea of yours would allow us to get closer to this without however having an excessively strong effect for us Europeans. And furthermore, personally, I don’t look for accuracy, on the contrary I look for “improvement” solutions but with the feeling of the time. This solution of yours is fantastic for me. Thanks for your work.

1 Like

Just for my curiosity: would this solution, with FXAA activated, make the image less sharp and more blurry?

FXAA is applied almost before everything and affects everything regardless of the NTSC artifacts, so this change does not affect FXAA at all.

5 Likes

Excellent, and the result is really beautiful. Thank you.

1 Like

Hi there. I noticed bloom seems to have changed (lastest code as of this morning), and seems to have an issue with same games/res(?).

Can you check the opening on R-Type via Mame? You should be able to see the issue as the letters R-Type scale in from the side.

Update: The issue seems to be caused by the delta renderer - I have disabled it now.

1 Like

Ok, good to know, but I’m unable to reproduce. Can you post the preset where you notice the glitch? Maybe I understood, you notice the bloom lagging behind?

1 Like

AMD Vulkan. Yes, it’s like an odd jittery ghosting effect, not like nornal Bloom.

I used tv-PAL-my-old.slangp as a base, and then modified it to these settings:

Ok, if you need/want delta render, you may try to higher “Delta render area size”; it should depend on the bloom radius, i guess. I’m disablind DR by default till i sort it out.

I’ll just leave Delta disabled for the time being.

1 Like

I slightly changed a function that modulates the weight of the scanlines and phosphors. It is a bit faster and should allow for better mask gamma control in the future.

Btw, even if the result on the paper should be almost, but not 101% the same, I’m unable to spot differences in the final result.

Can you confirm? Thanks!

1 Like

Testing atm, but so far nothing negative is jumping out. Same settings zoomed in by 1900% seem to look the same.

1 Like