CRT-Yah! A new shader chain

Aw shit. Wish you a quick, full recovery my man. Yeah been busy indeed, it’s the least that we the powertweakers can do isn’t it. I’m going through all the shaders again at 4K and 1440P (happy to finally leave 720p behind), really enjoying the new computer. And discovering fresh (for me at least) ones like @DariusG 's consumer, @beans 's beans, @Jezze 's yah, @Hyllian 's hyllian 2.0 or that weirdo whkrmrgks0 (which is actually quite interesting). So many toys to play with!

Well you have one more now. Come back soon! :slight_smile:

2 Likes

@Squalo I’m not sure how familiar you are with Git, but I added a “Black Lightening” parameter, with a default value of 1, which maintains the previous behavior. However, it can be lowered to 0 to disable the black level lightening effect caused by scanlines, mask and noise.

Here is the branch with the changes: https://github.com/ImJezze/slang-shaders/tree/crt-yah

Let me know if this is what you had in mind.

1 Like

It can but you need to do it in this order:

  1. Any chain of shaders as long as the final output is gamma corrected
  2. phosphor-luma.slang
  3. phosphor-chroma.slang
  4. A linearization shader that applies a 2.4 power gamma correction, because the output from phosphor-chroma is in linear space
  5. Any chain of shaders

This is because these shaders are part of Scanline Classic and there is a shader called scanline-advance that comes after it (does interlacing, geometry, and upscaling) and it requires a linearized input and does the gamma correction as the last step.

You also need to use float_framebuffer = true for both shaders.

@Jezze it was a driver issue after all. Tried them all and under d3d/glcore jitter breaks when prepending shaders, at least on my AMD-based computer. Works perfectly fine in vulkan. I hope some nVidia/Intel users will report their experience. I also updated my review. It’s now more accurate, in accord with our findings :slight_smile:

Wow that was quick, appreciate it. I will try the new version today when I get home, but yeah it sounds exactly like what I had in mind. Edit: you actually made it a slider, instead of a simple switch like I had proposed. That way we get the best of both worlds. This is perfect.

I have a quick question regarding brightness compensation. I configured a chain for a really bright game and when I apply it to different ones I notice that they still look great. Your implementation is adaptive, right? If I understand it correctly, it’s in fact more than just compensation, and can be used (to a certain extent) as an automatic brightness control. Kind of like a compressor-limiter in audio terms, if you know what I mean.

@anikom15 cool, will try that too. What kind of visually perceptible changes should I be looking for?

1 Like

Good to know the jitter problem is only caused by certain video drivers. I usually only use Vulkan, because it compiles 10 times faster than others, at least on my machine. I will keep looking into this problem with the other drivers, maybe I find a solution, but I cannot promise.

I’m glad you like the new parameter for the Black Lightening. I’ll raise a pull request in the upcoming days.

In regards to the brightness compensation: It’s mainly influenced by the shaders own settings for scanlines and mask. However when using the “additive” mask blend mode, the brightness of the current pixel is also taken into account.

1 Like

I’m actually switching to vulkan for all the cores that get along with it. I had been thinking about it for a while anyway. Your shader (which I will be using a lot) is the straw that broke the camel’s back, so it’s perfectly fine by me if scanline jitter stays as a vulkan exclusive, and I can’t see anyone complaining about it :slight_smile:

Nice. It does an excellent job.

Just a little update. Scanline jitter is fixed in glcore with latest AMD drivers.

1 Like

Just raised a PR with the new “Black Lightening” parameter. The default setting of 1.0 keeps the original appearance.

@Squalo That’s interesting and confusing at the same time. Because the only thing the jitter code does is alternating the texture coordinate over time depending on the frame rate. But good to know that it now works, at least for the glcore (and vulkan) renderer.

1 Like

Yes it is. I’ve been testing things thoroughly to be sure that my analysis/review was fair and consistent. Another weird little spin is that the effect is less obvious in glcore than vulkan. I. E. you have to lower the beam filter parameter to achieve the same “jitter intensity”. It’s working great nonetheless with the new drivers. Again, it would be nice if more users tested it, but the forum seems a little quiet these days.

hi, i’ve looked and its nice.

do you think is possible to incorporate ntsc rainbow effect on future ?

i mean for megadrive or nes/snes

I’m not exactly sure how the “rainbow” effect is defined. But you can set the following parameters and get something similar; the rainbow lines go diagonal though.

NTSC_PROFILE = 5.0
NTSC_QUALITY = 3.0

NTSC_PROFILE = 5.0 increases the fringing and artifacting (the slider only allows a maximum of 3.0) and NTSC_QUALITY = 3.0 makes use of 3-phase modulation with field merge (which basically deactivates the flickering).

1 Like

I checked but didnt give something remotely close. Diagonal rainbow is for NES, though.

That’s a small text file where i saved several original Genesis Rainbow records, in case can be useful to see how the effect does.

Unless you referred to something else as “not sure how rainbow is defined”.

Still, look very good with dithering alone

I’ve been checking this out recently and it’s quickly becoming one of my faves; due to the simplicity of configuration and especially the way hallation looks - however, it seems that the shader applies a general yellow tint which is only mitigated with the colour setting so much. Is this intentional, can it be mitigated entirely?

Thanks for your work!

2 Likes

That’s nes/snes NTSC phase right there with diagonal lines. It’s already discussed many times before how rainbow is created and already implemented in other shaders, like e.g. crt-consumer-1w-XL i wrote or ntsc-blastem in “ntsc” folder.

1 Like

Thanks for checking it out, glad you like it.

I think the yellow tint comes from the “Brightness Overlow”, which increases the brightness beyond full saturation, e.g. a full saturated red become orange. Another factor could be the “Mask Color Bleed”, where bright subpixel bleed into neighbor subpixel and slightly change the overall hue if the whole pixel.

Can you confirm the yellow tint goes away when decreasing these two settings? Maybe I need to tinker around with the factors for each color channel, so that the overall hue is not changed too much.

1 Like

Ahh - it’s brightness overflow that is causing it. Reducing this down to zero gives almost exactly the same colours as the raw output.

Reducing Mask colour bleed actually makes it worse; increasing it gives brighter pixels with deeper saturation; removing the yellow tint a bit.

As an aside, I would throw my hat in the ‘sharper NTSC’ ring. Love the colours and the waterfall effects in Sonic but the rest is so blurry that my eyes can’t handle it! EDIT: A general sharpness scale or guidance on sharpness would be great actually - finding on consoles like PS1/2 where increasing scale helps with text legibility, there’s a bit of blur inherent in moving to +0.5 or +1.

All tests performed at 4k on an LG BX OLED; Vulkan in Bazzite (Linux)

Yeah at first I had issues with my hues too (particularly red being pushed to yellow indeed), until I figured out what overflow does. It’s another of those unique yah traits that you won’t find anywhere else. I generally would recommend a value of 0.5 for it.

2 Likes

Thanks, I’ll give that a try! Do you have a real set to compare Yah against? It’s far and away becoming my favourite, it’s so easy to get good results.

@Jezze would you be able to advise on what to prepend or append to Yah single-pass to add halation? I’m trying to keep resources under control but the halation is sorely missed in single-pass.

Thanks again, and a Merry Christmas/Happy Holidays to you all :slight_smile:

1 Like

My crts are currently in storage, the poor things. I just don’t need them anymore. This is why :slight_smile:

Regarding halation, adding it yourself is basically going to create a preset that is pretty much yah multipass minus ntsc. This is where halation comes from

shader5 = "shaders/crt-yah/blur-horizontal.slang"
filter_linear5 = true // required: sample lut-output linear

shader6 = "shaders/crt-yah/blur-vertical.slang"
filter_linear6 = true

It’s the same tried and true method that other shaders use, afaik. If your device is really struggling with the blur passes, try prepending Hyllian’s dilation (in the “warp” folder). It’s not the same but it might be faster.

You can also run the shader at lower resolutions, makes a big difference with older machines and still looks great. Try 1920x1080 (easy way out) and if that’s still a bit slow, 1280x960 and 1194x896 are nice 4:3 integer vertical multiples of 240 and 224 respectively.

3 Likes

What are the chances of a Reshade version of Yah? If I had any idea how to code I’d try it myself!