OSSC like scanline shader for 4k displays

After talking about it with a few friends I decided to post it here and hopping someone can help out.

I know there’s a scanline shader in the misc folder but that won’t multiply correctly at 4k. I’m looking for something that can be multiplied by 8x or more, using integer scaling. I don’t mind black bars on top and bottom. What I’m looking for is a shader that can draw a black line every X lines, according to the multiplier so it will draw it exactly were a 240p CRT would draw it.

I tried every CRT shader disabling everything and just leaving scanlines without success. Some causes artifacts, some cause blurriness and bleeding on the scanlines from the top and bottom line. Overlays won’t work properly as far as I can tell because it needs to figure it the multiplier.

The OSSC does it perfectly. The Framemeister does it the wrong way, that’s why I’m asking for a OSSC like x5 scanlines. What I mean is, if you multiply a 240p source you will get big block pixels that will take 9 lines in a 4k display. The line is supposed to be drawn after the 9th line. What I’m not sure is how many lines the scanline should occupy. Some shaders will draw it between each line causing a weird scanline effects.

What would be awesome to have is pixel sharp image, without any kind of deterioration and correctly placed scanlines.

Check out misc/scanline-fract (available in GLSL and slang flavors). It only works with integer scaling, but it draws perfectly even lines with parameters for the thickness in pixels and the darkness in percent. Here it is with 8x scale, 3 px lines and 100% line-darkness:

1 Like

Holy!! This seems perfect! I’m back at my computer tomorrow! Can’t wait to test it.

Hey Huntek, I was finally able to get some time to test the shadder you mentioned.

It’s not scaling properly. I`m using integer resolution at 4k here. Bilinear filter off.

You can see it here:

This is taken from sony PVM 2950Q

It’s hard to explain in words but it`s like the shader is cutting pixels in half and also having uneven lines.

I tried to load it as a preset but it won’t show up to be selected. So I loaded it in a single pass and used bilinear and linear and don`t care as scaling.

Maybe Im doing something wrong but this doesnt seem correct on my end.

Hmm, yeah, that’s not right. What core are you using? Does it look like that with everything?

I`m using Higan Snes core. I haven’t tried other cores.

One thing that seems odd on my end is that when I set custom scanling to 1x it shows 448 and 240 and not 256x224. So in 4k it’s duplicating my resolution.

What would be some recommended settings when loading scanlines-fract? Custom scaling with integer scaling ON 4x height 4x width.

Load shader in a single pass. Filter method: Don’t care Scaling 4x or 5x.

That`s what I’m doing here.

It shouldn’t need anything intricate, just integer scaling with whatever AR you want.

Higan core is a little weird, though, as it uses a doubled res (I suspected you were using it, which is why I asked :slight_smile: ). In the core options, set it to use 256x224 (or 256x240) for the internal res and set ‘Blur emulation’ to ON. That should make it play nicer with shaders as well as automatically blending pseudo-hires content.

Still having some problems here. Mostly as you can see after 4 scanlines you get a larger space. Tried the Higan settings and tried don’t care scaling and 4 and 5x. Now I’m scaling it at 8x in width and height.

That means you’re still getting fractional scaling from somewhere. Video settings should be integer scale ON, shader scale should be don’t care. You might try toggling “crop overscan” on/off to see if that makes a difference, as well.

Finally received my OSSC.

It’s not just uneven scanlines.

This is a picture taken from my tv using ossc in 5x and scanlines at 12% strenght. See that while in retroarch we have 10 scanlines for just the heart while in the ossc we have 5. Which is much closer to a PVM and BVM.

That’s what I was refering to when saying it is “splitting pixels”. Maybe this would work ok in 1080p but 4k where it should shine it’s uneven (haven’t test crop on and off yet) and there too many scanlines in the same pixel line.

Again, that’s because higan core is running at double vertical res unless you use the core option to drop it down. Or, you could try using one of the other SNES cores that don’t do that double-res thing.

for me yes the 4k is enough I don’t even use the rec709 at full contrast just 70 to 80… with the bfi… my oled is the panasonic ez950 1000 nits… then if i force the hdr to retroarch??? i will have to be at 30 in contrast…no need for 10000nits… anyone can see it on my videos… users with a lcd4k tv not oled, not qled, confirmed me that everything is in its place no need to be at the maximum of rec709 and even less in hdr… I don’t know if this answers your question but on my oled4k tv and the bfi I don’t feel the need to buy anything. just spent a month making custom presets for the oled and I have a kvb trinitron aperture crt as a model… original machines etc… just copy my crt… see you soon

read video description for correct viewing. bfi on / my shader compensates for loss of brightness 70=contrast and brightness= 70 normal color mode, color = 50 rec2020 panasonic oled4k hdr tv range retroarch standard mode rec 709