A good shader for video playback?

I use RetroArch to play full quality LongPlay videos and i need a CRT scanline shader that works well with those.

The problem is that videos are higher resolution that NES, SNES, etc and that makes most shaders behave badly and produce uneven scanlines. So, is there a scanline shader that doesn’t do that in those resolutions? Or, is there a way to make the internal video playback resolution lower so the shaders look better?

You’ll have to force the resolution to something that works with the shaders. I think the easiest way to do it would be to make a preset with a stock shader first pass that sets up the resolution like this (you can play with the scale_x/y settings to match the game/console; 256x224 may be better for SNES, for example): scale_type_x0 = absolute scale_type_y0 = absolute scale_x0 = 320.0 scale_y0 = 240.0 filter_linear0 = true After that, you can do a CRT shader in the next pass(es) and it should look like it’s supposed to.

Awesome, didn’t think about that.

Just putting the y values without filter_linear is enough to watch a 1280*720 movie at the right ratio with a crt shader.

Great trick to make those old VHS tapes that got upscaled in 720p on youtube more tolerable. :slight_smile:

I included the bilinear filtering just to be safe, but yeah, if it looks better with nearest, go with that :slight_smile:

I was also thinking about just doing the Y res and not the X but was worried that it would make the phosphor mask stuff look weird (banding, etc.)

I’ll try that, thanks.

Edit: Ok i think i managed to make it work with a standard CRT scanline shader.

Edit 2: How can i implement this resolution to the classic gameboy preset? I can’t do this by myself it seems.

It’s the same concept, you’ll just use 160x144 instead of 320x240

Tried that but all i get is a yellowish image (i assume it’s the background of the shader) but no graphics or a dot screen.

This is the shader i made:

shaders = “6” shader0 = “G:\RetroArch\shaders\shaders_cg\stock.cg” filter_linear0 = “true” wrap_mode0 = “clamp_to_border” mipmap_input0 = “false” alias0 = “” float_framebuffer0 = “false” srgb_framebuffer0 = “false” scale_type_x0 = “absolute” scale_x0 = “160” scale_type_y0 = “absolute” scale_y0 = “144” shader1 = “G:\RetroArch\shaders\shaders_cg\handheld\shaders/gameboy/shader-files/gb-pass-0.cg” filter_linear0 = “false” wrap_mode0 = “clamp_to_border” mipmap_input0 = “false” alias1 = “” float_framebuffer0 = “false” srgb_framebuffer0 = “false” scale_type_x0 = “viewport” scale_x1 = “1.000000” scale_type_y0 = “viewport” scale_y1 = “1.000000” shader2 = “G:\RetroArch\shaders\shaders_cg\handheld\shaders/gameboy/shader-files/gb-pass-1.cg” filter_linear1 = “false” wrap_mode1 = “clamp_to_border” mipmap_input1 = “false” alias2 = “” float_framebuffer1 = “false” srgb_framebuffer1 = “false” scale_type_x1 = “source” scale_x2 = “1.000000” scale_type_y1 = “source” scale_y2 = “1.000000” shader3 = “G:\RetroArch\shaders\shaders_cg\handheld\shaders/gameboy/shader-files/gb-pass-2.cg” filter_linear2 = “false” wrap_mode2 = “clamp_to_border” mipmap_input2 = “false” alias3 = “” float_framebuffer2 = “false” srgb_framebuffer2 = “false” scale_type_x2 = “source” scale_x3 = “1.000000” scale_type_y2 = “source” scale_y3 = “1.000000” shader4 = “G:\RetroArch\shaders\shaders_cg\handheld\shaders/gameboy/shader-files/gb-pass-3.cg” filter_linear3 = “false” wrap_mode3 = “clamp_to_border” mipmap_input3 = “false” alias4 = “” float_framebuffer3 = “false” srgb_framebuffer3 = “false” scale_type_x3 = “source” scale_x4 = “1.000000” scale_type_y3 = “source” scale_y4 = “1.000000” shader5 = “G:\RetroArch\shaders\shaders_cg\handheld\shaders/gameboy/shader-files/gb-pass-4.cg” filter_linear4 = “false” wrap_mode4 = “clamp_to_border” mipmap_input4 = “false” alias5 = “” float_framebuffer4 = “false” srgb_framebuffer4 = “false” scale_type_x4 = “source” scale_x5 = “1.000000” scale_type_y4 = “source” scale_y5 = “1.000000” parameters = “baseline_alpha;response_time;blending_mode;adjacent_texel_alpha_blending;baseline_alpha;response_time;blending_mode;adjacent_texel_alpha_blending;contrast;screen_light;pixel_opacity;bg_smoothing;shadow_opacity” baseline_alpha = “0.100000” response_time = “0.333000” blending_mode = “0.000000” adjacent_texel_alpha_blending = “0.175500” baseline_alpha = “0.100000” response_time = “0.333000” blending_mode = “0.000000” adjacent_texel_alpha_blending = “0.175500” contrast = “0.950000” screen_light = “1.000000” pixel_opacity = “1.000000” bg_smoothing = “0.750000” shadow_opacity = “0.550000” textures = “COLOR_PALETTE;BACKGROUND” COLOR_PALETTE = “G:\RetroArch\shaders\shaders_cg\handheld\shaders/gameboy/resources/palette.png” COLOR_PALETTE_linear = “false” COLOR_PALETTE_wrap_mode = “clamp_to_border” COLOR_PALETTE_mipmap = “false” BACKGROUND = “G:\RetroArch\shaders\shaders_cg\handheld\shaders/gameboy/resources/background.png” BACKGROUND_linear = “true” BACKGROUND_wrap_mode = “clamp_to_border” BACKGROUND_mipmap = “false”

Basically, i took the original GB shader and added the stock.cg with the resolution settings and then modified the numbers for the other shaders to be in the right order.

160 is the vertical resolution (y) for gameboy.

And you need to change the pass number for each parameters linked to it:

for shader1 -> filter_linear1, wrap_mod1…

for shader2 -> filter_linear2, wrap_mod2…

[QUOTE=Tatsuya79;47091]160 is the vertical resolution (y) for gameboy.

And you need to change the pass number for each parameters linked to it:

for shader1 -> filter_linear1, wrap_mod1…

for shader2 -> filter_linear2, wrap_mod2…[/QUOTE] Thank you, i did this and it’s now much better but there’s another problem. I can see the dot matrix and the graphics but the graphics are shown twice, like there’s a mirror of some sort… I’ll try to mess with the default settings to see if i can fix it.

Edit: I changed the resolution as i had it before (160 x 144) and it’s now perfect!

It’s awesome to watch gameboy longplay videos this way.

You can do funny stuff with that resolution forcing trick.

Made a bob deinterlace + img-adj (force 240p) + crt flat preset. If you feel like playing Tobal 2 with scanlines in low res.

Or Virtua Fighter 2.

Heh, looks pretty good!

I use the same trick on mupen64plus with a high internal res and then force a low res through the shader passes. It gives you a form of antialiasing, which helps with some of N64’s infamous jaggies.

Good idea, but isn’t Mupen doing it already by itself? I can use 1600x1200 in the core options with my 1080p screen.

Yeah, I meant for it to work with CRT shaders. It antialiases it and then adds scanlines, etc.