New CRT shader from Guest + CRT Guest Advanced updates

I was about to prepare a test setup on an old system with nVidia gpu, so this should help indeed. :grinning: I can revert these changes and keep the effects, should go well.

Edit: pre_shader file only:

https://mega.nz/file/ct4jwAzQ#Eewm4B0IWwq96j6a-hON9Uvmt_f2KbzwXvpVHWM7fpY

3 Likes

Yes fixed :smiley: Could you also update the pre-shaders-ntsc?

Just to be sure, for accurate output when using the DisplayCAL LUT, I need to comment the part after “res = mixfix(color1, color2, mixer);” like below correct? (As everything after the res = mixfix is specific to the LUTs that come with your shader).

  else if (int(TNTC) == 4)
  {
     color1 = COMPAT_TEXTURE( SamplerLUT4, vec2( blue1, green ));
     color2 = COMPAT_TEXTURE( SamplerLUT4, vec2( blue2, green ));
     res = mixfix(color1, color2, mixer);
     // float l = mix(length(imgColor.rgb), length(res.rgb), 0.4);
     // res.rgb = normalize(res.rgb + 1e-10)*l;
  }
1 Like

Yes, commenting the two lines gives 100% accurate lut output. OTOH the changes are affecting the brightness only.

1 Like

OK, i put together another release version.

Changes:

  • compatibility with lut’s on nVidia cards should be fixed or at least improved
  • added the Mask gamma parameter. It allows to separately choose the gamma of mask application. Some masks look better with lower gamma down to 1.0.

Download link:

https://mega.nz/file/x4ZzCa7D#K3giLcRKOpjJFkab_02--s0sfCgsJA1uB1Cob01LBJA

8 Likes

@guest.r

I think the horizontal phosphor bloom can only be completely eliminated with 100% mask strength, which is obviously too dark for 99% of displays. Mask 8 is a 75% reduction in brightness(!). So yeah you really need that bloom to keep the image adequately bright, but it looks very unnatural and distracting with the three color masks. So, I’ve discovered yet another limitation to emulating CRT masks on a digital display.

I think the best way to solve this is to just use one of the two color masks, rather than trying to turn everything upside down and do something that the display/shader really isn’t designed to do.

So I’ve come full circle: back to using cgwg aperture!

Speaking of cgwg aperture, why does the grey ramp look so weird, here? Is this something to do with sharpness? Screenshots look good but in-game it looks weird. This could be my display doing something, hard to tell. Plasmas can do strange things sometimes.

edit: I haven’t tried the latest latest version, maybe there are some tricks there I haven’t tried yet.

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;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 = "7505.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.000000"
TATE = "0.000000"
IOS = "0.000000"
OS = "1.000000"
BLOOM = "0.000000"
gamma_c = "1.000000"
brightboost = "1.000000"
brightboost1 = "1.500000"
gsl = "2.000000"
scanline1 = "6.000000"
scanline2 = "18.000000"
beam_min = "1.500000"
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.000000"
CGWG = "0.500000"
mcut = "1.150000"
slotmask = "0.000000"
slotwidth = "2.000000"
double_slot = "1.000000"
slotms = "1.000000"
mclip = "0.500000"
inter = "350.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"
1 Like

You can have partial 100% mask strength with the 5-7 masks. Alas it’s not promising to invest too much time into full 100% masks without a proper display and adapting the viewing distance, because viewing distances averages the very small image parts. It’s a good practice though, if you buy a decent upgrade.

My display can also do funky things, even with screenshots! Display technology, related with crt emulation, is definitely more important than considered by many users.

You can try the Mask gamma. :grinning: It’s pretty nice setting to have, since you don’t need to search for a compromise with input/output gamma values regarding mask application distribution.

2 Likes

Not the intended use but Lut 2 with no masks looks great on my CRT.

2 Likes

Needed to adjust the trinitron masks 5&6 a bit more. It should look nicer. The saturation is now distributed towards edges of the beam, which cancels over-saturating the image and it also corresponds with actual trinitron masks better.

Otherwise some minor parameter tweaks.

Download link (25.11.2020_release_1):

https://mega.nz/file/E1AFzSKD#_18PDFGPBMSFo2haGV590EjbC6Dm4ixVKweWY4imq_8

4 Likes

I found a bug when using curvature.

  1. https://pasteboard.co/JC1agDo.png -Curvature

  2. https://pasteboard.co/JC19Y8g8.png -Without curvature

Everything else works fine.

1 Like

Thanks! It was a quite elusive bug, present with glcore and vulkan, D3D11 seems OK. Thankfully adapting the preset a bit should solve it.

1 Like

@guest.r

What do you think about removing the bright boosts altogether? With all of the autocorrection stuff happening behind the scenes, it seems like bright boost can only make the image objectively worse.

I’m getting the best results I’ve seen by disabling bright boost (setting both to 1.00) and working solely with the beam shape parameters.

1 Like

Brightboost is ok, if you throw in the slotmask for example. I made the automatic color corrections a bit humbler, since they are hard-coded, now complying with scanline type0. If you use something more than 1080p and thinner scanlines, it’s a set of different circumstances.

I needed to adjust the crt-guest-dr-venom preset in a curious situation with glcore and vulkan video APIs, where small glitches appeared when using curvature.

New version download (25.11.2020_release_2):

https://mega.nz/file/olhV3aoL#ji4SNj31GHY1RDpMajnBIOtSV8NVjBhIGYuFbBp9Cqg

Hopefully no new bugs… :wink:

5 Likes

What did you have to do to fix it?

I’ve run into these garbage pixels in other scenarios and have had sporadic luck fixing them, right now the Mega Bezel Guest SM preset exhibits these :frowning:

1 Like

Very strange. I had a very similar preset for the NTSC version, which didn’t produce the glitches. It isn’t a viewport scaling bug for example, because i just created a preset with all the pre-passes sourcescaling to 1.0, last pass to 4.0.

In the test case i removed the ‘avg-lum’ pass and bug was gone.

So i think there might be problematic passes, which somehow cause rounding errors. The NTSC pass for example had the linearize shader after the problematic pass and the glitchess appeared if reading before this pass.

PS: And i think i’ve nailed it now. :grin: I disabled mipmapping in the ‘problematic’ pass and the glitches were gone.

It seems to mess with the coordinates somehow, causing rounding errors.

1 Like

Ah yes, now I remember in one of the cases I managed to get rid of it it was by turning off mipmapping on a pass

1 Like

Looking good so far, no glitches found :slight_smile:

If the only thing I would want to do from your default preset is to turn mask from “0” to “-1” (disable mask), what would be your suggested lowering of bright boost dark pixels and bright boost bright pixels? Currently they are at 1.40 and 1.15, how much lower for both would you advice when only disabling the mask? (While keeping the spirit of your preset).

1 Like

1.15 or 1.20 for bb-dark and 1.0 for bb-bright seems nice. It’s good to know that multiplying in linear space doesn’t translate to relative gamma 1.0 space directly.

Multiplier of 1.4 in linear space of 2.4 gamma translates to 1.15 in ‘normal’ space.

1 Like

Would it be possible to have a parameter by which it is configurable by how much bright pixels flow into dark pixels horizontally? I think it would be useful if this could be set to personal preference.

With the current settings it makes the bright pixels sometimes too wide versus darker pixels in, for example vertical lines that have brighter segments “bulge” too much at certain points (too wide bright pixels), creating discontinuity in the straightness of the vertical lines.

1 Like

There are some parameters, that control the general behavior:

  • for beam behavior adjust the “Increased bright scanline beam” parameter (for vertical bulges)
  • for invasiveness of bright pixels you can adjust the “Scanline Spike Removal” parameter and adjust filtering with “Horizontal sharpness” and “Substractive sharpness”.

Raising the gamma values also produces more even vertical lines.

3 Likes