CRT-Yah! A new shader chain

Not sure what else I could do to further reduce the blurriness of the NTSC effect. The recent changes should have eliminated the blurriness in the vertical (y) direction. But as for the horizontal (x) direction, I’d say that’s just the nature of the effect, esp. for the two-phase option.

Regarding the sub-pixel mask setting: 2-MG stands for magenta/green. So the sub-pixel mask consists of only two alternating colors instead of three as with RGB. This is actually nothing special; other shaders also offer this type of sub-pixel mask. Magenta/green usually appears more uniform, because the brightness between magenta and green is very similar, unlike the brightness between RGB.

However, a special feature of this shader compared to most others is the scaling of the sub-pixel mask based on the screen resolution. For example, at 1080p, the sub-pixel size is 1, while at 2160p (4K), the sub-pixel size is automatically scaled to 2.

Long story short, I don’t know why magenta/green works better for your LG OLED. The interaction of the actual sup-pixel grid of your display and the simulated sub-pixel mask can be quite complex and also can lead to artifacts, esp. with a sub-pixel size of 1.

3 Likes

I was hoping this would be common knowledge by now but LG 4K OLED TVs before the G5 use RWBG subpixel layout, therefore the only CRT Shader Subpixel Mask that would align properly and evenly is RRBBGGX (and possibly XRRBBGG but I haven’t tested that on any OLED TV). Regular RGB or BGR Subpixel Masks would not look accurate at least close up to the screen because of this.

This shader looks really good. Is there a way to turn off the flickering though?

You can turn off the scanlines jitter and also the jitter of the NTSC effect when activated:

  • set “Scanlines > Offset” to 0
  • set “NTSC > Jitter” to 0

There is also some animated noise you can disable:

  • set “CRT > Noise” to 0

Hi, great shader for starters! Actually it’s now by default shader I really like it. I have a question though. For 480p content what settings should I set in order to have a more convincing look?

Alt+Tabing and going back in gets rid of the flicker without adjusting any of those settings. Not sure what the issue is. Sorry, this is happening on other shaders too.

FYI : With the newest version i had to turn down saturation from 1.15 to 0.95 otherwhise I got black fragments in bright Letters on different cores and systems across the board. As soon as I went under1.00 they were gone

@Dante Depends on what you mean by convincing. Since you mention 480p, e.g. like Dreamcast or Naomi: This resolution is automatically down-scaled to 240p. You can return to 480p by setting the “Screen > Scale” to 1, or you try 360p by setting the value to 0.5.

@passballtotucker What video driver do you use? I usually go with Vulcan and rarely test the others.

@Buccaneer The shader code for saturation was actually not changed only the preset settings. Were you able to configure a saturation above 1.0 before? And what video driver do you use? I will test other than Vulcan, and try to reproduce this issue.

1 Like

I could not reproduce the issue with other video drivers. However, the saturation method I use could produce numeric errors, leading to NaN or Inf, which could be handled differently from hardware to hardware.

There might be a simple solution, which should prevent the potential numeric errors. Can you open the file crt\shaders\crt-yah\common\color-helper.h go to line 82 and replace:

    return saturation > 1.0
        // increase
        ? apply_scale(pow(color, vec3(saturation)), max_color(color))
        // decrease
        : mix(vec3(luminance), color, saturation);

by:

    return mix(vec3(luminance), color, saturation);

This does not give the exact same result as before, but is very close.

If that works for you, I will provide an updated version soon.

Tested and I can confirm with that code it works flawlessly with saturation above 1.0. PS I use vulkan and the saturation was above 1.0 since a long time…sttrangely with the latest version the problem came up. Thx

Hey great shader. I wish there was a way to control the NTSC Resolution or Resolution Scale because when I enabled NTSC things got way too blurry without any ability to fine tune it.

I tried loading my Blargg NTSC Video Filter presets but I got a black screen when attempting to load using Beetle PCE/SGX/CD. Apparently the NTSC Video Filter preset loading isn’t broken when using Beetle PCE Fast. This last part is for @hunterk, @Tatsuya79, and @barbudreadmon.

@Jezze On another note, besides the lack of WOLED specific subpixel mask layouts mentioned above, I sorely missed subpixel mask layouts for bgr displays, which is what I’m currently using for the most part but great work on a shader that makes it easy to keep things bright while remaining saturated and providing full opacity mask and scanline emulation and more!

Another update is coming soon and address some of the recently discussed topics.

  • fixed potential numeric errors of the “Color > Saturation” parameter, by changing the way its applied. This slightly increased the saturation intensity; presets have been adjusted accordingly
  • added “NTSC > Scale” parameter, which is independent from the existing “Screen > Scale” parameter and can be used to sharpen the NTSC effect, but depending on the amount you will loose the semi-transparency effect of it
  • reduced the black gap between sub-pixel blocks:
    Previously, the subpixel type “5-RGBK” (now labeled “5-RGB/x”) resulted in RRGGBBXX when scaled by a factor of 2 (default for 4K). Now the black component (XX) has been halved to RRGGBBX

@Cyber
I have not added a BGR or RBG option (yet) because I cannot see any difference in the order of the colors, at least not from a distance of 3 meters in front of the TV. I understand the desire to align the simulated subpixel mask with the display’s native subpixel grid. However, in my opinion, this will never work because the native subpixel grid is at least three times smaller than the simulated subpixel mask. A single simulated R, G, B always covers at least one entire native RGB.

4 Likes

Earthion + Yah is just….lovely

4 Likes

A new version (#850, #851) will be available soon and brings some minor tweaks.

  • corrected an half pixel shift when the image is down-scaled automatically

    This shift was only noticeable when a game changed resolutions, like some SNES games switching from 224p to 448p when displaying a high-res font.

  • changed “Mask Size” parameter to “Mask Scale” to make the (manual) mask sizing/scaling independent from the output resolution

    Previously the “Mask Size” parameter incremented the base size by 1px, which let to different results with different output resolutions: 1080p vs. 2160p. The “Mask Scale” parameter increments the base size by a multiple

  • added “Sub-Pixel Shape” parameter to control the smoothness of individual sub-pixel

    This setting is only noticeable for sub-pixel with a size of least 3px; for 4K displays and beyond

  • adjusted “Brightness Compensation” to include “Sub-Pixel Shape” and “Mask Bleed” parameters
  • added curved CRT+NTSC preset (crt/shaders/crt-yah/presets/pure-crt)
  • added color LCD preset (crt/shaders/crt-yah/presets/pure-lcd)

    Although the shader is primarily intended to imitate CRT effects, I have added a preset to simulate LCD screens such as the GBA.

4 Likes

Hey bud, have been out for a while.

This looks very excellent now (from my taste). Thank you for incorporating it.

Its cool old school looking exp. from the real good.

The blurriness will always bring authentic feeling to be made from 90s.

Thank you for the really cool preset around. It will surely bring tons of fun, thanks to you .

3 Likes

Are we going to get an option for Double Scanlines/480p mode? It would be very helpful for things like the Dreamcast or the PSX bios, or Panzer Dragoon Zwei…or an HD CRT shader preset.

You can achieve double scanlines by setting the “Screen > Scale” parameter to 1.0.

For explanation: With “Screen > Scale” set to 0.0 the shader normalizes the resolution of every input, depending on the actual resolution.
e.g.
480p to 240p
448p to 224p

This also works with way higher resolutions and basically halves the resolution until it’s reaches about 240p. When incrementing the “Screen > Scale” parameter the normalized resolution is multiplied by the value + 1.0.
e.g.
0.5 applies a multiplier of 1.5 (240p to 360p)
1.0 applies a multiplier of 2.0 (240p to 480p)

This also works for games that are originally 240p.

You’re welcome! And thanks for your valuable feedback.

OK, I just kinda figured it wasn’t implemented yet because I get this:

It would certainly be preferable for there to be an automatic Scale option for PSX/Saturn games that switch between 480/240 modes. Some games use 480 for cutscenes or menus and then 240 for gameplay. (Possibly worth pointing out Two Phase and Three Phase is the same way, easy example is SoTN where the menus/cutscenes use Two Phase and the in game sprite stuff is Three Phase - an Auto setting is highly preferred here.)

I think I was also a little confused when I was experimenting with the Scale setting in 240p games because it makes them lose a ton of sharpness compared to Guest Advanced when you enable Double Scanlines, as well as the loss of NTSC de-dithering.

Can you share your settings? Because the image you show is not what I get.

What exactly is your expectation by “automatic Scale option for PSX/Saturn games that switch between 480/240 modes”? Do you want to see 480 scanlines at 480p and 240 scanlines at 240p? If that is the case, then this shader does the opposite: It displays both 480p and 240p with 240 scanlines, which is one of the main goals of the shader - to normalize different resolutions to a common factor.