Common-Overlays Repo

I just match it to a multiple of 240, which should be good for anything that used a CRT TV for display (doesn’t work for handhelds unless you use a least common multiple, which I guess would be a multiple of 480 for Game Boy Advance…?)

ah, but a lot of games/cores use 224 instead of 240 (this may be related to a crop overscan setting). If you use a multiple of 240 for those games/cores you’ll always get misaligned scanlines. That’s why so many options are necessary. I’ve made overlays for 3x-5x scale for both 224 and 240, with different levels of overdrive/glow effect, which is why there are so many options. I could have adjusted the overdrive/glow in even finer increments but it seemed excessive. Each overlay is a 50% reduction in brightness when opacity is at 100%.

Anyhoo, the overlays in \rpi\ appear to be working fine on this machine running Windows 10. Integer scale on the Y axis has to match the Y of the overlay being used. I made overlays for 3x ,4x and 5x scales for 224 and 240, so I think that covers all cores/games except for maybe some arcade games. There are a few changes I’d like to make:

  1. Could we merge \rpi\ with \effects\scanlines\ ? I think that makes more sense.

  2. Could we add these overlays to \effects\scanlines? (Dropbox link in post 25)

  3. Could we delete ”scanlines1920x1080” and “scanlines1920x1080-5x” from \rpi? They are redundant with the new overlays; options 1 or 2 for 4x (896, 960) and 5x (960, 1120, 1200) do the same thing.

  4. Can we also delete “scanlines1280x720” in \rpi? It’s redundant with the new 3x overlays.

Hi guys, I’ve used for a very long time scanlines1920x1080, scanlines1920x1080-5x and scanlines1280x720 and they all work pixel-perfect on my PC and Lakka/RPi.

Why are new ones necessary?

Never an issue for me.

@Nesguy I see the difference, it is between using

overlay0_full_screen = true

versus

overlay0_full_screen = false

in the cfg file.

1 Like

Great, that’s exactly what they should be doing and it’s why I’ve been saying that \rpi\ should be merged with \effects\scanlines.

The old overlays are included with these new overlays. Option 1 at 4x and options 2 and 3 at 5x do the exact same thing as the old scanline overlays located in \rpi. Not shown below, but option 1 at 3x is the same as the old 1280x720 scanlines.

I’ve already explained this but I’ll go ahead and try again.

I created new overlays to have different amounts of scanline overdrive/glow effect, and different levels of scanline beam width variation. I did this by altering the LCh lightness value in increments of 5 for each of the scanline patterns, raising the lightness of the outermost lines and lowering the lightness of the innermost lines. This results in the number of options that I’ve provided. Adjusting LCh in finer increments seemed excessive and unecessary. All overlays result in a 50% reduction in brightness when opactiy is adjusted to 100%. Here are all the patterns used; the numbers represent black% (100 is full black).

896/960 resolution (4x vertical scale):

1)
100
0
0
100

2)
50
0
50
100

3)
55
0
55
90

4)
60
0
60
80


1120 resolution (5x vertical scale):

1)
100
0
0
0
100

2)
100
0
0
100
100

3)
100
25
0
25
100

4)
95
30
0
30
95

5)
90
35
0
35
90

6)
85
40
0
40
85

7)
80
45
0
45
80

8)
75
50
0
50
75

9)
70
55
0
55
70

Yes, that’s great. It looks like the old overlays are doing exactly what they should be doing, which is what I said they should be doing, which is why \rpi\ should be merged with \effects\scanlines.

You can check out some examples using the new overlays here.

(seriously, how can I make this easier to understand? I’m at a bit of a loss, here. Am I providing too much information all at once, or am I not providing enough information? I’ve already answered your questions in previous posts but apparently I’m not being understood/not getting my point across, so how can I improve my communication? What am I doing wrong, here?)

First of all, I appreciate the work on the scanline overlays, thanks! My suggestion was to leave the RPi overlays as they are since they work well and are easy to find.

The post above is a good summary. After some thought I understand why using ‘overlay0_full_screen = false’ could be useful, it make the use of overlays independent of the users screen resolution. However, in my opinion it makes the selection rather unintuitive with so many options available.

If regular 720p or 1080p are assumed then using ‘overlay0_full_screen = true’ would reduce the number required to just the three basic ones 720p 3x, 1080p 4x and 1080p 5x (for each pattern).

Maybe each pattern could have a name for easier identification, for example option 1 could be ‘sharp’. Of course, it’s up to you.

@metchebe

Happy to hear that you’re finding them useful!

I’d like to remove them because they’re redundant with the new options, and then merge \rpi\ with \effects\scanlines\

I’d rather work on getting all of the existing overlays to work consistently with all platforms and avoid having a separate directory for each platform, just for the sake of simplicity, but I’ll leave this decision to whoever decides such things.

Okay, I’ll look into this and see if I can reduce the number of overlays that way.

I could add “(sharpest)” to option 1 and option 2, where necessary. I could add “(maxglow)” to the highest numbered options. Would that make things easier? It’s a bit of a pain to edit all the necessary files so I’d like to decide on some easy to understand labels before I go changing things.

@hunterk

Just wondering; can I use the instructions here to submit proposed changes to the overlays, cloning the overlays repo instead of the docs repo?

http://docs.libretro.com/meta/how-to-contribute/

yeah, should be essentially the same process. I’m planning to add your overlays soon, but I wanted to wait until the release cycle is over and once we get all of the stuff from this thread settled (I think it pretty much is, but I’d rather do one commit when we’re sure than do a bunch of commits while we sort things out).

1 Like

TL:DR; Using RA’s overlay system, is there a way to tile a .png overlay across the screen the same way GIMP tiles an image with filter->map->tile?

I’m having trouble following this. If I set “overlay0_full_screen = true,” then the overlay gets scaled to whatever the resolution is set to. So, for example, if I’m using a 4x overlay that’s 896 pixels tall, and the 4x custom ratio of the game is actually 960 pixels tall, then the 896 image gets scaled to 960 pixels tall, which results in uneven and misplaced scanlines. If, on the other hand, I’m using a 4x overlay that’s 960 pixels tall with a game that has a 4x custom ratio that’s 896 pixels tall, you still get weird and misplaced scanlines.

I’m not sure how to make just one overlay for each pattern for 3x, 4x, and 5x without tiling the image. If there’s some way to tile a png across the screen (the same as GIMP’s tile function), then I could make one overlay image for each pattern for 3x, 4x, and 5x. For example, you could just make one image that is 5 pixels tall and 1 pixel wide for each of the 5x scanlines patterns, and then tile the image, and it would work at any 5x vertical resolution (1120 or 1200).

No, there’s no way to tile anything, but that would probably be fairly easy to add… You can make them 1 px thick, though, and just stretch it across the screen.

That wouldn’t solve the problem of misplaced/weird scanlines when using an overlay that has a different Y than the Y of the custom ratio, though. The goal is to have one overlay per scanline pattern for the the 3x patterns, 4x patterns and 5x patterns. This cuts down the number of overlays from 30 something to 16.

No, there’s no way to tile anything, but that would probably be fairly easy to add…

I think it would be worth it to add this function, for the above reason that you can then create a single scanline overlay with a 3x, 4x, or 5x pattern and then get it to work with any 3x, 4x, or 5x resolution (respectively). I think that’s probably the easiest way to cut down on the number of overlays.

Yup, so all you need are images with scanlines across the whole area that are sized:

  • 1280x720 (for 3x)
  • 1920x1080 (variant 1, for 4x)
  • 1920x1080 (variant 2, for 5x)

The current overlays/rpi/scanlines* overlays are set up just like this.

There is no need to worry about the excess image out of the 1080 viewable area or if the image is smaller than 1080.

I’ve also checked and the 5x variant works just as well with custom aspect ratios that create overscan (for example 1120 or 1200) and also with cores that don’t overscan (like Master System which is 960 at 5x).

I took some GPU screenshots to corroborate, you can see them here. Note: the screenshot tool only captures the game viewport, but the display sizes are 1280x720 and 1920x1080. Also the garbage at the top and bottom for the 240p 5x image isn’t visible during play.

1 Like

Ahhh, okay. I still don’t really get it, but at least I know what I need to do, now.

@metchebe @hunterk

Okay, I made the new overlays but I’m still wondering about the names/labels. Right now I’m using the following:

3x-scanlines1-1280x720
3x-scanlines2-1280x720
3x-scanlines3-1280x720
4x-scanlines1-1920x1080
4x-scanlines2-1920x1080
4x-scanlines3-1920x1080
4x-scanlines4-1920x1080
5x-scanlines1-1920x1080
5x-scanlines2-1920x1080
5x-scanlines3-1920x1080
5x-scanlines4-1920x1080
5x-scanlines5-1920x1080
5x-scanlines6-1920x1080
5x-scanlines7-1920x1080
5x-scanlines8-1920x1080
5x-scanlines9-1920x1080

I think that’s a logical order for them to go in. Is it helpful to have the required resolution listed at the end like that? Should I add any other labels? Any other suggestions?

1 Like

Here’s the link to the new overlays:

Example:

This is 5x-scanlines6-1920x1080. Also using TVout-tweaks-multipass with signal resolution: 480.

Looks good to me, I think the resolution has to be listed. I think that there are so many that labels are not reasonable (maybe a README is better).

I think they could go in a new folder called effects/scanlines-fullscreen/ or similar.

1 Like

Okay, I’ll work on that.

Yeah, it really is a lot of overlays. If I was to add 4k overlays (8x and 10x) that would be 6 for 8x and 16 for 10x, or 22 additional overlays. At that point a shader would really be better.

I think these could eventually be replaced with a simple scanline shader that uses the code from MAME HLSL for scanline beam width variation. Could call it “MAME scanlines” or something. Shaders also tend to perform better in most situations, afaik. Of course, some platforms don’t even allow for shaders, so overlays are still useful in some situations.

AFAIK, these are good to go:

Here is the suggested Read Me, to be placed in the same folder as the scanline overlays:

These overlays have varying amounts of scanline beam width variation/glow/overdrive effect.

The lowest numbered overlays have the sharpest scanlines and no glow/overdrive. The highest numbered overlays have the most glow/overdrive and the most beam width variation.

The “classic” scanline overlays are still here, they’ve just been renamed as options 1 and 2.

Instructions

For these overlays to work properly, you must:

  1. choose an overlay with a resolution that matches the video resolution being used by RetroArch (e.g. use one of the 1920x1080 overlays if you’re using 1920x1080 for the video resolution).

  2. enable integer scaling. (settings -> video -> integer scale -> ON)

  3. set the aspect ratio to “custom.” (settings -> video -> aspect ratio -> “custom”)

  4. set the custom viewport x/y to an appropriate size. Set “custom aspect ratio height” to 4x or 5x if using 1920x1080 as the video resolution; if using 1280x720 as the video resolution, set “custom aspect ratio height” to 3x (settings -> video -> custom aspect ratio height)

Enjoy!

I suggest that these overlays be placed into \overlays\effects\scanlines\ and that \overlays\rpi\ be merged with \overlays\effects\scanlines.

I was also planning on making new versions of the aperture grille overlays to make them better-looking and more consistent with the others.