Koko-aio shader discussions and updates

Tested nvidia and intel and they works as expected, will take a while to test on amdโ€ฆ

Ah, i changed the reflection code for other reasons just yesterday, maybe you didnโ€™t tried and it fixed the issue?

Will d/l and take a look

UPDATE - the changes in the reflection code has fixed ps2 on amd (and possibly other emus that use glcore on amd).

1 Like

Checked this finally - and OMG - the moiree in some of the presets is gone with that, wow! Whatโ€™s the relevant parts to get rid of moiree? Or are they all in combination?

Before (with the ng-slotmask-bezel-bloom preset):

This preset - moiree is completely gone (bezel misaligned, doesnโ€™t matter for this test):

3 Likes

Ah, good question, whatโ€™s the preset?

Also, screenshots appear to be overcompressed, mask is gone.

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: