New CRT shader from Guest + CRT Guest Advanced updates

You will need the Guest’s g-sharp-resampler-horizontal. He explained above and made the download available: New CRT shader from Guest + CRT Guest Advanced updates

Then use these parameters in g-sharp:

SIGMA_GH = “1.000000”
HSHAR = “2.000000”
HAR = “1.000000”

2 Likes

New Release Version (08.05.2021-r1):

Notable changes:

  • After debugging the raster bloom effect i had to implement some changes to get it to work properly, at least with glcore and hopefully vulkan drivers. With these it should work as intended, OTOH there seems to be issues with mip-map generation with D3D11.
  • Afterglow parameter range improvements for better tweaking.
  • Most presets now got two stock pre-passes for custom shaders.
  • Small halation tweak.
  • Some code cleanup.
  • Edit: vignette better looking, simplified.

Download link:

https://mega.nz/file/M5Y33YqT#ovnBaoZPapkXGyaIk4kP4SKHu-fR8H7DGSfXKgDrLCc

Feedback is welcome although i didn’t seem to produce new issues. :grin:

11 Likes

I’m going to test this out later today, I’m going to be judgemental XD

1 Like

I’m really enjoying with my 1440p display atm. The best thing is size-3 masks look very nice. I would also like to mention that the fast version is quite suitable for high resolution content and it also has the nicest horizontal deconvergence.

A screenie:

5 Likes

That looks really great!, very natural looking :star_struck:

Any particular settings you are using for this look?

2 Likes

Here are my settings:

shaders = "8"
shader0 = "shaders_slang/crt-guest-advanced-2021-05-08-release1/shaders/guest/fast/stock.slang"
filter_linear0 = "false"
wrap_mode0 = "clamp_to_border"
mipmap_input0 = "false"
alias0 = ""
float_framebuffer0 = "false"
srgb_framebuffer0 = "false"
scale_type_x0 = "source"
scale_x0 = "1.000000"
scale_type_y0 = "source"
scale_y0 = "1.000000"
shader1 = "shaders_slang/crt-guest-advanced-2021-05-08-release1/shaders/guest/fast/stock.slang"
filter_linear1 = "false"
wrap_mode1 = "clamp_to_border"
mipmap_input1 = "false"
alias1 = "StockPass"
float_framebuffer1 = "false"
srgb_framebuffer1 = "false"
scale_type_x1 = "source"
scale_x1 = "1.000000"
scale_type_y1 = "source"
scale_y1 = "1.000000"
shader2 = "shaders_slang/crt-guest-advanced-2021-05-08-release1/shaders/guest/fast/pre-shaders.slang"
filter_linear2 = "true"
wrap_mode2 = "clamp_to_border"
mipmap_input2 = "false"
alias2 = "PrePass"
float_framebuffer2 = "false"
srgb_framebuffer2 = "false"
scale_type_x2 = "source"
scale_x2 = "1.000000"
scale_type_y2 = "source"
scale_y2 = "1.000000"
shader3 = "shaders_slang/crt-guest-advanced-2021-05-08-release1/shaders/guest/fast/linearize.slang"
filter_linear3 = "true"
wrap_mode3 = "clamp_to_border"
mipmap_input3 = "false"
alias3 = "LinearizePass"
float_framebuffer3 = "true"
srgb_framebuffer3 = "false"
scale_type_x3 = "source"
scale_x3 = "1.000000"
scale_type_y3 = "source"
scale_y3 = "1.000000"
shader4 = "shaders_slang/crt-guest-advanced-2021-05-08-release1/shaders/guest/fast/bloom_horizontal.slang"
filter_linear4 = "true"
wrap_mode4 = "clamp_to_border"
mipmap_input4 = "false"
alias4 = ""
float_framebuffer4 = "true"
srgb_framebuffer4 = "false"
scale_type_x4 = "absolute"
scale_x4 = "800"
scale_type_y4 = "source"
scale_y4 = "1.000000"
shader5 = "shaders_slang/crt-guest-advanced-2021-05-08-release1/shaders/guest/fast/bloom_vertical.slang"
filter_linear5 = "true"
wrap_mode5 = "clamp_to_border"
mipmap_input5 = "false"
alias5 = "BloomPass"
float_framebuffer5 = "true"
srgb_framebuffer5 = "false"
scale_type_x5 = "source"
scale_x5 = "1.000000"
scale_type_y5 = "source"
scale_y5 = "2.000000"
shader6 = "shaders_slang/crt-guest-advanced-2021-05-08-release1/shaders/guest/fast/crt-guest-advanced-pass1.slang"
filter_linear6 = "true"
wrap_mode6 = "clamp_to_border"
mipmap_input6 = "false"
alias6 = ""
float_framebuffer6 = "true"
srgb_framebuffer6 = "false"
scale_type_x6 = "viewport"
scale_x6 = "1.000000"
scale_type_y6 = "source"
scale_y6 = "0.500000"
shader7 = "shaders_slang/crt-guest-advanced-2021-05-08-release1/shaders/guest/fast/crt-guest-advanced-pass2.slang"
filter_linear7 = "true"
wrap_mode7 = "clamp_to_border"
mipmap_input7 = "false"
alias7 = ""
float_framebuffer7 = "false"
srgb_framebuffer7 = "false"
scale_type_x7 = "viewport"
scale_x7 = "1.000000"
scale_type_y7 = "viewport"
scale_y7 = "1.000000"
vigstr = "0.325000"
vigdef = "5.999998"
downsample_level = "1.000000"
prescalex = "2.000000"
h_sharp = "3.000001"
s_sharp = "0.000000"
warpX = "0.040000"
warpY = "0.060000"
csize = "0.050000"
bsize = "170.000000"
bloom = "0.150000"
halation = "0.350000"
gamma_c = "1.360000"
shadowMask = "6.000000"
maskstr = "0.550000"
slotmask = "0.550000"
slotwidth = "3.000000"
DER = "2.000000"
DEB = "-2.000000"
DES = "0.750000"
textures = "SamplerLUT1;SamplerLUT2;SamplerLUT3;SamplerLUT4"
SamplerLUT1 = "shaders_slang/crt-guest-advanced-2021-05-08-release1/shaders/guest/lut/sony_trinitron1.png"
SamplerLUT1_linear = "true"
SamplerLUT1_wrap_mode = "clamp_to_border"
SamplerLUT1_mipmap = "false"
SamplerLUT2 = "shaders_slang/crt-guest-advanced-2021-05-08-release1/shaders/guest/lut/sony_trinitron2.png"
SamplerLUT2_linear = "true"
SamplerLUT2_wrap_mode = "clamp_to_border"
SamplerLUT2_mipmap = "false"
SamplerLUT3 = "shaders_slang/crt-guest-advanced-2021-05-08-release1/shaders/guest/lut/other1.png"
SamplerLUT3_linear = "true"
SamplerLUT3_wrap_mode = "clamp_to_border"
SamplerLUT3_mipmap = "false"
SamplerLUT4 = "shaders_slang/crt-guest-advanced-2021-05-08-release1/shaders/guest/lut/custom_lut.png"
SamplerLUT4_linear = "true"
SamplerLUT4_wrap_mode = "clamp_to_border"
SamplerLUT4_mipmap = "false"

Maybe i forgot to use ‘interpolation’ for a nicer screenie with interlacing options. :smile:

5 Likes

Thanks again @guest !! This update was fantastic for me !!

I put jinc2-dedither on the first pass to get the dither checkerboard and give it more clarity, and used g-sharp-resampler-horizontal for the vertical lines (which I adjusted especially to not destroy details, such as small texts) on pass 2.

Edit: I tested it with the sgenpt-mix checkerboard at BLEND_LEVEL = “0.000000” and BLEND_LEVEL = “0.200000” in place of jinc2-dedither and I think it got better.

Now I have much better transparencies than before! I thought it couldn’t get any better, but these two spaces for pre-shaders came from heaven!

Animated GIF-downsized_large

5 Likes

I also used xbrz with g-sharp for GBA and other games that use dither and have lower resolution:

1 Like

@guest.r, I don’t know what you did, but this was solved:

1 Like

Gotta say you outdid yourself with this shader, it’s pretty much the number 1 crt shader for Retroarch at the moment. Mask 3 is the best, I use to love the aperture grille look but the lottes look just gives off such a gritty nostalgic look that brings me back to the mid 90’s, I’ll be sticking with that mask for a while.

6 Likes

@guest.r A few of the settings in interlace would be nice to turn on and off only when the resolution triggers the interlacing such as Internal Resolution, Downsampling and Prescale. The extra Blur is nice on highres stuff but almost always too much on 240p content.

3 Likes

The second iteration of the average screen luminance was developed using my older AMD gpu and mip-maps were regularly produced by enabling them in the current pass, which used textureLOD. After gpu change i recently tested the effect again and mip-maps weren’t working without enabling them in the current and the exact previous pass at the same time. Hopefully this works with other gpu’s too as the extra mip-map directive shouldn’t break it’s purpose.

Thanks, that’s very nice to hear. I’d like to mention that i didn’t plan such a ‘large’ shader couple of years back and many users/guests brought a lot of perspective into this, especially dr. venom. Anyway, my thanks goes to many people. :grinning:

I think some users would really prefer something like this to be on auto, but i don’t want to bring extra confusion into the parameter usage. Maybe there is a clever solution…will think it through.

5 Likes

is there a particular reason the custom shadow mask ends up being Green, Blue, Red?

1 Like

Which shadow mask, there’s a few lol

2 Likes

The reason is quite natural and technical since most visible colors can be reproduced with displays using pointy and close together red, green and blue sources of light.

CRT displays use this concept for colors and resolution, but the number and density of ‘light emitters’ is a rank or two greater on modern displays.

Most masks within crt shaders try to reproduce the lower density ‘phosphors’ of crt displays, so red, green and blue colors can be periodically enhanced as a repeating pattern, sometimes even sub-pixels are considered.

Looking from a greater distance and using a mask which considers all three color components the colors remain balanced and the image reproduction is color consistent with the input images.

Here is a very decent reading on crt masks and shaders:

6 Likes

Thanks for the information. I noticed that with mask 6 and the shadow mask set to say 50, it looks like the phosphors are in a different order than RGB, it looks like GBR, is it because of modern monitors? What happens if reordered to RGB? I think Lottes mask 1 is RGB ordering

This is an issue with running masks on modern displays, sometimes your displays subpixel structure interferes with the masks coming out properly, but idk I’m tired… Someone else will chime in eventually lol.

If the pattern RGB is repeated you get:

RGBRGBRGBRGBRGBRGBRGBRGB

If the pattern GBR is repeated you get:

GBRGBRGBRGBRGBRGBRGBRGBR

…so it’s basically the same thing. :wink:

1 Like

hahah you…you’re right. For the gamma out should I set to 2.20 if my monitor is calibrated to that gamma? or is the gamma out of 2.40 more accurate to crts even if my monitor is 2.20?

1 Like

The shader can deliver very enjoyable performance, even if you set input and output gammas to 1.0, which combo i sometimes use for ‘interlaced content’.

Example with 1.0/1.0 gamma:

Sot it’s the ratio between those two which you should balance a bit. I would rather say that you can normally use 2.4/2.4 gammas for monitor gamma of 2.2 and 2.4/2.2 for monitor gamma of 2.4.

Some knowledge about the shader intepolation mechanics is also needed to understand the consequences of adjusting shader gammas, but the correlations between these and monitor gamma is not this straightforward at all.

5 Likes