New CRT shader from Guest + CRT Guest Advanced updates

I forgot that you had posted preset settings for slotmask plus mask 10 a few posts up, I went back and used those settings. My preset before looked like this:

After applying your settings it now looks like this:

I think it looks so much better. I plan to upload the preset later on, gotta get some rest for now.

4 Likes

Ok so I’m about ready to go prime time with my updated preset using settings from @guest.r from this post. After I applied those settings I noticed some slight but noticeable moire appear when using curvature that I previously didn’t have. This is how my preset looked before:

And this is how it looks after applying the new parameters:

@guest.r is there a way to get rid of that moire while still keeping your settings intact?

@HyperspaceMadness also mentioned something to me earlier about my preset as well, he said he noticed the “Scanline Type” parameter is set to -1 but that he can still see scanlines, he mentioned that he thought -1 meant no scanlines at all but I just assumed -1 was to give very faint scanlines, is that what putting it to -1 supposed to do?

Here’s my preset so far:

shader0 = "shaders_slang/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/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/grade/pre-shaders-afterglow-grade.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/ntsc/shaders/ntsc-adaptive/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/ntsc/shaders/ntsc-adaptive/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/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"
g_signal_type = "0.000000"
wp_temperature = "8004.000000"
quality = "0.000000"
ntsc_phase = "3.000000"
GAMMA_INPUT = "2.200000"
interm = "5.000000"
SIZEHB = "3.000000"
SIGMA_HB = "0.750000"
SIZEVB = "3.000000"
SIGMA_VB = "0.750000"
bloom = "0.700000"
bloom_dist = "1.600001"
halation = "0.100000"
gamma_c = "1.360000"
brightboost = "1.300001"
brightboost1 = "1.250000"
gsl = "-1.000000"
scanline1 = "2.500000"
scanline2 = "14.000000"
beam_min = "1.800000"
beam_max = "0.775000"
beam_size = "0.750000"
scans = "1.650000"
scan_falloff = "0.650000"
spike = "1.500000"
sth = "0.300000"
csize = "0.060000"
bsize1 = "0.300000"
warpX = "0.040000"
warpY = "0.050000"
shadowMask = "10.000000"
maskstr = "1.000000"
mask_gamma = "2.399999"
slotmask = "1.000000"
slotmask1 = "1.000000"
slotwidth = "4.000000"
double_slot = "2.000000"
mclip = "0.350000"
gamma_out = "2.200000"
deconrry = "1.250000"
deconrby = "-1.250000"
decons = "1.400000"
addnoised = "-0.300000"
noiseresd = "1.000000"
post_br = "1.150000"
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"
2 Likes

A general moire mitigation can come when adding some noise, there was even an article on this on @hunterk 's blog. Otherwise it generally helps to either use less intensive scanlines/masks, especially for darker colors.

Scanline type parameter -1.0 is a preset for the least intensive scanlines. Currently there isn’t a preset for ‘scanlines off’, but it can be achieved in more ways.

Nevertheless, it’s a very nice preset you are working on and it might look differently with the mega bezel, because it uses different curvature algos (there are more of them). It would be a great idea to fine tweak the curvature… using the bezel environment.

4 Likes

just to add a bit: moire is an aliasing effect. That is, it’s a pattern created by resampling repeating high-frequency information to a lower resolution–and the resolution gradient caused by faux curvature makes it especially visible. As such, the way to deal with it is through dithering–i.e., noise–or low-pass filtering–i.e., anti-aliasing or, more generally speaking, blur.

6 Likes

When I get home later I’ll try playing around with the noise a little, I already dialed it in to -30, I don’t wanna go too far and make the image start to look washed out. Other than that I don’t wanna tweak the preset any further, I think the current parameters @guest.r provided are perfect the way they are. The image looks better, the mask looks sharper and difined since it’s cranked up to the max and it glows and pops out more plus the colors shine and look bright, it’s the best I’ve ever gotten this shader so far, I’ll just accept the slight moire if anything. I’ll be posting both presets up later on

3 Likes

You’re losing the mask completely over highlights. I thought HDR made this unnecessary? Or is this intended for non-HDR monitors?

1 Like

It’s for non hdr monitors. I turned the bloom distribution and post brightness up so maybe that’s what causes what you see or don’t see or it could be the clipping setting

Yeah the post brightness can definitely cause clipping.

I’ll take a look at the preset again when I get home before I post them up, far as I’m concerned it’s pretty much ready to be put out there, I’ll probably play with the noise the most to reduce the moire more than anything else though. If you think there’s a parameter or anything that you think can help improve it please don’t hesitate to tweak it, that’s how I always make it better with everyone’s suggestions and tweaks

2 Likes

Current issues with deconvergence:

  • mask smearing, possible tinting, brightness decrease
  • dynamic deconvergence produces a vertical/horizontal area which ‘feels different’.

I managed to successfully solve the issues. Fortunately deconvergence works top notch now, unfortunately the changes are somewhat bigger and there might be issues with presets.

The latest version posted is considered as stable, so there is no hurry.

Nevertheless the new release can be expected within next days.

9 Likes

Please don’t forget to post this preset whenever you decide to release this new version.

I NEED this so bad!

5 Likes

Welp guess I’ll be waiting to update my preset lol. Like @DevilSingh said please upload your preset with your deconvergence parameters, I’m definitely using those for my preset as well.

5 Likes

Just had some time to play with this, great addition to unlock this for us. Makes it even better possible to get preferred scanline shape right!

The usefulness triggered me to fantasize about another addition to the scanline shaping toolbox in the category “subtleness”.

Mostly in older 8 and 16 bit games I find for example the “stars” in outer space set games (random white pixels on black background) to be too pronounced, They loose the subtleness of distant stars in some outer space. In this particular case (but often found in 8-bit era games) bright pixels grow too much over dark and I would like to adjust for it. But changing the various scanline parameters just doesn’t make it right (changes overall picture too much). Maybe this is because it’s more prominent with the high contrast (255 versus 0).

Maybe a falloff parameter for the brightest end of the scale could be a usefull addition to the toolbox?

It could be considered a complement to the “Increased Bright Scanline Beam”. For example an “Increased Bright Scanline Beam Falloff” parameter? Or maybe allow for negative values in the Increased Bright Scanline Beam parameter? Something that rolls-off the size growth of the brightest pixels…

I’m aware this is definitely subtleness category stuff, but nonetheless would appreciate if you could give it a thought and consideration …

3 Likes

This issue is somewhat ‘cursed by scanline design’, since it involves a final result, comprised with adding (+) two scanline colors in linear space. Brighter color has more influence here.

Works very well and is in conjunction with the real crt appearance/gamma, but it’s a challenge for the opposite effect with this technique. The obvious solution therefore is to lower gamma, but unfortunately not only isolated pixels are affected.

I want to mention that this probably requires a special approach with more added code, but it probably won’t be included in the mainstream version, unless it’s maybe scanline gamma, already included with the ntsc and hd versions :grin: (i can get interesting results with it).

Maybe you could try the hd version with lowered scanline gamma and see how it goes.

5 Likes

New Release Version (2022-02-05-r1):

Notable changes:

  • deconvergence reworked, works as intended now (== much better), but i had to split the main shader pass into two passes. Didn’t notice anything odd with my setup, the speed is approximately the same. The drivers and gpu i’m using sometimes compensate certain situations, so testing, especially with nVidia gpus is welcome.

  • main shader pass uses float framebuffer now, older saved presets can be fixed by simply adding or changing float_framebuffer# = “true” to the guest-advanced pass in the preset.

  • some small fixes (PrescaleX with TATE…)

Download link:

https://mega.nz/file/k8Ix3KpY#vnJdWOn_kXu7oG3_I0Jl6PJvFb7gj0yyQHFqZ-Lv-EI

Last but not least, here are the preset parameters for the ‘screenie’ above (with standard version):

CS = "2.000000"
TNTC = "1.000000"
WP = "-65.000000"
SIZEHB = "3.000000"
SIGMA_HB = "0.750000"
SIZEVB = "3.000000"
SIGMA_VB = "0.750000"
bloom = "0.650000"
bloom_dist = "1.150001"
halation = "0.350000"
gamma_c = "1.100000"
brightboost = "1.600001"
gsl = "-1.000000"
scanline1 = "5.500000"
beam_min = "1.200000"
beam_size = "0.750000"
scans = "0.800000"
scan_falloff = "0.650000"
spike = "1.400000"
h_sharp = "3.200002"
s_sharp = "0.300000"
sth = "0.300000"
csize = "0.115000"
bsize1 = "0.300000"
warpX = "0.040000"
warpY = "0.050000"
shadowMask = "9.000000"
maskstr = "1.000000"
mask_gamma = "2.399999"
slotmask = "0.800000"
slotmask1 = "1.000000"
slotwidth = "3.000000"
double_slot = "2.000000"
mclip = "0.350000"
gamma_out = "2.200000"
deconrr = "1.750000"
deconrb = "-1.750000"
deconrry = "1.250000"
deconrby = "-1.250000"
decons = "1.200000" 

Feedback is welcome! :slightly_smiling_face:

10 Likes

Isn’t that (static) afterglow of bright over dark glow and not scanlines thickness.

2 Likes

I wouldn’t use the term afterglow in this context because “we” usually associate term afterglow with phosphor trails.

Not that I have an alternative terminology to offer you :joy:

I guess glow-bleed, idfk

P.S. I see that change of “(static) afterglow” to your post, I’m just going to leave this here anyway because it’s still relevant imo.

To clarify my ramblings, my issue with using the term “afterglow” for this, is that the after part of the term “implies” that motion/animation is happening (in my mind anyway). Whereas what we’re describing happens in static situation as well as in motion, which would in my mind make it more of a bleed effect on the “glow” versus an after effect.

3 Likes

Actually afterglow in reality is phosphors that still emmit light for a certain amount of time after triggered by the beam even if the beam is somewhere else. In reality all image has afterglow since the beam is not everywhere on screen.

1 Like

The most accurate noun for this is phosphor persistence. :slightly_smiling_face:

4 Likes

Honestly we went off on a hard tangent that doesn’t actually seem to have anything to do with rafans request :joy: (Afaik, at least from what I can understand of the situation)

They were specifically asking if they could have a setting for the peak/max brightness end of the scanline, (to my understanding anyway) for better shaping of the scanlines “theoretically”. As their example is black background with tiny white spots.

So nothing moving, no color changes happening on screen, just dramatic black to white transitioning with scanlines and the shaping of that transition is on the table.

1 Like