New CRT shader from Guest + CRT Guest Advanced updates

It’s possible if you use the ‘custom’ ntsc mode, in which you set fringing to 0.0. Ofc. custom artifacting should be increaed to a greater value.

5 Likes

We can now do our own HDR tonemapping, just FYI: https://github.com/libretro/RetroArch/commit/9151326b73d7bf0be7eccfbdd8513dc1f34719aa

8 Likes

I got the time and opportunity to try it out and it really works great, simplifying the HDR concept a lot. Tested it with some games and presets and it became a preferred experience. Since HDR implementation really varies from display to display (mine is like 430 sdr / 520 hdr nits) i added a brightness variable in the last pass to better customize the experience.

New Release Version (2022-01-07-r1):

Notable changes:

  • added a brightness control variable to better adjust the HDR effect.
  • finer tuning of rolling scanlines
  • ntsc preset included again along with other presets

Download link:

https://mega.nz/file/094UgbBR#ZAxqX4HUdO8WviF4f-rSFjfUgCxbbqir1ugGNL8Wcv0

13 Likes

@guest.r @HyperspaceMadness If I apply the new Guest version, will it break the MegaBezel? (I have the latest version 01/05 Rev2)
Thank you

3 Likes

The Mega Bezel uses an internally adapted version of Guest’s shader, it does not reference his stand-alone.

I will assume that, after some testing, HSM will update the internal version.

(He and I both have HDR displays, albeit HDR10.)

4 Likes

I wanted to ask, would it be possible for you to move the two parameters “Afterglow Strength” and “Afterglow Saturation” from the “pre-shaders-afterglow.slang” and place them into the “afterglow0.slang” file? I ask because I noticed on my last custom guest shader preset when I replaced the “pre-shaders-afterglow0” pass with “grade” both “afterglow strength” and “afterglow saturation” dissapeared when I go into the parameters. With those two parameters no longer there I noticed the first shader pass “afterglow0” parameters (persistence red, persistence green, persistence blue) displayed a more intense afterglow hence the reason I turned those 3 parameters down from their default value of 32 to 8. Yet I still notice the afterglow is still kind of strong even if I turn all 3 of those parameters down to 0 in my preset. I notice this the most on nes games, perfect example is Castlevania the first stage, soon as you start walking the trees in the background light up really strong with the glow, this doesn’t happen in the vanilla crt-guest-advanced-ntsc shader which my preset is based off, only in mines does that happen since I’m missing those two parameters from the “pre-shaders-afterglow0” pass that ended up getting replaced for the “grade” pass. Is there anything that can be done to include just those two parameters into the “afterglow0” slang file so that the afterglow can display the way it’s suppose to?

2 Likes

Thanks for mentioning it. It will be fixed in the next release.

2 Likes

Nice. I’ll be looking forward to it.

1 Like

Oops, i seem to misjudge the situation a bit. It sounded like grade had an afterglow handling, but didn’t find any. The mentioned parameters can’t be put backwards unfortunately.

But i can post the presets with more stock shaders, so there is room for grade also:

crt-guest-advanced.slangp

shaders = 13

shader0 = shaders/guest/advanced/stock.slang
filter_linear0 = false
scale_type0 = source
scale0 = 1.0

shader1 = shaders/guest/advanced/stock.slang
filter_linear1 = false
scale_type1 = source
scale1 = 1.0

shader2 = shaders/guest/advanced/stock.slang
filter_linear2 = false
scale_type2 = source
scale2 = 1.0
alias2 = StockPass

shader3 = shaders/guest/advanced/afterglow0.slang
filter_linear3 = false
scale_type3 = source
scale3 = 1.0
alias3 = AfterglowPass

shader4 = shaders/guest/advanced/pre-shaders-afterglow.slang
filter_linear4 = false
scale_type4 = source
mipmap_input4 = true
scale4 = 1.0
alias4 = PrePass

textures = "SamplerLUT1;SamplerLUT2;SamplerLUT3;SamplerLUT4"
SamplerLUT1 = shaders/guest/advanced/lut/trinitron-lut.png
SamplerLUT1_linear = true
SamplerLUT2 = shaders/guest/advanced/lut/inv-trinitron-lut.png
SamplerLUT2_linear = true
SamplerLUT3 = shaders/guest/advanced/lut/nec-lut.png
SamplerLUT3_linear = true
SamplerLUT4 = shaders/guest/advanced/lut/ntsc-lut.png
SamplerLUT4_linear = true 

shader5 = shaders/guest/advanced/avg-lum.slang
filter_linear5 = true
scale_type5 = source
scale5 = 1.0
mipmap_input5 = true
alias5 = AvgLumPass

shader6 = shaders/guest/advanced/linearize.slang
filter_linear6 = true
scale_type6 = source
scale6 = 1.0
alias6 = LinearizePass
float_framebuffer6 = true

shader7 = shaders/guest/advanced/gaussian_horizontal.slang
filter_linear7 = true
scale_type_x7 = absolute
scale_x7 = 800.0
scale_type_y7 = source
scale_y7 = 1.0 
float_framebuffer7 = true

shader8 = shaders/guest/advanced/gaussian_vertical.slang
filter_linear8 = true
scale_type_x8 = absolute
scale_x8 = 800.0
scale_type_y8 = absolute
scale_y8 = 600.0
float_framebuffer8 = true
alias8 = GlowPass

shader9 = shaders/guest/advanced/bloom_horizontal.slang
filter_linear9 = true
scale_type_x9 = absolute
scale_x9 = 800.0
scale_type_y9 = absolute
scale_y9 = 600.0 
float_framebuffer9 = true

shader10 = shaders/guest/advanced/bloom_vertical.slang
filter_linear10 = true
scale_type_x10 = source
scale_x10 = 1.0
scale_type_y10 = source
scale_y10 = 1.0
float_framebuffer10 = true
alias10 = BloomPass

shader11 = shaders/guest/advanced/crt-guest-advanced.slang
filter_linear11 = true
scale_type11 = viewport
scale_x11 = 1.0
scale_y11 = 1.0

shader12 = shaders/guest/advanced/deconvergence.slang
filter_linear12 = true
scale_type12 = viewport
scale_x12 = 1.0
scale_y12 = 1.0 

crt-guest-advanced-ntsc.slangp

shaders = 18

shader0 = shaders/guest/advanced/stock.slang
filter_linear0 = false
scale_type0 = source
scale0 = 1.0

shader1 = shaders/guest/advanced/stock.slang
filter_linear1 = false
scale_type1 = source
scale2 = 1.0

shader2 = shaders/guest/advanced/stock.slang
filter_linear2 = false
scale_type2 = source
scale2 = 1.0
alias2 = StockPass

shader3 = shaders/guest/advanced/afterglow0.slang
filter_linear3 = true
scale_type3 = source
scale3 = 1.0
alias3 = AfterglowPass

shader4 = shaders/guest/advanced/pre-shaders-afterglow.slang
filter_linear4 = true
scale_type4 = source
scale4 = 1.0
alias4 = PrePass0 

textures = "SamplerLUT1;SamplerLUT2;SamplerLUT3;SamplerLUT4"
SamplerLUT1 = shaders/guest/advanced/lut/trinitron-lut.png
SamplerLUT1_linear = true
SamplerLUT2 = shaders/guest/advanced/lut/inv-trinitron-lut.png
SamplerLUT2_linear = true
SamplerLUT3 = shaders/guest/advanced/lut/nec-lut.png
SamplerLUT3_linear = true
SamplerLUT4 = shaders/guest/advanced/lut/ntsc-lut.png
SamplerLUT4_linear = true 

# custom ntsc shaders

shader5 = shaders/guest/advanced/ntsc/ntsc-pass1.slang
shader6 = shaders/guest/advanced/ntsc/ntsc-pass2.slang

filter_linear5 = false
filter_linear6 = true

scale_type_x5 = source
scale_type_y5 = source
scale_x5 = 4.0
scale_y5 = 1.0
frame_count_mod5 = 2
float_framebuffer5 = true

scale_type6 = source
scale_x6 = 0.5
scale_y6 = 1.0

shader7 = shaders/guest/advanced/custom-fast-sharpen.slang
filter_linear7 = true
scale_type7 = source
scale_x7 = 1.0
scale_y7 = 1.0
alias7 = NtscPass

shader8 = shaders/guest/advanced/convert-ntsc.slang
filter_linear8 = true
scale_type8 = source
scale_x8 = 0.5
scale_y8 = 1.0

shader9 = shaders/guest/advanced/stock.slang
filter_linear9 = true
scale_type9 = source
scale_x9 = 1.0
scale_y9 = 1.0
alias9 = PrePass 
mipmap_input9 = true

shader10 = shaders/guest/advanced/avg-lum-ntsc.slang
filter_linear10 = true
scale_type10 = source
scale10 = 1.0
mipmap_input10 = true
alias10 = AvgLumPass

shader11 = shaders/guest/advanced/linearize-ntsc.slang
filter_linear11 = true
scale_type11 = source
scale11 = 1.0
alias11 = LinearizePass
float_framebuffer11 = true

shader12 = shaders/guest/advanced/gaussian_horizontal.slang
filter_linear12 = true
scale_type_x12 = absolute
scale_x12 = 640.0
scale_type_y12 = source
scale_y12 = 1.0 
float_framebuffer12 = true

shader13 = shaders/guest/advanced/gaussian_vertical.slang
filter_linear13 = true
scale_type_x13 = absolute
scale_x13 = 640.0
scale_type_y13 = absolute
scale_y13 = 480.0
float_framebuffer13 = true
alias13 = GlowPass

shader14 = shaders/guest/advanced/bloom_horizontal.slang
filter_linear14 = true
scale_type_x14 = absolute
scale_x14 = 640.0
scale_type_y14 = absolute
scale_y14 = 480.0 
float_framebuffer14 = true

shader15 = shaders/guest/advanced/bloom_vertical.slang
filter_linear15 = true
scale_type_x15 = absolute
scale_x15 = 640.0
scale_type_y15 = absolute
scale_y15 = 480.0
float_framebuffer15 = true
alias15 = BloomPass 

shader16 = shaders/guest/advanced/crt-guest-advanced-ntsc.slang
filter_linear16 = true
scale_type16 = viewport
scale_x16 = 1.0
scale_y16 = 1.0

shader17 = shaders/guest/advanced/deconvergence.slang
filter_linear17 = true
scale_type17 = viewport
scale_x17 = 1.0
scale_y17 = 1.0
2 Likes

That was my mistake I should have mentioned that grade wasn’t the issue at all, in fact I went replaced grade with a stock pass in my custom preset to test it and got the same result with stock. It’s unfortunate that those two parameters can’t get back ported to the other afterglow pass. The only reason I replaced the “preshaders” pass with grade is because they both essentially use the same parameters like color space, vignette, etc. I just wasn’t aware “afterglow strength” and “afterglow saturation” were apart of that pass. In any case if it can’t be ported over it’s not much of big deal. I thank you for trying to help me get to the bottom of that the most

2 Likes

@guest.r could you just port the needed things into grade? Or is that a no go as well?

I mainly ask because it’s a super commonly used shader with your chain.

4 Likes

I had a feeling you would chime in lol. Grade is pretty much missing those afterglow settings if you look at it the reverse way

2 Likes

I’ll try to look at the code in a bit, but I haven’t been doing well so idk if it’ll actually happen.

3 Likes

New Release Version (2022-01-10-r1):

Notable changes:

  • scanline saturation brightness loss and oversaturation compensation added
  • bloom effect doess less over-saturation
  • slightly improved halation
  • grade with afterglow support added in the shaders/guest/advanced/grade folder

Download link:

https://mega.nz/file/psp3wSoS#OF-0ZdxwYq38v3GYGxM9KnUFKUZ7TTNiLqgNEDiTYRQ

Feedback is welcome.

The ‘custom’ grade should be more or less used to replace the pre-shaders-afterglow pass.

15 Likes

Thanks for the update! Can you elaborate as to the difference in the halation now? Let’s say I currently have a setting of 0.05, what setting would I need to use to get it back to where the way it is currently or is it a different type of change?

2 Likes

The halation is now a bit less invasive (25%) spot on brighter colors, shifting more focus on the effect they emit. But you should be still fine with 0.05.

4 Likes

Thanks, a lot! I’ll see when @HyperspaceMadness updates it in Mega Bezel Reflection Shader!

3 Likes

This update gave me EXACTLY what I wanted, you came through once again @guest.r. The one thing I noticed right away is that the first two stock passes seem to be a part of the shader chain passes now, usually I get rid of those first two stock passes but when I tried to take them out this time my custom preset shader failed to load, it seems it won’t work unless those stock passes are there but that’s ok they’ll just stay there, that doesn’t affect anything at all. Afterglow now works the way it should in my preset and now it’s time to update my last post, thank you once again for this amazing shader.

7 Likes

Wouldn’t it be better to put that stuff on github? :stuck_out_tongue:

2 Likes

I already have an older version on Github, will update to latest eventually.

OTOH such dl links have it’s advantages, which also include a simple but very efficient version history. Don’t want to cancel this atm…

2 Likes