Applying shaders (scanlines) to screen res instead of content res?

As an example of what I’d like to do: A PC 200 VGA game can run in double scanned mode on my 1200p monitor because it’s even (fits 3x because 400 lines when double scanned) however I’d like to have 5x scaling. With double scan this isn’t possible because the scanlines become misaligned, however it seems this is working with Reshade’s Scanline abs shader.

You can specify scanline height’s like 400,600 etc. there, I assume this is working because it operates based on the entire screen (I’ve noticed that the other Reshade-CRT shaders still introduce artifacts though when you try it with them).

Is this possible with shaders in RA itself? For example, maybe by adding an artificial border?

there’s this guy:

Yeah I think this is possible, I’m not sure exactly what you want, you want the scanlines to align to the original content?

You could try the Mega Bezel Screen Only preset, and set it to integer scale. There is the no scanline mode to remove the scanlines, and fake scanlines which can be configured to however many scanlines you want, and it has an integer scanline option as well you can try.

If you want to try that it could make it clear exactly the effect you want and we could make a really simple shader to just do that

And as Hunterk just posted perhaps the scanline preset does everything you need

1 Like

Alright, here’s a detailed demonstration:

Game with 6 x scaling doublescan (through Normal 2x filter)

x5 scaling, misaligned:

5x scaling with the res-independet scanline shader: Interprets the image as single-scan. . I also note here that the height parameter only goes from 144-260, so wouldn’t be even sufficient for full PAL height.

Reshade, scanline shader set 400 height:

if you manually set the height in the res-independent scanline shader to 400, does it look more like what you’re wanting?

to do that, go to line 32 and change it from:

#pragma parameter imageSize “Simulated Image Height” 224.0 144.0 260.0 1.0

to

#pragma parameter imageSize “Simulated Image Height” 400.0 144.0 400.0 1.0

2 Likes

The parameter mod itself works without problems, it works as expected at 6x, but 5x is misaligned again

It looks better at height 333, but still not as clean as the reshade example.

So does just running something like guest advanced at integer scale not work?

Does the core output already have the doubled scanlines?

Try the guest-advanced-hd shader. It copes really well with this, even without integer scaling. This is a 200 line game, double scanned to 400 and 1200p output res:

Perfect scanlines. It’s my go to shader for DOS games. I use this config for this shader:

PR = "0.000000"
PG = "0.000000"
PB = "0.000000"
AS = "0.000000"
sat = "0.000000"
vigdef = "0.500000"
interm = "0.000000"
S_SHARP = "1.500000"
HSHARP = "2.000000"
HARNG = "0.000000"
VARNG = "0.000000"
bloom = "0.100000"
mask_bloom = "0.300000"
bloom_dist = "0.500000"
halation = "0.025000"
shadowMask = "13.000000"
maskstr = "0.400000"
mcut = "0.700000"
mshift = "3.000000"
mclip = "0.350000"
deconrg = "0.250000"
deconrb = "-0.250000"
deconrry = "-0.250000"
deconrgy = "-0.500000"
deconrby = "0.250000"
decons = "2.000001"
addnoised = "0.140000"
noiseresd = "1.000000"
noisetype = "1.000000"

Edit: Btw, for VGA games, you can select “VGA” instead of “SVGA” for emulated machine type. This will automatically double-scan as needed and also emulate weird pixel ratios of some games much better (like weird VGA modes like 199p or 350p).

Yes, he’s using one of the dosbox cores, so that means the core does the vertical doubling, if configured to do so.

2 Likes

Read it again: I’d like to have RA output Res 1000 treated as 1200, getting a look like with the Reshade example. I’m not sure if this is actually proper doublescan anymore btw, I can basically enter any scanline value that’s divides evenly (so 200, 240, 300 etc.), resulting in larger or smaller gaps.

Guest Advanced can’t handle this either, at least not from any option that I can see. The scanlines get messed up like with everything else.

Sorry, I misunderstood. You want 2000p output then and crop out the outer parts of the image on your 1200p display?

Oh, I think you can use the image-adjustment shader to do negative cropping / padding. Put that in front of the res-independent scanlines, maybe?

1 Like

After doing some comparisions, I think the correct height in Reshade should be 600 for the doublescanned look. A solution in RA to get somewhat similar thin scanlines for the reduced content res is then also half of it, meaning modifiyng the res-independent scanline parameter to 500. I’ll try to see what happens later if cropping has any effect.

You can do different scanline heights with the flycast core. E.g.I’ve tried this just with CRT-Geom’s height parameter: 1280x960 allows for 240, 360 and 480. The core itself allows non-integer internal resolutions of 640x480 (e.g. 960x720), I’m not sure how many artifacts that introduces, it seems to look pretty neat generally.