Koko-aio shader discussions and updates

Not really, eg: flycast switches between 25,30,50,60 (I know for sure, since koko-aio itself modulates temporal effects like interlacing based on that).

Holding E will not cause the shader to know what new fps are, so it will slow down the temporal smoothing too, which is exactly the opposite of the intended effect (having the smoothing to complete in the same real time, regardless of the source frames per second).

1 Like

Unfortunately for now I dont know a game and a core that do that

What’s the game in the screenshot and the core you are running?

What if you enable fps display?

this? it’s resident evil 2 with beetle psx core (not the hw one)

it’s 60 more or less

1 Like

Ooky, so 60 is fine; i’ll try to search for a 30fps content to match that smoothing speed as close as possible, then PR.

1 Like

–EDIT–

And just “backported” to koko-aio too.

It works nicely with these settings: you push the brightness to counteract CRT black crush, and lower the contrast to avoid white clipping.

So you intentionally broke something, then you do something else to patch it badly :sweat_smile:

1 Like

Shouldn’t this just affect the framebuffer and not the output the video signal? Like consoles like the PS1, Dreamcast, and N64 all support running at a lower framerate, but the TV signal itself is always around 50 Hz or 60 Hz. Frames from the buffer get double or tripled on the output.

Maybe the DC works differently in VGA mode though.

I’m not sure I understood the reason for the question, but shader works at the video signal framerate for the whole chain, last framebuffer output included, and unfortunately there’s no way for it to upscale it to the emulated CRT refresh screen, nor it has access to the current or elapsed time.

So if you want a temporal effect to last for a predictable (real) time, you have to scale its duration (in frames) by the input fps.

-EDIT- Flycast core has a specific option to notify retroarch about its output FPS.

since it make the output more CRT authentic and aesthetic it worth it, as I mentioned earlier, these effects give the impression of a more vibrant image compared to the static, pixel-perfect images found in modern screen :slight_smile:

1 Like

Okay, so Flycast is outputting at e.g. 30 fps. Real console would output two frames at a time for ~60 Hz signal because otherwise the TV wouldn’t work. Flycast either needs to double frames or Retroarch should detect it and double frames before sending to shaders.

Is that correct or am I misunderstanding something?

I know Beetle PSX has an ‘internal framerate’ that’s different from what is reported to RA, but it seems like interlacing shaders work fine?

so far so good, thank you so much!

1 Like

I want to report what seems like a “bug”:

If you run interlaced content like ps2/dc games with both Interlacing ON and Phosphor Persistence (ppe), you’ll get artifacts like this:

The first image is using one of your presets with default params but I turned ppe ON. I also tried glcore vs vulkan (both had the problem).

Can you generate a full preset and post it please? looks like afloat frameuffer is missing somewhere.

1 Like

It’s the operating system video driver that scales it to final screen refresh tho; RA outputs to 25/30/50/60 and no; interlacing shaders wouldn’t work for halved refresh, indeed.

The OriginalFPS uniform is there so that shaders could at least behave better in such scenarios.

1 Like

There you go koko, this is basically the default Monitor-Balanced.slangp with ppe ON:

shaders = "17"
shader0 = "shaders_slang/bezel/koko-aio/shaders-ng/colortools_and_ntsc_pass.slang"
alias0 = "colortools_and_ntsc_pass"
wrap_mode0 = "mirrored_repeat"
mipmap_input0 = "false"
filter_linear0 = "true"
float_framebuffer0 = "true"
srgb_framebuffer0 = "false"
scale_type_x0 = "source"
scale_x0 = "1.000000"
scale_type_y0 = "source"
scale_y0 = "1.000000"
shader1 = "shaders_slang/bezel/koko-aio/shaders-ng/fxaa.slang"
alias1 = "upscale_pass"
wrap_mode1 = "mirrored_repeat"
mipmap_input1 = "true"
filter_linear1 = "true"
float_framebuffer1 = "true"
srgb_framebuffer1 = "false"
scale_type_x1 = "source"
scale_x1 = "2.000000"
scale_type_y1 = "source"
scale_y1 = "2.000000"
shader2 = "shaders_slang/bezel/koko-aio/shaders-ng/shift_and_bleed.slang"
alias2 = "shift_and_bleed_pass"
wrap_mode2 = "mirrored_repeat"
mipmap_input2 = "false"
filter_linear2 = "true"
float_framebuffer2 = "true"
srgb_framebuffer2 = "false"
scale_type_x2 = "source"
scale_x2 = "1.000000"
scale_type_y2 = "source"
scale_y2 = "1.000000"
shader3 = "shaders_slang/bezel/koko-aio/shaders-ng/in_glow_x.slang"
alias3 = "in_glow_pass_x"
wrap_mode3 = "clamp_to_edge"
mipmap_input3 = "false"
filter_linear3 = "true"
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/bezel/koko-aio/shaders-ng/in_glow_y.slang"
alias4 = "in_glow_pass"
wrap_mode4 = "clamp_to_border"
mipmap_input4 = "false"
filter_linear4 = "true"
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/bezel/koko-aio/shaders-ng/halo_pre_gamma.slang"
alias5 = "halo_pre_gamma_pass"
wrap_mode5 = "clamp_to_border"
mipmap_input5 = "false"
filter_linear5 = "true"
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/bezel/koko-aio/shaders-ng/halo.slang"
alias6 = "halo_pass"
wrap_mode6 = "clamp_to_border"
mipmap_input6 = "false"
filter_linear6 = "true"
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/bezel/koko-aio/shaders-ng/avglum_pass.slang"
alias7 = "avglum_pass"
wrap_mode7 = "clamp_to_border"
mipmap_input7 = "false"
filter_linear7 = "true"
float_framebuffer7 = "true"
srgb_framebuffer7 = "false"
scale_type_x7 = "source"
scale_x7 = "0.500000"
scale_type_y7 = "source"
scale_y7 = "0.500000"
shader8 = "shaders_slang/bezel/koko-aio/shaders-ng/reflection_blur_pre.slang"
alias8 = "reflected_blurred_pass_pre"
wrap_mode8 = "clamp_to_border"
mipmap_input8 = "false"
filter_linear8 = "true"
float_framebuffer8 = "false"
srgb_framebuffer8 = "false"
scale_type_x8 = "source"
scale_x8 = "1.000000"
scale_type_y8 = "source"
scale_y8 = "1.000000"
shader9 = "shaders_slang/bezel/koko-aio/shaders-ng/reflection_blur.slang"
alias9 = "reflected_blurred_pass"
wrap_mode9 = "mirrored_repeat"
mipmap_input9 = "false"
filter_linear9 = "true"
float_framebuffer9 = "true"
srgb_framebuffer9 = "false"
scale_type_x9 = "source"
scale_x9 = "1.000000"
scale_type_y9 = "source"
scale_y9 = "1.000000"
shader10 = "shaders_slang/bezel/koko-aio/shaders-ng/bloom_pass_1.slang"
alias10 = "bloom_pass_1"
wrap_mode10 = "mirrored_repeat"
mipmap_input10 = "false"
filter_linear10 = "true"
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/bezel/koko-aio/shaders-ng/bloom_pass_2.slang"
alias11 = "bloom_pass_2"
wrap_mode11 = "clamp_to_edge"
mipmap_input11 = "false"
filter_linear11 = "true"
float_framebuffer11 = "false"
srgb_framebuffer11 = "false"
scale_type_x11 = "source"
scale_x11 = "0.500000"
scale_type_y11 = "source"
scale_y11 = "0.500000"
shader12 = "shaders_slang/bezel/koko-aio/shaders-ng/bloom_pass_3.slang"
alias12 = "bloom_pass_3"
wrap_mode12 = "clamp_to_edge"
mipmap_input12 = "false"
filter_linear12 = "true"
float_framebuffer12 = "false"
srgb_framebuffer12 = "false"
scale_type_x12 = "source"
scale_x12 = "1.000000"
scale_type_y12 = "source"
scale_y12 = "1.000000"
shader13 = "shaders_slang/bezel/koko-aio/shaders-ng/bloom_pass_4.slang"
alias13 = "bloom_pass_final"
wrap_mode13 = "mirrored_repeat"
mipmap_input13 = "false"
filter_linear13 = "true"
float_framebuffer13 = "true"
srgb_framebuffer13 = "false"
scale_type_x13 = "source"
scale_x13 = "1.000000"
scale_type_y13 = "source"
scale_y13 = "1.000000"
shader14 = "shaders_slang/bezel/koko-aio/shaders-ng/ambi_temporal_pass.slang"
alias14 = "ambi_temporal_pass"
wrap_mode14 = "clamp_to_border"
mipmap_input14 = "false"
filter_linear14 = "true"
float_framebuffer14 = "true"
srgb_framebuffer14 = "false"
scale_type_x14 = "absolute"
scale_x14 = "96"
scale_type_y14 = "absolute"
scale_y14 = "64"
shader15 = "shaders_slang/bezel/koko-aio/shaders-ng/helper_pass.slang"
alias15 = "helper_pass"
wrap_mode15 = "mirrored_repeat"
mipmap_input15 = "false"
filter_linear15 = "true"
float_framebuffer15 = "true"
srgb_framebuffer15 = "false"
scale_type_x15 = "absolute"
scale_x15 = "128"
scale_type_y15 = "absolute"
scale_y15 = "128"
shader16 = "shaders_slang/bezel/koko-aio/shaders-ng/final_pass.slang"
alias16 = "final_pass"
wrap_mode16 = "clamp_to_edge"
mipmap_input16 = "false"
filter_linear16 = "true"
float_framebuffer16 = "false"
srgb_framebuffer16 = "false"
scale_type_x16 = "viewport"
scale_x16 = "1.000000"
scale_type_y16 = "viewport"
scale_y16 = "1.000000"
GAMMA_OUT = "0.350000"
DO_CCORRECTION = "1.000000"
IN_GLOW_POWER = "1.300000"
LUMINANCE = "0.200000"
TEMPERATURE = "7200.000000"
DO_PPERSISTENCE = "1.000000"
DO_SHIFT_RGB = "1.000000"
OFFSET_STRENGTH = "0.400000"
DECON_GX = "0.000000"
DO_IN_GLOW = "1.000000"
IN_GLOW_W = "-0.800000"
IN_GLOW_H = "7.000000"
DO_PIXELGRID = "1.000000"
PIXELGRID_OVERMASK = "1.100000"
PIXELGRID_MIN_H = "0.300000"
PIXELGRID_MAX_H = "0.700000"
PIXELGRID_GAMMA_H = "5.199999"
PIXELGRID_OFFSET_CORE = "0.120000"
PIXELGRID_H_PRST = "1.000000"
PIXELGRID_MAX_W = "0.400001"
PIXELGRID_GAMMA_W = "1.500006"
PIXELGRID_BASAL_GRID = "0.020000"
PIXELGRID_Y_MASK = "0.400000"
PIXELGRID_Y_MASK_COORDS = "0.000000"
PIXELGRID_Y_MASK_HEIGHT = "1.000000"
PIXELGRID_Y_MASK_SHIFT = "0.150000"
PIXELGRID_Y_MASK_STEEP = "1.000000"
PIXELGRID_Y_MASK_ON_WHITE = "0.000000"
PIXELGRID_Y_SPARK = "6.000000"
DO_HALO = "1.000000"
HALO_NO_PREGAIN = "1.000000"
HALO_POWER = "0.500000"
HALO_SHARPNESS = "7.000000"
HALO_GAMMA = "1.800000"
HALO_GAMMA_OUT = "1.300000"
HALO_VS_SCAN = "1.000000"
DO_BLOOM = "1.000000"
BLOOM_MIX = "0.400000"
BLOOM_GAMMA_OUT = "1.200000"
BLOOM_POWER = "1.550000"
BLOOM_EYE_ADPT_SRT = "0.600000"
DO_CURVATURE = "1.000000"
DO_BEZEL = "1.000000"
BEZEL_REFL_STRENGTH = "0.370000"
BEZEL_DIFFUSION_STR = "0.150000"
DO_GLOBAL_SHZO = "1.000000"
GLOBAL_ZOOM = "0.991500"
DO_VIGNETTE = "1.000000"
V_SIZE = "1.080000"
V_SHAPE = "0.800000"
DO_SPOT = "1.000000"
S_POWER = "0.067000"
textures = "monitor_body_curved;monitor_body_straight;bg_under;bg_over;backdrop;sideshade"
monitor_body_curved = "shaders_slang/bezel/koko-aio/textures/monitor_body_curved.png"
monitor_body_curved_mipmap = "true"
monitor_body_curved_linear = "true"
monitor_body_curved_wrap_mode = "clamp_to_edge"
monitor_body_straight = "shaders_slang/bezel/koko-aio/textures/monitor_body_straight.png"
monitor_body_straight_mipmap = "true"
monitor_body_straight_linear = "true"
monitor_body_straight_wrap_mode = "clamp_to_edge"
bg_under = "shaders_slang/bezel/koko-aio/textures/background_under.png"
bg_under_mipmap = "false"
bg_under_linear = "true"
bg_under_wrap_mode = "mirrored_repeat"
bg_over = "shaders_slang/bezel/koko-aio/textures/background_over.png"
bg_over_mipmap = "false"
bg_over_linear = "true"
bg_over_wrap_mode = "mirrored_repeat"
backdrop = "shaders_slang/bezel/koko-aio/textures/backdrop.jpg"
backdrop_mipmap = "false"
backdrop_linear = "true"
backdrop_wrap_mode = "mirrored_repeat"
sideshade = "shaders_slang/bezel/koko-aio/textures/side_shade-helper.png"
sideshade_mipmap = "false"
sideshade_linear = "true"
sideshade_wrap_mode = "mirrored_repeat"
1 Like

Wow, I did not even realize they provided OriginalFPS. That will help a lot.

2 Likes

Yup, if you’re interested, search for it in the readme; there is FrameTimeDelta too (on a second thinking, it can be abused to measure the elapsed time):

Hi there,
The issue should be just fixed (don’t mind the commit message, i messed it up).

–EDIT–

Found and fixed another issue, now phosphors persistance takes real interlacing into account:

3 Likes

Great work as always! I was actually ignoring the issue for awhile thinking it might be “expected”. But it turned out to be fixable.

Also I would like to thank you for your patience with community feedback, you never “assume” bad intention even when the reporter is being ignorant (to an extent) or having an oversight, you instead explain and teach us new things.

2 Likes

Much appreciated, thanks, but is really not that hard in this community :wink:

5 Likes