Hyllian shaders and presets

Hyllian, correct me if I’m wrong, but didn’t your shaders have a vertical scanlines option? I can’t find it in the newer versions. At least, I know your crt-nobody has it.

1 Like

It was conflicting with latest features, so I took it out until I find a fix for it. Do you use it?

1 Like

I do use it, but take your time. Sometimes, it’s not easy to find a satisfying solution, and hurrying it might degrade the shader’s quality. In the meantime, I’ll use crt-nobody alongside vertical-oriented games. So far, I’ve only seen guest and you implementing this feature. It’s pretty useful.

I’ve been working on shaving crt-royale the last couple of months. I was always curious about why it take so long to load. After getting rid of bloated layers of ifdefs and includes, and cutting some complex features (deconvergence, curvature, halation/diffusion), I’ve managed to get a fast version of it:

I know the missing features are important to some people. But you still can use the regular version if that’s important. This fast version is intended for potato devices. On my machine regular version loads in 2~3 seconds. This fast version loads in half second or less I think. And I get more fps too.

BTW: it’s not hard to get an intermediate version with some of the features back.

10 Likes

Great job, Hyllian. Tested here and it’s working fine, faster to load and, so far, couldn’t detect any undesired artifact. However, I’m not a fan of Royale and didn’t test deeper. Nonetheless, it’s really good to see a simpler, easier to configure version of it, just like the “mini” shaders created by @DariusG. You both make excellent (and, unfortunately, underrated) contributions. I favor your shaders even on my main computer, which can run much more demanding options.

By the way, I wanted to make a post about some tips of usage I gained from my experience with your main shader, but I suck at it. Maybe I’ll just point some findings, better than nothing.

4 Likes

Nice you like it.

Do it! It’s always good to receive some feedback. Maybe I’m not seeing one or other thing.

1 Like

It’s probably not what you wanted (or expected), but I ended up making a quite large text about my experience with your shader and some useful options to better explain it to newcomers. You can still use it as feedback, to see how a user see and uses your shader. Anyway, correct me if I wrote something wrong, because I’m far from being an expert about the issue. Also, I didn’t include any screenshots, as there are plenty in this thread already. But I can take a few later if they’re wanted.


Quick Tips about CRT Hyllian

I’ve been a RetroArch user since early 2012, and a fan since late 2013. I’ve tested many and many shaders along the way, and one of my favorites was always CRT Hyllian, since I discovered it in a small section of a brazilian video gaming message board. Things improved much as the years went on, and I’m pleased its author kept up with times and managed to keep his shader modern, lightweight, straight-forward and still packed with meaningful features.

For starters, CRT Hyllian is not meant to be a full replication of every inner working of a CRT screen. Instead, it focuses on its most prominent features that helps with picture quality on retro games, such as: rich and controllable scanline gaps, several phosphors layouts, color correction, gamma balance and horizontal blur. Being par for the course, I employ shaders on an LED/LCD screen, which vastly differs from a cathode-ray tube one. With that in mind, I strive for improving visual quality of old games using tricks from a previous technology, while not straying far from the “unfiltered”/“raw” look that is more natural to current monitors and television. In other words, balancing past and present to make good use of the stronger points of both. This shader is absolutely great at achieving that.

In the end, results are less niche-looking (definitely not nostalgia-inducing), taking some liberty regarding accuracy, but having positive approval among casual and veteran retro gamers for keeping a clean, bright, smooth-yet-sharp picture quality across many different kinds of content. I shall comment a subset of parameters from this shader that can help you achieve the same outcome, whilst pointing out a few shortcomings you might face. Finally, but importantly, I have a screen brightness/backlight target of around half-value (50%) — my rationale is that you shouldn’t need to lower your device’s lifetime (or to strain your eyes) just to play your favorite games.

Before trying it out for yourself, make sure to grab the latest version of CRT Hyllian from the author’s GitHub page: https://github.com/Hyllian/hspack

Let’s look at some (not all) of the parameters:

Horizontal Filter Profile

  • Values: 0.0 for Sharp 1; 1.0 for Sharp 2 (default)

    This option selects between two pre-built profiles for horizontal sharpness.

    “Sharp 1” tends to make the picture sharper, closer to the unfiltered look. However, that makes each pixel much more apparent, resulting in a thin look, sometimes as if it was affected by ringing artifacts.

    “Sharp 2”, on the other hand, gives fuller details, a little less sharp, though more pleasing overall. The default is sane and probably the better choice. Anyway, your mileage may vary, so try each one.

LUT (Color Correction)

  • Values: 0.0 for Off; 1.0 for Grade-Composite (default); 2.0 for Grade-Composite-Deepblack

    This option will alter the look of most colors, either subtly or relevantly, depending on the case. If you wish to keep everything closer to unfiltered, choose the “Off” value. However, retro games often had their colors purposedly tamer, knowing that the CRT television would boost them further. Almost always, a well-implemented color correction has a positive impact and will make the picture prettier. So I suggest giving it a chance.

    “Grade-Composite” is the default, and it compensates for a possible darker picture by crushing the black levels and making everything forcibly brighter (and, sometimes, washed out). Don’t expect accurate blacks with this one, though it unintentionally follows a current tendency of modern gaming, by presenting dark grays instead of real blacks. Regardless, everything else is pretty good, so it’s a good choice if you think your image ended up too dark.

    “Grade-Composite-Deepblack” is my personal favorite, almost identical to the previous value, but scales down on crushing the black levels and brightness level is almost untouched. It’s balanced, more natural, and, since you have other ways to brighten the picture, there’s really no downside… well, except it actually has. Its real black is also not perfect, but it’s deep dark shade of red, more and more visible the brighter your image gets. It might be discreet or not, depending on your screen and settings.

    As a hidden bonus, there’s the choice of “Grade-RGB” and “Grade-RGB-Deepblack”, which are subtler than the composite variants. However, setting them up is not straight-forward and you need to manually edit the shader file to point the location of their LUT textures.

Gamma Balance/Correction

  • Values: default 2.4 for Input Gamma; default 2.2 for Output Gamma

    This option controls the luminance of the picture through gamma values. CRTs were different than LCDs, and the default choice accomodates for that.

    Unfortunately, as of now, current technology isn’t as bright as the one before, so you may end up with a considerably darker (though technically accurate) image. To simplify things and avoid unpleasant results, keep the default value for “Input Gamma”, and slightly raise “Output Gamma” until you feel comfortable with the results.

    Don’t make “Output Gamma” higher than “Input Gamma”, to not wash out your colors and cause imbalance. If the defaults are considered, that means not going above value 2.4. Personally, I use “Output Gamma” as 2.35, but 2.30 and 2.25 can be good options too.

Phosphor Layout (Masks)

  • Values: 0.0 for none; 1.0~6.0 for aperture grilles (1.0 default); 7.0~10.0 for shadow/triad masks; 11.0~14.0 for slot/cromaclear masks

    This option enables/disables several kinds of masks. Their main purpose is to smoothen out pixels’ edges and to improve contrast of pixel art, giving it some texture. Be advised though, they demand high-resolution screens to look good; the higher the value of a mask, the coarser it is.

    If you have a 4K screen, you’re mostly fine, just pick what you think looks best, taking notice that coarser choices are darker.

    If you’re at 1080p resolution, stick to mask 1.0 (aperture, default) or 7.0 (shadow/triad), as they’re finer and will provide a bright and clean image.

    Lower resolutions might benefit more by disabling phosphor layout (value 0.0) altogether.

    Slot/cromaclear layouts are significantly computational heavier, so don’t pick them if your hardware is modest.

    The parameter “Mask Dark Subpixel Strength”, if lowered, brightens the mask and, consequently, the whole picture. I use it from 0.30 to 0.40, depending on how I want things to look.

    The parameter “Mask Light Subpixel Strength” is very propense to spawn uneven lines if you mess with it. Better to leave it with default values.

Brightness Boost

  • Values: default 1.30

    This option controls how much brightness the colors will receive, with the brighter ones being more affected than the darker ones.

    Since darker colors won’t be as affected, lighting balance is more perserved and washed out colors are less likely.

    Do not go overboard with this option: it seems to brighten the image with no downside, but it can make white tones swallow nearby colors. Personally, I use it with values 1.25 or 1.20.

    However, do not be scared: this shader has one of the best implementations of this feature, and it really tries its best to not destroy lighter details. Just make sure to test your settings across different kinds of games.

    Some official presets change the default to 1.25, though it’s still coded as 1.30 in the shader itself.

Beam Width

  • Values: default 0.72 for Min Beam Width; default 1.00 for Max Beam Width

    This option sets the minimum and maximum width for the scanline beam. Note that scanline means a line containing the actual image, not the black line (actually called “scanline gap”) commonly used in crt shaders.

    Max Beam Width defaults to its highest value and should be kept like that, unless you’re trying to mimic some specific kind of monitor or television you have/had.

    Min Beam Width can be raised to make the picture significantly brighter, at the expense of more bleeding through scanline gaps. Personally, I use value 0.85, close to the old default used in previous versions of the shader. Do some tests, anyway. Higher values do give a blurrier feel to the final result and not everyone likes it.

Scanline Shape

  • Values: 0.0 for Sinc; 1.0 for Gaussian (default)

    This option defines the algorithm used for the scanline gaps (black lines) generation.

    “Sinc” is starker, giving more noticeable gaps, lessening light bleeding between lines and providing more vertical sharpness. Naturally, it darkens the image a bit. Personally, I like it a lot, although it has a nasty tendency to produce uneven lines in some situations, requering integer scaling to avoid them.

    “Gaussian”, the default, is brighter and much less likely to create uneven artifacts. A good choice, though the fainter gaps do let light leak more between lines, reducing vertical sharpness. No integer scaling needed, overall (and this is a big advantage).

Scanline Cutoff

  • Values: default 300.0

    This option sets the minimum vertical resolution the content (not your screen) need to have for the scanline gaps to disappear.

    Consumer CRT televisions worked in a way that it expected to be fed content with around 480 pixels of vertical resolution, which would be split in half, in alternating lines. Those halves would then be quickly alternated in cycles, many times per second, giving the illusion of a full (though shaky) image. Retro games often had around 240 pixels of vertical resolution, so the rest had to be filled with black lines, giving birth to scanline gaps.

    Later, however, retro games with more vertical resolution came out, drastically reducing the formation of gaps. So there’s the need for this option to exist: to automatically remove the gaps as soon as it detects a “higher” resolution content.

    Don’t mess with the defaults, scanline gaps in game with more than 240p really gives an unnatural and ugly picture.

Post Brightness

  • Values: default 1.0

    This option set the brightness of the whole picture, indiscriminately.

    Unlike the “Brightness Boost” parameter, this one quickly and evenly raises the brightness of everything, promptly resulting in washed colors or even destroying the picture. Wisely, the default value does nothing.

    I only explain this parameter to make things clear, but you should mostly avoid it, unless it’s your last resort to avoid darker results. Even so, stay at lower values, like 1.05 or 1.10.

4 Likes

Thanks, it’s definitly more than I’d usually expect. You captured the spirit of the shader. Good points raised. I only can say is that I’m working on a new version and some of your findings will help me to make some choices.

Now, I have some time to comment on some of your findings:

You’re commenting about the default hyllian. It use bicubic as horizontal filter. Sharp1 is configured for Hermite (B=C=0.0), which is the same as smoothstep, a bit softer than Quilez and exhibit some pixellation. Sharp2 is Catmull-Rom (B=0.0, C=0.5), it blends very well while keeping sharpness high.

Next version will only use the deepblack versions of RGB and composite.

I found a way to speed things up a bit, so complex masks will run better.

That option came out to be useless as you realize. In fact, if you need it, most certainly you have a defective display :P. It won’t be in the next version. BTW, I’ll probably revive a glow version.

1 Like

Thanks for your time, Hyllian. Great to see you intend to keep working on the shader, even though the current version is already good.

About LUT, I don’t really use grade-composite, but I did see its washed out colors in real life, plenty of times. When I went to game rental places, some CRT screens there had that poor, grayish blacks. I don’t know why that happened; maybe the TVs had too many hours of use, or maybe they were calibrated incorrectly, but it’s indeed nostalgic. If the option isn’t holding back further development, you could call it something like “grade-composite-brighten” as move it far from default. Perhaps someone will find them interesting or use them to make the picture brighter.

Also, is the reddish tint of grade-composite-deepblack unavoidable? It’s really not bad, just a small pet peeve. Some dark games are fine (like Doom 64, for the Nintendo 64), others are more affected (like Rez, for the Sega Dreamcast). I took a screenshot from Tail Concerto, see if it looks reddish to you (I see it more at night).

1 Like

The red push is a characteristic of composite. Grade shader does that to LUT when you choose composite in settings. If this characteristic isn’t interesting, just choose RGB then.

1 Like

Thanks a lot! Really didn’t know that, as I played with component cables since 2004. I’ve grown too used to that.

Here’s a POC of a crt hybrid between royale and hyllian using just 5 shaders: crt-hyllian-royale-poc

Not all params work, though. It’s just to show how hyllian scanlines can work with the brightness provided by crt-royale that pops the RGB mask.

0ndixslys7e71-240811-165352 0ndixslys7e71-240811-165253 0ndixslys7e71-240811-165147 0ndixslys7e71-240811-165110

3 Likes

Not bad, but I think the mask is too coarse for 1080p. Your own shader has a better implementation of finer phosphor layouts. Perhaps trying it on a higher resolution could yield better results.

1 Like

It’s a matter of taste, though. I like it at 1080p. But you need to stay at least 1 meter from display to play.

1 Like

I decided to upload some screenshots I took. First one with crt-hyllian applied, then another with no shader. Open both in a new tab and alternate between them to compare the improvements (or use a specialized image comparison software). See if you like it. This shader is really great and here’s my tiny demonstration of affection for it:

The Classic

A picture of a Super Mario World romhack (Super Nintendo), very clean art style, easy to get good results with. Bright picture, smooth-yet-sharp pixels and pleasant color correction.

Low-poly 3D Game

A picture of the original Super Smash Bros (Nintendo 64). Polygons get, simultaneously, sharper and anti-aliased. Everything still is bright and color corrected, of course.

High-resolution 3D Game

A picture of Dead or Alive 2 (Sega Dreamcast). The game has native 480p support, so no scanline gaps here. Nonetheless, this shader still finds a way to be useful, improving the lighting, boosting colors and slightly smoothing aliasing artifacts.


The following screenshots are not for the faint of the heart or easily offended, as it deals with controversial choices:

Against dither

A picture of Ristar (Mega Drive). Visible dither, but the shader’s horizontal blur and color correction lessen it a bit. Everything else is sharp, detailed and vibrant. As a trivia, this image is actually very similar to how the game is displayed through better cables (s-video, component…) on a CRT screen, because the extra sharpness unblends the dithered patterns.

Even on handhelds

A picture of Banjo-Kazooie: Grunty’s Revenge (Game Boy Advance). Colors were slightly toned down to compensate for the usual saturation of older handheld games. Pixels are softened, looking less overblown, while still maintaining the sharpness expected from the original LCD screen. Definitely not accurate, but satisfactory. If you want to play fullscreen, that’s a great way to go, as accurate handheld shaders are not meant for high scaling factors.

6 Likes

Is it me or do these look really dark, especially the fourth picture.

1 Like

In fact, I didn’t adjust too much. Though it can be mitigated with controls. The point was to show the hybrid visual.

With some adjustments, brightness can be improved:

1 Like

“The scanline cutoff” parameter is something you’ll potentially want to increase in the case of mimicking actual progressive displays (ie. not standard consumer televisions), since most of them would still show small scanline gaps as they are typically capable of higher resolutions than 480p (with exceptions ofc).

Although on 1080p or similar low res host display, the scaling factor is probably too low to bother for most progressive content.

1 Like

Ok, It was the tiny picture that contributed to it. I see the brightness of the dracula eyes when zoomed in. I also forgot, that scene is actually really dark even in game.

1 Like

Thanks for teaching. I suspected higher-resolution CRT screens could exhibit something of the sort, but since I’ve only ever had consumers CRTs, I never witnessed it.

It’s not exactly in my interest to simulate progressive CRT screens, but, if someone wants to do it, the “scanline cutoff” option would need to be improved, since it only turns gaps on/off. As of now, 480p content makes gaps look all wonky.