New CRT shader from Guest + CRT Guest Advanced updates

You could try the new option Resoultion Scaling, or use Blend Mode 0.0, at least for this game. With some settings, which tend to dissolve dithering, clear thin horizontal black outlines aren’t likely to get a good contrast, because the ntsc code blends it relentlessly with neighbor colors. :grin:

With math terms, the answer is rather simple if we look at the matrix and compare it with sRGB. The red color component gets less weights (0.408979 vs.0.412391) if multiplied only with a red color, blue and green get a bit more.

If red gamut is a bit wider, the changed matrix tends to enhance the red color component with mixed colors though.

But it’s more of a question how much clipping and if you get the desired colors in general. I wouldn’t mind very limited clipping too much, since it doesn’t affect very saturated colors, or in a negligible manner. Best answer would be to reduce brightness in the pre-pass a bit if it’s notable.

Regarding this aspect the usage of a lut is more advanced, but with a lut generating program like DisplayCal you cannot miss the concept that color profile conversions are not this trivial and you get to pick a preferred conversion type.

3 Likes

I get can closer with mask 6 on 1080, but the chunky masks look better on 4k in general. Mame_hlsl has the ability to incrementally scale masks but 99% of the values don’t work at least on a 1080 screen.(And that shader is a huge pain to work with.)

shaders = "17"
shader0 = "shaders_slang/crt/shaders/guest/advanced/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/shaders/guest/advanced/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/shaders/guest/advanced/afterglow0.slang"
filter_linear2 = "true"
wrap_mode2 = "clamp_to_border"
mipmap_input2 = "false"
alias2 = "AfterglowPass"
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/shaders/guest/advanced/pre-shaders-afterglow.slang"
filter_linear3 = "true"
wrap_mode3 = "clamp_to_border"
mipmap_input3 = "false"
alias3 = "PrePass0"
float_framebuffer3 = "false"
srgb_framebuffer3 = "false"
scale_type_x3 = "source"
scale_x3 = "1.000000"
scale_type_y3 = "source"
scale_y3 = "1.000000"
shader4 = "shaders_slang/crt/shaders/guest/advanced/ntsc/ntsc-pass1.slang"
filter_linear4 = "false"
wrap_mode4 = "clamp_to_border"
frame_count_mod4 = "2"
mipmap_input4 = "false"
alias4 = ""
float_framebuffer4 = "true"
srgb_framebuffer4 = "false"
scale_type_x4 = "source"
scale_x4 = "4.000000"
scale_type_y4 = "source"
scale_y4 = "1.000000"
shader5 = "shaders_slang/crt/shaders/guest/advanced/ntsc/ntsc-pass2.slang"
filter_linear5 = "true"
wrap_mode5 = "clamp_to_border"
mipmap_input5 = "false"
alias5 = ""
float_framebuffer5 = "false"
srgb_framebuffer5 = "false"
scale_type_x5 = "source"
scale_x5 = "0.500000"
scale_type_y5 = "source"
scale_y5 = "1.000000"
shader6 = "shaders_slang/crt/shaders/guest/advanced/custom-fast-sharpen.slang"
filter_linear6 = "true"
wrap_mode6 = "clamp_to_border"
mipmap_input6 = "false"
alias6 = "NtscPass"
float_framebuffer6 = "false"
srgb_framebuffer6 = "false"
scale_type_x6 = "source"
scale_x6 = "1.000000"
scale_type_y6 = "source"
scale_y6 = "1.000000"
shader7 = "shaders_slang/crt/shaders/guest/advanced/convert-ntsc.slang"
filter_linear7 = "true"
wrap_mode7 = "clamp_to_border"
mipmap_input7 = "false"
alias7 = ""
float_framebuffer7 = "false"
srgb_framebuffer7 = "false"
scale_type_x7 = "source"
scale_x7 = "0.500000"
scale_type_y7 = "source"
scale_y7 = "1.000000"
shader8 = "shaders_slang/crt/shaders/guest/advanced/stock.slang"
filter_linear8 = "true"
wrap_mode8 = "clamp_to_border"
mipmap_input8 = "true"
alias8 = "PrePass"
float_framebuffer8 = "false"
srgb_framebuffer8 = "false"
scale_type_x8 = "source"
scale_x8 = "1.000000"
scale_type_y8 = "source"
scale_y8 = "1.000000"
shader9 = "shaders_slang/crt/shaders/guest/advanced/avg-lum-ntsc.slang"
filter_linear9 = "true"
wrap_mode9 = "clamp_to_border"
mipmap_input9 = "true"
alias9 = "AvgLumPass"
float_framebuffer9 = "false"
srgb_framebuffer9 = "false"
scale_type_x9 = "source"
scale_x9 = "1.000000"
scale_type_y9 = "source"
scale_y9 = "1.000000"
shader10 = "shaders_slang/crt/shaders/guest/advanced/linearize-ntsc.slang"
filter_linear10 = "true"
wrap_mode10 = "clamp_to_border"
mipmap_input10 = "false"
alias10 = "LinearizePass"
float_framebuffer10 = "true"
srgb_framebuffer10 = "false"
scale_type_x10 = "source"
scale_x10 = "1.000000"
scale_type_y10 = "source"
scale_y10 = "1.000000"
shader11 = "shaders_slang/crt/shaders/guest/advanced/gaussian_horizontal.slang"
filter_linear11 = "true"
wrap_mode11 = "clamp_to_border"
mipmap_input11 = "false"
alias11 = ""
float_framebuffer11 = "true"
srgb_framebuffer11 = "false"
scale_type_x11 = "absolute"
scale_x11 = "640"
scale_type_y11 = "source"
scale_y11 = "1.000000"
shader12 = "shaders_slang/crt/shaders/guest/advanced/gaussian_vertical.slang"
filter_linear12 = "true"
wrap_mode12 = "clamp_to_border"
mipmap_input12 = "false"
alias12 = "GlowPass"
float_framebuffer12 = "true"
srgb_framebuffer12 = "false"
scale_type_x12 = "absolute"
scale_x12 = "640"
scale_type_y12 = "absolute"
scale_y12 = "480"
shader13 = "shaders_slang/crt/shaders/guest/advanced/bloom_horizontal.slang"
filter_linear13 = "true"
wrap_mode13 = "clamp_to_border"
mipmap_input13 = "false"
alias13 = ""
float_framebuffer13 = "true"
srgb_framebuffer13 = "false"
scale_type_x13 = "absolute"
scale_x13 = "640"
scale_type_y13 = "absolute"
scale_y13 = "480"
shader14 = "shaders_slang/crt/shaders/guest/advanced/bloom_vertical.slang"
filter_linear14 = "true"
wrap_mode14 = "clamp_to_border"
mipmap_input14 = "false"
alias14 = "BloomPass"
float_framebuffer14 = "true"
srgb_framebuffer14 = "false"
scale_type_x14 = "absolute"
scale_x14 = "640"
scale_type_y14 = "absolute"
scale_y14 = "480"
shader15 = "shaders_slang/crt/shaders/guest/advanced/crt-guest-advanced-ntsc.slang"
filter_linear15 = "true"
wrap_mode15 = "clamp_to_border"
mipmap_input15 = "false"
alias15 = ""
float_framebuffer15 = "false"
srgb_framebuffer15 = "false"
scale_type_x15 = "viewport"
scale_x15 = "1.000000"
scale_type_y15 = "viewport"
scale_y15 = "1.000000"
shader16 = "shaders_slang/crt/shaders/guest/advanced/deconvergence.slang"
filter_linear16 = "true"
wrap_mode16 = "clamp_to_border"
mipmap_input16 = "false"
alias16 = ""
float_framebuffer16 = "false"
srgb_framebuffer16 = "false"
scale_type_x16 = "viewport"
scale_x16 = "1.000000"
scale_type_y16 = "viewport"
scale_y16 = "1.000000"
WP = "-100.000000"
quality = "0.000000"
ntsc_sat = "1.200000"
SHARPEN = "1.200000"
CONTR = "0.150000"
blendMode = "2.000000"
prescalex = "4.000000"
glow = "0.020000"
bloom = "0.350000"
halation = "0.100000"
brightboost = "2.499999"
scanline2 = "10.000000"
beam_min = "1.799999"
scangamma = "1.500001"
shadowMask = "6.000000"
maskstr = "0.600000"
mask_gamma = "5.000000"
slotmask = "0.025000"
slotmask1 = "0.900000"
textures = "SamplerLUT1;SamplerLUT2;SamplerLUT3;SamplerLUT4"
SamplerLUT1 = "shaders_slang/crt/shaders/guest/advanced/lut/trinitron-lut.png"
SamplerLUT1_linear = "true"
SamplerLUT1_wrap_mode = "clamp_to_border"
SamplerLUT1_mipmap = "false"
SamplerLUT2 = "shaders_slang/crt/shaders/guest/advanced/lut/inv-trinitron-lut.png"
SamplerLUT2_linear = "true"
SamplerLUT2_wrap_mode = "clamp_to_border"
SamplerLUT2_mipmap = "false"
SamplerLUT3 = "shaders_slang/crt/shaders/guest/advanced/lut/nec-lut.png"
SamplerLUT3_linear = "true"
SamplerLUT3_wrap_mode = "clamp_to_border"
SamplerLUT3_mipmap = "false"
SamplerLUT4 = "shaders_slang/crt/shaders/guest/advanced/lut/ntsc-lut.png"
SamplerLUT4_linear = "true"
SamplerLUT4_wrap_mode = "clamp_to_border"
SamplerLUT4_mipmap = "false"
3 Likes

Looking closer, the color is off though, when comparing it to @Nesguy reference shot the thing color wise that sticks out the most is that it (reference shot) has more of a blue push into the green channel.

At least those are my thoughts.

1 Like

Yes, mask 6 gets very green when you push it to far. I’d probably need to add grade on to get it even closer.

2 Likes

I’m talking about something slightly different, I mean you’re completely right about mask 6 doing that for sure. (Mask 6 def pushes green to the screen lol)

I was specifically talking about the actual color space of the CRT he was showing a reference shot from, different manufacturers did kinda w/e they wanted with the color space (combine this with different regional white point standards) for their CRTs, within reason of course. (Sony tended to push the ever loving fuck out of red, jvc liked blue iirc).

That’s part of the reason for debates about what color what graphic(s) “actual” should be on a specific game, the nes Mario sky and the nes batman game both come to mind with the blue/purple situation.

I was just saying that the trees in his reference shot had an extra blue push in the green channel that was kinda obvious imo, tho tbh I’m not sure if it’s just the green channel getting that push or if that CRT just had a cooler white point (which would look similar, but different at the same time lol).

1 Like

I don’t think we can judge color from a photo though since CRTs are known to have cooler colors in photos than IRL, for whatever reason. Although this doesn’t discount the rest of what you’re saying.

1 Like

Yeahhhh… That’s fair :joy:

1 Like

Jesus, amazing. So basically 0.0 for NES/SNES era, 1.0 for PSX era, and 2.0 for PS2 era stuff? in your opinion?

Also can I get an opinion on scanline type/saturation/spike removal for least noticable scanlines while still providing the positive effects that scanlines provide? I currently use -1/0.30/1.5

1 Like

Plentiful of options here, color composition and game design is quite important tho with the ntsc shaders. Composite preset (1.0) is a very nice middle ground.

Sounds like you found a nice looking preset. You can play a bit with scanline shape (center, edges) also, but it’s not that important with mild scanlines. You can leave ‘spike removal’ and saturation at default values if unsure as they also matter more with stronger scanlines.

New Release Version (2021-07-21-r1):

Notable changes:

  • NTSC Resolution Scale improved for “upscaling”, better colors and fringing.
  • NTSC Blend Modes 0.0 and 1.0 improvement, better colors now.
  • Code cleanup, some parameter range adjustments (slotmask).

Download link:

https://mega.nz/file/40R3gYRA#x8PHCncB5vaqaESYzCPDVQzao0K2JEqksR6PQ-c44qY

11 Likes

Could somebody explain how to I install this in retroarch or reshade?

1 Like

Inside the zip file is a folder called “crt-guest-advanced-2021-07-21-release1”

  1. Open it.

  2. Drag and drop everything inside into the “crt” folder under shaders/slang_shaders/crt in your retroarch folder. Replace files if asked.

4 Likes

I’m still seeing weird fringing issues in games such as Ecco GAMMA_INPUT = “2.500000” halation = “1.000000” brightboost1 = “1.500000” shadowMask = “1.000000”

1 Like

Fringing was only adjusted for the “Resolution Scale” feature greater than 1.0, otherwise it’s like it was before.

But you can set the NTSC Presets to -1.0 and you can manually adjust the amount of fringing. It also works differently for horizontal source image sizes above 300px, it’s coded in the ntsc shaders for signal authenticity.

Apologies if this has already been asked, but I’m not too familiar with CRT shaders. What options should I set for this shader if I want to replicate a consumer Trinitron at 4k? I’m using CRT-Guest-Advanced. There are 3 different “Trinitron” mask options and I’m not sure what the differences mean…there’s also an “invTrini” option :stuck_out_tongue:

2 Likes

Mask 5 is a green-magenta 2-pixel wide mask. Best used with 4k with crt mask size 2.0.

Mask 6 is a RGB 3-pixel wide mask. Mask sizes of 1.0 or 2.0 are viable for 4k.

Mask 7 is a dark-bright 2-pixel wide mask. Best used with 4k with crt mask size 2.0.

You can select general mask strength with the “Mask Strength (0, 5-8)” parameter. How the mask behaves on darker pixels is determined with the “Mask 5-7 Low Strength” parameter.

Best scanline type for a trinitron setup is 2.0. I guess it’s also viable to try experimenting with some settings to get to know them a bit better.

If referring to LUT colors, it’s best to pick LUT option 1.0 or Color Profile 5.0 for a trinitron coloring appearance.

3 Likes

But you can set the NTSC Presets to -1.0 and you can manually adjust the amount of fringing.

Yeah, I know that part, but which settings are for the custom option/ Only the ones that start with “custom?” If that’s the case, where are the color bleed options and the like? Would it be possible to merge fields, like in some NTSC filter options that I’ve seen before? What are the default options for RF? Composite? S-video?

It also works differently for horizontal source image sizes above 300px, it’s coded in the ntsc shaders for signal authenticity.

Any way to make that a togglable option, similar to the interlacing options? I remember playing Ecco way back, and I don’t recall the weird fringing that I’m seeing here to be so jarring, especially during horizontal scrolling.

2 Likes

It would be possible to do this. Works quite nicely. :wink:

Svideo: 0.0 for artifacting and fringing

Composite: 1.0 for artifacting and fringing

RF: 2.0 for artifacting and fringing

Merge fields would probably deal with this problem.

2 Likes

New Release Version (2021-07-23-r1):

Notable changes:

  • NTSC Merge Fields parameter added for disabling the temporal component.
  • Edit: small bugfix

Download link:

https://mega.nz/file/EsATFAqZ#IsKartdDmIyXbPq5DOrRdBaY9Y0GU6OKAGjZTjEjAhQ

6 Likes

So after this we work on the vcr yeah? ROFL :joy::rofl:

PC is currently tied up but I’ll check this out in a bit.

2 Likes