Simple scanlines

Hello,

I love RetroArch, and use it a lot. However, I tried unsuccessfully to install simple scanlines, i.e. continuous lines whose thickness is 1 px, and whose brightness can be configurated. I could not find a shader like that, and I could not use a png file in retroarch, like I do in Mame UI FX.

If someone could help me, I would be grateful.

you can use a png through the overlay system. there are already some in the effects > scanlines subdir of the included overlays. If none of those suit your fancy, you can just replace any of them with a self-made png.

For a shader, you can’t really make one that functions as you describe that also looks good at different scale factors, etc. If you know exactly what resolution you’ll be using, you can get something going with fmod. My interlacing.cg shader does something similar, but it only works on integer scales that are multiples of 2.

In fact, if you’re planning to run at 4x scale (i.e., 1080p w/ integer scaling enabled), you can just take that shader and change the two instances of ‘2.0’ to ‘4.0’ and then use the runtime parameter to adjust the brightness of the lines.

Thanks, your interlacing.cg indeed is not far from what I want. It works fine on my monitor (640 * 480 res.) for nes, master system, nec and snes games, but not for genesis. Moreover, the lines are absolutely black, while I am looking for something more transparent. And I still don’t understand (perhaps because I am not an English native speaker) how I can “use a png. through the overlay system”. Could you explain me that?

Ah, 640x480 is actually the exact use-case for that shader, so you shouldn’t have to change the '2.0’s to '4.0’s :slight_smile:

In the shader options, there’s an option called ‘Parameters (Current)’ where you can change the darkness of the lines. When you find a setting you like, you can hardcode it into the shader by changing the very first line of the file:

#pragma parameter percent "Interlacing Scanline Bright %" 0.0 0.0 1.0 0.05

Just put your desired brightness setting (between 0.0 and 1.0) in the place of that first 0.0. For example, this would be 75% brightness:

#pragma parameter percent "Interlacing Scanline Bright %" 0.75 0.0 1.0 0.05

Genesis looks okay here, as long as I set ‘crop overscan’ to OFF in the video settings.

Thanks, I could modifie the brightness of the scanlines, not by changing the first line, which was in my case ineffective, but this one :

#define percent 0.97

Unfortunately, even with “crop overscan” off, the issue with genesis games remains with both cores (here, I decreased brightness).

So I tried the other way you had suggested. I created an image, 640 * 480 px, with black horizontal lines (1 px each), which I called nawak.png. Then, I made a nawak.cfg file, imitating what I’ve found in git hub :

overlays = 1

overlay0_overlay = nawak.png

overlay0_full_screen = true

overlay0_descs = 0

I put the files in the same folder. But When I select this file in “overlay preset”, it fails to load. Where is my mistake?

That overlay config looks fine to me. I’m not sure what could be messing it up. Did it print an error to the console?

For the shader, crop overscan needs to be off and integer scaling needs to be on, and you’ll have to refresh the video to make it take effect, either by toggling fullscreen or changing the windowed size (e.g., from 2x to 1x and then back to 2x). Here’s what it should look like:

Finally I made an other png, which were loaded correctly. Now what I see is exactly what I wanted. Thanks a lot, for your advice and your patience !

No problem! I’m glad you got it going :slight_smile:

Using this will cancel the on screen gamepad and buttons…

So how can I use this and return back to the RGUI without the on screen toggle button ?

Try this as your cfg:


overlays = 1

overlay0_full_screen = true
overlay0_normalized = true
overlay0_overlay = nawak.png
overlay0_descs = 1

overlay0_desc0 = "menu_toggle,0.5,0.5,rect,0.5,0.5"

This will add in an invisible button that covers the whole screen. When you tap it, it will bring up the menu. Replace the ‘nawak.png’ with whatever your scanline overlay is called.

Thanks!

I will try this later…

overlays = 1

overlay0_full_screen = true overlay0_normalized = true overlay0_overlay = scanlines1280x720.png overlay0_descs = 1

overlay0_desc0 = “menu_toggle,0.5,0.5,rect,0.5,0.5”

it is displaying the scanlines BUT the toggle menu is not working…