CRT-Yah! A new shader chain

It was just the stock CRT-Yah.slangp But I am on a Nightly RetroArch…and I made sure to update my Dreamcast core. Maybe there’s some option interfering with it but no other CRT shaders are doing this to the Dreamcast core.

And if your shader wants to just do the Opposite without providing an option to have 480 at 480 and 240 at 240, then that’s at least by your design. I’d hope for an option, but I can respect Creator Intent. It looks nice being stuck at 240p for the PSX bios screen at least. Hides the dithering.

I can think about an option that disables all automatic scaling, but yeah, that’s not what the shade is about.

Here is a comparison, between native image, automatically down-scaled to 240p and manually up-scaled to 360p.

Most if not all other shaders just apply their effects to the original input size. And with a 480p image on a 1080p monitor, you wont see much of the scanlines, because they are getting just too small.

The minimum scanlines size of this shader is 3px, btw. If the image size would result in smaller scanlines, it automatically falls back to 3px.

Can you tell me what render API you’re using (glcore, vulkan, dx11/12)? I would like to reproduce the issue in your screenshot. Unfortunately I cannot test different graphics cards, my only PC has a GTX 970.

Vulkan+RTX 5070. And yeah on 1080p, even 1440p, it’s true that 480p scanlines just don’t appear too right. You wind up with uneven odd looking artifacts.

On 4K OLED’s they look really nice though! :smiley: The crisp look of a Sega Genesis on an HD CRT still feels difficult to replicate these days however.

I will test the nightly build of Retrorach later this day, but it is strange that no other shader shows these artifacts.

Can you also test CRT-Yah.single-pass.slangp, and deactivate mask, scanlines and other effects successively. I would like to know what effect causes this issue on your end.

Mask Intensity at 0 cleans it up entirely on DX11/DX12. On Vulkan+GL Core I also need to switch the Mask away from Mask 4.

Thanks for testing that out! It seems the problem is the procedural generated mask, although I’m wondering why a Mask Intensity of 0 still show the issue on Vulkan and GL Core.

Could you do another test for me?

  1. Keep the stock settings, but set the Mask Scale to 1. This should give the sub-subpixel a size of 2px.
  2. Change the following lines of code in the file crt-yah.fs.h (line 361):
    vec3 mask = get_subpixel_color(
         pix_coord,
         subpixel_size,
         subpixel_mask,
         subpixel_type,
         subpixel_color_swap,
         1.0,
         subpixel_smoothness);
    
    to
    vec3 mask = get_subpixel_color(
         pix_coord,
         subpixel_size,
         subpixel_mask,
         subpixel_type,
         subpixel_color_swap);
    
    This will use another implementation of the mask generator.

Please let me know, if and what has changed.

Btw. did previous version of the shader show these artifacts?

p.s. Is there anyone else experiencing the same artifacts?

Hi again. Do you know if there’s some way to fix the NTSC effect if you set specific video scaling resolution ?

It apparently happened because coming from 4:3 to video size within next coords:

265

124

828

615

Looks like the shader assumes the wrong resolution. If you share your configuration, I will have a look.

I don’t know because I’m only just getting around to trying Yah out now. Changing the code didn’t change the artifacts.

Okay, then it must be something both mask generators have in common.

Regarding the mask scale, did the artifacts stay the same when you incremented the scale or did they change at least? I would expect the latter.

video scaling: custom. Coords:

265

124

828

615

monitor resolution: 1600x900

#reference "crt-yah.slangp"
COLOR_PROFILE = "-0.700000"
COLOR_TEMPERATUE = "0.600000"
NTSC_PROFILE = "2.000000"
NTSC_SHIFT = "1.000000"
NTSC_JITTER = "2.000000"
CRT_NOISE_AMOUNT = "1.000000"
CRT_CURVATURE_AMOUNT = "0.150000"
CRT_VIGNETTE_AMOUNT = "0.100000"
CRT_CORNER_RAIDUS = "0.060000"
CRT_CORNER_SMOOTHNESS = "0.200000"

A new version is on the horizon and addresses some of the recent feedback:

  • Changed NTSC Profile parameter to be continuous with fractional increments
  • Added Auto option to NTSC Quallity (Phase) parameter (suggested by @PU786)
  • Added Screen Resolution parameter to select between Auto and Native (suggested by @PU786)

    Auto is the default setting and applies the automatic down-scale to high resolutions as before. Native disables the automatic down-scale. However the minimum size of 3px per scanline is still enforced.

  • Fixed NTSC effect when using the custom scale option in RetroArch (reported by @ynnad4)

I’m still looking into those artifacts, presumably caused by the procedural mask. Unfortunately I cannot reproduce this issue yet. If someone else could help, that would be very much appreciated.

4 Likes

hi, is it available already ? Dont know how much it takes to update. Thank you for the quick fix. I still cannot see the options you mention and it still happens this twisted rainbow

The pull request I linked should have been merged by the time of your writing. I just tested updating the shaders in RetroArch and it contains the new version now.

1 Like

yeah, its very perfect now. Thank you a lot for your awesome work into this project.

3 Likes

Where can I acquire such Shader, TC?

Hi !

I am using RA to browse game pics with shaders, instead of actually playing games :innocent: (I use PNGs from mobygames) ; I have noticed with the pure- presets a diagonal line, is it because this is static content (or maybe the Image viewer (?) core), or can it be fixed with a change in parameters ?

Thanks for this nice set of shaders by the way !

I also use images to test my shader, only for effects that require motion I start a game. :wink:

But no, this is not normal, it’s an artifact that should not be there.

It could be the same issue @PU786 has reported and seems to be related to the mask settings. Can you test if the artifacts disappear when set the Mask Intensity to 0?

If you are willing to change some code for testing purpose also look at this previous post.

@Superdonkeyjack Not sure if this is the right topic to discuss your question, as it is quite basic. To get femilar with RetroArch and shaders look here. RetroArch ships with hundreds of shaders out-of-the-box (incl. this one via online updater).

1 Like

No, I mean your specific one that you’ve been updating through this thread. It looks fantastic, I tried using the one that’s the default. Doesn’t come close to what I’m seeing in that.

You can find several presets for this shader in the following folder:

crt/shaders/crt-yah/presets

1 Like