New CRT shader from Guest + CRT Guest Advanced updates

Thanks. I’m only after limiting invasiveness of bright pixels horizontally (horizontal bulges).I think I already tried your suggestions.

Substractive sharpness gives artifacts in some situations, so I normally like to keep keep it at “0”. For higher values it deletes complete pixels, mainly to be seen in 8-bit games. For example if you have the order of horizontally 1) white pixel, then a 2) black pixel, then a 3) darker pixel. Then 1 flows into 2) black pixel and 3) darker pixel gets deleted partially or completely (there is no smooth flowing as I think with real CRT: it will never delete pixels completely because of brighter pixels next to it).

If I put scanlike spike removal at 2 it gets a little bit better, but not enough.

I need to put horizontal sharpness at 9.00 to remove the issue almost completely , but then the sharpness is really sharp LCD / PC like.

So even with above maximum measures the invasiveness of bright pixels can still be too much horizontally. It creates inconsistenties in vertical lines across the screen.

See below picture with example of what happens with your default preset:

  1. green pixels are deleted. I don’t think pixels get deleted on real CRT
  2. vertical black line should be straight vertically but gets wobbly with your default preset ). I don’t think straight black vertical lines get wobbly on real CRT.

Once you start noticing it, it makes the entire image more “wobbly”, because straight vertical lines are not straight anymore, and because of the related missing pixels.

I tried your suggestions, but the issue will remain unless you turn substractive sharpness to “0” and “horizontal sharpness” to “9.00”.

My suggestion would be to tone down the invasiveness of bright pixels on their horizontal neighbour pixels or make it better configurable? Hopefully there is some room for improvement on this area.

compare-noshader-vs-default-preset

2 Likes

You can’t have this as simple if you want fancy filtering. If you increase horizontal sharpness to maxx., you won’t have these issues though. Similar with basic scanlines. Or you can try crt-guest-sm glsl. :grinning:

I’m constantly improving the shader and many things are still on the TODO list. Some aren’t trivial though.

compare-noshader-vs-default-preset

Thumbs up for the crt reference image… :grin:

CRT’s were dissolving dithering patterns, today’s crt shaders are generally not doing such an intensive blending. Due to high gamma of the crt displays the darker pixels got mitigated.

1 Like

Are you implying that when drawing darker pixels in your paint program on a Vintage or Studio CRT that these pixels would simply not show up? (mitigated?)

Or are you saying that when you would implement intensive blending in your shader (dissolving dithering) that it would improve your shader?

Just trying to understand what you’re saying.

1 Like

I’m saying that crt obviously didn’t have razor sharp transitions between pixels. Due to nature of the gamma specific ‘interpolation’ the blended area endorsed brighter color components.

But’s it really simple, if you want sharper transitions than you can’t have smooth blending without a minor issue.

Something like this is currently discontinued due the general slowdown it would make:

OK it’s doable with the current version, but dunno, eats 6% performance, needs an extra parameter etc. :grimacing:

3 Likes

I can give an example:

Point scaled image:

Composite Philips CM8833

RGB Scart Philips CM8833

3 Likes

Very nice reference pictures :+1:. I don’t see pixels disappearing completely though, did you find any while comparing raw output (point scaled) versus the CRT ones?

What is really interesting is too see how much less saturated the image of the CRT is! Particularly:

  • the purple within the letters on the raw output is actually blue on the CRT
  • the orange in the explosion between yellow and red on the raw output is a darker shade of yellow on the CRT
  • Red is clearly much less saturated

Do you have an idea what’s causing this? Does the CRT have a higher white point? Or do you have brightness turned up by a lot on the CRT?

That sounds wicked! Maybe it’s an idea to put this behind a switch close to the horizontal filtering parameter “HQ filtering ON/OFF (6% performance hit)”? :smiling_imp:

1 Like

Photos of CRTs always look bluer/cooler than screenshots for some reason. It’s a bit of a mystery.

1 Like

I mentioned mitigated. :grinning: I think the below comparison should reveal a bit more. Isolated dark pixels do not have the same presence power when blending in linear space.

CRT: ref0

LCD: ref1

Ofc. you can use substractive sharpness with my shader if you overdo the base blur.

I removed the color artifacts, but it’s a bit against the common sense when complaining against blur when increasing blur and wanting more blur. :grin:

1 Like

It looks better on test image compared with actual gaming. Very hard edges with black colors etc. look quite odd in random situations. But i saved the code. :grinning:

1 Like

I have to defend myself here, even though you’re making a pun. I only said the invasiveness of bright pixels over darker ones was too strong and more of a middle ground would IMO be more true to real CRT. That’s a different remark from general blending or blur.

But the most important message is that you removed the color artifacts, which is good news :grin: .

If that is indeed the case then I think I’m done testing. So I’ll not be annoying the hell out of you anymore :wink:

Doesn’t sound like something that is worth pursueing further? Your shader is very polished already, it would be unfortunate to make things better in one place while degrading it in other areas.

1 Like

Gamma correction and dark pixel bright boost raises the black level, so I don’t want that. Bright pixel bright boost blows out the highs and clips detail if I set it higher than ~1.10.

Mask gamma- maybe this is the key, but I’m pretty confused now that there are four(!) separate gamma settings (including grade’s). How do these interact?

Guest-dr-venom has clear advantages when it comes to scanlines and mask control but I’m still struggling to get it bright without clipping and/or washing out the colors.

I’m curious to see what others can come up with.

@BendBombBoom you’re good at this stuff; lets see some screens/settings :stuck_out_tongue:

I accidentally posted this in the wrong thread and the body is too similar to what I already posted so blah blah blobbity blah.

2 Likes

I’m using one of grade’s newer version but I’ve been having trouble with it playing nice. I’m not sure why. Here are my current settings with Venom 2 for a 4k screen. (The sharpening is just to push the thick and thin.)

shaders = "8"
shader0 = "shaders_slang/sharpen/shaders/fast-sharpen.slang"
filter_linear0 = "false"
wrap_mode0 = "clamp_to_border"
mipmap_input0 = "false"
alias0 = "StockPass"
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/crt-gdv-new/afterglow0.slang"
filter_linear1 = "false"
wrap_mode1 = "clamp_to_border"
mipmap_input1 = "false"
alias1 = "AfterglowPass"
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/crt-gdv-new/pre-shaders-afterglow.slang"
filter_linear2 = "false"
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/shaders/guest/crt-gdv-new/avg-lum.slang"
filter_linear3 = "true"
wrap_mode3 = "clamp_to_border"
mipmap_input3 = "true"
alias3 = "AvgLumPass"
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/crt-gdv-new/linearize.slang"
filter_linear4 = "true"
wrap_mode4 = "clamp_to_border"
mipmap_input4 = "false"
alias4 = "LinearizePass"
float_framebuffer4 = "true"
srgb_framebuffer4 = "false"
scale_type_x4 = "source"
scale_x4 = "1.000000"
scale_type_y4 = "source"
scale_y4 = "1.000000"
shader5 = "shaders_slang/crt/shaders/guest/crt-gdv-new/blur_horiz2.slang"
filter_linear5 = "true"
wrap_mode5 = "clamp_to_border"
mipmap_input5 = "false"
alias5 = ""
float_framebuffer5 = "false"
srgb_framebuffer5 = "false"
scale_type_x5 = "absolute"
scale_x5 = "800"
scale_type_y5 = "source"
scale_y5 = "1.000000"
shader6 = "shaders_slang/crt/shaders/guest/crt-gdv-new/blur_vert2.slang"
filter_linear6 = "true"
wrap_mode6 = "clamp_to_border"
mipmap_input6 = "false"
alias6 = "GlowPass"
float_framebuffer6 = "false"
srgb_framebuffer6 = "false"
scale_type_x6 = "absolute"
scale_x6 = "800"
scale_type_y6 = "absolute"
scale_y6 = "600"
shader7 = "shaders_slang/crt/shaders/guest/crt-gdv-new/crt-guest-dr-venom2.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"
parameters = "SHARPEN;CONTR;DETAILS;PR;PG;PB;AS;sat;TNTC;CP;CS;WP;wp_saturation;lsmooth;GAMMA_INPUT;decon;deconstr;SIZEH;GLOW_FALLOFF_H;SIZEV;GLOW_FALLOFF_V;glow;bloom;TATE;IOS;OS;BLOOM;gamma_c;brightboost;brightboost1;gsl;scanline1;scanline2;beam_min;beam_max;beam_size;vertmask;scans;spike;h_sharp;s_sharp;csize;bsize;warpX;warpY;shadowMask;masksize;maskDark;maskLight;CGWG;mcut;mask_gamma;slotmask;slotwidth;double_slot;slotms;mclip;inter;interm;gamma_out"
SHARPEN = "0.100000"
CONTR = "0.250000"
DETAILS = "0.000000"
PR = "0.070000"
PG = "0.070000"
PB = "0.070000"
AS = "0.070000"
sat = "0.100000"
TNTC = "2.000000"
CP = "0.000000"
CS = "0.000000"
WP = "0.000000"
wp_saturation = "1.250000"
lsmooth = "0.900000"
GAMMA_INPUT = "2.200000"
decon = "1.000000"
deconstr = "0.000000"
SIZEH = "1.000000"
GLOW_FALLOFF_H = "1.000000"
SIZEV = "1.000000"
GLOW_FALLOFF_V = "1.000000"
glow = "0.200000"
bloom = "0.250000"
TATE = "0.000000"
IOS = "0.000000"
OS = "1.000000"
BLOOM = "0.000000"
gamma_c = "1.200000"
brightboost = "1.400000"
brightboost1 = "1.400000"
gsl = "0.000000"
scanline1 = "6.000000"
scanline2 = "20.000000"
beam_min = "3.250000"
beam_max = "1.000000"
beam_size = "1.000000"
vertmask = "0.000000"
scans = "0.600000"
spike = "1.000000"
h_sharp = "5.200000"
s_sharp = "0.500000"
csize = "0.000000"
bsize = "600.000000"
warpX = "0.000000"
warpY = "0.000000"
shadowMask = "7.000000"
masksize = "2.000000"
maskDark = "0.500000"
maskLight = "1.500000"
CGWG = "0.800000"
mcut = "1.500000"
mask_gamma = "2.400000"
slotmask = "0.000000"
slotwidth = "2.000000"
double_slot = "1.000000"
slotms = "1.000000"
mclip = "0.500000"
inter = "400.000000"
interm = "1.000000"
gamma_out = "2.400000"
textures = "SamplerLUT1;SamplerLUT2;SamplerLUT3"
SamplerLUT1 = "shaders_slang/crt/shaders/guest/lut/sony_trinitron1.png"
SamplerLUT1_linear = "true"
SamplerLUT1_wrap_mode = "clamp_to_border"
SamplerLUT1_mipmap = "false"
SamplerLUT2 = "shaders_slang/crt/shaders/guest/lut/sony_trinitron2.png"
SamplerLUT2_linear = "true"
SamplerLUT2_wrap_mode = "clamp_to_border"
SamplerLUT2_mipmap = "false"
SamplerLUT3 = "shaders_slang/crt/shaders/guest/lut/other1.png"
SamplerLUT3_linear = "true"
SamplerLUT3_wrap_mode = "clamp_to_border"
SamplerLUT3_mipmap = "false"
2 Likes

I made the effect quite faster, so i will implement it np. The only downside is that it requires substractive sharpness at least 0.9, better 1.0. But this is no real downside, since the rarely produced artifacts get eaten away by the edge reduction - they always happen on edges that will get slimmer.

Substractive sharpness is also not what many think, it’s a relative value and very small with horizontal sharpness value above 4.0.

Implementation with normal filtering is a living mess and looks lot worse due a requirement for a hard threshold value etc., lot of technical stuff to consider, code gets messy and bulky etc. Not an option. :face_with_monocle:

Demo picture:

You are right, if you add a black level, then it gets in the way. But clipping is very interesting to me, because you get a nice play of colors. I toyed around with the option to allow clipping to only halve saturation, didn’t made it into a release though. Clipping affects colors differently, and masks save color information, something to play a bit with brightboost or bloom. :grin:

The gamma interaction within ‘gdv’ is between input gamma and output gamma, other do their own function. Mask gamma is totally independent and gamma corect is a very quick fix to compensate when stacking effect which diminish the brightness on the dark part.

2 Likes

This should be cooler in temp but the more I lower the value the more it kills those cloud details. Not a big deal but I can’t sacrifice those pixels.

1 Like

I like the NTSC version for when I want things to look more composite like. NTSC and Venom2 work well together.

5 Likes

I guess i didn’t produce new bugs, please let me know if you find any. :smiley:

Notable changes:

  • edge effect implemented for better edge contrast
  • scanline saturation max. effect increased
  • some small tweaks

Edit:

  • a seperate ntsc/hires file to avoid bogus parameter
  • sharpness is now calculated automatically to avoid artifacts (they are pretty much visible without adjustments).

Download link:

https://mega.nz/file/5wwg3LKS#6zW0S9hERb8hxy9LpzdYQdpkAgHX8THlFYTIsYLVa4c

7 Likes

Best results I’ve seen so far. I think the shading in the Outrun clouds is supposed to be somewhat subtle, personally. The interpolation from the forum’s image viewer exaggerates the clipping and also makes the image look darker (this could also be a browser thing; I’m using Firefox fwiw).

With these settings you can make the temperature cooler and the shading in the clouds becomes more apparent @BendBombBoom LMK what you think. I changed some stuff on my display so the gamma should more closely match 2.2 now, I think.

Hyllian is still a bit punchier, but this is getting pretty close IMO.

I’ve noticed that the more neutral you make the settings, the better the results tend to be.

shaders = "7"
shader0 = "shaders_slang/misc/grade.slang"
filter_linear0 = "false"
wrap_mode0 = "clamp_to_border"
mipmap_input0 = "false"
alias0 = "StockPass"
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/crt-gdv-new/afterglow0.slang"
filter_linear1 = "false"
wrap_mode1 = "clamp_to_border"
mipmap_input1 = "false"
alias1 = "AfterglowPass"
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/crt-gdv-new/pre-shaders-afterglow.slang"
filter_linear2 = "false"
wrap_mode2 = "clamp_to_border"
mipmap_input2 = "false"
alias2 = "LinearizePass"
float_framebuffer2 = "true"
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/crt-gdv-new/avg-lum.slang"
filter_linear3 = "true"
wrap_mode3 = "clamp_to_border"
mipmap_input3 = "true"
alias3 = "AvgLumPass"
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/crt-gdv-new/blur_horiz2.slang"
filter_linear4 = "true"
wrap_mode4 = "clamp_to_border"
mipmap_input4 = "false"
alias4 = ""
float_framebuffer4 = "false"
srgb_framebuffer4 = "false"
scale_type_x4 = "absolute"
scale_x4 = "800"
scale_type_y4 = "source"
scale_y4 = "1.000000"
shader5 = "shaders_slang/crt/shaders/guest/crt-gdv-new/blur_vert2.slang"
filter_linear5 = "true"
wrap_mode5 = "clamp_to_border"
mipmap_input5 = "false"
alias5 = "GlowPass"
float_framebuffer5 = "false"
srgb_framebuffer5 = "false"
scale_type_x5 = "absolute"
scale_x5 = "800"
scale_type_y5 = "absolute"
scale_y5 = "600"
shader6 = "shaders_slang/crt/shaders/guest/crt-gdv-new/crt-guest-dr-venom2.slang"
filter_linear6 = "true"
wrap_mode6 = "clamp_to_border"
mipmap_input6 = "false"
alias6 = ""
float_framebuffer6 = "false"
srgb_framebuffer6 = "false"
scale_type_x6 = "viewport"
scale_x6 = "1.000000"
scale_type_y6 = "viewport"
scale_y6 = "1.000000"
parameters = "g_gamma_in;g_signal_type;g_gamma_type;g_crtgamut;g_space_out;g_hue_degrees;g_I_SHIFT;g_Q_SHIFT;g_I_MUL;g_Q_MUL;g_lum_fix;g_vignette;g_vstr;g_vpower;g_lum;g_cntrst;g_mid;wp_temperature;g_sat;g_vibr;g_satr;g_satg;g_satb;g_lift;blr;blg;blb;wlr;wlg;wlb;rg;rb;gr;gb;br;bg;LUT_Size1;LUT1_toggle;LUT_Size2;LUT2_toggle;PR;PG;PB;AS;sat;TNTC;CP;CS;WP;wp_saturation;GAMMA_INPUT;lsmooth;SIZEH;GLOW_FALLOFF_H;SIZEV;GLOW_FALLOFF_V;glow;bloom;TATE;IOS;OS;BLOOM;gamma_c;brightboost;brightboost1;gsl;scanline1;scanline2;beam_min;beam_max;beam_size;vertmask;scans;spike;h_sharp;s_sharp;csize;bsize;warpX;warpY;shadowMask;masksize;maskDark;maskLight;CGWG;mcut;mask_gamma;slotmask;slotwidth;double_slot;slotms;mclip;inter;interm;gamma_out"
g_gamma_in = "2.400000"
g_signal_type = "1.000000"
g_gamma_type = "1.000000"
g_crtgamut = "2.000000"
g_space_out = "0.000000"
g_hue_degrees = "0.000000"
g_I_SHIFT = "0.000000"
g_Q_SHIFT = "0.000000"
g_I_MUL = "1.000000"
g_Q_MUL = "1.000000"
g_lum_fix = "0.000000"
g_vignette = "0.000000"
g_vstr = "40.000000"
g_vpower = "0.200000"
g_lum = "-0.000000"
g_cntrst = "0.000000"
g_mid = "0.500000"
wp_temperature = "7005.000000"
g_sat = "0.000000"
g_vibr = "0.000000"
g_satr = "0.000000"
g_satg = "0.000000"
g_satb = "0.000000"
g_lift = "0.000000"
blr = "0.000000"
blg = "0.000000"
blb = "0.000000"
wlr = "1.000000"
wlg = "1.000000"
wlb = "1.000000"
rg = "0.000000"
rb = "0.000000"
gr = "0.000000"
gb = "0.000000"
br = "0.000000"
bg = "0.000000"
LUT_Size1 = "16.000000"
LUT1_toggle = "0.000000"
LUT_Size2 = "64.000000"
LUT2_toggle = "0.000000"
PR = "0.140000"
PG = "0.140000"
PB = "0.140000"
AS = "0.080000"
sat = "0.100000"
TNTC = "0.000000"
CP = "0.000000"
CS = "0.000000"
WP = "0.000000"
wp_saturation = "1.000000"
GAMMA_INPUT = "2.400000"
lsmooth = "0.900000"
SIZEH = "4.000000"
GLOW_FALLOFF_H = "0.300000"
SIZEV = "4.000000"
GLOW_FALLOFF_V = "0.300000"
glow = "0.000000"
bloom = "0.200000"
TATE = "0.000000"
IOS = "0.000000"
OS = "1.000000"
BLOOM = "0.000000"
gamma_c = "1.000000"
brightboost = "1.000000"
brightboost1 = "1.000000"
gsl = "2.000000"
scanline1 = "10.000000"
scanline2 = "20.000000"
beam_min = "1.000000"
beam_max = "1.000000"
beam_size = "1.000000"
vertmask = "0.000000"
scans = "1.000000"
spike = "0.000000"
h_sharp = "3.000001"
s_sharp = "1.000000"
csize = "0.000000"
bsize = "600.000000"
warpX = "0.000000"
warpY = "0.000000"
shadowMask = "0.000000"
masksize = "1.000000"
maskDark = "0.500000"
maskLight = "1.500000"
CGWG = "0.700000"
mcut = "1.150000"
mask_gamma = "2.399998"
slotmask = "0.000000"
slotwidth = "2.000000"
double_slot = "1.000000"
slotms = "1.000000"
mclip = "1.000000"
inter = "350.000000"
interm = "1.000000"
gamma_out = "2.200000"
textures = "SamplerLUT1;SamplerLUT2;SamplerLUT3"
SamplerLUT1 = "shaders_slang/crt/shaders/guest/lut/sony_trinitron1.png"
SamplerLUT1_linear = "true"
SamplerLUT1_wrap_mode = "clamp_to_border"
SamplerLUT1_mipmap = "false"
SamplerLUT2 = "shaders_slang/crt/shaders/guest/lut/sony_trinitron2.png"
SamplerLUT2_linear = "true"
SamplerLUT2_wrap_mode = "clamp_to_border"
SamplerLUT2_mipmap = "false"
SamplerLUT3 = "shaders_slang/crt/shaders/guest/lut/other1.png"
SamplerLUT3_linear = "true"
SamplerLUT3_wrap_mode = "clamp_to_border"
SamplerLUT3_mipmap = "false"
3 Likes

Looks good. I will probably try this out and tweak things for a bit more contrast but that could all be display dependent or me just pushing things beyond where they were meant to be.

2 Likes

Here’s a shot using Hyllian for the sake of comparison; it definitely has an edge when it comes to dynamic range. Detail in the clouds is more defined and it’s a bit brighter overall.

Considering the options for increasing brightness in GDV: Bright boost and gamma correction are out for me as I don’t want to do anything that raises the black level further, it’s already a bit too high with neutral settings. Mask gamma is neat but didn’t really solve it for me, either. Best option seems to be bloom, which introduces clipping at around 0.25 for me.

Hyllian, custom settings:

I had some success tweaking the brightness and contrast parameters in grade, you might give that a try. Contrast pivot might also help(?)

Another GDV, this one is very close to my Hyllian settings.

If these look good, I’ll post settings.

GDV

Hyllian

2 Likes