You mean in the horizontal, right? These are imperfections of the scanlines interpolation. I think the best you can do is set the Beam Shape to 1 (smooth). But I guess you already did that, at least in the configuration you posted some time ago.
Another update is on the way. It hopefully fixes the mask artifacts reported by @PU786 and @yyyeeeaaahhh.
Otherwise there is rather boring stuff, like some refactoring and a few tweaks.
- (hopefully) fixed mask artifacts with high resolution input
- reduced code duplication by moving code to shared files
- reworked Screen Resolution parameter
- 1-Native: as before, no automatic scaling besides the min scanlines height of 3px
- 2/3-Low: same as 0-Auto before, auto down-scaling to ~240p
(option 3 also allows auto up-scaling from lower resolutions than 240p) - 4/5-High: new, auto down-scaling to ~480p
(option 5 also allows auto up-scaling from lower resolutions than 480p)
It is not recommended to configure the emulator to render in higher resolution than native. Otherwise this has a huge performance impact depending on your hardware.
- made Lut pass the first pass
- changed scanlines jitter to consider all brightness related setting (incl. contrast, saturation, temperature. etc.)
- changed increment of Frequency parameter from 30Hz to 10Hz
As the previous update, it contains breaking changes for custom complex presets, simple presets should not be affected.
What is the difference between screen resolution and the screen scale parameter?
Screen Resolution is kind of a preset. It automatically scales the image to the desired resolution. If you want to always display games in about 240p regardless of their actual resolution, then select 2-Low. If you always prefer 480p, then select 5-High+. The plus indicates that this setting also up-scales lower resolutions. 1-Native does nothing, besides ensuring a min. scanlines height of 3px.
Screen Scale on the other hand, gives you manual control over the resolution. +1 doubles the resolution, -1 halves the resolution. It is applied relative to the selected automatic scaling.
The actual scaling depends on the actual image size. e.g. if you have a 448p input, then the Low profile will not scale down to 240p as mentioned above, but to 224p. So, it basically halves the resolution and vice versa; 224p with High+ will become 448p.
The reason for Screen Resolution over Screen Scale is, that I like to have a consistent appearance, also for games that change their resolution dynamically. Like some SNES games, when displaying a high-res font, or most PS1 games, where the title screen is high-res but the game itself low-res.
The reason I ask is because I like to run PSX games at 640x480 (PCSX-Rearmed’s Enhanced Resolution setting) as that was a resolution the console could achieve, just most games didn’t run it. Call it a fantasy PlayStation if you like!
So the interesting thing is that I have PCSX Rearmed upscale when I’m playing on my CRT (via a Raspberry Pi with a SCART hat) - but obviously the TVL of my CRT doesn’t change. So I get the higher resolution rendering but the scanlines/phosphors etc are the same.
However, in Yah if I have a higher resolution - either by upscaling or by running a native 480i game (there weren’t many - but Ehrgeiz is one) then the scale increases along with the number of scanlines.
I’ve noticed that other shaders in RetroArch do a similar thing where it will up the number of scanlines the higher the internal game resolution is running - so a 480 or 720p game would look like it was on a high res CRT monitor; where as a 16bit console would look like a consumer TV.
Obviously, on a real CRT this doesn’t happen - the TVL is fixed no matter what resolution it supports.
Comparing Yah and other shaders to my 14” consumer Trinitron, I can’t get the scaling to behave in a similar way to how the TV looks. I realise this is likely to be a limitation of either RetroArch and/or simulating a resolution agnostic TV on an OLED which is very strict about resolutions, but either way - just thought it was interesting.
Hopefully that makes sense - maybe I can drum up some screenshots.
Thanks for your detailed expatriation. Some screenshot would most certainly help to understand better.
So, my takeaway is, that you want to run PS1 games with a vertical resolution of 480. That’s what the two High presets are for. Option 4 will downscale any larger input, e.g. if the emulator renders at twice the internal resolution then Yah will downscale 960 to 480. I do not recommend changing the internal resolution, because the downscale is not done on the texture level, it only halves the rendered scanlines.
Usually you should let the emulator render at the native internal resolution. And this is not always fixed: e.g. the game itself has a vertical resolution of 240, the title screen has 480 and some black screens are way lower than 240. For this case use option 5: It works like 4, down-scaling from higher resolutions, but 5 also up-scales from lower resolutions. So, you should always get about 480 scanlines.
I say “about” because it is not actually scaling to a specific resolution: Instead the rendered scanlines are basically just halved or doubled until you get roughly 480. Usually this is no problem because the internal rendering does not switch between odd resolutions. Most of the time the switch is between 240 and 480. And with option 5, Yah should look nearly the same for both.
If you need more control over the scaling you can use Screen Scale in combination with Screen Resolution. Screen Scale allows for fractional scaling, adding or removing individual scanlines.
When I get the emulator to upscale internally, the CRT is delivering that as 480i - which is the same resolution as 240p seeing as interlaced doesn’t deliver all 480 pixels at the same time like progressive does.
So to the eye, the scanlines on the CRT are hardly visible (they almost look vertical) - but when taking pictures of the two difference resolutions, the pictures look the same. As 480i is essentially two 240p images drawn sequentially on alternate lines, a picture from the camera just looks like 240p; but to the eye it looks like a higher resolution image - but with flickering.
On a PC running Retroarch, Yah and on an OLED, you’re only ever getting a progressive, none flickering image, so when the scaling upscales it to 480p, it’s literally doubling the resolution, doubling the number of scanlines and drawing them all at the same time. The result is a more high-resolution CRT monitor style look with a very high TVL.
This only really becomes a problem if we’re being purist - obviously I’m not - but using Yah in Native mode, a 480i PSX game like Ehrgeiz will double to 480p, creating a look that wouldn’t occur on a CRT because on a CRT half the lines wouldn’t be there half the time.
I’m not sure there is a way around this - maybe add super thin scanlines, or just put up with 240p!
Okay, now I get what you mean. True, Yah, does not simulate an interlaced image with the High resolution profile, it is lithely progressive and therefor just doubling the resolution of a 240p input. I can look into this direction, but currently the High profile is just there to work in the same fashion as the Low profile; normalizing the resolution.
I added automatic scaling primarily to compensate for the SNES’s high-resolution mode. Many Japanese games frequently switch back and forth between the two modes when displaying text. And without this automatic scaling, you’d constantly be switching between normal and double scanlines.
Having a little play around - if you set Scanline and Mask intensity to 1, and the set Mask Scale to 1, you kind of get the vertical effect interlaced gives you
Can you show me a screenshot?
It’s still extremely heavy when switch on composite.
Hmm, that’s unfortunate. 
On my fairly outdated GTX 970: I got about 300fps with the old version on a MegaDrive (320x240) game. With the new version it’s about 500fps.
Can you tell me more about the games you run.
Gtx 970 probably is many times faster than the adreno chip in sd865, like 8-10 times. Just normal games, gba or Megadrive.
Apologies, I’ve been ill the past few weeks. I’ll try and get you a screenshot
No worries, there’s no need to be in a hurry. I hope you’re feeling better now.
Is there a way to use this shader with mega bezel?
Also, I’m not sure if Auto Chroma Phase is working correctly. In guest-advance-ntsc, auto still blends the sonic waterfall while Yah’s doesn’t. Unless it just works differently.
You’re right the Auto Chroma Phase does not work correctly. I think it worked at some point and then I messed it up with my latest refactoring. It will be fixed with the next update. If you don’t want to wait you can check this commit to see what has to be changed.
Regarding your Mega Bezel question: I actually don’t know. But I guess there is no general hurdle. I think @ynnad4 used a regular bezel here. If someone can guide me how to setup a mega bezel - maybe there is a template - then I can give it a try.
Thanks! This is probably my favorite shader now.
There’s a couple of other things I noticed.
When using higher res cores (ps2, gamecube, dreamcast), I set screen resolution to 1 for native since I don’t won’t those at 240p. This causes a pink tint on the screen as well as what looks like uneven scanlines. Setting retroarch to integer scale fixes both of those issues but I don’t want to use that. I was wondering if that could be fixed within the shader. I am on a 1440p screen. Maybe this isn’t an issue at 4k.
I also like using your LCD variant for handhelds, but one thing I don’t like is how the mask seems to move under the “pixels”. I wonder if that could be fixed.