New CRT shader from Guest + CRT Guest Advanced updates

Thanks for the thorough explanation! :slight_smile: Even though a lot of it is over my head, haha!

But isn’t the default gamma_out lower than default gamma_in already?

What would be the “neutral” value to you?

But wasn’t CRT’s gamma around 2.4~2.5, in contrast to the 2.2 gamma of current displays? Shouldn’t we always convert it to 2.2 in the case of sRGB displays?

Got it! I’ll keep to it for gamma adjustments.

So the NTSC adaptive sharpness doesn’t use any pattern detection like mdapt or gdapt does? I never liked mdapt or gdapt much because I don’t want false-positives.

Sorry for all the questions! I’m trying to understand a bit more how your shader works. :slight_smile:

1 Like

No, it’s 2.4/2.4 with this shader.

You must consider both values. If the divider is 1.0 (2.4 / 2.4 = 1.0), then it’s neutral.

We don’t convert in general, just do interpolation in linear space (2.4). Like i mentioned, RA works appropriate without shaders which would do gamma.

The NTSC version uses a gamma combo of 2.0/1.95 and the HD version a combo of 1.80/1.75. (Now questions will start, lol).

If we used like 2.4/2.2 then a gamma surplus would be created, assuming LCD gamma of 2.4. This is a bit harder to understand. LCD displays do their own thing.

For example, you can go with 2.4 / 2.4 or 2.2 / 2.2 or 2.0 / 2.0 combos. The end result would look very similar on a LCD. The quotient is 1.0 in all cases.

But but if you use 2.4 / 2.2, 2.2 / 2.2 or 2.0 / 2.2 the results would look differently, although output gamma is always 2.2. The quotient in the first case is ~1.1, 1.0 in the second case, ~0.9 in the third.

~1.1 assumes/compensates for LCD gamma of 2.4, 1.0 LCD gamma of 2.2, and 0.9 LCD gamma of ~2.0.

The only reason why one would use 2.4/2.2 combo is to increase contrast and saturation. It’s sometimes beneficial if the shader is coded in a specific manner.

It uses a kind of logic, but not pattern detection. The application of the logic is ‘continuous’ and not discrete, that’s why it looks like without detection artifacts.


Ah! This makes sense now! I’ve always used the NTSC preset, so I did not know the base shader uses 2.4/2.4 (and I read your post before you edited it). And you’re right, I don’t understand why the NTSC preset is 2.0/1.95, but I’m sure there’s a good reason for it! :smiley:

So, in the end, the recommended way to adjust the gamma is on the “Gamma correct” parameter?


@guest.r IIRC HDR uses BT2020 which uses 2.4 gamma. I’ve made changes to gamma for my presets that are 2.2 content and 2.2 CRT. Is there a more elegant way to do this? It’s sometimes difficult to make sense of some of the settings. Thanks again for all of the recent improvements.

Maybe phrasing these settings as, display gamma and content gamma might make it make more sense – to me at least. To be honest, I don’t know what the correct settings would be. Sorry if what I said made no sense. :sweat_smile:


Yeah it would be nice to have more clarification especially on the settings that show up in multiple places like gamma, brightness, contrast, saturation, describing what part of the signal chain they’re affecting (especially pre/post-mask) and how they should be used. Having like a whole doc write-up would be really cool.

I might be misremembering, but didn’t RA get the ability for more settings to have descriptions? I don’t know if that applies to shaders too but that would be extremely helpful. If not, can we get that implemented?

Also, it might be good to include some extra highly tuned presets so most people will only have to make very minor adjustments, as opposed to how it is now where the preset is just like a plain default that you really have to work on to get looking right.


That’s the whole point of this project:


I agree that cyber does a great job with his presets. Definitely love the ‘pvm-like’ presets. BTW Cyber, you don’t have any pure presets anymore. You used to have a pure sharp preset that didn’t have smoothing, etc in previous releases. Unless I’m mistaken – in that case which would you recommend for a sharp general preset?


I don’t want to go much lower than 2.0, because main gamma_in also effects how bloom and glow are distributed. They look better around 2.2-2.4.

gamma_in also affects horizontal filtering, wich looks more authentic (ntsc) with lower gamma.

But otherwise there are scanline_gamma and mask_gamma parameters, which look ok at 2.4 and work independently.

Much better to use the gamma_correct parameter, then raise gamma_out, which would de-saturate the image significantly. Combos like 2.4/3.0 would not look this nice regarding colors.

You can use the dafault settings without problems. I would perhaps only change gamma_correct and mask_gamma if you go for a certain look.

Yeah, this would be nice indeed. Otherwise i’m patching up to write the documentation for the shader.


Thanks for the explanations! I’ll focus on using “Gamma correct” and “Mask gamma” and leave the rest at defaults unless I really need to change them.

Documentation would be really great! And after that, it would be awesome to have this shader on the main libretro repository.

It does have that feature, but unfortunately it doesn’t work on shader parameters, I believe. :frowning:


Would it be posible to make the shader look exactly like this? I get close with my settings, but I always think something is missing. Here is an example of a close up of my 14" sanyo CRT


The gaps between the subpixels are really black and also the subpixels are not completely straight, and pixels are more rectangle instead of square… I wonder if this could be possible…


You can try really mild scanlines and mask 6 BGR layout with greater mask strengths. A notch of bloom could improve the appearance with brighter areas too. Glow can also be tuned down.


Thanks, I’ll give it a try :smiley:. But I think mask 10 looks closer than the 6, also mask 6 looks awful a 4k. What I already know, mask 6 hasn’t got black gaps between subpixels. At least mask 10 does. If I put clipping at max also looks more similar to my crt, but the colors loses a bit of detail. Also scanlines look really dark. If I put mild scanlines, intensive black dessapears. An it looks a bit odd…


I’ll put this on my TODO list for someday :slight_smile:


I’m also trying to achieve the same look as you.

Do you prefer mask 10 instead of 12 for 4K?


Mask 12 in size 2 for 4k looks too big. I don’t know why. But If I put size 1 with width of 8 and height of 4 looks like mask 10 in size 2 with width o 4 and height of 2. I don’t know if I’m doing something wrong here…

1 Like

One question. Why BGR layout? My PC monitor is RGB, also My sanyo CRT Pixels Looks like RGB. thanks in advance…


Because it’s got much better subpixel spacing. RGB layout produces stripes on displays with RGB matrices (mask 6).


ok. thanks a lot. maybe is that what is missing. I’ll give it a try and I’ll post it as soon as I can… :smiley:


Mask 12 is already sized for 4K, so you must use it at size 1. It’s width should be 7 and not 8, but correct me if I’m wrong. The only thing I’m not sure is how high should it be, but I’m using a height of 3 right now.

It looks like this (ignore the bloom):